Hello Tim,
The example shows any Window-Background and a Buttonbar on Top.
Just define the Image ( Alpha-Blended BMP ) for the Buttonbar => FILE c_path + "\system\format.bmp"
I started with the Bar-Tools ( comes close to the Button-Tools ) there it is possible, to test
the Bar-Size and included BMP's, how they look together on a defined Window-Background.
Some nice Button-Sets will be included as well.
FUNCTION MAIN()
LOCAL oWnd, oBar, oImage, oBrush
LOCAL oBButt1,oBButt2,oBButt3,oBButt4,oBButt5
LOCAL oBButt6,oBButt7,oBButt8,oBButt9
c_path := CURDRIVE() + ":\" + GETCURDIR() + "\"
DEFINE CURSOR oCursorHand HAND
SetBalloon( .T. ) // Balloon shape required for tooltips
W_LOGO := "Background2.jpg"
W_BRUSH := "Gray.bmp"
W_COLOR1 := 14853684
W_COLOR2 := 16314573
W_MOVE := 0.50 // Gradient 2. Color-Position
W_DIRECT := .T. // Horizontal
nDESKTOP := 1
// Desktop 1 = Image
// Desktop 2 = Image-Brush
// Desktop 3 = Gradient
// Desktop 4 = Color
// Desktop 5 = Style
// Color
// -------
IF nDESKTOP = 4
DEFINE BRUSH oBrush COLOR W_COLOR1
ENDIF
// Style
// -------
IF nDESKTOP = 5
IF W_STYLE = "BRICKS"
DEFINE BRUSH oBrush STYLE "BRICKS"
ENDIF
IF W_STYLE = "BORLAND"
DEFINE BRUSH oBrush STYLE "BORLAND"
ENDIF
IF W_STYLE = "TILED"
DEFINE BRUSH oBrush STYLE "TILED"
ENDIF
ENDIF
// Brush
// -------
IF nDESKTOP = 2
DEFINE BRUSH oBrush FILE c_path + "\project\" + W_BRUSH
ENDIF
IF nDESKTOP = 1 .or. nDESKTOP = 3
DEFINE WINDOW oWnd TITLE "Test" ;
MDI MENU TMenu():New()
ENDIF
IF nDESKTOP = 2 .or. nDESKTOP = 4 .or. nDESKTOP = 5
DEFINE WINDOW oWnd TITLE "Test" ;
MDI MENU TMenu():New() BRUSH oBrush
ENDIF
DEFINE BUTTONBAR oBar OF oWnd SIZE 95, 70 2007 TOP
// Some Buttons ......
DEFINE BUTTON oBButt1 OF oBar FILE c_path + "\system\format.bmp" MESSAGE "Color-Background" ;
ACTION ( nSTYLE := 1, ;
PROMPT "Color-Select"
oBButt1:cToolTip := { " " + CRLF + ;
"Color-Background selected." + CRLF + ;
"Please aktivate all Previews" + CRLF + ;
"with Button < Show All >, or" + CRLF + ;
"select a single Dialog from the" + CRLF + ;
"right Buttonbar", "C o l o r - Background ", 1, 0, 128 }
DEFINE BUTTON oBButt2 OF oBar FILE c_path + "\system\format.bmp" MESSAGE "Gradient-Background" ;
ACTION ( nSTYLE := 2, ;
PROMPT "Gradient-Select"
oBButt2:cToolTip := { " " + CRLF + ;
"Gradient-Background selected." + CRLF + ;
"Please aktivate all Previews" + CRLF + ;
"with Button < Show All >, or" + CRLF + ;
"select a single Dialog from the" + CRLF + ;
"right Buttonbar", "G r a d i e n t - Background", 1, 0, 128 }
...
...
...
// Show Hand-Cursor on Caption
AEval( oBar:aControls, { | o | o:oCursor := oCursorHand } )
SET MESSAGE OF oWnd TO "Button-Test" ;
CENTERED CLOCK KEYBOARD 2007
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( IIF( nDESKTOP = 1, WI_LOGO( oWnd, hDC ), NIL ), ; // Image
IIF( nDESKTOP = 3, W_GRAD( oWnd, hDC ), NIL ) ) // Gradient
RETURN NIL
//--------- 1 ) W - LOGO ------------------------
STATIC FUNCTION WI_LOGO( oWnd, hDC )
LOCAL oImage1
LOCAL nWidth := oWnd:nWidth()
LOCAL nHeight := oWnd:nHeight()
DEFINE IMAGE oImage1 FILE c_path + "\project\" + W_LOGO
PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , nWIDTH, nHEIGHT, , .T. )
oWnd:ReleaseDC()
RETURN NIL
// --------- 3 ) GRADIENT -----------------------
STATIC FUNCTION W_GRAD( oWnd, hDC )
LOCAL nWidth := oWnd:nWidth()
LOCAL nHeight := oWnd:nHeight()
aGrad := { { W_MOVE, W_COLOR1, W_COLOR2 }, ;
{ W_MOVE, W_COLOR2, W_COLOR1 } }
IF W_DIRECT = .T.
GradientFill( hDC, 0, 0, nHeight, nWidth, aGrad, .T. )
ENDIF
IF W_DIRECT = .F.
GradientFill( hDC, 0, 0, nHeight, nWidth, aGrad, .F. )
ENDIF
oWnd:ReleaseDC()
RETURN NIL