I have a GUI drag and drop HMI app for industrial control using these stock controls and basically that is all I do. But in my app most the runtime colors also show in the designer form.
What technique do you use to catch the events in your designer?
I guess you didn't implement a TIDesigner derived designer?
@kupferstecher: I suggest you to take a look at designer/designer.pp of Lazarus. One further important tidbit seems to be the check with IsDesignMsg inside TControl.WndProc.
Yes, I already digged into that, thats how I came up with the posted code. Unfortunately it doesn't work. As said I can receive the message in the designer via
IsDesignMsg, but it gets further processed, even if I return "true". The procedure
TControl.WndProc is immediately exited at that point. But
TWinControl.WndProc was called before (inheritance), I'm not sure what was already happening there.
When I click the button, the sequence is as follows (displayed with writeln, maybe the sequence got distorted?):
When lowering the mouse button:
- TKDesigner.IsDesignMsg is called with message Button Down
After releasing the mouse button
- TForm1.Button1Click
- TKDesigner.IsDesignMsg is called with message Button Up
Seems that IsDesignMsg was called after the message was processed.
Could it be that I have to do something with the message passed via IsDesignMsg? Like marking it as handled or anything like that.
or hope that someone more knowledgeable with the designer answers.
Yes, I really hope that. At least one guy should know how the Lazarus designer really works
EDIT: @BrunoK: I'll have a look, thanks.