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 » Application Wizard based?
Application Wizard based? [message #22389] Thu, 09 July 2009 20:27 Go to next message
kbyte is currently offline  kbyte
Messages: 87
Registered: July 2008
Member
Hi all,

My question is:
Is there any simple way to make a wizard type application with upp or do we have to make all the things from the ground up?

If not, which is the better option:
1-have lots of dialogs (close one open other)
2-one dialog with lots of pannels (one hide, other shown)

By wizard app i mean those apps that have the next, previous buttons.

Thanks a lot
Alex
Re: Application Wizard based? [message #22390 is a reply to message #22389] Thu, 09 July 2009 20:55 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
AFAIK no support for this.

But both solutions are equally viable. Since you'll probably have a template for your layout, it doesn't make any difference if you apply that template to a TopWindow or panel. I would recommend windows because you can have different sizes for different steps without writing resize code.
Re: Application Wizard based? [message #22393 is a reply to message #22390] Thu, 09 July 2009 21:56 Go to previous messageGo to next message
kbyte is currently offline  kbyte
Messages: 87
Registered: July 2008
Member
Thanks a lot


Alex
Re: Application Wizard based? [message #28316 is a reply to message #22389] Fri, 27 August 2010 09:18 Go to previous messageGo to next message
sevenjay is currently offline  sevenjay
Messages: 30
Registered: October 2008
Location: Taiwan
Member
I have the same request.
I have done it not very good, maybe it could be better.
Hope helpful.
WizardPage.h
#ifndef _WizardPage_WizardPage_h
#define _WizardPage_WizardPage_h

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

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

class WizardPage : public WithWizardPageLayout<TopWindow> {
	WithPage1Layout<ParentCtrl> Page1;
	WithPage2Layout<ParentCtrl> Page2;
	WithPage3Layout<ParentCtrl> Page3;
	Array<ParentCtrl*> pageList;
	int in_page;
	void ClickNext();
public:
	typedef WizardPage CLASSNAME;
	WizardPage();
};

#endif

main.cpp
#include "WizardPage.h"

WizardPage::WizardPage()
{
	CtrlLayout(*this, "Window title");
	CtrlLayout(Page1);
	pcPageBox.Add(Page1);
	pageList.Add(&Page1);
	CtrlLayout(Page2);
	pcPageBox.Add(Page2);
	pageList.Add(&Page2);
	CtrlLayout(Page3);
	pcPageBox.Add(Page3);
	pageList.Add(&Page3);
	Page1.Hide();
	Page2.Hide();
	Page3.Hide();
	in_page=1;
	pageList[in_page-1]->Show();
	
	
	btnNext<<=THISBACK(ClickNext);
}
void WizardPage::ClickNext()
{
	if(pageList.GetCount()>in_page)
	{
		pageList[in_page-1]->Hide();
		++in_page;
		pageList[in_page-1]->Show();
	}
}

GUI_APP_MAIN
{
	WizardPage().Run();
}

WizardPage.lay
LAYOUT(WizardPageLayout, 424, 228)
	ITEM(Button, btnNext, SetLabel(t_("Next")).LeftPosZ(316, 56).TopPosZ(200, 15))
	ITEM(ParentCtrl, pcPageBox, LeftPosZ(32, 356).TopPosZ(36, 148))
END_LAYOUT

LAYOUT(Page1Layout, 400, 200)
	ITEM(EditString, dv___0, LeftPosZ(132, 64).TopPosZ(40, 19))
	ITEM(StaticText, dv___1, SetText(t_("This is page 1")).LeftPosZ(8, 160).TopPosZ(0, 19))
END_LAYOUT

LAYOUT(Page2Layout, 400, 200)
	ITEM(Option, dv___0, SetLabel(t_("test")).LeftPosZ(32, 56).TopPosZ(48, 16))
	ITEM(StaticText, dv___1, SetText(t_("This is page 2")).LeftPosZ(16, 160).TopPosZ(8, 19))
END_LAYOUT

LAYOUT(Page3Layout, 400, 200)
	ITEM(StaticText, dv___0, SetText(t_("This is page 3")).LeftPosZ(16, 160).TopPosZ(44, 19))
	ITEM(LabelBox, dv___1, LeftPosZ(56, 76).TopPosZ(64, 60))
END_LAYOUT
Re: Application Wizard based? [message #28327 is a reply to message #22389] Fri, 27 August 2010 19:35 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi sevenjay & Alex,

I just recently developed a class for easy handling wizards, since I needed one too. It might be useful for you as well Wink

It is really simple, just one file actually, in my opinion it doesn't even deserve it's own package, but for now I put it here like that. It uses templated class which takes 2-10 parameters similar to WithStepOneLayout<ParentCtrl> and provides the basic handling of actions like next, previous, finish etc. The biggest advantage IMHO is, that the class is, unlike many things in U++, fully DOCUMENTED Very Happy

It uses similar concept as the code posted above, just taken it little further, using the templates and more general approach on some things. E.g. ability to skip some steps, modifying the dialog while running using WhenStep callback and few others.

If you have any trouble using it, just ask. Also let me now what you think of it and any ideas how to make it better.

Best regards,
Honza

[Updated on: Fri, 27 August 2010 19:38]

Report message to a moderator

Re: Application Wizard based? [message #28520 is a reply to message #28327] Sun, 05 September 2010 22:19 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Honza,

Where is the file?

Javier
Re: Application Wizard based? [message #28524 is a reply to message #28520] Sun, 05 September 2010 23:12 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

281264 wrote on Sun, 05 September 2010 22:19

Honza,

Where is the file?

Javier


Oups, looks like I forgot to upload it Embarassed Or some cyber daemon stole it Twisted Evil

Anyway, here it is Wink

Best regards,
Honza
  • Attachment: Wizard.zip
    (Size: 3.57KB, Downloaded 233 times)
Previous Topic: Wider scrollbars
Next Topic: Dockable toolbars
Goto Forum:
  


Current Time: Thu Mar 28 09:47:46 CET 2024

Total time taken to generate the page: 0.01762 seconds