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++ TheIDE » U++ TheIDE: Layout (Forms) Designer » Multiple window project advice,examples? (Visual designer layouts and navigation between all.)
Multiple window project advice,examples? [message #44324] Sun, 22 February 2015 19:42 Go to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Has anyone seen a good or any example of a multiple window(layout) project, using the visual designer?

I have created multiple new windows/forms for a project, but I'm struggling to find any instructions or examples of code methods necessary to navigate between the multiple windows within a project. I have read all documentation suggested in other posts including the GUI tutorial.

any advice appreciated


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Tue, 24 February 2015 15:33]

Report message to a moderator

Re: Multiple Layout (forms) project examples? [message #44332 is a reply to message #44324] Mon, 23 February 2015 15:21 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
I did find a guide on adding additional 'windows' to U++ projects as titled by the author.
See Leonard's Ultimate++ Notebook: (not sure why all of the results found are circa 2005/2006).
http://leonardoce.interfree.it/leowiki.html

But, in Step 3, I'm not understanding specifically where the 'Constructor' is located.
The instructions state:

Quote:
Open the generated header file (usually named "{pkgname}.h") and put the generated class declaration under the class declaration already present. If you want you can change the name of the class... etc...

Cut and paste the constructor from the header file to the cpp file (usually named "main.cpp"}.


This is the 'Dialog class' code generated from my new layout.

class MainDlg : public WithMain<TopWindow> {
	typedef MainDlg CLASSNAME;

public:
	MainDlg();
};

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


This is my 'Dialog struct' code generated:

struct MainDlg : WithMain<TopWindow> {
	typedef MainDlg CLASSNAME;
	MainDlg();
};

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


Is the (constructor from the header file to the cpp file (usually named "main.cpp"}) already in the header file (of HomeBudget example).

If anyone understands this explanation please advise, the author was a bit vague for this beginner.

Any advice appreciated.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Mon, 23 February 2015 15:37]

Report message to a moderator

Re: Multiple Layout (forms) project examples? [message #44333 is a reply to message #44332] Mon, 23 February 2015 15:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Edward wrote on Mon, 23 February 2015 15:21
I did find a guide on adding additional 'windows' to U++ projects as titled by the author.
See Leonard's Ultimate++ Notebook: (not sure why all of the results found are circa 2005/2006).
http://leonardoce.interfree.it/leowiki.html

But, in Step 3, I'm not understanding specifically where the 'Constructor' is located.
The instructions state:

Quote:
Open the generated header file (usually named "{pkgname}.h") and put the generated class declaration under the class declaration already present. If you want you can change the name of the class... etc...

Cut and paste the constructor from the header file to the cpp file (usually named "main.cpp"}.


This is the 'Dialog class' code generated from my new layout.

class MainDlg : public WithMain<TopWindow> {
	typedef MainDlg CLASSNAME;

public:
	MainDlg();
};

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


This is my 'Dialog struct' code generated:

struct MainDlg : WithMain<TopWindow> {
	typedef MainDlg CLASSNAME;
	MainDlg();
};

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


Is the "constructor from the header file to the cpp file (usually named "main.cpp"} already in the header file (of HomeBudget example).

Its very surprising everyone knows so little about using Ultimate++ considering its age, ~10 years...

Any advice appreciated.


Not quite sure where the problem is - it all looks OK.

The only thing you need to be careful about is that 'struct' part can go to header (needs to if the dialog is about to be used from multiple files) and constructor part (MainDlg::MainDlg() { ... }) must reside in .cpp.

Re: Multiple Layout (forms) project examples? [message #44334 is a reply to message #44324] Mon, 23 February 2015 15:45 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Mirek

That is what I do not understand, what specifically to do in the constructor part of the instructions.

Since you are very familiar, is he saying to use the newly generated Struct, or copy an existing struct from my existing project?
An existing Struct from HomeBudget could not reference a new layout I added?

What I'm working on is trying to add an additional layout to example, HomeBudget, with a Close button on the new form.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...
Re: Multiple Layout (forms) project examples? [message #44335 is a reply to message #44324] Mon, 23 February 2015 18:38 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Edward

I was once in your shoes. Crossover from VB6 to U++ was an uphill task for me. I found the s7dataarchiver project by mubeta http://www.ultimatepp.org/forums/index.php?t=msg&th=5494 &start=0&
exactly what I needed to understand how to code in U++. the link to the authors website is down too. http://sai.selfip.com/s7da

I cannot find the link to the project on the forum now, but should have the zip file stashed away somewhere on my hard drive.

Regards
Jerson
Re: Multiple Layout (forms) project examples? [message #44336 is a reply to message #44324] Mon, 23 February 2015 19:20 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Thanks Jerson, I hope you find the file.

I'm glad you understand my quandary. If there had been an Example of this I would not be troubling everyone.
But I must say they do have an extensive list of examples, far more than MS VS. But no Serial Communication example. Sad
Serial comm is next on my list.

http://www.buy-fla.com/Layouts.PNG


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Mon, 23 February 2015 19:49]

Report message to a moderator

Re: Multiple Layout (forms) project examples? [message #44337 is a reply to message #44324] Mon, 23 February 2015 23:25 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Should each layout (eg. form1.lay) have it's own corresponding header file (eg, form1.h)?

I ask this because this instruction does not explain clearly in Step 3.
Please see the 'AnotherWindow' section here: http://leonardoce.interfree.it/leowiki.html

I believe when this question is answered my problem will be solved.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Tue, 24 February 2015 00:31]

Report message to a moderator

Re: Multiple Layout (forms) project examples? [message #44338 is a reply to message #44337] Tue, 24 February 2015 08:47 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1096
Registered: August 2007
Senior Contributor
Quote:
Re: Multiple Layout (forms) project examples? Tue, 24 February 2015 00:25
Edward
Should each layout (eg. form1.lay) have it's own corresponding header file (eg, form1.h)?

I ask this because this instruction does not explain clearly in Step 3.
Please see the 'AnotherWindow' section here: http://leonardoce.interfree.it/leowiki.html

I believe when this question is answered my problem will be solved.


Hello Edward,
Usually you won't need more than one layout file (eg., form.lay file), since a single layout file can contain more than one layouts. On the other hand, you may want to seperate layout files semantically if your project is huge and have many components, but this is up to you.

Adding more than one layout to a single layout file is easy and all you have to do is to derive your window/dialog/custom ctrl from the layout template you create with the layout editor. You have to examine the provided examples. Nevertheless, there is a very simple FTP Browser example I wrote within the FTP package in bazaar section of this forum, (Here: http://www.ultimatepp.org/forums/index.php?t=msg&th=8899 &start=0&)
If I understand your problem correctly, maybe this example can give you a clue, since it has a single layout file, a single header file and more than one layouts, dynamically added.


Regards,
Oblivion


[Updated on: Tue, 24 February 2015 08:52]

Report message to a moderator

Re: Multiple Layout (forms) project examples? [message #44339 is a reply to message #44337] Tue, 24 February 2015 09:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Edward wrote on Mon, 23 February 2015 23:25
Should each layout (eg. form1.lay) have it's own corresponding header file (eg, form1.h)?


Well, that is completely your decision. You can have 3 headers, you can put all struct definitions into single header, or you can even even avoid header and put struct (or class) into .cpp.

Does not really matter. It is all same as any other struct/class in C++, same rules apply here.

There is nothing magic about layouts. Layout, as defined in designer (and included somewhere) practically does nothing else than define a templates that contains all widgets as member variables and a method that places them on parent widget (that is the task of CtrlLayout method). You use this template to declare your own struct/class that then contains all widgets.

I guess you are confused because the whole system is much simpler than you think...
Re: Multiple Layout (forms) project examples? [message #44340 is a reply to message #44336] Tue, 24 February 2015 09:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Edward wrote on Mon, 23 February 2015 19:20
Thanks Jerson, I hope you find the file.

I'm glad you understand my quandary. If there had been an Example of this I would not be troubling everyone.
But I must say they do have an extensive list of examples, far more than MS VS. But no Serial Communication example. Sad
Serial comm is next on my list.

http://www.buy-fla.com/Layouts.PNG


Well, I would gladly provide equivalent example for you, but from your graph it is not clear what is relation of "sublayouts" to the main layout. Are these dialogs invoked from the main window? Or somewhat integrated into main layout (e.g. as tabs)?
Re: Multiple Layout (forms) project examples? [message #44343 is a reply to message #44340] Tue, 24 February 2015 11:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
I have created a new example with multiple layouts. I have tried to be as diverse as possible, defining some structs in header, others in .cpp, using two layout files etc...

I am attaching it here, but it will be part of reference examples too...

Mirek
  • Attachment: Layouts.zip
    (Size: 2.46KB, Downloaded 274 times)
Re: Multiple window project advice,examples? [message #44345 is a reply to message #44324] Tue, 24 February 2015 15:31 Go to previous message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Thank You Mirek!!

I will review your example this morning.

My project (health system monitor)will have a main window open continuously during operation -- with a real-time display. The other windows are: 1. Startup splash screen with trademark logo. 2. Print reports -- the report window will contain a calendar date selector, report type selector, numerous criteria selectors. 3. Password-protected management window with a busy 4-5 tabbed control: input point properties, recipients, email settings, paging settings, serial communication settings, and more. 4. A software license validation window -- used on first time run.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...
Previous Topic: Layout Designer, Code Generator : some switch options are hidden
Next Topic: Layout Designer causes compile errors
Goto Forum:
  


Current Time: Sun Jun 23 17:35:04 CEST 2024

Total time taken to generate the page: 0.02715 seconds