Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » How to create sizable header columns in ArrayCtrl
How to create sizable header columns in ArrayCtrl [message #2348] Sun, 09 April 2006 05:57 Go to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
Maybe this is obvious and should be almost automatic, but I am not getting any success here. I tried

arrayCtrl.AddColumn("Name", 10);
arrayCtrl.AddColumn("Value", 20);

but I would like for users to size and resize the header column. Please help. Thanks
Re: How to create sizable header columns in ArrayCtrl [message #2352 is a reply to message #2348] Sun, 09 April 2006 07:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kevinle10@gmail.com wrote on Sat, 08 April 2006 23:57

Maybe this is obvious and should be almost automatic, but I am not getting any success here. I tried

arrayCtrl.AddColumn("Name", 10);
arrayCtrl.AddColumn("Value", 20);

but I would like for users to size and resize the header column. Please help. Thanks


Those are just initial values. Users can resize header columns.

If it does not work, problem is elsewhere Wink (If that is the case, please send more code or even better, compilable testcase).

Mirek
Re: How to create sizable header columns in ArrayCtrl [message #2359 is a reply to message #2348] Sun, 09 April 2006 17:36 Go to previous messageGo to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
Mirek,

I think I know what the problem is. When I put any control inside a label box, the events to those (child) controls no longer get to them. You can duplicate easily by putting an ArrayCtrl and a Button inside a LabelBox, then the column headers of the ArrayCtrl are no longer resizable and THISBACK(buttonPush) has no effect. Please take a look at this problem to make Ultimate++ the best. I like Ultimate very much. Thanks
Re: How to create sizable header columns in ArrayCtrl [message #2360 is a reply to message #2359] Sun, 09 April 2006 18:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kevinle10@gmail.com wrote on Sun, 09 April 2006 11:36

Mirek,

I think I know what the problem is. When I put any control inside a label box, the events to those (child) controls no longer get to them. You can duplicate easily by putting an ArrayCtrl and a Button inside a LabelBox, then the column headers of the ArrayCtrl are no longer resizable and THISBACK(buttonPush) has no effect. Please take a look at this problem to make Ultimate++ the best. I like Ultimate very much. Thanks


How do you "put it inside label box"? As child? If that is the case, it simply is the feature (mouse events are ignored by LabelBox and its childs, because otherwise you would not be able to use LabelBox with sibling Ctrls). The moral of the story - never add Ctrls as LabelBox childs. Or, if you insiset on doing so, at least restore mouse processing by calling NoIgnoreMouse for LabelBox.

Dropping a couple of lines of code or even (better) testing package would really help me here to understand circumstances and fix the bug if there is any!

Mirek
Re: How to create sizable header columns in ArrayCtrl [message #2361 is a reply to message #2348] Sun, 09 April 2006 18:13 Go to previous messageGo to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
Mirek,

I need a way to group controls in my dialog into two groups and split the two groups using a Splitter control. It makes sense to use the LabelBox to group, but as I mentioned in my previous post, the LabelBox seems to "eat" the events to their children.

Therefore, I just experimented using the ParentCtrl instead of the LabelBox. Works fine Razz . The problem is the lack of visual aspects for the users. They can't tell the groups easily and they cannot see there's a splitter bewteen the two groups. Can you please help me with a work-around. Thanks
Re: How to create sizable header columns in ArrayCtrl [message #2362 is a reply to message #2361] Sun, 09 April 2006 18:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kevinle10@gmail.com wrote on Sun, 09 April 2006 12:13

Mirek,

I need a way to group controls in my dialog into two groups and split the two groups using a Splitter control. It makes sense to use the LabelBox to group, but as I mentioned in my previous post, the LabelBox seems to "eat" the events to their children.

Therefore, I just experimented using the ParentCtrl instead of the LabelBox. Works fine Razz . The problem is the lack of visual aspects for the users. They can't tell the groups easily and they cannot see there's a splitter bewteen the two groups. Can you please help me with a work-around. Thanks


I see. Well, have you tried "NoIgnoreMouse" for LabelBox? That should fix the problem.

Alternative is to keep ParentCtrl and place both LabelBox and ArrayCtrl (and button) on it as siblings.

Mirek
Re: How to create sizable header columns in ArrayCtrl [message #2363 is a reply to message #2348] Sun, 09 April 2006 18:51 Go to previous messageGo to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
I like your suggested alternative better. I just tried and it again works perfectly Razz . I have not tried the first approach using NoIgnoreMouse" for LabelBox yet.

Now should I subclass the Splitter control class and overide the Paint() method to draw the split line and make it obvious to the users? Or is there a better way? Thanks Mirek.
Re: How to create sizable header columns in ArrayCtrl [message #2364 is a reply to message #2363] Sun, 09 April 2006 19:04 Go to previous messageGo to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
Mirek and everyone,

Another reason I like the second approach (using ParentCtrl to group controls and LabelBox as simply a sibling) is that when you resize your dialog box (or windows) if you have an ArrayCtrl like I do, you would see better rendering and less flickering due to screen re-drawing.

Re: How to create sizable header columns in ArrayCtrl [message #2365 is a reply to message #2363] Sun, 09 April 2006 20:02 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kevinle10@gmail.com wrote on Sun, 09 April 2006 12:51

I like your suggested alternative better. I just tried and it again works perfectly Razz . I have not tried the first approach using NoIgnoreMouse" for LabelBox yet.

Now should I subclass the Splitter control class and overide the Paint() method to draw the split line and make it obvious to the users? Or is there a better way? Thanks Mirek.


Well, you might try to put a decorative Frame to the left and right sides of your ParentCtrl-s.

Something like .AddFrame(LeftSeparatorFrame()). If you would not like visual appearance, you can make your frame.

Mirek
Previous Topic: ArrayCtrl - how to set tooltips? [BY DERIVING...]
Next Topic: ArrayCtrl: Difference between xx.Ctrls<EditString>() and xx.Edit(ef1)
Goto Forum:
  


Current Time: Mon Apr 29 17:46:02 CEST 2024

Total time taken to generate the page: 0.02566 seconds