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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » "Forlano tabs" - how to reduce a headache by the proper use of the designer...
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer... [message #2153 is a reply to message #2151] Sun, 02 April 2006 15:19 Go to previous messageGo to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
So, here we go:
#include <CtrlLib/CtrlLib.h>
//"Forlano tabs example"- might not be very correct but might be usuful for learning...
//with added added one layout from the designer

//Step1 - if you want to use layouts - always include something like this
#define LAYOUTFILE "editmask.lay"
#include <CtrlCore/lay.h>

//Step 2 - please check that you have LAYOUT(Tab1Layout, 680, 368)
//personally I find renaming layouts faster in text mode...
//Step 3 - the Tab1 class below is pasted from automatically generated by the Designer
//using Alt_C first option "Dialog class"

class Tab1 : public WithTab1Layout<TopWindow> {
public:

	typedef Tab1 CLASSNAME;

	Tab1();
};

Tab1::Tab1()
{
	CtrlLayout(*this, "");
}

//the code below is what you had had before, except Step 4 

//personalized tab (1 child) widget
class LuigiTab : public ParentCtrl {
	Button btn;
	DocEdit doc;
public:

typedef LuigiTab CLASSNAME;
	LuigiTab();
	~LuigiTab(){;}
};

LuigiTab::LuigiTab() {
	btn.SetLabel("Just Button");
	btn.SetRect(20,20,100,25);
	Add(btn);
	//I strongly recommend to learn positioning from Designer- use Ctrl-T!
	doc.LeftPosZ(30, 500).TopPosZ(50, 300);
	Add(doc);

}

//personalized tabs (many -container) widget
class LuigiTabs : public TabCtrl {
	Tab1 tab1;  //Step 4 - this is your new tab!!!
	LuigiTab tab2,tab3; //tab1 removed 
public:

	typedef LuigiTabs CLASSNAME;
	LuigiTabs();
	~LuigiTabs(){;}
};

//the code below is all the same

Now you can make your tab1 changes using the designer... Smile
What's next? Smile

[Updated on: Sun, 02 April 2006 15:56]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to combine two widget-class in the topwindow
Next Topic: Getting data in a row of ArrCtrl
Goto Forum:
  


Current Time: Thu May 16 05:03:46 CEST 2024

Total time taken to generate the page: 0.01394 seconds