FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Colors of btnbmp
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Colors of btnbmp
Posted: Tue Jul 22, 2008 09: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

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Colors of btnbmp
Posted: Tue Jul 22, 2008 09:17 AM
#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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Colors of btnbmp
Posted: Tue Jul 22, 2008 09:45 AM

Thanks Enrico,

It's working very nice!!

Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion