Home » Community » Newbie corner » Multi Layout App
Re: Multi Layout App [message #37540 is a reply to message #37519] |
Mon, 15 October 2012 18:21   |
nejnadusho
Messages: 60 Registered: October 2012
|
Member |
|
|

OK I already have the following code. In fact I had it before the first post.
Now I thought that one that might help would want to see some effort.
I have tried all kinds of stuff out of the forums and tutorials cant make it work yet.
.h File
#ifndef _SProject_SProject_h
#define _SProject_SProject_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <SProject/SProject.lay>
#include <CtrlCore/lay.h>
class SProject : public WithSProjectLayout<TopWindow> {
public:
typedef SProject CLASSNAME;
SProject();
};
#endif
.cpp File
#include "SProject.h"
SProject::SProject()
{
CtrlLayout(*this, "Window title");
Sizeable().Zoomable();
}
GUI_APP_MAIN
{
SProject().Run();
}
.lay File
LAYOUT(SProjectLayout, 704, 524)
ITEM(Button, logInButton, SetLabel(t_("LogInButton\aLogIn")).SetFont(StdFontZ(18).Bold().Italic()).SetFrame(FieldFrame()).LeftPosZ(304, 104).TopPosZ(420, 32))
ITEM(EditField, LogInTxtBox, MaxChars(18).SetFont(StdFontZ(14)).SetFrame(FieldFrame()).WantFocus(false).LeftPosZ(268, 168).TopPosZ(292, 28))
ITEM(Label, usernameBox, SetLabel(t_("\"UsernameBoxLabel\aUsername ")).SetFont(StdFontZ(12).Italic()).LeftPosZ(268, 164).TopPosZ(296, 21))
ITEM(StaticText, dv___3, SetText(t_("Restaurant’s Easy One Solution")).SetFont(SansSerifZ(20).Bold()).LeftPosZ(192, 332).TopPosZ(104, 36))
ITEM(StaticText, dv___4, SetText(t_("Welcome")).SetAlign(ALIGN_CENTER).SetFont(SansSerifZ(20).Bold()).LeftPosZ(184, 332).TopPosZ(64, 19))
ITEM(StaticText, dv___5, SetText(t_("to")).SetAlign(ALIGN_CENTER).SetFont(SansSerifZ(20).Bold()).LeftPosZ(332, 40).TopPosZ(84, 19))
ITEM(EditField, dv___6, SetFrame(FieldFrame()).WantFocus(false).LeftPosZ(268, 168).TopPosZ(324, 27))
ITEM(Label, passwordBox, SetLabel(t_("Password")).SetFont(StdFontZ(12).Italic()).LeftPosZ(268, 125).TopPosZ(328, 21))
END_LAYOUT
LAYOUT(Page1, 400, 200)
ITEM(Button, Button1, SetLabel(t_("Back")).SetFont(StdFont().Bold()).SetFrame(FieldFrame()).LeftPosZ(160, 56).TopPosZ(96, 15))
END_LAYOUT
How can I do the trick to display the Page1 layout when I click the 'LogIn' Button and display back the SProjectLayout when I click the 'Back' button.
Again I have been looking at alot of posts and tutorials etc. there is no clear description or at least I cannot grasp it.
Please add the 2-3-4 lines of code for the .h and.cpp files that will make this scenario work.
Thank you a lot.
nejnio
|
|
|
Goto Forum:
Current Time: Sun Aug 24 13:23:53 CEST 2025
Total time taken to generate the page: 0.03619 seconds
|