Hello,
I can add a buttonbar on a dialog, but is it possible to have a menu (and buttonbar) in a dialog?
Thanks,
Marc
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg
@ 2, 1 BUTTON "&Close";
ACTION oDlg:End()
ACTIVATE DIALOG oDlg;
ON INIT BUILDMENU( oDlg );
CENTER
RETURN NIL
STATIC FUNCTION BUILDMENU( oDlg )
LOCAL oMenu
MENU oMenu
MENUITEM "&Test"
MENU
MENUITEM "&Test1";
ACTION MSGINFO( "Test1" )
MENUITEM "&Test2";
ACTION MSGINFO( "Test2" )
MENUITEM "&Test3";
ACTION MSGINFO( "Test3" )
ENDMENU
ENDMENU
oDlg:SetMenu( oMenu )
RETURN NIL
#INCLUDE "fivewin.CH"
FUNCTION test()
local oDlg
local vspare := .f.
DEFINE DIALOG oDlg RESOURCE "test"
REDEFINE CHECKBOX vspare ID 104 of oDlg ON CHANGE(msginfo(vspare))
REDEFINE BUTTON ID 101 OF oDlg ACTION msginfo('OK')
REDEFINE BUTTON ID 102 OF oDlg ACTION msginfo('Cancel')
REDEFINE BUTTON ID 103 OF oDlg ACTION msginfo('Help')
ACTIVATE DIALOG oDlg CENTERED on init BUILDMENU( oDlg )
RETURN nil
STATIC FUNCTION buildmenu( odlg )
LOCAL oMenu
IF .t. // enable/disable menu
MENU oMenu
MENUITEM "&Test"
MENU
MENUITEM "&Test1";
ACTION MSGINFO( "Test1" )
MENUITEM "&Test2";
ACTION MSGINFO( "Test2" )
MENUITEM "&Test3";
ACTION MSGINFO( "Test3" )
ENDMENU
ENDMENU
oDlg:SetMenu( oMenu )
ENDIF
RETURN NIL
/****************************************************************************
test.rc
produced by Borland Resource Workshop
*****************************************************************************/
TEST DIALOG 6, 15, 207, 111
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
DEFPUSHBUTTON "OK", 101, 148, 6, 50, 14
PUSHBUTTON "Cancel", 102, 148, 24, 50, 14
PUSHBUTTON "Help", 103, 148, 42, 50, 14
CHECKBOX "Checkbox", 104, 7, 14, 93, 11, BS_AUTOCHECKBOX | WS_TABSTOP
}
Return to FiveWin for CA-Clipper
Users browsing this forum: No registered users and 10 guests