- Code: Select all Expand view
- #include "Fivewin.ch"
#include "Ribbon.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg;
SIZE 800, 600
ACTIVATE DIALOG oDlg;
ON INIT MAKERIBBON( oDlg );
CENTER
RETURN NIL
STATIC FUNCTION MAKERIBBON( oDlg )
LOCAL oRib
LOCAL oGr1, oGr2, oGr3, oGr4
LOCAL oMn1
MENU oMn1 POPUP
MENUITEM "Test 1" ACTION MSGINFO( "Test 1" )
MENUITEM "Test 2" ACTION MSGINFO( "Test 2" )
MENUITEM "Test 3" ACTION MSGINFO( "Test 3" )
ENDMENU
DEFINE RIBBONBAR oRib OF oDlg;
PROMPT "Test 1", "Test 2", "Test 3"
oRib:SetSize( oDlg:nWidth, 100 )
ADD GROUP oGr1 RIBBONBAR oRib;
WIDTH 80;
TO OPTION 1;
@ 4, 4 ADD BUTTON GROUP oGr1;
SIZE oGr1:nWidth - 9, oGr1:nHeight - 7;
PROMPT "Test 1";
BITMAP "OPEN.BMP";
ACTION MSGINFO( "Test 1" )
ADD GROUP oGr2 RIBBONBAR oRib;
WIDTH 80;
TO OPTION 1;
@ 4, 4 ADD BUTTON GROUP oGr2;
SIZE oGr2:nWidth - 9, oGr2:nHeight - 7;
PROMPT "Test 2";
BITMAP "OPEN.BMP";
ACTION MSGINFO( "Test 2" );
POPUP MENU oMn1
ADD GROUP oGr3 RIBBONBAR oRib;
WIDTH 80;
TO OPTION 2;
@ 4, 4 ADD BUTTON GROUP oGr3;
SIZE oGr3:nWidth - 9, oGr3:nHeight - 7;
PROMPT "Test 3";
BITMAP "OPEN.BMP";
ACTION MSGINFO( "Test 3" )
ADD GROUP oGr4 RIBBONBAR oRib;
WIDTH 80;
TO OPTION 2;
@ 4, 4 ADD BUTTON GROUP oGr4;
SIZE oGr4:nWidth - 9, oGr4:nHeight - 7;
PROMPT "Test 4";
BITMAP "OPEN.BMP";
ACTION MSGINFO( "Test 4" );
POPUP MENU oMn1
RETURN NIL
EMG