Home » Community » Newbie corner » Hello, need a helping hand
Re: Hello, need a helping hand [message #26831 is a reply to message #26830] |
Tue, 01 June 2010 15:55 |
|
koldo
Messages: 3361 Registered: August 2008
|
Senior Veteran |
|
|
jerson wrote on Tue, 01 June 2010 15:11 | Hi folks
I'm an absolute newbie to C++ coding and UPP. I code in C and VB6. I stumbled upon UPP a few days back and find it really interesting; however, my lack of knowledge about C++ and UPP is only making it difficult to cross the initial barriers.
I have worked with the examples and am able to run almost all of them. There are some that I cannot understand that report errors(in the uppsrc directory). I work on a WinXP machine.
Right now, I am able to create the example code called shopping list I found on the www. This was a very nice example to learn UPP. However, the next step has frustrated me and I will like a helping hand if anyone can.
On the layout, I wish to place a slider control visually (if that is possible) and link it to a text label that will show the value of the slider. I am able to place the static text label & name it. But, how do I place the slider? I suspect it has to be done in code. Being a total newbie in UPP and a total zero in C++ means a double whammy and I'm stuck. I want to migrate away from VB6 and come to UPP.
I intend to add new controls and eventually graduate to creating a simple RS232 terminal for my own use while 'learning the ropes'
Can anyone guide me gently please ?
I will appreciate links too if this is something I missed here.
Thanks
|
Hello Jerson
Yes, you can enter the SliderCtrl in the Layout designer.
If you right click the mouse in the Layout designer and choose Progress/SliderCtrl you will get it.
To do it in a very simple way you can get the package Reference/Layout, and modify it adding an SliderCtrl.
For example, in Layout example after adding:
- a SliderCtrl named slider
- a Label named text;
, change the code with this:
void Slider() {
text = AsString(~slider);
}
GUI_APP_MAIN
{
WithDialogLayout<TopWindow> dlg;
CtrlLayoutOKCancel(dlg, "Enter a number");
dlg.number <<= 10;
dlg.slider <<= THISBACK(SliderFunc);
for(;;)
switch(dlg.Execute()) {
case IDOK:
PromptOK(AsString(~dlg.number));
break;
case IDCANCEL:
return;
}
}
I advise you to follow this:
1. Check the samples:
After that you like U++.
2. Read the documentation:
After that you understand
3. Check the samples you prefer again and read the code
After that you really understand
Best regards
IƱaki
|
|
|
|
|
Hello, need a helping hand
By: jerson on Tue, 01 June 2010 15:11
|
|
|
Re: Hello, need a helping hand
By: koldo on Tue, 01 June 2010 15:55
|
|
|
Re: Hello, need a helping hand
|
|
|
Re: Hello, need a helping hand
By: jerson on Tue, 01 June 2010 20:07
|
|
|
Re: Hello, need a helping hand
|
|
|
Re: Hello, need a helping hand
By: jerson on Wed, 02 June 2010 03:19
|
|
|
Re: Hello, need a helping hand
By: jerson on Mon, 07 June 2010 06:09
|
|
|
Re: Hello, need a helping hand
|
|
|
Re: Hello, need a helping hand
By: jerson on Mon, 07 June 2010 09:37
|
|
|
Re: Hello, need a helping hand
By: koldo on Mon, 07 June 2010 09:56
|
|
|
Re: Hello, need a helping hand
By: jerson on Mon, 07 June 2010 10:36
|
|
|
Re: Hello, need a helping hand
|
|
|
Re: Hello, need a helping hand
By: koldo on Mon, 07 June 2010 11:11
|
|
|
Re: Hello, need a helping hand
By: jerson on Mon, 07 June 2010 14:27
|
|
|
Re: Hello, need a helping hand
By: koldo on Mon, 07 June 2010 15:52
|
|
|
Re: Hello, need a helping hand
By: jerson on Thu, 15 July 2010 16:46
|
|
|
Re: Hello, need a helping hand
|
|
|
Re: Hello, need a helping hand
By: jerson on Mon, 02 August 2010 08:05
|
|
|
Re: Hello, need a helping hand
By: koldo on Mon, 02 August 2010 08:59
|
Goto Forum:
Current Time: Fri May 10 18:29:08 CEST 2024
Total time taken to generate the page: 0.02491 seconds
|