EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Overriding Component Editors for TcxGridColumn objects

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Form Designer
View previous topic :: View next topic  
Author Message
aecspades



Joined: 04 Dec 2006
Posts: 14

PostPosted: Tue Feb 24, 2009 4:46 pm    Post subject: Overriding Component Editors for TcxGridColumn objects Reply with quote

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
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Sat May 16, 2009 7:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
aecspades



Joined: 04 Dec 2006
Posts: 14

PostPosted: Mon May 18, 2009 7:27 pm    Post subject: Reply with quote

Works perfectly - thank you very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Form Designer All times are GMT
Page 1 of 1

 
Jump to:  
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