How to dynamically add items with icons to ultraExplorer bar

Posted by ChUIMonster on 06-Feb-2009 14:36

I am currently very successfully populating an ultraExplorerBar dynamically

using these two methods that I have added to the class containing the

ultraExplorerBar:

method private void addGroup( input groupName as character ):

if protopbar:groups:exists( groupName ) = false then

myExplorerBar:groups:insert( 0, groupName, groupName ).

return.

end method.

method public void addItem2ExplorerBar( input groupName as character, input itemName as character ):

addGroup( groupName ).

myExplorerBar:groups:items:add( itemName, itemName ).

return.

end method.

There is, however, a small problem. This code results in the "default

image" being used with each item and that is kind of ugly.

I can easily turn off the default image by adding:

myExplorerBar:groups:items:Settings:UseDefaultImage = Infragistics.Win.DefaultableBoolean:False.

to the addItem2ExplorerBar() method but that is even uglier

What I would really like to be able to do is to specify an image with the

item when I add it using a third parameter to addItem2ExplorerBar(). But

the add() method obviously doesn't support that.

Any ideas?

All Replies

Posted by Thomas Mercer-Hursh on 06-Feb-2009 14:41

What are you doing working on a non-ChUI interface????

Posted by Admin on 06-Feb-2009 14:44

This method returns the new item:

oItem = myExplorerBar:groups:items:add( itemName, itemName ).

it's of type UltraExplorerBarItem.

Assign the Image to either the small or large appearance object of the Settings object:

oItem:Settings:SmallAppearance:Appearance:Image = oImage.

oImage could be of type System.Drawing.Bitmap and newed like this:

oImage = NEW System.Drawing.Bitmap ("c:\work\ProTop.NET\Images\dbstats.bmp").

Posted by jmls on 06-Feb-2009 14:44

God damn, I can't believe that you beat me to the punchline !

Posted by Admin on 06-Feb-2009 14:45

A Dinosaur went with evolution...

Posted by ChUIMonster on 06-Feb-2009 14:59

Mostly correct anyway

The actual syntax is:

myItem:Settings:AppearancesSmall:Appearance:Image = myImage.

Posted by Admin on 06-Feb-2009 15:02

my, my, my, that's so selfish...!

Posted by ChUIMonster on 06-Feb-2009 15:06

Well once you switch off all the foo-foo color syntax highlighting, keyboard macros, templates, keyword case changing, auto-indentation and so forth OEA makes an almost passable code editor.

Then you have to get past the "this is a -1 bit install of Progress" glitch when you add the Infragistics trial (hint: reinstall Progress, nothing less will work).

After that you just have to ignore the "visual designer" thing and before you know it you're slinging potentially useful code

I must say -- the Infragistics documentation is giving me a renewed appreciation for Progress' documentation!

Posted by ChUIMonster on 06-Feb-2009 15:09

God damn, I can't believe that you beat me to the

punchline !

I can understand Thomas being online, although he probably should have been on his lunch break, but you & Mike? Come on It's Friday night! Get yee to the nearest watering hole!

Posted by Admin on 06-Feb-2009 15:12

Then you have to get past the "this is a -1 bit

install of Progress" glitch when you add the

Infragistics trial (hint: reinstall Progress, nothing

less will work).

I don't wanna disappoint you too much. On Paul G.s laptop today the installation of the Infragistics Controls went without any issue...

I must say -- the Infragistics documentation is

giving me a renewed appreciation for Progress'

documentation!

But therefore in their forum you see photos of their developers and they are clearly tagged as "Infragistics Employees" (while in this forum the employees of the vendor hardly show their full names).

Message was edited by:

Mike Fechner

Posted by Peter Judge on 06-Feb-2009 15:15

But therefore in their forum you see photos of their

developers and they are clearly tagged as

"Infragistics Employees" (while in this forum the

employees of the vendor hardly show their full

names).

Not all of us. And really, do you want to see what we all look like?

-- peter

Posted by ChUIMonster on 07-Feb-2009 14:25

Ok, so I tried the same technique on the group.

It compiles and executes without any issues but nothing happens. No image magically appears next to the group

There was no default image either so I'm thinking that there must be a property somewhere that turns that behavior on and off. But after spending an hour or so crawling through the class browser I'm not having any luck... any ideas?

Posted by Simon de Kraa on 07-Feb-2009 15:26

I think you have to change the HeaderAppearance:Image.

There is an example .\src\samples\GuiForDotNet\UltraControls\WinExplorerBar\BasicFeatures where you can edit the properties at runtime to see what happens.

Edit: I also had to set the "Use Large Group Header Images" to True.

Message was edited by:

Simon de Kraa

Posted by ChUIMonster on 08-Feb-2009 13:18

Thanks Simon,

FWIW I used the following:

myGroup:Settings:AppearancesSmall:HeaderAppearance:Image = myImage.

myGroup:Settings:AppearancesSmall:NavigationPaneHeaderAppearance:Image = myImage. /* when group is open */

This thread is closed