How to reserve some space on the right of the ribbon?

Topics related to the Krypton Ribbon.

Moderators: Phil Wright, Chris Porter

How to reserve some space on the right of the ribbon?

Postby swautier » Tue Aug 19, 2008 10:14 pm

Hi,

My app drives some piece of hardware. We want to display a small Hardware connection status panel in the top right corner of the app. But I also want to use a ribbon, which means this panel would be displayed on the right of the ribbon. Is there any way to do this? Or does the ribbon always use the full width of the window?

To give you a more accurate idea, this info panel would look something like this:
3 right-aligned lines each ending with a small green or red LED-like indicator featured as [x] below:

Camera 1 [x]
Camera 2 [x]
Accel [x]

TIA for your lights,

Serge.
Serge
http://www.apptranslator.com - Software Localization Made Easy
swautier
 
Posts: 20
Joined: Tue Aug 19, 2008 10:06 pm
Location: Belgium

Re: How to reserve some space on the right of the ribbon?

Postby Chris Porter » Wed Aug 20, 2008 2:04 am

Why not put the status window in the Ribbon? You can drop in custom controls that do pretty much anything and should easily be able to render colored icons based on data from another source.
Chris Porter
 
Posts: 714
Joined: Fri Oct 12, 2007 5:39 am
Location: Oklahoma City, OK, US

Re: How to reserve some space on the right of the ribbon?

Postby swautier » Wed Aug 20, 2008 7:34 am

Chris, thanks for your reply.

I thought of that but I see 2 problems:

1 (minor). Can I make sure that this group won't be shrinked is user narrows the window (e.g. up to displaying the leds only but not the labels). Not much of a problem though since the main form will most likely be fixed size.

2 (more important). Even if I add this group to each tab of the ribon to make sure it's always displayed, I can't be sure it will always be displayed on the right end side of the form: If the contents of a tab doesn't fill the whole width space, my status group will move.

Or can I right-align a ribon group?

TIA,
Serge.
Serge
http://www.apptranslator.com - Software Localization Made Easy
swautier
 
Posts: 20
Joined: Tue Aug 19, 2008 10:06 pm
Location: Belgium

Re: How to reserve some space on the right of the ribbon?

Postby shartmann » Wed Aug 20, 2008 11:18 am

Hi,

I'm having the same problem as swautier,
I like to add an activity indicator like in firebird (the rotating circle) and I think this doesn't look good inside the tab pages.
It would be nice if the ribbon would have an optional "free (outside) area" on the right, where we can add own controls, logos etc.

best regards
Stephan
shartmann
 
Posts: 45
Joined: Thu Mar 27, 2008 5:58 pm

Re: How to reserve some space on the right of the ribbon?

Postby Phil Wright » Wed Aug 20, 2008 3:06 pm

You can pretty much get what you want and with a little extra coding but with one restriction. Use the following process...

1, Create a new Form
2, Set KryptonForm as the base class
3, Drop a KryptonPanel onto the client area
4, Set the Dock=Right for the KryptonPanel
5, Drop a KryptonRibbon on the client area.

Now you have the situation you require as the ribbon will only extend to the right until it meets the docked panel on the right hand side. There is an issue with this when using Vista. Under Vista when you have custom chrome and the ribbon it reverts to showing using the glassy borders. This does not work when you have the panel docked on the right as you will notice the panel uptends up and into the top border! To get around this set the AllowFormIntegrate property on the KryptonRibbon to False. Now it works fine but you are stuck with the Office 2007 custom chrome under Vista. This custom border is the restriction I mentioned.

The only remaining issue is that the docked panel on the right extends all the way down to the bottom of the client area. So when you add your control for taking up the remainder of the client area it does not extend to the right edge in the way I assume you would like. The only way around this is that you would need to hook into the form OnSize and manually resize the filler panel so it sizes as needed. So drag and drop another KryptonPanel onto the remainding client area and then use this code to set its size...

Code: Select all
        protected override void OnSizeChanged(EventArgs e)
        {
            kryptonPanel2.SetBounds(0,
                                    kryptonRibbon1.Height,
                                    ClientSize.Width,
                                    ClientSize.Height - kryptonRibbon1.Height);
            base.OnSizeChanged(e);
        }


I just tried this and it works pretty well.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia

Re: How to reserve some space on the right of the ribbon?

Postby swautier » Thu Aug 21, 2008 12:07 am

Phil,

Thanks for the details. Will giv it a try asap.

Keep up with the excellent work.

Serge.
Serge
http://www.apptranslator.com - Software Localization Made Easy
swautier
 
Posts: 20
Joined: Tue Aug 19, 2008 10:06 pm
Location: Belgium


Return to Krypton Ribbon

Who is online

Users browsing this forum: No registered users and 1 guest

cron