Here you have a working sample:
Code: Select all
#include "FiveWin.ch"
function Main()
local oDlg
DEFINE DIALOG oDlg TITLE "Calculator"
ACTIVATE DIALOG oDlg ;
ON INIT BuildPages( oDlg )
return nil
function BuildPages( oDlg )
local oPages := TPages():New( 0, 0, oDlg:nWidth(), oDlg:nHeight(), oDlg )
local oDlg1, oDlg2
oDlg:SetMenu( BuildMenu( oPages ) )
oDlg:oClient = oPages
oDlg:ReSize()
DEFINE DIALOG oDlg1 STYLE WS_CHILD OF oPages
@ 0.5, 1 BUTTON "+" OF oDlg1 SIZE 10, 10
@ 3, 2 SAY "Normal" OF oDlg1
oPages:AddPage( oDlg1 )
DEFINE DIALOG oDlg2 STYLE WS_CHILD OF oPages
@ 0.5, 1 BUTTON "Sin" OF oDlg2 SIZE 10, 10
@ 3, 2 SAY "Scientific" OF oDlg2
oPages:AddPage( oDlg2 )
oPages:SetOption( 1 )
return nil
function BuildMenu( oPages )
local oMenu
MENU oMenu 2007
MENUITEM "Type"
MENU
MENUITEM "Normal" ACTION oPages:SetOption( 1 )
MENUITEM "Scientific" ACTION oPages:SetOption( 2 )
ENDMENU
ENDMENU
return oMenu