Possible, to use ButtonBMP on MDI-Window ?

Possible, to use ButtonBMP on MDI-Window ?

Postby ukoenig » Tue Apr 28, 2009 11:36 am

Hello,

With the new FWH-9.04 I wanted to create a Buttonbar ( Right-Hand-Side )
inside a MDI-Window.
Doing this, the Buttons are disabled.
I changed as test the new sample : Testbtn3.prg from Dialog to MDI-Window.
It doesn't work. Is there a solution, to place ButtonBMP's inside a MDI-Window ?

After changing Dialog to MDI-Window
Image

For my new tools, I want to draw my own vertical Buttonbar
( maybe possible with transparent buttons, to get the gradient-background ? )
Image

The Button-Define :
Code: Select all  Expand view

@ 0, 960 BTNBMP oBtn50 OF oWnd  ;
SIZE 60 , 80  PROMPT " " + CRLF + "Project" ;
FONT oBTFont1 TOP RESOURCE "magic" ;
ACTION  ( Tools(oWnd,oBar,oBtn50,oBtn51,oBtn52),  lOPEN := .T., oBtn50:Disable() )  

// ??? Button still with grey background
// I need only the Image and Text
oBtn50:lTransparent := .T. // ??? Button still with grey background

oBtn50:cTooltip := "Background" + CRLF + "Edit"
oBtn50:lBorder := .F.
 


Regards
Uwe :roll:
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: Possible, to use ButtonBMP on MDI-Window ?

Postby ukoenig » Wed Apr 29, 2009 11:34 pm

Hello,

I got it working, with placing a Dialog on the Main-Window.
But there is a problem, to place the dialog on a exact defined position.
I wanted to calculate the Dialog-Position with GetSysMetrics of the Main-Window
but I had to adjust the values of the Dialog-size/position step by step to cover the needed area.
Even the gradientfill of the Dialog I had to adjust.
Is it possible anyhow, to calculate a exact position of a Dialog ?
The normal calculation to place the Dialog with width : 32 Pixel on top of the window would be :

nWidth := GetSysMetrics(0)
nHeight := GetSysMetrics(1)

oDlg:Move( 20, nWidth - 32, 32, nHeight - 40, .f. )

20 Pixel from Top
Dialog Left = nWidth - 32
Dialog Width = 32
Dialog Hight = nheight - 40 ( 20 Pixel for Title and 20 Pixel for Bottom )

It doesn't work. I had to change in :
oDlg:Move( 20, nWidth - 65, 70, nHeight - 75, .f. )
to cover the exact area.

Image

Code: Select all  Expand view

FUNCTION B_BAR(oWnd)
LOCAL nWidth := GetSysMetrics(0), nHeight := GetSysMetrics(1)

nStyle = nOR( WS_OVERLAPPED | WS_VISIBLE )

DEFINE DIALOG oDlg FROM 0, 0  TO 100, 100 OF oWnd STYLE nSTYLE PIXEL TRANSPARENT

@ 0, 0 BTNBMP oBtn50 OF oDlg ;
SIZE 32 , 40  PROMPT " " + CRLF + "Project" 2007 ;
FONT oBTFont1 TOP RESOURCE "magic" ;
ACTION  ( Tools(oWnd),  lOPEN := .T., oBtn50:Disable() )  
oBtn50:lTransparent = .T.
oBtn50:cTooltip := "Background" + CRLF + "Edit"
oBtn50:lBorder := .F.

@ 40, 0 BTNBMP oBtn51 OF oDlg ;
SIZE 32 , 40  PROMPT "Create" + CRLF + "EXE-File" 2007 ;
FONT oBTFont1 TOP RESOURCE "magic" ;
ACTION MAKE_EXE()  
oBtn51:lTransparent := .T.
oBtn51:cTooltip := "New EXE-File"
oBtn51:lBorder := .F.

@ 80, 0 BTNBMP oBtn52 OF oDlg ;
SIZE 32 , 40  PROMPT " " + CRLF + "Preview" 2007 ;
FONT oBTFont1 TOP RESOURCE "preview" ;
ACTION MsgInfo("Hello")
oBtn52:lTransparent := .T.
oBtn52:cTooltip := "Background" + CRLF + "Edit"
oBtn52:lBorder := .F.

@ 120, 0 BTNBMP oBtn53 OF oDlg ;
SIZE 32 , 40  PROMPT " " + CRLF + "Help"2007 ;
FONT oBTFont1 TOP RESOURCE "help" ;
ACTION  IIF( FILE( "BackgrdHelp.exe" ), Winexec("BackgrdHelp.exe"), ;
                      MsgAlert( "No HelpFile : BackgrdHelp.exe", "Error" ) )
oBtn53:lTransparent := .T.
oBtn53:cTooltip := "Help" + CRLF + "Edit"
oBtn53:lBorder := .F.

@ 160, 0 BTNBMP oBtn54 OF oDlg ;
SIZE 32 , 40  PROMPT " " + CRLF + "Quit" 2007 ;
FONT oBTFont1 TOP RESOURCE "quit" ;
ACTION oWnd:End()
oBtn54:lTransparent := .T.
oBtn54:cTooltip := "Quit"
oBtn54:lBorder := .F.

ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
ON INIT oDlg:Move( 20, nWidth - 65, 70, nHeight - 75, .f. ) ;
ON PAINT GradBar( hDC, oDlg )

RETURN( NIL )

// -----------------------------------------------

STATIC FUNCTION GradBar( hDC, oDlg )

local aGrad := { { 0.50, 16054371, 11892819 } }

GradientFill( hDC,  0, 0, oDlg:nHeight + 10, oDlg:nWidth, aGrad, .T. )

RETURN NIL
 


Regards
Uwe :roll:
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: No registered users and 101 guests