I finished the Basics on the new ButtonTools and is it a first Overview of the Results.
What we can do :
1. Select any Backgrounds : Color, Gradient, Style-Brush, Image-Brush and Image in Relation to the Buttons.
2. Select a Button-Image and set 2 other Buttons in combination with Text TOP, BOTTOM, LEFT and RIGHT.
3. One Click-Preview shows Buttons from Source or Resource with and without Border and 2007-Style.
4. A Activate-Button for each Dialog-Preview. A Close-all-Button, to close all open Dialogs ( Previews ).
5. Define the Button-Size for the Preview
6. Write the Source for the Button-selections.
7. A Gradient-Designer and Button-Resizer in the Setup-Section.
8. Button-Sets can be stored to a Database and Reloaded.
9. Display of Alpha-Blended-BMP's on Dialog-Bottom ( free Selection of the Image in the Setup-Section ).
10. Transparent Text with defined Font, Color and Size ( is shown together with the Alpha-Blended BMP )
+ some more functions.
Because it is possible now, to do a Preview with all possible Combinations,
a Test shows, that Buttons are not displayed with Borders, using Resources.
With Style 2007 and from Source, the Borders are shown.
On a Dialog Preview, the upper 3 Buttons are shown without Border.
The second Line ( 3 Buttons ) must have Borders.
Missing Button-Border with Style-Brush and Resources
Problem transparent Buttons on Images ?. Style 2007 works.
The same with Gradient-Background :
-----------------------------------------------------------------------
DEFINE DIALOG oDlg3 RESOURCE "DIALOG1" of oWnd ;
TITLE "Buttons from Resource Transparent" TRANSPARENT
// ----- Transparent Button NOBORDER ---------
Not Transparent
REDEFINE BTNBMP oBtn1 ID 100 OF oDlg3 ;
NOBORDER ;
FILENAME cBUTTON1 ;
ACTION MsgAlert( "Button-Click", "Button 1" ) ;
PROMPT "But.1" ;
FONT oFont1 ;
RIGHT
oBtn1:lTransparent = .t.
oBtn1:cTooltip := "Button1"
Not Transparent on Images.
Colors, Gradient, Styles and Image-Brush is OK.
REDEFINE SAY oSay3 PROMPT "Alpha-Blended BMP" ID 230 OF oDlg3 FONT oFont2
oSay3:lTransparent = .t.
-----------------------------------------------------------
The Dialog-Resource :
- Code: Select all Expand view
//------------------- RESOURCE - TEST 1 -----------------------------------------
FUNCTION DLG_RES1( oWnd,oFont1, oFont2 )
local oBtn1, oBtn2, oBtn3, oBtn4, oBtn5, oBtn6, oBtn7, oSay3
IF lOPEN[3] = .T.
MsgAlert( "Test allready activated !", "Attention" )
RETURN( NIL )
ENDIF
lOPEN[3] := .T.
DEFINE DIALOG oDlg3 RESOURCE "DIALOG1" of oWnd ;
TITLE "Buttons from Resource Transparent" TRANSPARENT
// Color
// -------
IF nSTYLE = 1
D_COLOR( oDlg3 )
ENDIF
// Style-Brush
// ----------------
IF nSTYLE = 3
D_BRUSH( oDlg3 )
ENDIF
// ImageBrush
// ----------------
IF nSTYLE = 4
DB_IMAGE( oDlg3 )
ENDIF
// ----- Transparent Buttons with NOBORDER ---------
REDEFINE BTNBMP oBtn1 ID 100 OF oDlg3 ;
NOBORDER ;
FILENAME cBUTTON1 ;
ACTION MsgAlert( "Button-Click", "Button 1" ) ;
PROMPT "But.1" ;
FONT oFont1 ;
RIGHT
oBtn1:lTransparent = .t.
oBtn1:cTooltip := "Button1"
REDEFINE BTNBMP oBtn2 ID 110 OF oDlg3 ;
NOBORDER ;
FILENAME cBUTTON1 ;
ACTION MsgAlert( "Button-Click", "Button 2" ) ;
PROMPT "But.2" ;
FONT oFont1 ;
LEFT
oBtn2:lTransparent = .t.
oBtn2:cTooltip := "Button2"
REDEFINE BTNBMP oBtn3 ID 120 OF oDlg3 ;
NOBORDER ;
FILENAME cBUTTON1 ;
ACTION MsgAlert( "Button-Click", "Button 3" ) ;
PROMPT "But.3" ;
FONT oFont1 ;
TOP
oBtn3:lTransparent = .t.
oBtn3:cTooltip := "Button3"
// ----- Transparent Buttons with BORDER ( doesn't work !!!! ) ---------
REDEFINE BTNBMP oBtn4 ID 200 OF oDlg3 ;
FILENAME cBUTTON1 ;
ACTION MsgAlert( "Button-Click", "Button 4" ) ;
PROMPT "But.4" ;
FONT oFont1 ;
BOTTOM
oBtn4:lTransparent = .t.
oBtn4:cTooltip := "Button4"
REDEFINE BTNBMP oBtn5 ID 210 OF oDlg3 ;
FILENAME cBUTTON2 ;
ACTION MsgAlert( "Button-Click", "Button 5" ) ;
PROMPT " "
oBtn5:lTransparent = .t.
oBtn5:cTooltip := "Button5"
REDEFINE BTNBMP oBtn6 ID 220 OF oDlg3 ;
FILENAME cBUTTON3 ;
ACTION MsgAlert( "Button-Click", "Button 6" ) ;
PROMPT " "
oBtn6:lTransparent = .t.
oBtn6:cTooltip := "Button6"
// --------------
REDEFINE BTNBMP oBtn7 ID 300 OF oDlg3 2007 ;
FILENAME "./system/stop.bmp" ;
PROMPT "Close" ;
FONT oFont1 ;
ACTION ( lOPEN[3] := .F., oDlg3:End() )
oBtn7:lTransparent = .t.
oBtn7:cTooltip := "Close"
REDEFINE SAY oSay3 PROMPT "Alpha-Blended BMP" ID 230 OF oDlg3 FONT oFont2
oSay3:lTransparent = .t.
ACTIVATE DIALOG oDlg3 CENTERED NOWAIT ;
ON INIT ( oDlg3:Move( 100, 470, 430, 290, .f. ), DisableX(oDlg3, .T.), ;
oBtn1:SetSize( nButtonW, nButtonH, .T. ), ;
oBtn2:SetSize( nButtonW, nButtonH, .T. ), ;
oBtn3:SetSize( nButtonW, nButtonH, .T. ), ;
oBtn4:SetSize( nButtonW, nButtonH, .T. ), ;
oBtn5:SetSize( nButtonW, nButtonH, .T. ), ;
oBtn6:SetSize( nButtonW, nButtonH, .T. ) ) ;
ON PAINT ( D_ALPHA( hDC ), ;
IIF( nSTYLE = 2, D_GRADIENT( hDC, oDlg3 ), NIL ), ;
IIF( nSTYLE = 5, DL_IMAGE( oDlg3 ), NIL ) )
RETURN NIL
Regards
Uwe