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
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!
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 . 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
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 . 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.
I like your suggested alternative better. I just tried and it again works perfectly . 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.
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.
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 . 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.