|
EControl Ltd. VCL libraries and software support forum
|
View previous topic :: View next topic |
Author |
Message |
aecspades
Joined: 04 Dec 2006 Posts: 14
|
Posted: Tue Feb 24, 2009 4:46 pm Post subject: Overriding Component Editors for TcxGridColumn objects |
|
|
I've successfully created custom wizards for several gauge controls that a user can add to a form. I trap a double-click on any control from the zFormDesigner1MouseDown event and show the appropriate wizard.
Now, I am trying to do the same thing for a 'Format Columns' wizard for column objects (TcxGridColumn) added by a QuantumGrid (TcxGrid) object . The double-click on the column headings evidently gets trapped by the TcxGrid object itself so the same method doesn't work for columns. Instead, I created a custom component editor called TColumnEditor, and then registered it using:
Code: | RegisterComponentEditor(TcxGridColumn, TColumnEditor); |
That didn't work, because the TcxGrid object seems to trap all messages for its child objects (?), but this did work:
Code: | RegisterComponentEditor(TcxGrid, TColumnEditor); |
...so, I was able to successfully add a 'Format Columns' option and trap the double-click. The problem is that this code inside of the component editor (PrepareItem, ExecuteVerb) :
Code: | Sel := TzDesignerSelections.Create;
Designer.GetSelections(Sel); |
or
Code: | Sel := TzDesignerSelections.Create;
zFormDesigner1.GetSelections(Sel); |
always returns the TcxGrid object, not the column(s) that were selected. Those columns do correctly appear in the TInspectorList when selected with the mouse, and if I add a toolbar button and run the same code in the main unit (outside of the Component editor) the same code does return the selected columns and not the cxGrid object. Evidently, the TzFormDesigner object manipulates the list of selected objects after (?) the component editor has already been called.
I'd like to override both the double-click behavior and add a new right-click option to the menu that gets shown to the user. So, the question is: is it possible to trap the default component editor for TcxGridColumn objects (or add the same behavior some other way)? |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Sat May 16, 2009 7:26 am Post subject: |
|
|
Hello,
Designer was updated to handle this situation.
Now component editor for TcxGridColumn will work, but only for popup menu.
Edit method of component editor will not be called because double click message is
not send (probably due to processing left click by TcxGrid).
P.S. Request updated sources (by sending request from registered e-mail to support@econtrol.ru).
Michael. |
|
Back to top |
|
|
aecspades
Joined: 04 Dec 2006 Posts: 14
|
Posted: Mon May 18, 2009 7:27 pm Post subject: |
|
|
Works perfectly - thank you very much! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|