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 

Controlling categories displayed by TPaletteToolList

 
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 May 12, 2009 11:08 pm    Post subject: Controlling categories displayed by TPaletteToolList Reply with quote

Is there some way to control what categories are displayed in a TPaletteToolList? I'm using

EC_NO_BPL;NEWNEWDESIGNER;EC_DSN_REG;EC_REG

...as conditional defines. I only want to show the 'Standard' and 'Data Controls' category, but some of the forms use the Developer Express Quantum Grid, so I need to register that as well. I know that I can manually do RegisterNoIcon for the Grid controls, but the cxGridReg.Register and cxGridPopupMenuReg.Register methods do dozens of method calls that I'd have to copy into my program, and those calls might change when I download a new version of the control from Developer Express. I thought that I could loop through the Items in the TPaletteToolList and just set Visible=false but that is a read only property. I also tried adding code that would reject (set Accept=false) the grid controls on the TDesignerEvents.OnRegisterComponent but that event never seemed to get called (?).

Any advice that you can give would be very appreciated.
Back to top
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Fri May 15, 2009 8:11 pm    Post subject: Reply with quote

Hello,

Added property:
TPaletteToolList.CustomItems: TStrings

which allows fully control palette, for example:

+My standard controls
TButton
TLabel
TListBox
+My DB controls
TDbEdit
+My additional
TPaintBox
TImage
TBevel

(+ - category)

When this list is empty default palette is created.

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:35 pm    Post subject: Reply with quote

That does work, thank you very much, but it worked differently then I expected. Can you change it somehow so that an entire Catgory can be displayed without listing every control? For example, I have a 'Common' category that has all of the controls that I expect the user to work with. I would like to have the code to register those controls in one place, and not have to have a matching list of objects in the CustomItems property as well. So for example:

+Common
+My standard controls
TButton
TLabel
TListBox

...would show all of the controls in the Common category, but only TButton, TLabel, and TListBox from the "My standard controls" category. Or maybe something like '++' instead to indicate all controls (so it doesn't have to look ahead in the list)?

++Common
+My standard controls
TButton
TLabel
TListBox

Whatever makes sense to you would be great - I'll work with what I have now but that would make a really good addition even better.
Back to top
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Tue May 19, 2009 8:20 pm    Post subject: Reply with quote

New changes to CustomItems usage:

1. Specification component item
Code:
ComponentClassName

2. Specification new category
Code:
+CategoryName

3. Specification existed category (components page) with adding all components which belong to this page.
Code:
++CategoryName

4. Rename existed category (components page) with adding all components which belong to this page.
Code:
++CategoryName=Display_name_of_category

5. Adding all components which belong to the page without adding category.
Code:
++CategoryName=
Back to top
View user's profile Send private message Send e-mail
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