1. RE: CreateGrayscaleIcon and setSubFieldsEasy

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C23C12.EB63A850
 charset=iso-8859-2

Each button in a FlattToolBar has three images: Normal, Hot, and Disabled.
These need to be placed in its imagelist. When you use setEnable(FTB, False)
the thrid image is displayed.


> -----Original Message-----
> From: 10963508 at europeonline.com [mailto:10963508 at europeonline.com]
> Sent: Saturday, 3 August 2002 5:41
> To: EUforum
> Subject: CreateGrayscaleIcon and setSubFieldsEasy
> 
> 
> 
> Here are two very useful functions:
> First is to set statusbar parts easy.
> Second is to make grayscale icon from colored icon.
> I have one question: when I disable button on flattoolbar 
> with setEnable()
> it doesnt get disabled look, with that gray color. How do I do that?
> 
> 
> First setSubFieldsEasy:
> --------------------------------------------------------------
> ----------
> 
> --/*
> -- setSubFieldsEasy [Created on 26. July 2002, 18:25]
> -- The 'setSubFieldsEasy' procedure set win32lib
> -- statusbar fields widths.
> -- You give it strings which you expect to be in
> -- each statusbar part and it will caclulate and set
> -- parts widths for you.
> --
> -- PARAMETERS
> -- 'statusbar'
> --    Win32lib id of statusbar.
> -- 'texts'
> --    Sequence with strings, expected strings in statusbar parts.
> --*/
> global procedure setSubFieldsEasy (integer statusbar, sequence texts)
>     sequence arg_seq
>     integer prev_wid_sum, str_wid
>     arg_seq = repeat (0, length (texts + 1))
>     prev_wid_sum = 0
>     for i = 1 to length (texts) do
>         str_wid = getTextWidth (statusbar, texts [i] & ",,")
>         arg_seq [i] = prev_wid_sum + str_wid
>         prev_wid_sum += str_wid
>     end for
>     arg_seq [length (arg_seq)] = -1
>     setSubFields (statusbar, arg_seq)
> end procedure
> 
> 
> Now CreateGrayscaleIcon:
> --------------------------------------------------------------
> --------------
> -
> 
> 
> global constant xGetIconInfo = registerw32Function (user32, 
> "GetIconInfo",
> {C_LONG, C_POINTER}, C_INT)
> global constant xCreateIconIndirect = registerw32Function (user32,
> "CreateIconIndirect", {C_POINTER}, C_LONG)
> 
> --// ICONINFO struct
>     ICONINFO_fIcon    = allot (DWord),
>     ICONINFO_xHotspot = allot (DWord),
>     ICONINFO_yHotspot = allot (DWord),
>     ICONINFO_hbmMask  = allot (Long),
>     ICONINFO_hbmColor = allot (Long),
>     SIZEOF_ICONINFO   = allotted_size (),
> 
> --// Equal to C's function.
> global function GetRValue (atom rgbval)
>     return remainder (rgbval, 256)
> end function
> 
> --// Equal to C's function.
> global function GetGValue (atom rgbval)
>     --// return shift_right (rgbval, 8)
>     return floor (remainder (rgbval, 256 * 256) / 256)
> end function
> 
> --// Equal to C's function.
> global function GetBValue (atom rgbval)
>     return floor (rgbval / (256 * 256))
> end function
> 
> global function RGB( atom r, atom g, atom b )
> 
>     -- return RGB value of triad
>     return r + ( g * 256 ) + ( b * 256 * 256 )
> 
> end function
> 
> 
> --/*
> -- CreateGrayscaleIcon [Created on 31. July 2002, 15:59]
> -- The 'CreateGrayscaleIcon' function
> -- creates a grayscale icon starting
> -- from a given icon. The resulting icon will have
<snip>

> 
> 
> 
==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
==================================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.


==================================================================

------_=_NextPart_000_01C23C12.EB63A850
Content-Type: application/ms-tnef

new topic     » topic index » view message » categorize

2. RE: CreateGrayscaleIcon and setSubFieldsEasy

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C23C3F.22FDCDA0
 charset=iso-8859-2

My mistake. I thought your CreateGreyscaleIcon was doing that already.

> -----Original Message-----
> From: 10963508 at europeonline.com [mailto:10963508 at europeonline.com]
> Subject: Re: CreateGrayscaleIcon and setSubFieldsEasy
> 
> 
> 
> ----- Original Message -----
> From: "Derek Parnell" <Derek.Parnell at SYD.RABOBANK.COM>
> >
> > Each button in a FlattToolBar has three images: Normal, 
> Hot, and Disabled.
> > These need to be placed in its imagelist. When you use 
> setEnable(FTB,
> False)
> > the thrid image is displayed.
> 
> I know that but I was thinking how to create that disabled 
> look for disabled
> button. You can't do it by hand with some icon editor.
> 
> 
> 
> 

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
==================================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.


==================================================================

------_=_NextPart_000_01C23C3F.22FDCDA0
Content-Type: application/ms-tnef

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

Search



Quick Links

User menu

Not signed in.

Misc Menu