1. UpDown Control

include win32lib.ew

constant
Win = create(Window, "Window", 0, 100, 100, 800, 600, { WS_DLGFRAME, 
WS_SYSMENU }),
TheList = create(List, "", Win, 10, 457, 
31,25,{WS_CHILD,WS_VISIBLE,WS_BORDER}),
TheSelector = create(UpDown, "", Win, 45, 455, 10, 22,0)

addItem(TheList,"1")
addItem(TheList,"2")
addItem(TheList,"3")
addItem(TheList,"4")
addItem(TheList,"5")

setBuddy(TheSelector,TheList)
setScrollRange(TheList,1,5)

WinMain(Win,Normal)

---------------
Shows the List with the first item and the UpDown, but when I press an 
arrow on the UpDown, the List item is highlighted by a dashed box but 
doesn't change.
Obviously, I'm doing something wrong or at least, not completely right. 
 Can someone please set me straight?
This part may be self explanitory when I get the first part right, but 
is there a way to scroll to the beginning of the list when you've 
reached the end and vice-versa?

new topic     » topic index » view message » categorize

2. UpDown Control

Howdy folks,
It's been a while.
I'm working with the newest verion of Win32Lib.
I'm having trouble getting an UpDown control to work with a text box.
Here's the code, what am I doing wrong?
------------------------------
include win32lib.ew
without warning

constant win = createEx( Window, "Looky Here", 0, Default,Default, 300,200,
WS_NO_RESIZE,0 )

constant txt = createEx( EditText, "0", win, 10,10, 100,25,
w32or_all({ES_RIGHT,ES_NUMBER}),0 )
constant upd = createEx( UpDown, 	"", win, 115,10, 20,20,
w32or_all({UDS_AUTOBUDDY,UDS_ARROWKEYS,UDS_NOTHOUSANDS}),0 )
setScrollRange ( upd, 2, 1000 )
setScrollPos ( upd, 10 )

WinMain( win, Normal)
---------------------------


LewyT

new topic     » goto parent     » topic index » view message » categorize

3. Re: UpDown Control

> }}}
<eucode>
> ------------------------------
> include win32lib.ew
> without warning
> 
> constant win = createEx( Window, "Looky Here", 0, Default,Default, 300,200,
> WS_NO_RESIZE,0 )
> 
> constant txt = createEx( EditText, "0", win, 10,10, 100,25,
> w32or_all({ES_RIGHT,ES_NUMBER}),0 )
> constant upd = createEx( UpDown,        "", win, 115,10, 20,20,
> w32or_all({UDS_AUTOBUDDY,UDS_ARROWKEYS,UDS_NOTHOUSANDS}),0 )
> setScrollRange ( upd, 2, 1000 )
> setScrollPos ( upd, 10 )
> 
> WinMain( win, Normal)
> ---------------------------
> </eucode>
{{{


Try this after declaring both controls:

    setBuddy( upd, txt )

~Greg

new topic     » goto parent     » topic index » view message » categorize

4. Re: UpDown Control

Nevermind,
I figured it out: I was missing the UDS_SETBUDDYINT in the styles.
Here is the corrected code:

--===============================
include win32lib.ew
without warning

constant win = createEx( Window, "Looky Here", 0, Default,Default, 300,200,
WS_NO_RESIZE,0 )

constant txt = createEx( EditText, "0", win, 10,10, 100,25,
w32or_all({ES_RIGHT,ES_NUMBER}),0 )
constant upd = createEx( UpDown, 	"", win, 115,10, 20,20,
w32or_all({UDS_AUTOBUDDY,UDS_ARROWKEYS,UDS_NOTHOUSANDS,UDS_SETBUDDYINT}),0 )

setScrollRange ( upd, -13, 106 )
setScrollPos ( upd, 10 )

WinMain( win, Normal)
--==============================


LewyT

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu