Print Page | Close Window

[SOLVED] Status Bar

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=513
Printed Date: 11-Jun-2026 at 3:03pm


Topic: [SOLVED] Status Bar
Posted By: Linguinut
Subject: [SOLVED] Status Bar
Date Posted: 19-Oct-2007 at 11:05am
Could someone provide a quick reference for how to add something to the status bar?  An example would be row state, or current user, or ip address.



Replies:
Posted By: Bill Jensen
Date Posted: 19-Oct-2007 at 2:36pm
The ShellLayoutViews (DevEx and DotNet) register the status bar with the root workitem under the name contained in the constant:

UIExtensionSiteNames.MainStatus

Retrieve it from there and add whatever you want to it.


Posted By: Linguinut
Date Posted: 19-Oct-2007 at 5:01pm
When attempting to access the status bar, somehow all of my DevExpress tools have disappeared.  Time to go home.  I'll tackle this one tomorrow.  If you know of a quick way to get these back, let me know.  I will reinstall tomorrow.


Posted By: Linguinut
Date Posted: 23-Oct-2007 at 4:07pm
Just in case anyone is wondering, I did reinstall the DevExpress controls and the IDE toolbox was refilled.  After I did that, I was made aware that there is a utility in the DevExpress installation that will repopulate the toolbox.  Apparently, some installations of 3rd party controls can disrupt the toolbox and reset it (via devenv.exe /setup).  I lost the IdeaBlade stuff, too, but I ran the toolbox utility that came with the install and all was well there.
 
Now, back to the question about the status bar.  I apologize for my ignorance, but retrieving the MainStatus object has left me a bit bewildered.  How is this actually done?  The syntax is escaping me.  Here is what I am guessing it should be:
 
DevExpress.XtraEditors.ImageEdit myButton = new DevExpress.XtraEditors.ImageEdit();
myButton.Image = Resources.GetImage(ResourceNames.RowStateUnchangedImage);
WorkItem.UIExtensionSites[UIExtensionSiteNames.MainStatus].Add<DevExpress.XtraEditors.ImageEdit>(myButton);
 
[Edit]  The addition could be any UI control.  I just used the ImageEdit as an example.


Posted By: Bill Jensen
Date Posted: 24-Oct-2007 at 11:43am
UIExtensionSites are one of the weakest areas of CAB.  I haven't used them much either.
 
I found series by RichNewman that provides some introductory material on CAB.  Relevant installments are here:
 
http://richnewman.wordpress.com/2007/10/13/introduction-to-uiextensionsites-introduction-to-the-cabscsf-part-13/ - http://richnewman.wordpress.com/2007/10/13/introduction-to-uiextensionsites-introduction-to-the-cabscsf-part-13/
 
and here:
 
http://richnewman.wordpress.com/2007/10/20/more-on-uiextensionsites-introduction-to-cabscsf-part-14/ - http://richnewman.wordpress.com/2007/10/20/more-on-uiextensionsites-introduction-to-cabscsf-part-14/
 
Bill J.


Posted By: Linguinut
Date Posted: 26-Oct-2007 at 5:02pm
A bit helpful; however, one of the biggest problems with CAB-related "introductions" is that the writer fails to tell the reader some rather important things.  In the first article, Newman does not state what namespace the UIExtensionSite is in.  Am I supposed to intuitively know this?  I had to hunt for this myself.  It is in the Microsoft.Practices.CompositeUI namespace.

In addition, the status bar within a DevEx DF/CAB app is an XtraBar...so it only takes BarItems.  Not a big deal...there's a bunch of 'em. 

Problem. 

There is no such thing as a DevExBasicControlViewPresenter, so there is no corresponding BindRowStateImage.  Why is that bad?  The only thing that the BindRowStateImage takes is a Windows form control.  Sorry, Charlie...you are out of luck.  I cannot add a DevEx control to the MainStatus site and use it with BindRowStateImage.

Off I go to figure out another way.

In case anyone is interested, here is a code snippet that shows you how to add a DexEx item to a status bar.  This code is being run from a view's presenter.

BarStaticItem mBarItem = new BarStaticItem();
mBarItem.Alignment = BarItemLinkAlignment.Right;
mBarItem.Caption =
"Some Text Here";
UIExtensionSite mUISite = WorkItem.RootWorkItem.UIExtensionSites[UIExtensionSiteNames.MainStatus];
mUISite.Add<BarStaticItem>(mBarItem);

When I get around to figuring out how to get the RowStateImage showing on the status bar, I will pull this out and register the bar item much higher up.  Then I would just call for that bar item when needed and set its properties.  That is for another day.  Time to go home.




Print Page | Close Window