PDA

View Full Version : UpDown_Lionheart Try :-)



Lionheart008
29-01-2009, 15:55
;) Theme: "UI", updown script...

hi dear thinbasic user and good morning...
coming back some minutes from work, corrected my script and has played last night with the new "updown" script (you can find it here: thinbasic/samplescripts/UI/updown/...

my little version takes a second updown control with planet names... you can move by clicking the up-down icon the weekly day and after that you can choose the planets...
it was just a little problem to adept the close button function for me, thank you eros :-)

by the way: do you know the 8th weekly day??? ;) you find it in the script :lol:

wish all here and the newbies a good day, with sunshine in your heart and full of positively mood in mind, that's really possible ... :)

ciao und servus, Lionheart

Petr Schreiber
29-01-2009, 20:27
Hi Frank,

interesting code.
I am little puzzled how you evaluate single value from two updowns, but maybe I am just too tired today :oops:

But I have little trick for you.
Instead of having:


SELECT CASE udPos
CASE 1 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "Monday"
CASE 2 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "Tuesday"
CASE 3 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "Wednesday"
CASE 4 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "Thursday"
CASE 5 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "Friday"
CASE 6 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "Saturday"
CASE 7 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "Sunday"
CASE 8 : CONTROL SET TEXT CBHNDL, %ID_TEXT, "ThinbasicDay"
END SELECT


... you can make code more elegant this way:




CONTROL SET TEXT CBHNDL, %ID_TEXT, CHOOSE$(udPos, "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "ThinbasicDay")




It is shorter, but still very easy to understand I think :)

ErosOlmi
29-01-2009, 23:36
I am little puzzled how you evaluate single value from two updowns, but maybe I am just too tired today :oops:


To detect which UpDown control (or in general any control) in %WM_NOTIFY message, you need to check idfrom field in pNmud.hdr UDt: pNmud.hdr.idfrom
Every %WM_NOTIFY message also set the control sending the message.

Ciao
Eros