Page 1 of 1

btnbmp bug?? - RESOLVED -

PostPosted: Fri May 12, 2023 9:00 am
by Silvio.Falconi
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

Image


Code: Select all  Expand view

#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

Re: btnbmp bug??

PostPosted: Fri May 12, 2023 3:29 pm
by karinha
I liked. It gives a special effect. Although I prefer to use BUTTONBMP.

Code: Select all  Expand view

#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.

Re: btnbmp bug??

PostPosted: Sat May 13, 2023 2:01 am
by mauri.menabue
hi Silvio

that black mark because the button has fire, try the test with the changes you will see

Code: Select all  Expand view


#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

Re: btnbmp bug??

PostPosted: Sat May 13, 2023 9:34 am
by Silvio.Falconi
mauri.menabue wrote:hi Silvio

that black mark because the button has fire, try the test with the changes you will see

Code: Select all  Expand view


#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

Re: btnbmp bug?? - RESOLVED -

PostPosted: Sat May 13, 2023 4:22 pm
by karinha
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.

Re: btnbmp bug?? - RESOLVED -

PostPosted: Sun May 14, 2023 10:10 am
by Silvio.Falconi
Menabue solution

Re: btnbmp bug?? - RESOLVED -

PostPosted: Tue May 16, 2023 7:27 pm
by Armando
Hello Friends:

Why Silvio never share his solutions?

Regards

Re: btnbmp bug?? - RESOLVED -

PostPosted: Wed May 17, 2023 6:57 am
by Silvio.Falconi
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