New Posts New Posts RSS Feed: [SOLVED] Status Bar
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

[SOLVED] Status Bar

 Post Reply Post Reply
Author
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Status Bar
    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.

Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post 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:
 
 
and here:
 
 
Bill J.
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post 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.


Edited by Linguinut - 23-Oct-2007 at 4:15pm
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post 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.

Edited by Linguinut - 26-Oct-2007 at 5:08pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down