Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Well another problem I'm facing (drawing inside Tab)
Well another problem I'm facing [message #47830] |
Sat, 08 April 2017 03:29  |
germax
Messages: 20 Registered: March 2017 Location: germany
|
Promising Member |
|
|
I have the following to work with atm:
class MINE : public WithMyLayout<TopWindow>
{
WithTAB_one<ParentCtrl> tab_1;
WithTAB_two<ParentCtrl> tab_2;
WithTAB_three<ParentCtrl> tab_3;
WithTAB_four<ParentCtrl> tab_4;
WithTAB_five<ParentCtrl> tab_5;
WithTAB_six<ParentCtrl> tab_6;
............
}
And of course they're all added to my TabCtrl defined in MyLayout...
NOW, the problem I'm facing now is that I need to Draw inside one of those tabs (it's tab_4 but that isn't important really )
[that explorer view from the other thread needs to be inside a tab together with a treectrl and an sqlarray in the end....]
How can I get
void MINE::Paint(Draw& w){...}
to draw nothing but tab_4 (well in fact a rect inside tab_4 would be even better to be honest,
since it indeed holds different controls prior.
I'd love to add a Paint() Method exclusively to tab_4
but TAB_four::Paint doesn't work obviously... neither does tab_4::Paint...
I can add a dummy Ctrl to hold the Paint method
like
void Picture::Paint(Draw& w){...}
and add the Picture control to the tab I need;
but then a whole lot of other problems arise for me.
the Paint method makes extensive use of variables, vectors and methods of my Main class (MINE)
which are inaccessible directly, and frankly adding a crapton of GetMethods is only a last resort really.
I thought as Picture being a child of "my" layout included in my class it's automatically child of my class itself, but that doesn't seem to be the case *shrugs*
So yeah, I need your expertise..
is there are callback I could use to paint a childtab with a mainclass method?
ideally something like:
tab_4.Paint <<= THISBACK(PaintTabFour);
or alike
thank you
Alex
that other german guy
[Updated on: Sat, 08 April 2017 03:30] Report message to a moderator
|
|
|
Re: Well another problem I'm facing [message #47874 is a reply to message #47830] |
Sat, 15 April 2017 11:44  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
germax wrote on Sat, 08 April 2017 03:29I have the following to work with atm:
class MINE : public WithMyLayout<TopWindow>
{
WithTAB_one<ParentCtrl> tab_1;
WithTAB_two<ParentCtrl> tab_2;
WithTAB_three<ParentCtrl> tab_3;
WithTAB_four<ParentCtrl> tab_4;
WithTAB_five<ParentCtrl> tab_5;
WithTAB_six<ParentCtrl> tab_6;
............
}
Once again I am not 100% sure what the question is, but maybe you are just confused by example and thing that you need to use above (simplified) form for tabs. That is not true, you can use any Ctrl derived object here, so:
struct MyTab4 : WithTAB_four<ParentCtrl> {
virtual void Paint(Draw&);
};
class MINE : public WithMyLayout<TopWindow>
{
WithTAB_one<ParentCtrl> tab_1;
WithTAB_two<ParentCtrl> tab_2;
WithTAB_three<ParentCtrl> tab_3;
MyTab4 tab_4;
WithTAB_five<ParentCtrl> tab_5;
WithTAB_six<ParentCtrl> tab_6;
............
}
Mirek
[Updated on: Sat, 15 April 2017 11:45] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 25 11:58:30 CEST 2025
Total time taken to generate the page: 0.00575 seconds
|