Colors of btnbmp

Colors of btnbmp

Postby Marc Vanzegbroeck » Tue Jul 22, 2008 9:03 am

Hi,

It's maybe a stange question but is it possible to give a color instead of a bitmap calling BTNBMP?
I'm using this buttons in a touchscreen application and the customer can change the color of the buttons.
What I did till now is creating a bitmap-drawing for each main color (YELLOW,RED, GREEN,...) with that color.
The customer can chose a color from a list and than I'm setting that bitmap to the button.
Now I have 9 colors to chose from, but if I want to have more colors I have to create a new bitmap for each color.
It would be easyer to just call the button with the color...

Thanks
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Colors of btnbmp

Postby Enrico Maria Giordano » Tue Jul 22, 2008 9:17 am

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBtn

    LOCAL cVar := SPACE( 20 )

    DEFINE DIALOG oDlg

    @ 1, 1 GET cVar

    @ 30, 10 BTNBMP oBtn PROMPT "Close";
             ACTION oDlg:End()

    oBtn:SetColor( CLR_RED, CLR_YELLOW )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Marc Vanzegbroeck » Tue Jul 22, 2008 9:45 am

Thanks Enrico,

It's working very nice!!

Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests