btnbmp style win10
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
btnbmp style win10
I have problem to show btnbmp with a bitmap at left and text to right to have the same look of the normal button on windows10
how I can resolve please .do you have a test sample thanks
how I can resolve please .do you have a test sample thanks
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
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
- Antonio Linares
- Site Admin
- Posts: 42513
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
thanks antonio,
I take this from another italian application not mine
![Image](https://s14.postimg.org/z8fy8adtd/testbtn.jpg)
the first button is colorized when the user move over the mouse , the second button is colorize as default
I made
and I have this result
![Image](https://s14.postimg.org/vmeq9jp5t/test.png)
the color when the mouse is over is right but the button are showed bad ( 3d ?)
I take this from another italian application not mine
![Image](https://s14.postimg.org/z8fy8adtd/testbtn.jpg)
the first button is colorized when the user move over the mouse , the second button is colorize as default
I made
Code: Select all | Expand
#include "Fivewin.ch"
Function test()
Local oDl
Local oBtn[3]
Local bGrad2015 := { | lInvert | If( ! lInvert,;
{ { 1, RGB( 244, 244, 245 ), RGB( 244, 244, 245 ) } },;
{ { 1, RGB( 145, 201, 247 ), RGB( 145, 201, 247 ) } } ) }
DEFINE DIALOG oDlg Size 300,400 COLOR CLR_BLACK,CLR_WHITE
@ 10,10 BTNBMP oBtn[1] ;
FILENAME "allegati.bmp" ;
SIZE 45,12 ;
ACTION NIL ;
OF oDlg ;
PROMPT "Allegati" ;
NOROUND LEFT ;
GRADIENT bGrad2015
@ 10,60 BTNBMP oBtn[2] ;
FILENAME "IMG.bmp" ;
SIZE 45,12 ;
ACTION NIL ;
OF oDlg ;
PROMPT "Immagine" ;
NOROUND LEFT ;
GRADIENT bGrad2015
Activate dialog oDlg
Return nil
and I have this result
![Image](https://s14.postimg.org/vmeq9jp5t/test.png)
the color when the mouse is over is right but the button are showed bad ( 3d ?)
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
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
- Antonio Linares
- Site Admin
- Posts: 42513
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
Antonio,
this go ok bat I wish when the mouse is not over a gray colorborder when the mouse is over I wish not border
it seem it not produce this command oBtn2:nClrBorder := (IIF(oBtn2:lMOver,,CLR_GRAY))
Code: Select all | Expand
#include "Fivewin.ch"
Function test()
Local oDl
Local oBtn[3]
Local cCursorBtn:= TCursor():New(,'HAND')
Local bGrad2015 := { | lInvert | If( ! lInvert,;
{ { 1, RGB( 244, 244, 245 ), RGB( 244, 244, 245 ) } },;
{ { 1, RGB( 145, 201, 247 ), RGB( 145, 201, 247 ) } } ) }
DEFINE DIALOG oDlg Size 300,400 COLOR CLR_BLACK,CLR_WHITE
@ 10,10 BTNBMP oBtn1 FILENAME "DLG_ALLEGO.bmp" DEFAULT;
PROMPT "Allegati..." FLAT SIZE 45,15 LEFT PIXEL OF oDlg ;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 NOBORDER
oBtn1:nClrBorder := (IIF(oBtn1:lMOver,,CLR_GRAY))
oBtn1:oCursor := cCursorBtn
@ 10,60 BTNBMP oBtn2 FILENAME "DLG_IMG.bmp" CANCEL;
PROMPT "Immagine..." FLAT SIZE 45,15 LEFT PIXEL OF oDlg ;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 NOBORDER
oBtn2:nClrBorder := (IIF(oBtn2:lMOver,,CLR_GRAY))
oBtn2:oCursor := cCursorBtn
Activate dialog oDlg
Return nil
this go ok bat I wish when the mouse is not over a gray colorborder when the mouse is over I wish not border
it seem it not produce this command oBtn2:nClrBorder := (IIF(oBtn2:lMOver,,CLR_GRAY))
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
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
- Antonio Linares
- Site Admin
- Posts: 42513
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
not run
Antonio I with the style of Button class on Win10 but with bmp
there is a bug
I wrote NOROUND and it make a border with round angles ...why ?
this is only button
![Image](https://s14.postimg.org/6vi5t400h/button.png)
this is btnbmp with no resource but with noround
@ 233, 118 BTNBMP oBtnOK ;
PROMPT "&Conferma" FLAT SIZE 45,15 LEFT PIXEL OF oDlg NOROUND;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 ;
ACTION ( oDlg:end( IDOK ) )
![Image](https://s14.postimg.org/wsbu5a0yp/button.png)
this is with resource allways NOROUND
@ 233, 118 BTNBMP oBtnOK RESOURCE "DLG_OK" ; //
PROMPT "&Conferma" FLAT SIZE 45,15 LEFT PIXEL OF oDlg NOROUND;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 ;
ACTION ( oDlg:end( IDOK ) )
![Image](https://s14.postimg.org/b5wtoms81/button.png)
If I erase FLat then I have a bad button ...
but if I set NOROUND why I have a round button ?
at the end I made
oBtnOK:nRound:= 0
oBtnCan:nRound:= 0
and I have this result
![Image](https://s14.postimg.org/43yw286k1/button.png)
but it is no good
Antonio I with the style of Button class on Win10 but with bmp
there is a bug
Code: Select all | Expand
@ 233, 118 BTNBMP oBtnOK RESOURCE "DLG_OK" ;
PROMPT "&Conferma" FLAT SIZE 45,15 LEFT PIXEL OF oDlg ;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 NOROUND;
ACTION ( oDlg:end( IDOK ) )
@ 233, 182 BTNBMP oBtnCan RESOURCE "DLG_NO" ;
PROMPT "&Annulla" FLAT SIZE 45,15 LEFT PIXEL OF oDlg ;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 NOROUND;
ACTION ( oDlg:end( IDCANCEL ) ) GDIPLUS
oBtnOK:lBorder :=(IIF(!oBtnOK:lMOver,.t.,.f.))
oBtnOK:nClrBorder := (IIF(oBtnOK:lMOver,CLR_GRAY,))
oBtnOK:oCursor := oCursorHand
oBtnCan:lBorder :=(IIF(!oBtnCan:lMOver,.t.,.f.))
oBtnCan:nClrBorder := (IIF( oBtnCan:lMOver,CLR_GRAY,))
oBtnCan:oCursor := oCursorHand
I wrote NOROUND and it make a border with round angles ...why ?
this is only button
![Image](https://s14.postimg.org/6vi5t400h/button.png)
this is btnbmp with no resource but with noround
@ 233, 118 BTNBMP oBtnOK ;
PROMPT "&Conferma" FLAT SIZE 45,15 LEFT PIXEL OF oDlg NOROUND;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 ;
ACTION ( oDlg:end( IDOK ) )
![Image](https://s14.postimg.org/wsbu5a0yp/button.png)
this is with resource allways NOROUND
@ 233, 118 BTNBMP oBtnOK RESOURCE "DLG_OK" ; //
PROMPT "&Conferma" FLAT SIZE 45,15 LEFT PIXEL OF oDlg NOROUND;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 ;
ACTION ( oDlg:end( IDOK ) )
![Image](https://s14.postimg.org/b5wtoms81/button.png)
If I erase FLat then I have a bad button ...
but if I set NOROUND why I have a round button ?
at the end I made
oBtnOK:nRound:= 0
oBtnCan:nRound:= 0
and I have this result
![Image](https://s14.postimg.org/43yw286k1/button.png)
but it is no good
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
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
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
Antonio
see the last picture
I wish have the border gray when the mouse is not over on the button as the windows10 buttons style
see the last picture
I wish have the border gray when the mouse is not over on the button as the windows10 buttons style
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
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
Re: btnbmp style win10
To be sure of using the same theme of the operating system, you can use my implementation of theme inside TBtnBmp.
For all BtnBmps inside the application:
or for a single BtnBmp:
For all BtnBmps inside the application:
Code: Select all | Expand
TBtnBmp():lDefaultTheme := .T.
or for a single BtnBmp:
Code: Select all | Expand
oButton:SetThemed(.T.)
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
sorry Antonino I removed it from my mind ![Smile :)](./images/smilies/icon_smile.gif)
But
![Image](https://s14.postimg.org/jiswvw0hd/image.png)
I not have the same effect on secon d button of first (custom)
the custom is good, how i can to insert bitmaps and use cutom button ?
![Smile :)](./images/smilies/icon_smile.gif)
But
Code: Select all | Expand
#include "fivewin.ch"
function main()
local oDlg, theme
local oBmp2015
Local bGrad2015 := { | lInvert | If( ! lInvert,;
{ { 1, RGB( 244, 244, 245 ), RGB( 244, 244, 245 ) } },;
{ { 1, RGB( 145, 201, 247 ), RGB( 145, 201, 247 ) } } ) }
DEFINE WINDOW oDlg FROM 0,0 TO 300,300 PIXEL TITLE "Test"
@ 10,10 SAY "custom" PIXEL
TThemed():New(30,10,oDlg,100,30)
@ 200,110 BTNBMP oBmp2015 ; //
PROMPT "&Conferma" FLAT SIZE 100,30 LEFT PIXEL OF oDlg NOROUND;
COLOR CLR_BLACK,CLR_WHITE GRADIENT bGrad2015 ;
ACTION NIL
oBmp2015:nRound:= 0
oBmp2015:SetThemed(.T.)
ACTIVATE WINDOW oDlg CENTERED
return nil
![Image](https://s14.postimg.org/jiswvw0hd/image.png)
I not have the same effect on secon d button of first (custom)
the custom is good, how i can to insert bitmaps and use cutom button ?
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
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
Re: btnbmp style win10
Hello,
I tried this code:
![Image](https://i.imgur.com/fNaG1RP.png)
I tried this code:
Code: Select all | Expand
#include "fivewin.ch"
function main()
local oWnd, oBtn
DEFINE WINDOW oWnd FROM 0,0 TO 300,300 PIXEL TITLE "Test"
@ 10,10 BTNBMP oBtn PROMPT "&Conferma" SIZE 100,30 LEFT PIXEL OF oWnd FILE "ok.png" action oWnd:End()
oBtn:SetThemed(.T.)
ACTIVATE WINDOW oWnd CENTERED
return nil
![Image](https://i.imgur.com/fNaG1RP.png)
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
Code: Select all | Expand
Function test()
Local nBottom := 33
Local nRight := 62
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
Local oDlg
DEFINE DIALOG oDlg ;
TITLE "test" ;
SIZE nWidth, nHeight PIXEL ;
STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION, 4 )
@ 233, 118 BTNBMP oBtnOK OF oDlg ;
SIZE 55, 14 PIXEL ;
LEFT ;
PROMPT "&Conferma" FILENAME "DLG_OK.bmp" ;
ACTION ( oDlg:end( IDOK ) )
@ 233, 182 BTNBMP oBtnCan OF oDlg ;
SIZE 55, 14 PIXEL ;
BORDER LEFT ROUND ;
PROMPT "&Annulla" FILENAME "DLG_no.bmp" ;
ACTION ( oDlg:end( IDCANCEL ) )
oBtnOK:SetThemed(.T.)
oBtnOK:nRound:= 0
ACTIVATE DIALOG oDlg
here not run ok
I not have the same effect of normal button or ttheme button on windows 10 pro
on win10 the button must be gray and when I move th emouse over it must colorized on clear blue and the border color must change
also I use FLAT command and gradient (bGrad2015 wrote on first message of this topic) I not have the effects of a win10 button
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
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
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
Probable bug for the color border at line 1590 of btnbmp class
it not change the color border if obtn:lMover:= .t.
I wish btnbmp as this
![Image](https://s14.postimg.org/6vi5t400h/button.png)
with images
the buuton with clear blue is showed when I put the mouse over
can it is possible ?
it not change the color border if obtn:lMover:= .t.
I wish btnbmp as this
![Image](https://s14.postimg.org/6vi5t400h/button.png)
with images
the buuton with clear blue is showed when I put the mouse over
can it is possible ?
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
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
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: btnbmp style win10
antonio,
can I have the modifies of nclrborder ?
can I have the modifies of nclrborder ?
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
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
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: btnbmp style win10
can I have the modifies of nclrborder ?
Till FWH1712, nClrBorder should be a constant. It can not be a codeblock.
From FWH1801, nClrBorder can be a codeblock.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India