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 » TabCtrl » tabctrl contents not visible
tabctrl contents not visible [message #37964] Sun, 25 November 2012 13:00 Go to next message
crydev is currently offline  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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Smile But the reason is actually really simple. You are adding mLibraryTab without specifying any size for it, so it is not visible Wink 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 #37968 is a reply to message #37965] Sun, 25 November 2012 18:38 Go to previous messageGo to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Thanks a lot Honza! I knew it would be a small fault in my code, but the small ones are the hardest to find Smile It works now!
Re: tabctrl contents not visible [message #60352 is a reply to message #37964] Thu, 21 December 2023 00:34 Go to previous messageGo to next message
netdiver is currently offline  netdiver
Messages: 4
Registered: January 2023
Location: Berlin
Junior Member
Followup Question.
(I'm starting with U++, so please be patient.)

I have a simple GUI_APP with a layout file that contains the main window layout and a (what I hope to be able to see one day) a second layout for the TabCtrl content.

In I'm adding a tab to my TabCtrl with this simple line
void Setup(){
WithCtrlTabProperties<ParentCtrl> tabP;
mainTab.Add( tabP, t_("Websites") );
}

The tab is created, but the content (CtrlTabProperties with a test button) is not showing up.

Did I miss something?
Re: tabctrl contents not visible [message #60353 is a reply to message #37964] Thu, 21 December 2023 01:13 Go to previous messageGo to next message
netdiver is currently offline  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();
}
Re: tabctrl contents not visible [message #60354 is a reply to message #37964] Thu, 21 December 2023 01:32 Go to previous message
netdiver is currently offline  netdiver
Messages: 4
Registered: January 2023
Location: Berlin
Junior Member
Ok, found sthe solution.

I forgot zo call

CtrlLayout(TabCtrl_Properties);
Previous Topic: How to dynamically add remove tabs
Next Topic: TabCtrl.WhenSet is called when app closes
Goto Forum:
  


Current Time: Thu Mar 28 19:20:38 CET 2024

Total time taken to generate the page: 0.01149 seconds