I know there have been changes regarding bitmaps and buttonbars. I did a search but could not find topics on the changes. Here are my questions:
1) Is there a thread or two that discusses the newer capability of higher resolution, or alpha bitmap, button bars ?
2) What would be a good file in the samples folder of these capabilities
Thanks ... I'm using 9.05.
Bitmaps and Button bars
- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Bitmaps and Button bars
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Re: Bitmaps and Button bars
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.

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.

Code: Select all | Expand
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
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 76 times
- Contact:
Re: Bitmaps and Button bars
Tim,
Alpha channel bitmaps are automatically detected and used from FWH.
All you have to do is to create an alpha channel bitmap and use it as you use other bitmaps.
You can find some alpha channel bitmaps in c:\FWH\bitmaps\AlphaBmp\*.bmp
Alpha channel bitmaps are automatically detected and used from FWH.
All you have to do is to create an alpha channel bitmap and use it as you use other bitmaps.
You can find some alpha channel bitmaps in c:\FWH\bitmaps\AlphaBmp\*.bmp
Re: Bitmaps and Button bars
Working on the Tools, I noticed after changing the Gradient, Style 2007 gets lost ?
Normal Buttonbar with Style 2007 and no Gradient change :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 TOP
oBar1:SetColor( D_TCOLOR )

The same Buttonbar with Style 2007 and defined Gradient :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 TOP
oBar1:SetColor( D_TCOLOR )
oBar1:bClrGrad = { || { { D_MOVE, D_COLOR1, D_COLOR2 },;
{ D_MOVE, D_COLOR2, D_COLOR1 } } }

Style 2007 gets lost with the new Gradient-Define ?
RBest Regards
Uwe
Normal Buttonbar with Style 2007 and no Gradient change :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 TOP
oBar1:SetColor( D_TCOLOR )

The same Buttonbar with Style 2007 and defined Gradient :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 TOP
oBar1:SetColor( D_TCOLOR )
oBar1:bClrGrad = { || { { D_MOVE, D_COLOR1, D_COLOR2 },;
{ D_MOVE, D_COLOR2, D_COLOR1 } } }

Style 2007 gets lost with the new Gradient-Define ?
RBest Regards
Uwe

Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Bitmaps and Button bars
Thanks for the replies. I'm also reviewing the "whats new" notes ...
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Re: Bitmaps and Button bars
Tim,
Testing all possible Solutions I still found a wrong Position of the Buttonbar with :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 BOTTOM
The Bottom of the Buttonbar is covered with the Messagebar.
Bottom Buttonbar must be Top Messagebar.

Best Regards
Uwe
Testing all possible Solutions I still found a wrong Position of the Buttonbar with :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 BOTTOM
The Bottom of the Buttonbar is covered with the Messagebar.
Bottom Buttonbar must be Top Messagebar.

Best Regards
Uwe

Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.