Home » U++ Library support » TabCtrl » tabctrl contents not visible
tabctrl contents not visible [message #37964] |
Sun, 25 November 2012 13:00  |
crydev
Messages: 151 Registered: October 2012 Location: Netherlands
|
Experienced Member |
|
|
I am trying to rebuild my current settings dialog which didn't use a tabctrl to a tabctrl based dialog. I need this because I need to put more settings inside the dialog.
I have the following code. To me it seems ok but it is not working. The contents of the ParentCtrl I want to put inside a tab is not visible! Can anybody help me out in this? My code is as following:
In header file:
TabCtrl mTabCtrl;
ParentCtrl mLibraryTab, mImdbTab;
Dialog constructor:
mLibraryTab
<< bOk.Ok().SetLabel("OK").LeftPos(10, 50).BottomPos(10, 20)
<< bCancel.SetLabel("Cancel").LeftPos(65, 50).BottomPos(10, 20)
<< mDirectories.SetLabel("Library Directories").LeftPos(10, 300).TopPos(5, 110)
<< mLibraryGeneral.SetLabel("Library General").LeftPos(10, 300).TopPos(120, 40)
<< bBrowse.SetImage(MovieManagerIml::AddButton()).LeftPos(265, 40).TopPos(25, 40)
<< bRemove.SetImage(MovieManagerIml::DeleteButton()).LeftPos(265, 40).TopPos(70, 40)
<< mDirectoryList.LeftPos(20, 240).TopPos(25, 85)
<< mForceResync.SetLabel("Synchronise when settings have changed.").LeftPos(20, 240).TopPos(135, 20)
;
mTabCtrl.Add(mLibraryTab, "Library");
Add(mTabCtrl.SizePos());
Before I had "*this" with the left shift to add controls. This worked with no problem. I also tried to just add the controls by using mLibraryTab.Add(<controls>) but that does not work either. Why are my controls not visible on the form?
|
|
|
Re: tabctrl contents not visible [message #37965 is a reply to message #37964] |
Sun, 25 November 2012 13:42   |
|
crydev wrote on Sun, 25 November 2012 13:00 | I have the following code. To me it seems ok but it is not working. The contents of the ParentCtrl I want to put inside a tab is not visible! Can anybody help me out in this?
|
Hi crydev,
I've been caught by the same problem in the past and I remember how frustrating it was But the reason is actually really simple. You are adding mLibraryTab without specifying any size for it, so it is not visible You have to provide some sizing, this should work:
mLibraryTab
<< bOk.Ok().SetLabel("OK").LeftPos(10, 50).BottomPos(10, 20)
<< bCancel.SetLabel("Cancel").LeftPos(65, 50).BottomPos(10, 20)
<< mDirectories.SetLabel("Library Directories").LeftPos(10, 300).TopPos(5, 110)
<< mLibraryGeneral.SetLabel("Library General").LeftPos(10, 300).TopPos(120, 40)
<< bBrowse.SetImage(MovieManagerIml::AddButton()).LeftPos(265, 40).TopPos(25, 40)
<< bRemove.SetImage(MovieManagerIml::DeleteButton()).LeftPos(265, 40).TopPos(70, 40)
<< mDirectoryList.LeftPos(20, 240).TopPos(25, 85)
<< mForceResync.SetLabel("Synchronise when settings have changed.").LeftPos(20, 240).TopPos(135, 20)
;
mTabCtrl.Add(mLibraryTab.SizePos(), "Library"); // <-- SizePos() added
Add(mTabCtrl.SizePos());
Best regards,
Honza
|
|
|
|
|
Re: tabctrl contents not visible [message #60353 is a reply to message #37964] |
Thu, 21 December 2023 01:13   |
netdiver
Messages: 4 Registered: January 2023 Location: Berlin
|
Junior Member |
|
|
Here the test code
LAYOUT(TestTabCtrlLayout, 720, 376)
ITEM(Upp::TabCtrl, MainTab, LeftPosZ(0, 420).TopPosZ(0, 212))
END_LAYOUT
LAYOUT(Tab_1, 400, 200)
ITEM(Upp::Label, T1, SetLabel(t_("JumdidumTAB1")).LeftPosZ(16, 216).TopPosZ(12, 19))
ITEM(Upp::Button, dv___1, SetLabel(t_("Aktivieren")).HSizePosZ(16, 292).VSizePosZ(40, 132))
END_LAYOUT
#include "TestTabCtrl.h"
TestTabCtrl::TestTabCtrl()
{
CtrlLayout(*this, "Window title");
WithTab_1<ParentCtrl> TabCtrl_Properties;
MainTab.Add( TabCtrl_Properties, t_("Webseiten") );
MainTab.Add( t_("Whatever") );
}
GUI_APP_MAIN
{
TestTabCtrl().Run();
}
|
|
|
|
Goto Forum:
Current Time: Sun May 11 22:49:28 CEST 2025
Total time taken to generate the page: 0.00399 seconds
|