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 » TopWindow&PopUp, TrayIcon » Modal vs non-modal window
Re: Modal vs non-modal window [message #11964 is a reply to message #11961] Thu, 04 October 2007 20:08 Go to previous messageGo to previous message
NeonN is currently offline  NeonN
Messages: 8
Registered: September 2007
Location: Czech Republic
Promising Member
Ok, I think i got what i needed Smile... I thought out the mrjt's post again and used the THISBACK system of dealing with the OK/Cancel bottons instead of CtrlLayoutOKCancel().

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

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

class WindowTest : public WithLayout1<TopWindow> {
	private:
		WithLayout2<TopWindow> * wnd;
		void onButton1Click();
		void onExitWindow2();
		void DealWithWindow2();
	
	public:
		typedef WindowTest CLASSNAME;
		WindowTest();
};

void WindowTest::onButton1Click()
{
	wnd = new WithLayout2<TopWindow>;
	CtrlLayout(*wnd, "Title2");
	//wnd->Open();
	//wnd->Open(this);
	wnd->OpenMain();
	this->Disable();
	wnd->WhenClose = wnd->ok <<= THISBACK(DealWithWindow2);
}

void WindowTest::DealWithWindow2()
{
	this->Enable();
	delete wnd;
}

WindowTest::WindowTest()
{
	CtrlLayout(*this, "Title1");
	Button1 <<= THISBACK(onButton1Click);
}

GUI_APP_MAIN
{
	WindowTest().Run();
}


It's working but I don't know if it is ok... or if there is an easier/better option?
Next question is the pros and cons of having the new dialog window in a separate class (I am talking about window with about 10-20 edits or other components to fill + saving it all to DB).

I would be glad of any response Smile... and sorry for stupid questions Smile. I am porting one app from PHP and I am not used to use classes or any GUI objects...
 
Read Message icon5.gif
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: TopWindow Backup/Restore
Next Topic: Minor bug: TopWindow::GetStdSize()
Goto Forum:
  


Current Time: Mon Apr 28 21:59:00 CEST 2025

Total time taken to generate the page: 0.00495 seconds