btnbmp bug?? - RESOLVED -

Post Reply
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

btnbmp bug?? - RESOLVED -

Post 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

#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
Last edited by Silvio.Falconi on Sat May 13, 2023 9:33 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
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: btnbmp bug??

Post by karinha »

I liked. It gives a special effect. Although I prefer to use BUTTONBMP.

Code: Select all | Expand

#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
User avatar
mauri.menabue
Posts: 163
Joined: Thu Apr 17, 2008 2:38 pm

Re: btnbmp bug??

Post 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


#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
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: btnbmp bug??

Post 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


#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 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
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: btnbmp bug?? - RESOLVED -

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: btnbmp bug?? - RESOLVED -

Post by Silvio.Falconi »

Menabue solution
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
Armando
Posts: 3271
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: btnbmp bug?? - RESOLVED -

Post by Armando »

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
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: btnbmp bug?? - RESOLVED -

Post 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
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
Post Reply