Autor Beitrag
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 02.03.08 16:51 
Hallo,

Ich hätte gerne mal wieder ein Problem ;)
Und zwar habe ich eine von TScrollbox abgeleitete Komponente. Diese hat ein ControlCanvas gekriegt, über welches ich in der ClientArea zeichne. Ich würde jetzt gerne über das Mausrad die ganze Sache skalieren. Nur erschließt sich mir kein Weg, an die Mausrad-Events ranzukommen.

DoMouseWheel wird nicht aufgerufen, MouseWheelHandler genauso wenig. Ist auch fast klar, die Scrollbox kann ja keinen Fokus erhalten, entsprechend gibts auch keine Message.

Irgendwie muss das doch aber gehen, oder?
Mir die Nachricht vom Form schicken lassen schließt sich auch aus, da die Kompo nicht davon abhängig sein sollte (mal abgesehen davon dass ich nicht weiß ob das überhaupt geht...)

mfg
Martok

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Mi 05.03.08 15:44 
*Schaf*

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 06.03.08 18:23 
*schaf*

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
artelogic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Do 06.03.08 19:00 
was heißt *schaf*?
artelogic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Do 06.03.08 19:06 
TScrollBox ist doch von TWinControl abgeleitet und kann damit sowohl den Focus erhalten als auch Messages empfangen. Müsste also gehen, würd ich jetzt mal so aus der Hüfte geschossen sagen... ;)
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Do 06.03.08 19:08 
einfach nur ein text um das topic zu pushen. damit man eine nachricht abschicken kann muss ja was drin stehen.

deswegen:

*gras* (die zwei schafe brauchen ja auch essen)

lg elundril

P.S: könntest auch deinen beitrag editieren anstatt nen neuen zu schreiben ;-)

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 06.03.08 19:19 
@artelogic: wenn es gehen würde, würde ich wohl kaum fragen, oder? Ich hab mir hier schon ein Bein ausgerissen und schon quasi alles überschrieben was geht, aber die Nachricht WM_MOUSEWHEEL kommt einfach nicht in der WndProc der Scrollbox an. Was übrigens öfter(=immer) so zu sein scheint, wie ich in anderen Foren gelesen hab.


Und Schaf ist auch ganz logisch: Schaf = sheep = *schieb* ^^
Edit setzt auch das Thread-Datum neu? Toll, wieder was gelernt;)

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
artelogic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Fr 07.03.08 00:05 
Zitat:
wenn es gehen würde, würde ich wohl kaum fragen, oder?

das musst du mir sagen, ich kenn dich nicht! ;)

Also wenn du der ScrollBox mit bspw. SetFocus den focus verpasst, werden auch die MouseWheel-Events ausgelöst.
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Fr 07.03.08 00:27 
Tatsächlich einer der wenigen Ansätze, die ich noch nicht hatte^^

Nur gibts dann 2 Probleme:
-irgendwer muss den Focus setzen
-er ist wieder weg wenn ein anderes Control bedient wurde.

Ich könnte den jetzt zwar per OnMoueMove immer wieder zurückklauen (was erstmal meine Temporärlösung ist), aber gefallen tut mir das nicht wirklich...

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
artelogic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Fr 07.03.08 01:24 
naja, aber es stellt sich ja ohnehin (systemweit) die frage, für wen solche events bestimmt sind. und die vcl trifft nunmal die annahme, daß das control mit dem focus dasjenige welches ist. das könnte man sicherlich umstellen durch überschreiben der geeigneten methoden (WndProc oder keine ahnung welche). aber im prinzip erscheint es doch sinnvoll, nur das focusierte control zu versorgen.

ich glaub, ich würd die Click-Methode überschreiben und darin SetFocus aufrufen oder halt per OnMouseEnter, je nach geschmack.