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 » U++ Widgets - General questions or Mixed problems » Filling TabCtrl from Layout
Filling TabCtrl from Layout [message #3834] Thu, 29 June 2006 15:10 Go to next message
brianE is currently offline  brianE
Messages: 13
Registered: June 2006
Promising Member
Hi Guys,
I have tried reading thread call 'Forlano tabs' but am still not clear on this point; please advise.

I have simple layout: splitter, TabCtrl at top; ArrayCtrl under it.
I have second layout: some buttons.
I have third layout: some edits.

I want to put the buttons layout on tab1 of the TabCtrl and the edits layout on tab2 of the TabCtrl. I know you can do this! But I can't get my head around where things get declared and where to 'Add'. Please point me in right direction.

BrianE
Re: Filling TabCtrl from Layout [message #3835 is a reply to message #3834] Thu, 29 June 2006 15:50 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1194
Registered: March 2006
Location: Italy
Senior Contributor
brianE wrote on Thu, 29 June 2006 15:10

Hi Guys,
I have tried reading thread call 'Forlano tabs' but am still not clear on this point; please advise.

I have simple layout: splitter, TabCtrl at top; ArrayCtrl under it.
I have second layout: some buttons.
I have third layout: some edits.

I want to put the buttons layout on tab1 of the TabCtrl and the edits layout on tab2 of the TabCtrl. I know you can do this! But I can't get my head around where things get declared and where to 'Add'. Please point me in right direction.

BrianE


Please be patient, I need to retrieve my old examples e modify it in order to work with latest 606-dev version.

Luigi
Re: Filling TabCtrl from Layout [message #3836 is a reply to message #3834] Thu, 29 June 2006 16:27 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1194
Registered: March 2006
Location: Italy
Senior Contributor
brianE wrote on Thu, 29 June 2006 15:10

Hi Guys,
I have tried reading thread call 'Forlano tabs' but am still not clear on this point; please advise.

I have simple layout: splitter, TabCtrl at top; ArrayCtrl under it.
I have second layout: some buttons.
I have third layout: some edits.

I want to put the buttons layout on tab1 of the TabCtrl and the edits layout on tab2 of the TabCtrl. I know you can do this! But I can't get my head around where things get declared and where to 'Add'. Please point me in right direction.

BrianE


The file attached contains that example update to the 606-dev3 version (iml file have been changed since them). Please study it and lets speak about it so we have a concrete example.
Try to modify the layout you prefer adding one button at once and note the difference. Then add the callback to your button in the correspondent constructor.
Modify only little thing and observe carefully! Focus your attention only about one class at once. Then come back with other questions.

Luigi

PS: do not try to open directly the file during the download, but first save it on the disk. Move the unzipped directory as it is in MyApps dir and run theIDE.

PPS: the title of your post is too specific and perhaps our Administrator will move this thread in the tabCtrl forum... Smile

[Updated on: Thu, 29 June 2006 16:36]

Report message to a moderator

Re: Filling TabCtrl from Layout [message #3839 is a reply to message #3834] Thu, 29 June 2006 18:57 Go to previous messageGo to next message
brianE is currently offline  brianE
Messages: 13
Registered: June 2006
Promising Member
Hi, Luigi
The app is great - if somewhat complex for my present needs! However, it has lots of things I can look at later. I managed to extract the essence of what is needed and now my own little app works, so thanks.

I manually typed in all the things I needed to make it work but I'm pretty sure there must be ways to play copy/paste more than just the class declarations; so, as always, more questions:

I don't really understand when to use the word 'Layout' or the use of 'With' as in:
class VegaTabs : public WithVegaTabsLayout<TopWindow> {
public:

	typedef VegaTabs CLASSNAME;

	VegaTabs();
	~VegaTabs(){;}
};

I'm not sure what "CtrlLayout(*this, "");" actually does.

I don't know how to create new cpp files eg your "VegaTab1.cpp" so that I can split up the various classes I will need. [I have found this now!]

How can I get to see files that are not in my project whilst still having my project workable-with? At the moment I have two Upp's working at the same time!

I do read the documentation but at this stage it's hard to know which bits are the most important!

BrianE

[Updated on: Thu, 29 June 2006 20:33]

Report message to a moderator

Re: Filling TabCtrl from Layout [message #3841 is a reply to message #3839] Thu, 29 June 2006 21:20 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1194
Registered: March 2006
Location: Italy
Senior Contributor
I know it is complicated, but you started asking something (TabCtrl) not so immediate Smile
brianE wrote on Thu, 29 June 2006 18:57


I don't really understand when to use the word 'Layout' or the use of 'With' as in:
class VegaTabs : public WithVegaTabsLayout<TopWindow> {
public:

	typedef VegaTabs CLASSNAME;

	VegaTabs();
	~VegaTabs(){;}
};




"Layout" is just a name! It has no effect except that to remind you that the class come from designer. Sometimes I've not used the word "Layout". See for example the layout "NewTournamet" without 'layout'. You are free to name the layout as you like.

"With" instead is automatically added by Designer to the name of the layout when you generate the code with ALT + C (I hope you remind the tutorial about designer). I've never changed the label "WithLayoutName" and I think it is safe to not change it (maybe others can confirm this guessing). Instead you can write:

class BrianTabs : public WithVegaTabsLayout<TopWindow>

instead of that above.

Quote:


I'm not sure what "CtrlLayout(*this, "");" actually does.


This is something you do not need to know! Smile It is a standard non verbose U++ way to build the class widget. I do not know exactly what is does, but I easily guess it reads the lay file (see it with CTRL+T) corrispondent to its own layout and create really the widgets you have designed (allocated memory, and so on). Try this in some class that open a window to see the effect

CtrlLayout(*this, "My experiment");

(observe the title of the window).

Quote:


I don't know how to create new cpp files eg your "VegaTab1.cpp" so that I can split up the various classes I will need.



Do you remind how to create a lay file? Well, it is the same, just type myfile.cpp and the file will appear in your package.

Quote:

I read the documentation but at this stage it's hard to know which bits are the most important!



It is normal. For this reason the forum exists.
Now try to build your own easy class that do some simple thing: For example drop two editint fields, a button and a label. The pressure of the button does the sum of what it is inside the editfields and write it in the label. I started doing these things in order to master the behaviour of the elementary widgets. Try to coordinate the behaviour of these 4 widgets and then come again with the code. Follow even the tutorial about designer.
Then we pass to the TabCtrl that is a bit more complicated. I was not able to manage it without the help of Aris (our forum Administrator) when I began.

Luigi

[Updated on: Thu, 29 June 2006 21:23]

Report message to a moderator

Re: Filling TabCtrl from Layout [message #4505 is a reply to message #3836] Sat, 12 August 2006 20:16 Go to previous messageGo to next message
domingo is currently offline  domingo
Messages: 3
Registered: August 2006
Location: Spain - Malaga
Junior Member
In the file ForlanoVega.rar is missing a file TwoCtrl.h !!!
Re: Filling TabCtrl from Layout [message #4508 is a reply to message #4505] Sun, 13 August 2006 05:25 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
domingo wrote on Sat, 12 August 2006 19:16

In the file ForlanoVega.rar is missing a file TwoCtrl.h !!!

Must be like this...?:
#ifndef _ForlanoVega_TwoCtrl_h_
#define _ForlanoVega_TwoCtrl_h_

#include <CtrlLib/CtrlLib.h>

class Ctrl2 : public ParentCtrl {
	EditField edit;
	Button button;
public:
	typedef Ctrl2 CLASSNAME;
	Ctrl2();
	~Ctrl2() {;}
};
#endif


//
#include "VegaMain.h"

Ctrl2::Ctrl2()
{
	edit.SetRect(0,0,20,13);
	button.SetRect(15,0,30,13);
	Add(edit);
	Add(button);
}
Re: Filling TabCtrl from Layout [message #4525 is a reply to message #4505] Mon, 14 August 2006 12:35 Go to previous message
forlano is currently offline  forlano
Messages: 1194
Registered: March 2006
Location: Italy
Senior Contributor
domingo wrote on Sat, 12 August 2006 20:16

In the file ForlanoVega.rar is missing a file TwoCtrl.h !!!


Hi,

still in holidays and watching the forum evolution with a Mac OS with no possibility to check any source code.
I remind that the posted code compiled without problems. In fact there was no use of TwoCtrl widget in the application. Any way the missing files should be those given above by Aris. In the opposite case just comment any reference to TwoCtrl in the application.

Luigi

Previous Topic: scrolling without Frame and wrapping Ctrl?
Next Topic: Tips...
Goto Forum:
  


Current Time: Sat Jul 13 03:14:06 CEST 2024

Total time taken to generate the page: 0.02353 seconds