Page 1 of 1

Brush on btnbmp with color

PostPosted: Wed Feb 08, 2023 9:55 am
by Silvio.Falconi
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

Re: Brush on btnbmp with color

PostPosted: Wed Feb 08, 2023 3:05 pm
by karinha
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.

Re: Brush on btnbmp with color

PostPosted: Wed Feb 08, 2023 4:40 pm
by karinha
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.

Re: Brush on btnbmp with color

PostPosted: Thu Feb 09, 2023 9:43 am
by Silvio.Falconi
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

Re: Brush on btnbmp with color

PostPosted: Thu Feb 09, 2023 1:50 pm
by karinha
I liked this model.

https://imgur.com/KufhpL0

Image

Regards, saludos.

Re: Brush on btnbmp with color

PostPosted: Thu Feb 09, 2023 2:48 pm
by karinha

Re: Brush on btnbmp with color

PostPosted: Fri Feb 10, 2023 10:34 am
by Silvio.Falconi


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

Re: Brush on btnbmp with color

PostPosted: Fri Feb 10, 2023 2:38 pm
by karinha
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.

Re: Brush on btnbmp with color

PostPosted: Fri Mar 03, 2023 11:13 am
by Silvio.Falconi
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