View previous topic :: View next topic |
Author |
Message |
aecspades
Joined: 04 Dec 2006 Posts: 14
|
Posted: Wed Jan 24, 2007 3:58 pm Post subject: OnDblClick event? |
|
|
Is there a way to trap a double-click event in FormDesigner? I would like to override the default function for certain control types, for example I would like to display the Chart editor when a TChart is double-clicked. It looks like FormDesigner always generates a "Control.OnClick" method for the control that was selected, eventually falling through to the OnGetScriptProc method. I could probably trap the OnMouseDown event and try to figure out what the selected control was by using X,Y coordinates but that seems cumbersome and still wouldn't 'stop' the "Control.OnClick" method from being created. I'm also unclear about the differences between the TzFormDesigner events and TDesignerEvents and when one should be used instead of the other (for example OnKeyPress exists in both?) .
Thanks for any help you can give |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Thu Jan 25, 2007 2:35 am Post subject: |
|
|
1. You may process OnMouseDown. To disable processing in designer you should call Abort procedure.
2. When control is double clicked in designer, designer calls TComponentEditor.Edit for this control. As I understand you had registered TDefaultEditor. Ensure that TDefaultEditor is registered before other component editors (i.e. before loading packages - with runtime packages or before TeeChartReg.Register - without runtime packages).
If TDefaultEditor will be registered after other editors it will override them, so they will not be accessible.
3. Events in TDesignerEvents are fired for all designers. Events in TzFormDesigner are fired only for that designer.
Michael. |
|
Back to top |
|
|
|