Home » Community » Newbie corner » First time with upp
First time with upp [message #35023] |
Thu, 29 December 2011 19:27 |
idkfa46
Messages: 155 Registered: December 2011
|
Experienced Member |
|
|
hi guys,
this is my first time on upp, i was trying to build a little program to understand how upp works but i have some problems atm.
The simply program "prova2" just have to take take 2 numbers and return the sum but something is wrong...
this is my code:
main.cpp
#include "prova2.h"
prova2::prova2()
{
CtrlLayout(*this, "Window title");
}
int prova2::calcolo(int x, int y)
{
int somma;
somma = x+y;
return somma;
}
GUI_APP_MAIN
{
prova2().Run();
}
prova2.h
#ifndef _prova2_prova2_h
#define _prova2_prova2_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <prova2/prova2.lay>
#include <CtrlCore/lay.h>
class prova2 : public Withprova2Layout<TopWindow> {
int calcolo(int x, int y);
public:
typedef prova2 CLASSNAME;
prova2();
};
#endif
prova2.lay
LAYOUT(prova2Layout, 268, 140)
ITEM(EditInt, x, LeftPosZ(52, 64).TopPosZ(24, 19))
ITEM(EditInt, y, LeftPosZ(188, 64).TopPosZ(24, 19))
ITEM(Label, dv___2, SetLabel(t_("X =")).LeftPosZ(16, 33).TopPosZ(24, 21))
ITEM(Label, dv___3, SetLabel(t_("Y =")).LeftPosZ(152, 33).TopPosZ(24, 21))
ITEM(Label, somma, LeftPosZ(80, 172).TopPosZ(52, 24))
ITEM(Label, dv___5, SetLabel(t_("Somma =")).LeftPosZ(16, 56).TopPosZ(56, 21))
ITEM(Button, calcola, SetLabel(t_("CALCOLA")).SetFont(StdFontZ(19).Bold()).LeftPosZ(16, 236).TopPosZ(88, 32))
END_LAYOUT
where is my epic fail ?!
how is possible to obtain the sum without typing the button "CALCOLA" ?
Thanks for ur help and your time
regards,
Matteo
|
|
|
|
|
|
|
Goto Forum:
Current Time: Wed May 15 05:15:50 CEST 2024
Total time taken to generate the page: 0.02336 seconds
|