Now run ok
the child window gets under the bar
how can i tell that the windows child must go before the bar?
try this release
#include "FiveWin.ch"
#define colore1 nRgb( 245,244,234) //sfondo dialog
#define colore2 nRgb(233,229,206)
function Main()
local oWnd, oLogo, oBarRight,oBar,oFont
local nClrText := CLR_BLACK
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, 14
DEFINE WINDOW oWnd MDI ;
COLOR CLR_BLACK, CLR_WHITE ;
TITLE "Test logo in Mdi with two buttonars"
@ 0, 0 Bitmap oLogo File "c:\work\fwh\bitmaps\fivetech.bmp" of oWnd:oWndClient PIXEL NOBORDER
DEFINE BUTTONBAR oBar OF oWnd _3D 2015 //SIZE 40, 40
DEFINE BUTTON FILENAME "chiudi.bmp" OF oBar NOBORDER GROUP ;
ACTION MostraBarra(oBarRight,oWnd)
DEFINE BUTTON OF oBar NOBORDER GROUP ;
ACTION Newchild(oWnd)
DEFINE BUTTONBAR oBarRight OF oWnd SIZE 230,32 2013 RIGHT
oBarRight:bClrGrad := { | lPressed | If( ! lPressed,;
{ { 0.5, colore2,colore2 } },;
{ { 0.5, colore1, colore1 } } ) }
oWnd:oWndClient:bPainted := { || SetLogo( oLogo,oWnd ), 1 }
oWnd:bResized := { || SetLogo( oLogo, oWnd ) }
Navigator(oBarRight,oWnd,oLogo)
oWnd:oRight:= oBarRight
ACTIVATE WINDOW oWnd
return nil
function SetLogo( oLogo, oWnd )
local nX, nY
nX := oWnd:oWndClient:nWidth() - oLogo:nWidth() - 10
nY := oWnd:oWndClient:nHeight() - oLogo:nHeight() - 10
oLogo:Move( nY, nX, oLogo:nWidth(), oLogo:nHeight(), .T. )
return nil
Function Navigator(oBarRight,oWnd,oLogo)
local oPanel1
DEFINE BUTTON FILENAME "apri.bmp" OF oBarRight NOBORDER GROUP ;
ACTION CloseBarra(oWnd,oBarRight)
Return nil
Function MostraBarra(oBarRight,oWnd)
oBarRight:nWidth:= 250
oBarRight:show()
UpdateWindow( oWnd:hWnd )
oWnd:CoorsUpdate()
oWnd:oRight:=oBarRight
oWnd:resize()
SysRefresh()
return nil
Function CloseBarra(oWnd,oBarRight)
oBarRight:Hide()
oBarRight:nWidth:=1
oWnd:oRight:=NIL
oWnd:resize()
SysRefresh()
Return nil
Function Newchild(oWnd)
local oWinNew
local nRow:= 0,nCol:= 0
local nHChild := 24
local nWChild := 80
local nPosL := 0
local nPosVSp := 360 //331
local nHSay := 19
local nWPanel := 32
if Len( oWnd:oWndClient:aWnd ) > 0
if ( nRow + nHChild ) > oWnd:nHeight
nRow := 0
if ( nCol + Int( nWChild / 2 ) ) > oWnd:nWidth
nCol := 0
else
nCol += Int( nWChild / 2 )
endif
else
nRow += Int( nHChild / 4 )
endif
endif
if oWinNew == nil
DEFINE WINDOW oWinNew MDICHILD ;
FROM nRow, nCol TO nHChild, nWChild ;
TITLE "test new child " ;
of oWnd
ACTIVATE WINDOW oWinNew
else
oWinNew:SetFocus()
endif
RETURN NIL
that is, I have to impose on the child window that if there is a bar it must not go beyond that column, if it is not there it can go to the end of the main window
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com