FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour btnbmp bug?? - RESOLVED -
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
btnbmp bug?? - RESOLVED -
Posted: Fri May 12, 2023 09:00 AM
at the beginning when i load the test i see in the dialog the btnbmp with a black border (which shouldn't be there)
then if I move the dialog to another position I see the border with the right color and this also when I press the btnbmpo to scroll the popup menu
I don't understand why that black edge is formed and I don't know how to remove it



Code (fw): Select all Collapse
#include "fivewin.ch"

// test btnbmp

Function test()
local oDlg,oBtn
local oFont,oBold
local oCursorBtn :=TCursor():New(,'HAND')

  local nWd  := GetSysMetrics(0) * .58
  local nHt  := (GetSysMetrics(1) / 2 ) -20

 oFont := TFont():New( "Tahoma", 0, 14,, )
       oBold := TFont():New( "Tahoma", 0, 14,,.t. )

DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
       FONT oFont   COLOR CLR_BLACK, RGB( 245,245,235)  ;
       STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                  WS_MINIMIZEBOX)

 @ 10,550 BTNBMP  oBtn ;
           NAME "COMBOBMP"       ;
           SIZE 100, 25 PIXEL    ;
           PROMPT "testobutton"      ;
           FONT oFont  FLAT  RIGHT ;
           COLOR  CLR_BLACK ,RGB( 245,245,235);
           ACTION ::ShowPopUp( { |oBtn,nRow,nCol| oBtnMenu(oBtn)     } )


           oBtn:bClrGrad = { | lInvert | If( ! lInvert,;
                    { { 0.25, RGB( 245,245,235), RGB(250,250,245) },;
                      { 0.75, RGB(250,250,245), RGB( 245,245,235) } },;
                    { { 0.25, RGB(250,250,245), RGB( 245,245,235) }, ;
                      { 0.75, RGB( 245,245,235), RGB(250,250,245) } } ) }
               oBtn:nClrBorder := IIF(oBtn:lMOver,RGB( 219, 230, 244),RGB( 219, 230, 244))
               oBtn:oCursor:=   oCursorBtn





               ACTIVATE DIALOG oDlg

RETURN NIL 
//--------------------------------------------//
Function oBtnMenu(oBtn)
 MENU oMenu POPUP
    MenuItem "XXXXXXXXXXXXXXXXX"
    MenuItem "XXXXXXXXXXXXXXXXX"
    MenuItem "XXXXXXXXXXXXXXXXX"
ENDMENU
return oMen
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: btnbmp bug??
Posted: Fri May 12, 2023 03:29 PM
I liked. It gives a special effect. Although I prefer to use BUTTONBMP.
Code (fw): Select all Collapse
#Include "fivewin.ch"

FUNCTION test()

   LOCAL oDlg, oBtn
   LOCAL oFont, oBold
   LOCAL oCursorBtn := TCursor():New(, 'HAND' )

   LOCAL nWd  := GetSysMetrics( 0 ) * .58
   LOCAL nHt  := ( GetSysMetrics( 1 ) / 2 ) - 20

   SkinButtons()

   oFont := TFont():New( "Tahoma", 0, 14,, )
   oBold := TFont():New( "Tahoma", 0, 14,, .T. )

   DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL FONT oFont               ;
      COLOR CLR_BLACK, RGB( 245, 245, 235 )                                  ;
      STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, WS_MINIMIZEBOX)

   //10  550
   @ 10, 450 BTNBMP oBtn NAME "COMBOBMP" SIZE 100, 25 PIXEL ;
      PROMPT "TestBtnBmp" FONT oFont RIGHT FLAT 2007        ;
      ACTION( ::ShowPopUp( {| oBtn, nRow, nCol | oBtnMenu( oBtn ) } ) )

   oBtn:bClrGrad = {| lInvert | If( ! lInvert, ;
      { { 0.25, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) }, ;
      { 0.75, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) } }, ;
      { { 0.25, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) }, ;
      { 0.75, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) } } ) }

   oBtn:nClrBorder := iif( oBtn:lMOver, RGB( 219, 230, 244 ), RGB( 219, 230, 244 ) )
   oBtn:oCursor :=   oCursorBtn

   ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

FUNCTION oBtnMenu( oBtn )  // ERROR

   LOCAL oMenu

   MENU oMenu POPUP 2007

      MenuItem "XXXXXXXXXXXXXXXXX"

      MenuItem "XXXXXXXXXXXXXXXXX"

      MenuItem "XXXXXXXXXXXXXXXXX"

   ENDMENU

Return( oMenu )

// FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
Re: btnbmp bug??
Posted: Sat May 13, 2023 02:01 AM
hi Silvio

that black mark because the button has fire, try the test with the changes you will see
Code (fw): Select all Collapse
#include "fivewin.ch"

// test btnbmp

Function test()
local oDlg,oBtn
local oFont,oBold
local pippo := "mmm"   // ***************************** 
local oGet             // *****************************
local oCursorBtn :=TCursor():New(,'HAND')

  local nWd  := GetSysMetrics(0) * .58
  local nHt  := (GetSysMetrics(1) / 2 ) -20

 oFont := TFont():New( "Tahoma", 0, 14,, )
       oBold := TFont():New( "Tahoma", 0, 14,,.t. )

DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
       FONT oFont   COLOR CLR_BLACK, RGB( 245,245,235)  ;
       STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                  WS_MINIMIZEBOX)

 @ 10,550 BTNBMP  oBtn ;
           NAME "COMBOBMP"       ;
           SIZE 100, 25 PIXEL    ;
           PROMPT "testobutton"      ;
           FONT oFont  FLAT  RIGHT ;
           COLOR  CLR_BLACK ,RGB( 245,245,235);
           ACTION ::ShowPopUp( { |oBtn,nRow,nCol| oBtnMenu(oBtn)     } ) 


           oBtn:bClrGrad = { | lInvert | If( ! lInvert,;
                    { { 0.25, RGB( 245,245,235), RGB(250,250,245) },;
                      { 0.75, RGB(250,250,245), RGB( 245,245,235) } },;
                    { { 0.25, RGB(250,250,245), RGB( 245,245,235) }, ;
                      { 0.75, RGB( 245,245,235), RGB(250,250,245) } } ) }
               oBtn:nClrBorder := IIF(oBtn:lMOver,RGB( 219, 230, 244),RGB( 219, 230, 244))
               oBtn:oCursor:=   oCursorBtn


     @ 5, 50 GET oget var pippo of odlg   // ******************************

        

               ACTIVATE DIALOG oDlg ON init oGet:setfocus()  // ***************************

RETURN NIL
//--------------------------------------------//
Function oBtnMenu(oBtn)
 MENU oMenu POPUP
    MenuItem "XXXXXXXXXXXXXXXXX"
    MenuItem "XXXXXXXXXXXXXXXXX"
    MenuItem "XXXXXXXXXXXXXXXXX"
ENDMENU
return oMenu
TIA
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: btnbmp bug??
Posted: Sat May 13, 2023 09:34 AM
mauri.menabue wrote:hi Silvio

that black mark because the button has fire, try the test with the changes you will see
Code (fw): Select all Collapse
#include "fivewin.ch"

// test btnbmp

Function test()
local oDlg,oBtn
local oFont,oBold
local pippo := "mmm"   // ***************************** 
local oGet             // *****************************
local oCursorBtn :=TCursor():New(,'HAND')

  local nWd  := GetSysMetrics(0) * .58
  local nHt  := (GetSysMetrics(1) / 2 ) -20

 oFont := TFont():New( "Tahoma", 0, 14,, )
       oBold := TFont():New( "Tahoma", 0, 14,,.t. )

DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
       FONT oFont   COLOR CLR_BLACK, RGB( 245,245,235)  ;
       STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                  WS_MINIMIZEBOX)

 @ 10,550 BTNBMP  oBtn ;
           NAME "COMBOBMP"       ;
           SIZE 100, 25 PIXEL    ;
           PROMPT "testobutton"      ;
           FONT oFont  FLAT  RIGHT ;
           COLOR  CLR_BLACK ,RGB( 245,245,235);
           ACTION ::ShowPopUp( { |oBtn,nRow,nCol| oBtnMenu(oBtn)     } ) 


           oBtn:bClrGrad = { | lInvert | If( ! lInvert,;
                    { { 0.25, RGB( 245,245,235), RGB(250,250,245) },;
                      { 0.75, RGB(250,250,245), RGB( 245,245,235) } },;
                    { { 0.25, RGB(250,250,245), RGB( 245,245,235) }, ;
                      { 0.75, RGB( 245,245,235), RGB(250,250,245) } } ) }
               oBtn:nClrBorder := IIF(oBtn:lMOver,RGB( 219, 230, 244),RGB( 219, 230, 244))
               oBtn:oCursor:=   oCursorBtn


     @ 5, 50 GET oget var pippo of odlg   // ******************************

        

               ACTIVATE DIALOG oDlg ON init oGet:setfocus()  // ***************************

RETURN NIL
//--------------------------------------------//
Function oBtnMenu(oBtn)
 MENU oMenu POPUP
    MenuItem "XXXXXXXXXXXXXXXXX"
    MenuItem "XXXXXXXXXXXXXXXXX"
    MenuItem "XXXXXXXXXXXXXXXXX"
ENDMENU
return oMenu
TIA
THANK YOU BUT I GOT THERE MYSELF
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: btnbmp bug?? - RESOLVED -
Posted: Sat May 13, 2023 04:22 PM

Good afternoon Silvio. Post how you solved it, other users may have the same problem as you. With the solution, it gets easier.

Buenas tardes Silvio. Publica cómo lo resolviste, otros usuarios pueden tener el mismo problema que tú. Con la solución, se vuelve más fácil.

Gracias, tranks.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: btnbmp bug?? - RESOLVED -
Posted: Sun May 14, 2023 10:10 AM

Menabue solution

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: btnbmp bug?? - RESOLVED -
Posted: Tue May 16, 2023 07:27 PM

Hello Friends:

Why Silvio never share his solutions?

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: btnbmp bug?? - RESOLVED -
Posted: Wed May 17, 2023 06:57 AM
Armando wrote:Hello Friends:

Why Silvio never share his solutions?

Regards

if you read everything you would understand that the solution is already published, I don't have to publish other solutions, as I have already written the solution has been found by MeNabue
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion