- Code: Select all Expand view
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
local oBar
DEFINE WINDOW oWnd FROM 1,0 TO 500,800 PIXEL MDI
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ACTION child()
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
function Child()
local oWndChild
DEFINE WINDOW oWndChild MDICHILD OF oWnd FROM 0,0 TO 25,25
ACTIVATE WINDOW oWndChild CENTERED
return nil
Antonio, usando el ejemplo que has puesto de simular un MDI sencillo...
- Code: Select all Expand view
#include "FiveWin.ch"
function Main()
local oWnd, oChild1
Local nClientWidth
DEFINE WINDOW oWnd FROM 1,0 TO 500,800 PIXEL
DEFINE WINDOW oChild1 FROM 0,100 TO 100,250 PIXEL OF oWnd
oChild1:Center()
oChild1:Show()
ACTIVATE WINDOW oWnd
Return nil
lo que hace es centrar en la pantalla, no en la ventana contenedora.
A mi entender, creo que deberia de funcionar el evento Center() del ejemplo anterior, seria lo mas "correcto"
Y para centrarlo, de momento... lo hago "calculando" el ancho/alto...
- Code: Select all Expand view
#include "FiveWin.ch"
function Main()
local oWnd, oChild1
Local nClientWidth
DEFINE WINDOW oWnd FROM 1,0 TO 500,800 PIXEL
nClientWidth := oWnd:GetCliAreaRect():nWidth
DEFINE WINDOW oChild1 FROM 0, (nClientWidth-250)/2 TO 0, (nClientWidth/2)+125 PIXEL OF oWnd
oChild1:nHeight := oWnd:GetCliAreaRect():nHeight
oChild1:Show()
ACTIVATE WINDOW oWnd
Return nil
Hago algo mal???