Bitmaps and Button bars

Bitmaps and Button bars

Postby TimStone » Tue Jun 30, 2009 1:26 am

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.
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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Bitmaps and Button bars

Postby ukoenig » Tue Jun 30, 2009 7:14 am

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.

Image

Code: Select all  Expand view

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bitmaps and Button bars

Postby Antonio Linares » Tue Jun 30, 2009 10:42 am

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bitmaps and Button bars

Postby ukoenig » Tue Jun 30, 2009 2:13 pm

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 )

Image

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 } } }

Image

Style 2007 gets lost with the new Gradient-Define ?

RBest Regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bitmaps and Button bars

Postby TimStone » Tue Jun 30, 2009 3:18 pm

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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Bitmaps and Button bars

Postby ukoenig » Tue Jun 30, 2009 5:22 pm

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.

Image

Best Regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: karinha and 43 guests