Is it possible to create a ButtonBmp without border?
How would be the code?
I've been working on it and I didn´t find a way to do it.
Thanks in advance.
jose_murugosa wrote:Is it possible to create a ButtonBmp without border?
How would be the code?
I've been working on it and I didn´t find a way to do it.
Thanks in advance.
Antonio Linares wrote:Jose,
clause ... GET ... ACTION ... creates a TButtonBmp control as a child control of the GET. Class TButtonBmp is inherited from Class TButton, based on the standard Windows buttons.
Though some resoures editors, as MS VSX, shows an optional "flat" style for a button, when we test such style, the button still shows its border.
A possible solution would be to modify Class TGet and use a TBtnBmp instead of a TButtonBmp, but then you would not have themes support in the TBtnBmp button.
METHOD CreateButton() CLASS TGet
local oThis := Self
if ValType( ::bAction ) == "B" .and. Upper( ::ClassName() ) == "TGET"
//JSe modifica para que al indicar que no se desee borde en botón cambie a objeto btnbmp sin borde
IF ::lNoBorderBtn
IF Empty( ::cBmpName ) //no hay bmp
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL TRANSPARENT
::oBtn:SetText( "..." )
ELSE
/*
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL BITMAP ::cBmpName
*/
IF At( ".", ::cBmpName)<>0 //si es .bmp
@0, ::nwidth - ::nHeight BTNBMP ::oBtn OF Self;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
FILE ::cBmpName ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL NOBORDER TRANSPARENT
ELSE //si es un bmp
@0, ::nwidth - ::nHeight BTNBMP ::oBtn OF Self;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
RESOURCE ::cBmpName;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL NOBORDER TRANSPARENT
ENDIF
ENDIF
ELSE
if Empty( ::cBmpName )
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL
if Empty( ::oBtn:hBitmap )
::oBtn:SetText( "..." )
endif
else
@ 0, ::nWidth - ::nHeight BUTTONBMP ::oBtn OF Self ;
ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
SIZE ::nHeight - 4, ::nHeight - 4 PIXEL BITMAP ::cBmpName
endif
ENDIF
::oBtn:lCancel = .T. // so the GET VALID is not fired when the button is focused
ENDIF
return nil
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 87 guests