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: 1428 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Collapsable/Expandable Frame [message #18455 is a reply to message #17905] |
Wed, 01 October 2008 22:36   |
 |
forlano
Messages: 1221 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
| mrjt wrote on Tue, 02 September 2008 19:20 | I've added this package (ExpandFrame) to Bazaar. It now also contains a container Ctrl that allows vertical or horizontal stacking of the frames (with scrolling) and cbporter's much prettier style is now the default.
|
Hello,
I'm interested in this package, but I've not understood where to download the latest version. Is it in SVN?
EDIT: Yes, it is in SVN
Thanks,
Luigi
[Updated on: Wed, 01 October 2008 22:43] Report message to a moderator
|
|
|
|
|
|
| Re: Collapsable/Expandable Frame [message #18463 is a reply to message #18457] |
Thu, 02 October 2008 07:25   |
 |
forlano
Messages: 1221 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
| forlano wrote on Wed, 01 October 2008 23:02 |
| forlano wrote on Wed, 01 October 2008 22:36 |
| mrjt wrote on Tue, 02 September 2008 19:20 | I've added this package (ExpandFrame) to Bazaar. It now also contains a container Ctrl that allows vertical or horizontal stacking of the frames (with scrolling) and cbporter's much prettier style is now the default.
|
Hello,
I'm interested in this package, but I've not understood where to download the latest version. Is it in SVN?
EDIT: Yes, it is in SVN.
|
EDIT2: I've downloaded the .deb version but I do not see any test case .
|
Hoping to find the ExpandFrame package in the svn for windows I've downloaded it. Unfortunately the whole bazaar assembly is absent.
So, if I have not missed something, the windows and linux distro are not equivalent.
Anyway, where can I download the ExpandFrame package with a test case?
Thanks,
Luigi
|
|
|
|
|
|
| Re: Collapsable/Expandable Frame [message #18646 is a reply to message #18644] |
Tue, 14 October 2008 13:17   |
 |
forlano
Messages: 1221 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
| mrjt wrote on Tue, 14 October 2008 12:41 | Apologies for the delay. There never was a proper test-case before, so I've attached a zip containing both the source and an example (also added to SVN).
I'm not sure why the Bazaar assembly is missing from the SVN, it's certainly in the one I use. Is the actual Bazaar sub-directory missing?
|
Hi,
I have downloaded from http://www.ultimatepp.org/svnbuilds the latest svn (is that the place where to download the current distro with your last update? I am afraid not). I found the baazar folder but it didn't appeared in theide. I've added a bazaar.var file in the root directory and everything was OK. So seems that only this file is missing in SVN.
Thanks,
Luigi
[Updated on: Tue, 14 October 2008 13:21] Report message to a moderator
|
|
|
|
|
|
| Re: Collapsable/Expandable Frame [message #25318 is a reply to message #18648] |
Wed, 17 February 2010 00:25   |
|
|
If I do a lot of sections / frames so that the scrollbar appears, I try to navigate through the fields using Tab / Shift + Tab. When I move below the scrolling region, the frame does not scroll automatically, and further movement between the fields I can not see.
To see at what I field, and generally to see this field I have to help with the mouse, what is wrong. I believe that this package is interesting primarily for editing large forms, which can not be placed entirely on the screen.
How to automatically move the scrollbar, using the Tab / Shift + Tab, the current field would be visible all the time?
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
|
|
|
| Re: Collapsable/Expandable Frame [message #25619 is a reply to message #25610] |
Thu, 04 March 2010 00:00   |
|
|
The idea of opening / closing frame is interesting, but I did not really get what you suggest. If possible, tell me more how it should look like.
By the way I would have uploaded the current version, but it seemed wrong to upload the product, the author of which I am not.
PS
If you do not mind I put it up in SVN. (since I started its intensive use)
PSPS
Or I can upload it under a different name.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
|
|
|
| A small bug. [message #40696 is a reply to message #12019] |
Wed, 04 September 2013 09:09  |
rxantos
Messages: 73 Registered: October 2011
|
Member |
|
|
When using the Flat Style, the control crashes if the frame is expanded. This happens because the borders are set to NULL on the flat style.
to fix it change in ExpandFrame::BorderSz()
int sz = (int)(uintptr_t)(handle.style->border[0][0]);
to
int sz = (handle.style->border[0]) ? (int)(uintptr_t)(handle.style->border[0][0]) : 0;
|
|
|
|
Goto Forum:
Current Time: Tue Apr 28 21:33:17 GMT+2 2026
Total time taken to generate the page: 0.01437 seconds
|