Help for MDI Frame
Posted: Tue Sep 01, 2020 12:53 am
Please help checking my code.
in FWH version 17.09 after calling the print procedure, windows dialog1 is borderless.
in version 20.07 the return to windows dialog1 leaves a frame.
thank you
Mulyadi
in FWH version 17.09 after calling the print procedure, windows dialog1 is borderless.
in version 20.07 the return to windows dialog1 leaves a frame.
Code: Select all
#include "FiveWin.ch"
static oWnd
static lWnd1, oWnd1
// ... static lWnd2, oWnd2
Function Main()
local oBar, oBar1, oBar2
lWnd1 := .F.
// lWnd2 := .F.
DEFINE WINDOW oWnd TITLE "test MDI" MDI
DEFINE BUTTONBAR oBar OF oWnd 3D SIZE 110, 30 2007
oBar:bClrGrad := { |lMouseOver| If( lMouseOver, CLR_BROWN, nARGB( 64, 0, 192, 0 ) ) }
oBar:SetColor( CLR_BLUE )
DEFINE BUTTON oBar1 OF oBar ACTION test1() PROMPT " Dialog 1 " left
DEFINE BUTTON oBar2 OF oBar ACTION test2() PROMPT " Dialog 2 " left
DEFINE BUTTON OF oBar ACTION oWnd:end() PROMPT "Exit" left GROUP
ACTIVATE WINDOW oWnd maximized VALID MsgYesNo( "Exit ?" )
return nil
//--------------------------------------------------
Function ChangeParent( oDlg, oChild )
local n
for n = 1 to Len( oDlg:aControls )
SetParent( oDlg:aControls[ n ]:hWnd, oChild:hWnd )
AAdd( oChild:aControls, oDlg:aControls[ n ] )
oDlg:aControls[ n ]:oWnd = oChild
next
return nil
//---------------------------------------------------
static function test1()
local oBrush
if ! lWnd1
DEFINE BRUSH oBrush GRADIENT { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }
DEFINE WINDOW oWnd1 from 0,0 to oWnd:nHeight, oWnd:nWidth pixel ;
MDICHILD OF WndMain() BRUSH oBrush nosysmenu ;
title "This frame exists after returning to the dialog1 test window"
lWnd1 := .T.
dialog1( oWnd1 )
ACTIVATE WINDOW oWnd1 MAXIMIZED ON INIT oWnd1:paint() ;
VALID ( oWnd1:Hide(), lWnd1 := .F., .t. )
RELEASE BRUSH oBrush
else
oWnd1:Maximize()
oWnd1:SetFocus()
endif
return nil
//------------------- Dialog1
// actual this function on other file
Function dialog1( oWnd )
local oDlg, oBrush, oFld
local btnprint
DEFINE BRUSH oBrush GRADIENT { { 1, 9815189, CLR_WHITE } }
DEFINE DIALOG oDlg of oWnd size oWnd:nRight-20, oWnd:nBottom-80 TRUEPIXEL brush oBrush
@ 2, 1 FOLDEREX oFld OF oDlg PIXEL ;
PROMPTS "Folder 11", "Folder 12", "Folder 13", "Folder 14", "Close" ;
on change ( if( nOption == 5, oWnd:end(), ) ) ;
TAB HEIGHT 24 ;
SIZE oDlg:nWidth, oDlg:nHeight TRANSPARENT
@ 10, 5 say "This folder 11" of oFld:aDialogs[1] size 100,14 pixel transparent
@ 10, 5 say "This folder 12" of oFld:aDialogs[2] size 100,14 pixel transparent
@ 10, 5 say "This folder 13" of oFld:aDialogs[3] size 100,14 pixel transparent
@ 10, 5 say "This folder 14" of oFld:aDialogs[4] size 100,14 pixel transparent
@ 10,100 btnbmp btnprint prompt "test print" of oFld:aDialogs[1] size 100,14 pixel center adjust 2007 ;
action test_print1()
ACTIVATE DIALOG oDlg NOWAIT CENTERED ;
ON INIT ( ChangeParent( oDlg, oWnd ) )
oDlg:end()
return nil
//------------------------------------------------------
//------------------------------------------------------
static function test2()
msginfo( "as of Dialog1")
return nil
//-------------------------------------------
//
static function test_print1
local oPrn
local oBrushRed, oBrushGrn
local oFont
DEFINE BRUSH oBrushRed COLOR CLR_RED
DEFINE BRUSH oBrushGrn COLOR CLR_HGREEN
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-20 OF oPrn
PAGE
oPrn:SayText( 300, 400, "Yellow, RedBrush", 2000, 200, oFont, nil, CLR_YELLOW, oBrushRed, "PIXEL" )
oPrn:SayText( 620, 400, "Default: nil,nil", 2000, 200, oFont, nil, nil, nil, "PIXEL" )
ENDPAGE
ENDPRINT
RELEASE FONT oFont
RELEASE BRUSH oBrushRed, oBrushGrn
return nil
Mulyadi