|
|
Home » Developing U++ » UppHub » Collapsable/Expandable Frame
Collapsable/Expandable Frame [message #12019] |
Mon, 08 October 2007 11:56  |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
This package provides two controls that give to ability to have dynamically expandable/collapsable layouts, similar to MS Outlook (in function, if not appearance).

The style shown is the default, but can be redefined using a Chameleon.
ExpandFrame: A frame that can be applied to any Upp Ctrl and allows the user to hide/show it's child ctrl. A simple example:
TopWindow wnd;
ExpandFrame frame;
DocEdit editor;
frame.Left(editor, 300).SetTitle("Left-aligned editor").Expand();
wnd.AddFrame(frame);
wnd.Run();
ExpanderCtrl: This is container ctrl that allows the grouping of ExpanderFrames with minimal effort from the programmer. A scollbar is automatically provided when necessary.
TopWindow wnd;
ExpanderCtrl expand;
DocEdit editor;
expand.AddExpander(editor, true, 300).SetTitle("Vertical frame container");
wnd.Add(expand.SizePos());
wnd.Run();
See the ExpandFrameExample package for a further example.
James
[Updated on: Tue, 14 October 2008 12:42] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Collapsable/Expandable Frame [message #12834 is a reply to message #12811] |
Tue, 20 November 2007 12:59   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Hmm. Strange bug that, for me it only seems to effect vertical frames and I can't see any reason why this should be the case.
Anyway, it seems to to do with Upp backpainting and the fix is quite simple. I've uploaded the package again, and incase you've made changes yourself here is the fix:
ExpandFrame::ExpandFrame()
{
style = NULL;
child_size = 0;
childfocus = false;
ignorefocus = false;
expand = false;
type = 0;
btn.Transparent(); // Bugfix
Add(btn);
}
All this is for dev-11, as I think it was a new bug from this release, but this should not break nay older version.
And to Mirek: I'm hoping to improve the Chameleon skin for this, but I'm having problems accessing the correct theme settings. Is it possible to expose/access theme settings for window titlebars? I think the settings are available (in Win32 at least), but not currently used by Upp.
James
[Updated on: Wed, 05 December 2007 16:36] Report message to a moderator
|
|
|
Re: Collapsable/Expandable Frame [message #13011 is a reply to message #12834] |
Wed, 05 December 2007 12:40   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
Hi!
I've been working on creating a new skin for you ExpandFrame. I'm not quite done yet, because obtaining a look that is not ugly is hard.
But I've noticed a bug in your code. If you set a frame to bottom position, the Image will disappear once you expand the frame and appear again when you collapse it.
And vertical frames don't display text unless you also set an image, while horizontal ones do.
[Updated on: Wed, 05 December 2007 13:40] Report message to a moderator
|
|
|
|
|
|
Re: Collapsable/Expandable Frame [message #13120 is a reply to message #13053] |
Thu, 13 December 2007 10:57   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Sorry for the delayed reply. Very nice.
I personally think the second verion is both prettier and clearer, partly due to the 3D effect.
I noticed the problem with the background image on the vertical bars, so I've attached a new version with seperate values for vertical and horizontal bars. If you set it like this:
background[2] = RotateClockwise(/*Image from background[0]*/)
background[3] = RotateClockwise(/*Image from background[1]*/)
It should look better.
And you getting the theme information from the OS for that look? If you are I would love see the code, I could use it for a number of other things I'm working on.
James
[Updated on: Thu, 13 December 2007 11:33] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Fri May 09 22:24:23 CEST 2025
Total time taken to generate the page: 0.01877 seconds
|
|
|