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 » Method to Open a New Layout Window
Method to Open a New Layout Window [message #1414] Fri, 03 March 2006 01:52 Go to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Hey everyone,

I am new at U++ in addition to being fairly new at C++. I have written some Win32 API applications using straight C before, but nothing fancy. I am trying to Open a layout window that was created by pressing a button. What method would I use to display the 'modify' layout after pressing the OK button on the 'ExampleLayout' layout?

Thanks in advance.



Justin


***header file*******
#ifndef _Example_Example_h
#define _Example_Example_h

#include <CtrlLib/CtrlLib.h>

#define LAYOUTFILE <Example/Example.lay>
#include <CtrlCore/lay.h>



class Example : public WithExampleLayout<TopWindow> {
public:
	Withmodify<ParentCtrl> modify;
	typedef Example CLASSNAME;
	Example();
	void Compute();
};

#endif








***cpp File**********
#include "Example.h"


void Example::Compute()
{
	
	/*
	I want this code to open another layout window
	*/
	
	
}


Example::Example()
{
	CtrlLayout(*this, "Window title");
	btnOK <<= THISBACK(Compute);
	
}

GUI_APP_MAIN
{
	Example().Run();
}













***Layout File*******

LAYOUT(ExampleLayout, 404, 276)
	ITEM(Button, btnOK, SetLabel(t_("&OK")).LeftPosZ(84, 180).TopPosZ(92, 104))
END_LAYOUT



LAYOUT(modify, 512, 316)
        ITEM(Button, btnNew, SetLabel(t_("&OK")).LeftPosZ(84, 180).TopPosZ(92, 104))
END_LAYOUT

Re: Method to Open a New Layout Window [message #1420 is a reply to message #1414] Fri, 03 March 2006 10:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Execute for modal dialog, Open for modeless.

Note however that you must call CtrlLayout for your dialog somewhere.

Mirek
Re: Method to Open a New Layout Window [message #1429 is a reply to message #1420] Fri, 03 March 2006 18:39 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
I receive this error message if I try to use Open or Execute with this:



C:\MyApps\NCase\main.cpp(7) : error C2039: 'Execute' : is not a member of 'Withmodify<T>'
with
[
T=ParentCtrl
]
Re: Method to Open a New Layout Window [message #1430 is a reply to message #1429] Fri, 03 March 2006 18:41 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Also note that I added 'CtrlLayout(modify);' to the example constructor.

Re: Method to Open a New Layout Window [message #1431 is a reply to message #1430] Fri, 03 March 2006 18:43 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Nevermind. I figured out that I was supposed to use <TopWindow> instead of <ParentCtrl>. Thanks for your help Luzr


Razz
Re: Method to Open a New Layout Window [message #1433 is a reply to message #1429] Fri, 03 March 2006 18:45 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Justin wrote on Fri, 03 March 2006 12:39

I receive this error message if I try to use Open or Execute with this:



C:\MyApps\NCase\main.cpp(7) : error C2039: 'Execute' : is not a member of 'Withmodify<T>'
with
[
T=ParentCtrl
]


Ah, sorry, I missed ParentCtrl. Use TopWindow instead of ParentCtrl here...


Mirek
Previous Topic: Okay there's a PdfDraw, but is it possible to draw a pdf?
Next Topic: DoubleClick or RightClick [SOLVED]
Goto Forum:
  


Current Time: Thu Mar 28 21:37:22 CET 2024

Total time taken to generate the page: 0.01795 seconds