View previous topic :: View next topic |
Author |
Message |
aecspades
Joined: 04 Dec 2006 Posts: 14
|
Posted: Tue May 12, 2009 11:08 pm Post subject: Controlling categories displayed by TPaletteToolList |
|
|
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 |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Fri May 15, 2009 8:11 pm Post subject: |
|
|
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 |
|
|
aecspades
Joined: 04 Dec 2006 Posts: 14
|
Posted: Mon May 18, 2009 7:35 pm Post subject: |
|
|
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 |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Tue May 19, 2009 8:20 pm Post subject: |
|
|
New changes to CustomItems usage:
1. Specification component item
2. Specification new category
3. Specification existed category (components page) with adding all components which belong to this page.
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.
|
|
Back to top |
|
|
|