Re: buttons...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Yes, it does; I ususally scan "inline" email programs for mangling, didn't
notice any, must have not looked close enough!

Dan
----- Original Message -----
From: <Patrick.Barnes at transgrid.com.au>
To: "EUforum" <EUforum at topica.com>
Subject: RE: buttons...


>
> Does this code work?
>
>
> It's in an attachment because I think the last one got mangled by the
email system.
>
> -----Original Message-----
> From: Dan Moyer [mailto:DANIELMOYER at prodigy.net]
> Sent: Thursday, 12 December 2002 14:59
> To: EUforum
> Subject: Re: buttons...
>
>
> Fails for me on click the down button & either select or cancel color
> selection,
>
> Test\buttons\butt1.exw:57 in procedure getColor()
> slice ends past end of sequence (13 > 11)
>
> Dan Moyer
>
> ----- Original Message -----
> From: <Patrick.Barnes at transgrid.com.au>
> To: "EUforum" <EUforum at topica.com>
> Sent: Wednesday, December 11, 2002 5:44 PM
> Subject: RE: buttons...
>
>
> > I managed this:
> > ------------------------------------------------------------------
> > include win32lib.ew
> >
> > constant win = create(Window, "Test", 0, Default, Default, 100, 100, 0),
> > color_button = create(PictureButton, "", win, 30, 10, 24, 24,0),
> > more_button = create(PictureButton, "", win, 53, 10, 8, 24,0)
> >
> >
> > function bgr( atom col)
> > return rgb( and_bits(col, #0000FF), and_bits(col, #00FF00) / 256,
> and_bits(col, #FF0000) / (256*256) )
> > end function
> >
> > sequence fontxpm fontxpm ={"24 24 4 1",
> > "2   c #C0C0C0",
> > "3   c #000080",
> > "4   c #808080",
> > "5   c #000000",
> > "222222222222222222222222",
> > "222222222222222222222222",
> > "222222222222222222222222",
> > "222222222222222222222222",
> > "222222222223222222222222",
> > "222222222243422222222222",
> > "222222222233322222222222",
> > "222222222433342222222222",
> > "222222222332332222222222",
> > "222222224322334222222222",
> > "222222223333333222222222",
> > "222222243222233422222222",
> > "222222233222243322222222",
> > "222222432222243342222222",
> > "222223333222333333222222",
> > "222222222222222222222222",
> > "222225555555555555555222",
> > "222225555555555555555222",
> > "222225555555555555555222",
> > "222225555555555555555222",
> > "222222222222222222222222",
> > "222222222222222222222222",
> > "222222222222222222222222",
> > "222222222222222222222222"}
> >
> > global constant downxpm ={"7 20 2 1",
> > "2   c #C0C0C0",
> > "3   c #000000",
> > "2222222","2222222","2222222",
> > "2222222","2222222","2222222",
> > "2222222","2222222","2222222",
> > "2333332","2233322","2223222",
> > "2222222","2222222","2222222",
> > "2222222","2222222","2222222",
> > "2222222","2222222"}
> >
> >
> > atom nowcolor nowcolor = #000000
> > procedure getColor(integer ID, integer Event, object params)
> > nowcolor = bgr( getColorDialog(win, nowcolor) )
> > fontxpm[5][8..13] = sprintf( "%06x", nowcolor)
> > setBitmap(color_button,createDIB(xpmToEuBmp(fontxpm)))
> > end procedure
> >
> > procedure setColor(integer ID, integer Event, object params)
> > setWindowBackColor(win, nowcolor)
> > end procedure
> >
> > setBitmap(color_button,createDIB(xpmToEuBmp(fontxpm)))
> > setBitmap(more_button,createDIB(xpmToEuBmp(downxpm)))
> > setHandler(more_button, w32HClick, routine_id("getColor"))
> > setHandler(color_button, w32HClick, routine_id("setColor"))
> >
> >
> > WinMain(win, Normal)
> > ------------------------------------------------------------------
<snip>

>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu