Simulate btnbmp Window 10

Simulate btnbmp Window 10

Postby Silvio.Falconi » Mon Feb 18, 2019 6:09 pm

I wish have all control with the same style

I have problems with btmbmp : I wish recreate the windows 10 button style color adding an image at Left
To better understand what I'm trying to do I created a simple little program where at the bottom there are two buttons one created with btnbmp and one created with normal Button

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

Function test()
   Local oDlg
   Local oBtn[3],aGet[1]
   Local cCursorBtn:=  TCursor():New(,'HAND')
   Local nBottom   := 33
   Local nRight    := 62
   Local nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local nHeight := nBottom * DLG_CHARPIX_H

   Local cImage1:="save.png"
   Local cImage2:="print.png"
   Local cImage3:="no.png"

    DEFINE DIALOG oDlg SIZE 880,600;
      PIXEL TRUEPIXEL RESIZABLE



  @ oDlg:nBottom - 40,oDlg:nWidth-225 BTNBMP oBtnPrint;
    RESOURCE cImage2 FLAT LEFT  ;
    PROMPT "Stampa" SIZE 90,30 PIXEL OF oDlg;
    ACTION dummy()


  @ oDlg:nBottom - 40,oDlg:nWidth-120 Button oBtnClose;
                 PROMPT "Chiudi"    SIZE 90,30 PIXEL OF oDlg;
                  ACTION ( oDlg:end( IDOK ) )

     oDlg:bResized  := <||
             local oRect    := oDlg:GetCliRect()

         oBtnPrint:nLeft   := oRect:nRight - 220
         oBtnPrint:nTop    := oRect:nBottom - 50

         oBtnClose:nLeft      := oRect:nRight - 120
         oBtnClose:nTop       := oRect:nBottom - 50

         RETURN nil
         >

   Activate dialog oDlg ;
   on init (oBtnPrint:SetThemed( .t. ) )

   Return nil

   //-----------------------------------------------//
Function Dummy()
   RETURN NIL

   

//-------------------------------------------------------------/
 


obviously I also use the style WindowsXP.manifest in the rc file

The button created with the normal button when we do not go over it with the mouse is gray

Image


then when the mouse is over it becomes light blue and the border is dark blue.


Image


I wanted to do the same style but with the possibility of adding an image to the left.

I tried with Many gradient but I not arrive to the result I wish

How can I solve?


I found the color I need

No Over
nColorBorder_Initial:= nRGB( 173,173,173)
nColorback_Initial:= nRgb(225,225,225)

Over Mouse
nColorBorder_over:= nRGB(0,120,215)
nColorback_over:= nRgb(229,241,251)




I try also with :

local nClrBack := nRgb(225,225,225)
local nClrText := CLR_BLACK
local nCBorder := nRgb(229,241,251)
local nClrBorder := nRGB( 173,173,173)
Local nCBack := nRgb(229,241,251)

Local oBold

DEFINE FONT oBold NAME "Segoe UI" SIZE 0,-14 BOLD

@ oDlg:nBottom - 40,oDlg:nWidth-225 BTNBMP oBtnPrint PROMPT "Stampa" ;
RESOURCE cImage2 SIZE 90,30 PIXEL OF oDlg FLAT NOBORDER ;
COLOR nClrText, nClrBack

WITH OBJECT oBtnPrint
:bAction := dummy()
:nClrBorder := nClrBorder
:bColorMap := { | o | o:lBorder := o:lMOver, nCBorder }
:oFontBold := oBold
:lRound := .F.
END













SomeOne can help me please
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Simulate btnbmp Window 10

Postby nageswaragunupudi » Mon Feb 18, 2019 7:35 pm

BUTTONBMP and BUTTON are the same, except that you can place an image on BUTTONBMP.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Simulate btnbmp Window 10

Postby Silvio.Falconi » Mon Feb 18, 2019 8:28 pm

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
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Simulate btnbmp Window 10

Postby Silvio.Falconi » Tue Feb 19, 2019 9:23 am

the problem is

@ 99,120 BUTTONBMP oBtnSave;
PROMPT "&Salva" ;
SIZE 60,18 PIXEL ;
OF oDlgMod ;
RESOURCE ".\bitmaps\SAVE.png" ;
TEXTRIGHT FONT oBold ;
ACTION ( oDlgMod:end( IDOK ) )

I must addd many space on Prompt to move the text but

On Windows Seven it run ok and it is good to see

Image

on windows 10 I see it bad (style)
Last edited by Silvio.Falconi on Tue Feb 19, 2019 9:38 am, edited 1 time in total.
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Simulate btnbmp Window 10

Postby nageswaragunupudi » Tue Feb 19, 2019 9:26 am

This button is painted by Microsoft Windows.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Simulate btnbmp Window 10

Postby Silvio.Falconi » Tue Feb 19, 2019 11:16 am

it seem to have Vbasic and I hate it!!:)
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: 7075
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 42 guests