Brush on btnbmp with color

Brush on btnbmp with color

Postby Silvio.Falconi » Wed Feb 08, 2023 9:55 am

I made

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

Function test()
local oDlg,ofont
local oBrowse
local aData:= {}
local oBrush1,oBrush2
local obtn

    DEFINE BRUSH oBrush1  STYLE HORIZONTAL
    DEFINE BRUSH oBrush2  STYLE HORIZONTAL

   DEFINE FONT oFont NAME "TAHOMA" SIZE 00, -12
   DEFINE DIALOG oDlg SIZE 400,500 PIXEL FONT oFont TRUEPIXEL ;
           TITLE "test" TRANSPARENT  COLOR CLR_BLACK,CLR_WHITE



    @ 10,10 BTNBMP obtn  CENTER SIZE 96,96 PIXEL OF oDlg NOROUND 2007

    obtn:bClrGrad := { |lInvert| If( lInvert, oBrush2:hBrush, oBrush1:hBrush ) }
    obtn:disable()

ACTIVATE DIALOG oDlg CENTERED
   oFont:End()
RELEASE BRUSH oBrush1,oBrush2
RETURN NI
 


Image

and it run ok as you can see only it show black lines

How I can make to add a color ? for a sample red ?

I made
DEFINE BRUSH oBrush1 STYLE HORIZONTAL COLOR CLR_RED it run ok on easy dialog
but I need on Tfolderex class and it not run ok
I tried to change the color of border for a sample
:nClrBorder := { ||nRgb(218,214,179) } but not work
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Brush on btnbmp with color

Postby karinha » Wed Feb 08, 2023 3:05 pm

Intente ahora:

Code: Select all  Expand view

// \SAMPLES\SILFLDCR.PRG

#Include "FiveWin.ch"  //-> The Best...

FUNCTION Espera_Alvarez()

   LOCAL oDlg, oFld, oFont, aGrad, oBrush, oBrush1, oBrush2, oBtn
   LOCAL aBitmaps := { "..\bitmaps\alphabmp\facebook.bmp", ;
                       "..\bitmaps\alphabmp\windows.bmp" }

   SkinButtons()

   aGrad := { { 0.30, CLR_WHITE, CLR_HBLUE },{ 0.50, CLR_HBLUE, CLR_WHITE } }

   DEFINE BRUSH oBrush FILE "..\bitmaps\sea.bmp" RESIZE
   DEFINE BRUSH oBrush1 COLOR nRGB( 250, 213, 174 ) STYLE HORIZONTAL
   DEFINE BRUSH oBrush2 COLOR nRGB( 192, 192, 192 ) STYLE HORIZONTAL

   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -14 BOLD
                     
   DEFINE DIALOG oDlg TITLE "- TFolderex - Testing -" SIZE 350, 350          ;
      PIXEL TRUEPIXEL RESIZABLE BRUSH oBrush //GRADIENT aGrad

   oDlg:lHelpIcon := .F.
     
   @ 1, 0 FOLDEREX oFld PIXEL ADJUST OF oDlg ;
      PROMPT "Prenotazioni", "Pagamenti"     ;
      BITMAPS aBitmaps                       ;
      TAB HEIGHT 26 OPTION 1 ROUND 5 FONT oFont COLOR CLR_HGREEN TOP

   oFld:aEnable = { .T., .T., .F. }

   // NOROUND / NOBORDER
   @ 245, 10 BTNBMP oBtn CENTER SIZE 100, 100 PIXEL OF oDlg 2007 UPDATE ;
      FILE "..\bitmaps\alphabmp\ichat.bmp"                              ;
      PROMPT "Silvio" +CRLF+ "Wow" +CRLF+ "FiveWin" +CRLF+ "The best"   ;
      ACTION( SILVIO_MUESTRA() ) FONT oFont COLOR CLR_CYAN, CLR_BLACK

   oBtn:bClrGrad := {| lInvert | If( lInvert, oBrush2:hBrush, oBrush1:hBrush  ) }

   ACTIVATE DIALOG oDlg CENTERED

   oBrush:End()
   oBrush1:End()
   oBrush2:End()

   oFont:End()

RETURN NIL

FUNCTION SILVIO_MUESTRA()

   MsgInfo( "Silvio, muestre ahora el que no funciona bien", ;
            "Silvio, muestre ahora el que no funciona bien" )


RETURN NIL

// fin / end
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Brush on btnbmp with color

Postby karinha » Wed Feb 08, 2023 4:40 pm

Silvio, part II:

Code: Select all  Expand view

// \SAMPLES\SILFLDCR.PRG = Part II

#Include "FiveWin.ch"  //-> The Best...

FUNCTION Espera_Alvarez()

   LOCAL nCBorder   := 0xC38B2B //, nClrBorder := CLR_HRED //0xE6E6E6
   // Olive Color
   LOCAL nClrBorder := { { 0.2, RGB( 000, 128, 000 ), RGB( 000, 128, 000 ) }, ;
                         { 0.8, RGB( 109, 135, 100 ), RGB( 109, 135, 100 ) } }
   LOCAL oDlg, oFld, oFont, aGrad, oBrush, oBrush1, oBrush2, oBtn
   LOCAL aBitmaps := { "..\bitmaps\alphabmp\facebook.bmp", ;
                       "..\bitmaps\alphabmp\windows.bmp" }

   SkinButtons()

   aGrad := { { 0.30, CLR_WHITE, CLR_HBLUE },{ 0.50, CLR_HBLUE, CLR_WHITE } }

   DEFINE BRUSH oBrush FILE "..\bitmaps\sea.bmp" RESIZE
   DEFINE BRUSH oBrush1 COLOR nRGB( 250, 213, 174 ) STYLE HORIZONTAL
   DEFINE BRUSH oBrush2 COLOR nRGB( 192, 192, 192 ) STYLE HORIZONTAL

   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -14 BOLD
                     
   DEFINE DIALOG oDlg TITLE "- TFolderex - Testing -" SIZE 350, 350          ;
      PIXEL TRUEPIXEL RESIZABLE BRUSH oBrush //GRADIENT aGrad

   oDlg:lHelpIcon := .F.
     
   @ 1, 0 FOLDEREX oFld PIXEL ADJUST OF oDlg ;
      PROMPT "Prenotazioni", "Pagamenti"     ;
      BITMAPS aBitmaps                       ;
      TAB HEIGHT 26 OPTION 1 ROUND 5 FONT oFont COLOR CLR_HGREEN TOP

   oFld:aEnable = { .T., .T., .F. }

   // NOROUND / NOBORDER
   @ 245, 10 BTNBMP oBtn CENTER SIZE 100, 100 PIXEL OF oDlg 2007 UPDATE ;
      FILE "..\bitmaps\alphabmp\ichat.bmp" NOBORDER                     ;
      PROMPT "Silvio" +CRLF+ "Wow" +CRLF+ "FiveWin" +CRLF+ "The best"   ;
      ACTION( SILVIO_MUESTRA() ) FONT oFont COLOR CLR_CYAN, CLR_BLACK

   oBtn:bClrGrad := {| lInvert | If( lInvert, oBrush2:hBrush, oBrush1:hBrush  ) }

   WITH OBJECT oBtn
      :nClrBorder  := nClrBorder
      :bColorMap   := { | o | o:lBorder := o:lMOver, nCBorder }
      :lRound      := .F.
   END

   ACTIVATE DIALOG oDlg CENTERED

   oBrush:End()
   oBrush1:End()
   oBrush2:End()

   oFont:End()

RETURN NIL

FUNCTION SILVIO_MUESTRA()

   MsgInfo( "Silvio, muestre ahora el que no funciona bien", ;
            "Silvio, muestre ahora el que no funciona bien" )


RETURN NIL

// fin / end
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Brush on btnbmp with color

Postby Silvio.Falconi » Thu Feb 09, 2023 9:43 am

karinha wrote:Silvio, part II:

Code: Select all  Expand view

// \SAMPLES\SILFLDCR.PRG = Part II

#Include "FiveWin.ch"  //-> The Best...

FUNCTION Espera_Alvarez()

   LOCAL nCBorder   := 0xC38B2B //, nClrBorder := CLR_HRED //0xE6E6E6
   // Olive Color
   LOCAL nClrBorder := { { 0.2, RGB( 000, 128, 000 ), RGB( 000, 128, 000 ) }, ;
                         { 0.8, RGB( 109, 135, 100 ), RGB( 109, 135, 100 ) } }
   LOCAL oDlg, oFld, oFont, aGrad, oBrush, oBrush1, oBrush2, oBtn
   LOCAL aBitmaps := { "..\bitmaps\alphabmp\facebook.bmp", ;
                       "..\bitmaps\alphabmp\windows.bmp" }

   SkinButtons()

   aGrad := { { 0.30, CLR_WHITE, CLR_HBLUE },{ 0.50, CLR_HBLUE, CLR_WHITE } }

   DEFINE BRUSH oBrush FILE "..\bitmaps\sea.bmp" RESIZE
   DEFINE BRUSH oBrush1 COLOR nRGB( 250, 213, 174 ) STYLE HORIZONTAL
   DEFINE BRUSH oBrush2 COLOR nRGB( 192, 192, 192 ) STYLE HORIZONTAL

   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -14 BOLD
                     
   DEFINE DIALOG oDlg TITLE "- TFolderex - Testing -" SIZE 350, 350          ;
      PIXEL TRUEPIXEL RESIZABLE BRUSH oBrush //GRADIENT aGrad

   oDlg:lHelpIcon := .F.
     
   @ 1, 0 FOLDEREX oFld PIXEL ADJUST OF oDlg ;
      PROMPT "Prenotazioni", "Pagamenti"     ;
      BITMAPS aBitmaps                       ;
      TAB HEIGHT 26 OPTION 1 ROUND 5 FONT oFont COLOR CLR_HGREEN TOP

   oFld:aEnable = { .T., .T., .F. }

   // NOROUND / NOBORDER
   @ 245, 10 BTNBMP oBtn CENTER SIZE 100, 100 PIXEL OF oDlg 2007 UPDATE ;
      FILE "..\bitmaps\alphabmp\ichat.bmp" NOBORDER                     ;
      PROMPT "Silvio" +CRLF+ "Wow" +CRLF+ "FiveWin" +CRLF+ "The best"   ;
      ACTION( SILVIO_MUESTRA() ) FONT oFont COLOR CLR_CYAN, CLR_BLACK

   oBtn:bClrGrad := {| lInvert | If( lInvert, oBrush2:hBrush, oBrush1:hBrush  ) }

   WITH OBJECT oBtn
      :nClrBorder  := nClrBorder
      :bColorMap   := { | o | o:lBorder := o:lMOver, nCBorder }
      :lRound      := .F.
   END

   ACTIVATE DIALOG oDlg CENTERED

   oBrush:End()
   oBrush1:End()
   oBrush2:End()

   oFont:End()

RETURN NIL

FUNCTION SILVIO_MUESTRA()

   MsgInfo( "Silvio, muestre ahora el que no funciona bien", ;
            "Silvio, muestre ahora el que no funciona bien" )


RETURN NIL

// fin / end
 


Regards, saludos.



sorry the border not is colorized but allways black and nClrBorder want a codebock
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Brush on btnbmp with color

Postby karinha » Thu Feb 09, 2023 1:50 pm

I liked this model.

https://imgur.com/KufhpL0

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Brush on btnbmp with color

Postby karinha » Thu Feb 09, 2023 2:48 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Brush on btnbmp with color

Postby Silvio.Falconi » Fri Feb 10, 2023 10:34 am



I may have become colorblind because I'm old man , but here I see the border color allways black

Image

@ oBrw:nBottom+1, oBrw:nWidth-44.4 BTNBMP aBtnBrow[1] SIZE 20,20 PIXEL OF oDlg NOROUND 2007
aBtnBrow[1]:bClrGrad := { |lInvert| If( lInvert, aBru[ 2 ]:hBrush, aBru[ 1 ]:hBrush ) }
WITH OBJECT aBtnBrow[1]
:nClrBorder := nRgb(218,214,179)// border color
:bColorMap := { || { { nRgb( 245,244,234), nRgb(218,214,179) } } } // image color
END
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Brush on btnbmp with color

Postby karinha » Fri Feb 10, 2023 2:38 pm

Silvio.Falconi wrote:


I may have become colorblind because I'm old man , but here I see the border color allways black

Image

@ oBrw:nBottom+1, oBrw:nWidth-44.4 BTNBMP aBtnBrow[1] SIZE 20,20 PIXEL OF oDlg NOROUND 2007
aBtnBrow[1]:bClrGrad := { |lInvert| If( lInvert, aBru[ 2 ]:hBrush, aBru[ 1 ]:hBrush ) }
WITH OBJECT aBtnBrow[1]
:nClrBorder := nRgb(218,214,179)// border color
:bColorMap := { || { { nRgb( 245,244,234), nRgb(218,214,179) } } } // image color
END


jajajaja, habla con el señor Nages.

hahahaha, talk to Mister Nages.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Brush on btnbmp with color

Postby Silvio.Falconi » Fri Mar 03, 2023 11:13 am

karinha wrote:
Silvio.Falconi wrote:


I may have become colorblind because I'm old man , but here I see the border color allways black

Image

@ oBrw:nBottom+1, oBrw:nWidth-44.4 BTNBMP aBtnBrow[1] SIZE 20,20 PIXEL OF oDlg NOROUND 2007
aBtnBrow[1]:bClrGrad := { |lInvert| If( lInvert, aBru[ 2 ]:hBrush, aBru[ 1 ]:hBrush ) }
WITH OBJECT aBtnBrow[1]
:nClrBorder := nRgb(218,214,179)// border color
:bColorMap := { || { { nRgb( 245,244,234), nRgb(218,214,179) } } } // image color
END


jajajaja, habla con el señor Nages.

hahahaha, talk to Mister Nages.

Regards, saludos.



Image

Resolved!!!
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=36937&start=0&hilit=xbrowse+border
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests