Home » U++ Library support » TabCtrl » TabDlg propose
Re: TabDlg propose [message #19692 is a reply to message #19678] |
Mon, 05 January 2009 22:41 |
|
mirek
Messages: 13979 Registered: November 2005
|
Ultimate Member |
|
|
tojocky wrote on Sun, 04 January 2009 13:26 |
luzr wrote on Sun, 04 January 2009 16:02 | Not sure:
Calling SizePos on tab component is quite easy. OTOH, sometimes you might want the tab not to be resized - and doing this, you are loosing this option.
|
Sorry for stupid question...
How can i do? i tryed, but not work:
TabDlg dlg;
WithOptionsGeneralLayout<ParentCtrl> tab_options_general;
tab_options_general.SizePos();
dlg.Add(tab_options_general, t_("General")).Slave(&tab_options_general);
edit: May be add third parameter, "bool slave = false"?
In TabCtrl.h
class TabDlg : public TopWindow {
...
TabCtrl::Item& Add0(Ctrl& tab, const char *text, bool isslave = false);
...
TabCtrl::Item& Add(T& tab, const char *text, bool isslave = false) { CtrlLayout(tab); return Add0(tab, text, isslave); }
...
TabDlg& operator()(T& tab, const char *text, bool isslave = false) { Add(tab, text, isslave); return *this; }
In TabCtrl.cpp
TabCtrl::Item& TabDlg::Add0(Ctrl& tab, const char *text, bool isslave)
{
Size tsz = max(tab.GetRect().GetSize(), sz);
if(isslave)
tab.SizePos();
TabCtrl::Item& m = tabctrl.Add(tab, text);
if(isslave)
m.Slave(&tab);
if(tsz != sz) {
sz = tsz;
Rearrange();
}
return m;
}
|
OK, I have changed my mind. Original idea is quite ok.
Applied.
Mirek
|
|
|
Goto Forum:
Current Time: Sun May 12 23:12:22 CEST 2024
Total time taken to generate the page: 0.02476 seconds
|