I create a dialog AS MDICHILD from a class, where I inserted the creation of the msgbar
BUT THE CLAUSOLE AS MDICHILD NOT WORK !!
this is the test
- Code: Select all Expand view
#include "fivewin.ch"
REQUEST DBFCDX
#define AS_MDICHILD 1
#define AS_DIALOG 2
FUNCTION Main()
local oWnd
RddSetDefault( "DBFCDX" )
SetHandleCount( 100 )
SET DATE FORMAT "dd-mm-yyyy"
SET DELETED ON
SET CENTURY ON
SET EPOCH TO year( date() ) - 20
SET MULTIPLE OFF
DEFINE WINDOW oWnd ;
FROM 0, 0 TO 24, 79 ;
TITLE "TEST" ;
COLOR CLR_BLACK, CLR_WHITE ;
MENU BuildMenu() ;
MDI VSCROLL HSCROLL
DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2015
DEFINE BUTTON OF oBar PROMPT "test" CENTER ACTION test(oWnd)
ACTIVATE WINDOW oWnd
return nil
function BuildMenu();return nil
function test(oWnd)
local oAnalisi := NewDlg():New( "Test", 10, 10, 300, 300,oWnd)
local oBar
DEFINE BUTTONBAR oBar TOP _3D OF oAnalisi SIZE 65,24 2015 NOBORDER
oAnalisi:Activate()
return nil
CLASS NewDlg
DATA oDlg
METHOD NEW()
METHOD ACTIVATE()
METHOD END()
ENDCLASS
METHOD NEW( cTitle, nTop, nLeft, nBottom, nRight,oWnd ) CLASS NewDlg
DEFINE DIALOG ::oDlg TITLE cTitle OF oWnd;
FROM nTop, nLeft TO nBottom, nRight PIXEL ;
STYLE NOR( WS_POPUP, WS_VISIBLE, WS_CAPTION, WS_THICKFRAME, WS_SYSMENU, WS_MINIMIZEBOX )
RETURN ::oDlg
METHOD ACTIVATE() CLASS NewDlg
LOCAL oDlg
::oDlg := oDlg
::oDlg:bInit := { || StatusBar( ::oDlg ) }
ACTIVATE DIALOG ::oDlg AS MDICHILD
RETURN NIL
METHOD END() CLASS NewDlg
::oDlg:End()
RETURN NIL
STATIC FUNCTION STATUSBAR(oDlg)
//LOCAL oDlg
oDlg := ::oDlg
SET MESSAGE OF ::oDlg;
TO "status bar";
RETURN NI