Moderador: Moderadores
#include "hwgui.ch"
FUNCTION Main
LOCAL oMainW, nGT
nGT := hb_gtSelect()
hb_ThreadStart( { || test() } )
INIT WINDOW oMainW ;
TITLE "Dummy Main Window" AT 0,0 SIZE 0 , 0
hwg_Msginfo(Transform( nGT,"" ) )
oMainW:Close()
RETURN NIL
function Test()
LOCAL nGT
nGT := hb_gtSelect()
hb_gtReload( "WVG" )
CLS
? nGT
Alert( "WVG" )
return ""
JoséQuintas escreveu:Isso manteve as duas Main() de cada uma aberta.
#include "hwgui.ch"
Function Test
Local oMain
/* MENUPOS clause sets the submenu, where items with child windows names
will appear. It is set by position, starting with 0. */
INIT WINDOW oMain MDI TITLE "MDI window" AT 100, 100 SIZE 400, 300 ;
MENUPOS 1
MENU OF oMain
MENU TITLE "&File"
MENUITEM "&Create Child" ACTION CreateChildWindow()
SEPARATOR
MENUITEM "&Exit" ACTION oMain:Close()
ENDMENU
MENU TITLE "&Windows"
// Rearrange child windows
MENUITEM "&Tile" ACTION hwg_Sendmessage(HWindow():GetMain():handle,WM_MDITILE,MDITILE_HORIZONTAL,0)
ENDMENU
MENU TITLE "&Help"
MENUITEM "&About" ACTION hwg_Msginfo( HwG_Version(), "About" )
ENDMENU
ENDMENU
ACTIVATE WINDOW oMain
Return Nil
Function CreateChildWindow
Local oChildWnd
INIT WINDOW oChildWnd MDICHILD TITLE "Child "+Time()
// Here may be any controls...
oChildWnd:Activate()
Return Nil
***************************************
FUNCTION FECHA_JANELAS(oWnd,lFECHATUDO)
***************************************
LOCAL oDLGS := HDIALOG():ADIALOGS
LOCAL oDLGSMODAL := HDIALOG():aModalDialogs
LOCAL oDLGSMDI := HWindow():aWindows
LOCAL nHANDLE := oWnd:handle
LOCAL lRET :=.T.
LOCAL nI, nI2
IF lFECHATUDO=NIL
lFECHATUDO:=.F.
ENDIF
IF LEN(oDLGS)>0
FOR nI= 1 TO LEN(oDLGS)
IF lFECHATUDO
oDLGS[nI]:close()
ELSE
lRET:=.F.
ENDIF
NEXT
ENDIF
IF LEN(oDLGSMODAL)>0
FOR nI= 1 TO LEN(oDLGSMODAL)
IF lFECHATUDO
oDLGSMODAL[nI]:close()
ELSE
lRET:=.F.
ENDIF
NEXT
ENDIF
FOR nI2= 1 TO LEN(oDLGSMDI)
IF nI2 > 3
IF nHANDLE != oDLGSMDI[nI2]:handle
lRET:=.F.
//ShowMsg(valtoprg(oDLGSMDI[i]:handle))
//oDLGSMDI[i2]:close()
ENDIF
ENDIF
NEXT
RETURN(lRET)
Itamar M. Lins Jr. escreveu:Até hoje faço confusão com isso. Pq uma DIALOG aberto não deixa o usuário minimizar a MAIN, são detalhes que só usando para ver, mesmo com explicações, só com uso para ver como é o comportamento.
Itamar M. Lins Jr. escreveu: Pq uma DIALOG aberto não deixa o usuário minimizar a MAIN,
JoséQuintas escreveu:Pera aÃ....
Deixei passar...
Se não pode minimizar, então também não pode abrir com Main oculta.
ThisformMain:Move( 0, 0, 0, 0 )
With Object ThisformMain
:Move( 0, 0, ::nWidth, ::nHeight )
:Restore()
End
Move(nCol, nRow, nWidth, nHeight)
Usuários vendo este fórum: Nenhum usuário registrado online e 2 visitantes