#include "fivewin.ch"
#include "ribbon.ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//
function Main()
local oApp := TApplication():New()
oApp:Run()
return nil
//----------------------------------------------------------------------------//
CLASS TApplication
DATA oWnd
DATA oRBar
METHOD New()
METHOD BuildMenu()
METHOD BuildRibbon()
METHOD BackStage( )
METHOD Resize( )
METHOD Run()
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New() CLASS TApplication
DEFINE WINDOW ::oWnd TITLE "RibbonBar Style 2010 - Test";
MENU ::BuildMenu() COLOR "N/W*"
::BuildRibbon( )
SET MESSAGE OF ::oWnd TO "Testing Class RibbonBar Style 2010 and Message Bar 2010 colors" ;
CENTERED CLOCK KEYBOARD 2010
::oWnd:Center()
return Self
METHOD Run() CLASS TApplication
ACTIVATE WINDOW ::oWnd MAXIMIZED
return nil
METHOD Resize( nSizeType, nWidth, nHeight ) CLASS TApplication
local n
if nWidth != NIL
::oTitle:Move( , , nWidth - 1 )
for n = 1 to 2
::aBrw[ n + 2 ]:Move( , nWidth / 2 + 10, nWidth / 2 - 20 )
::aTtls[ n + 2 ]:Move( , nWidth / 2 + 10, nWidth / 2 - 20 )
::aBrw[ n ]:Move( , 10, nWidth / 2 - 20 )
::aTtls[ n ]:Move( , 10, nWidth / 2 - 20 )
next
::oSplit:Adjust()
endif
RETURN NIL
METHOD BuildRibbon() CLASS TApplication
local oMenu, oMainMenu
local oGr, oGr1, oGr2, oGr3, oGr4
local oBtn, oBtn1, oBtn2, oBtn3, oBtn4, oBtn5
local oBtn6, oBtn7, oBtn8, oBtn9, oBtn10
local oBtn11, oBtn12, oBtn13, oBtn14, oBtn15
local oBtn16, oBtn17, oBtn18, oBtn19, oBtn20
local oBtn21, oBtn22, oBtn23, oBtn24, oBtn25
local oBtn26, oBtn27, oBtn28, oBtn29, oBtn30
local oBtn31, oBtn32, oBtn33, oBtn34, oBtn35
local oSay1, oChk1, lVal1 := .T.
local oTBtn0, oTBtn1, oTBtn2, oTBtn3
local aClrMenu1 := { { 0.5, RGB( 69, 124, 188 ), RGB( 41, 93, 171 ) }, ;
{ 0.5, RGB( 26, 64, 136 ), RGB( 56, 135, 191 ) } }
local aClrMenu2 := { { 0.5, RGB( 123, 178, 236 ), RGB( 71, 126, 205 ) }, ;
{ 0.5, RGB( 17, 78, 175 ), RGB( 128, 225, 255 ) } }
MENU oMenu POPUP 2010
MENUITEM "Style Set" FILE ".\bitmaps\styleset161.BMP"
MENUITEM "Colors"
MENUITEM "Font"
ENDMENU
DEFINE RIBBONBAR ::oRBar WINDOW ::oWnd ;
PROMPT "Archivo", ;
"Configuración", ;
"Ficheros", ;
"Informes", ;
"Ayudas" HEIGHT 133 OPTION 2 2010 STARTBTN 1
::oRBar:bAction = {| nOpt, nOld | if( nOpt == ::oRBar:nStart, ::oRBar:BackStage(), ) }
::BackStage( ::oRBar )
ADD GROUP oGr RIBBON ::oRBar TO OPTION 2 PROMPT "Clipboard" width 130 //BITMAP "..\bitmap\fivetech.BMP"
ADD GROUP oGr1 RIBBON ::oRBar TO OPTION 2 PROMPT "Font" WIDTH 205
ADD GROUP oGr2 RIBBON ::oRBar TO OPTION 2 PROMPT "Paragraph" WIDTH 215
ADD GROUP oGr3 RIBBON ::oRBar TO OPTION 2 PROMPT "Styles" WIDTH 75 BITMAP ".\bitmaps\style16.BMP"
ADD GROUP oGr4 RIBBON ::oRBar TO OPTION 2 PROMPT "Editing"
@ 2,5 ADD BUTTON oBtn1 PROMPT "Paste" BITMAP ".\bitmaps\PASTE32.BMP" GROUP oGr ACTION ( Msginfo( "Paste" ) ) ;
SPLITPOPUP ROUND RSIZE 2 SIZE 50,65
@ 2, 55 ADD BUTTON oBtn2 GROUP oGr BITMAP ".\bitmaps\cut16.BMP" ;
SIZE 60, 20 PROMPT "Cut" MOSTLEFT round ;
action ( msginfo( "Cut" ) )
@ 24, 55 ADD BUTTON oBtn3 GROUP oGr BITMAP ".\bitmaps\copy16.BMP" ;
SIZE 65, 20 PROMPT "Copy" MOSTLEFT round action ( msginfo( "Copy" ) )
@ 46, 55 ADD BUTTON oBtn4 GROUP oGr BITMAP ".\bitmaps\paste16.BMP" ;
SIZE 70, 20 PROMPT "Paste" MOSTLEFT round ;
action( msginfo( "Paste" ) )
@ 68, 30 ADD BUTTON oSay1 GROUP oGr SIZE 65, 15 PROMPT "A Say" SAYBUTTON
@ 10, 05 ADD BUTTON oBtn5 GROUP oGr1 BITMAP ".\bitmaps\bold16.bmp" SIZE 25, 20 ROUND ;
ACTION( oBtn5:lSelected := !oBtn5:lSelected )
@ 10, 30 ADD BUTTON oBtn6 GROUP oGr1 BITMAP ".\bitmaps\italic16.bmp" SIZE 25, 20 ROUND ;
ACTION( oBtn6:lSelected := !oBtn6:lSelected )
@ 10, 55 ADD BUTTON oBtn7 GROUP oGr1 BITMAP ".\bitmaps\underline16.bmp" SIZE 35, 20 ROUND Popup
@ 10, 90 ADD BUTTON oBtn8 GROUP oGr1 BITMAP ".\bitmaps\strikethru16.bmp" SIZE 25, 20 ROUND;
ACTION( oBtn8:lSelected := !oBtn8:lSelected )
@ 10, 115 ADD BUTTON oBtn9 GROUP oGr1 BITMAP ".\bitmaps\subindex16.bmp" SIZE 25, 20 ROUND;
ACTION( oBtn9:lSelected := !oBtn9:lSelected, oBtn10:lSelected := .f., oBtn10:Refresh() )
@ 10, 140 ADD BUTTON oBtn10 GROUP oGr1 BITMAP ".\bitmaps\superindex16.bmp" SIZE 25, 20 ROUND ;
ACTION( oBtn10:lSelected := !oBtn10:lSelected, oBtn9:lSelected := .f., oBtn9:Refresh() )
@ 10, 165 ADD BUTTON oBtn11 GROUP oGr1 BITMAP ".\bitmaps\casing16.bmp" SIZE 35, 20 ROUND POPUP
@ 40, 05 ADD BUTTON oBtn11 GROUP oGr1 BITMAP ".\bitmaps\hilight16.bmp" SIZE 35, 20 ROUND POPUP
@ 40, 40 ADD BUTTON oBtn12 GROUP oGr1 BITMAP ".\bitmaps\fontcolor16.bmp" SIZE 35, 20 ROUND POPUP
@ 40, 100 ADD BUTTON oBtn13 GROUP oGr1 BITMAP ".\bitmaps\fontsizeincrease16.bmp" SIZE 25, 20 ROUND
@ 40, 125 ADD BUTTON oBtn14 GROUP oGr1 BITMAP ".\bitmaps\fontsizedecrease16.bmp" SIZE 25, 20 ROUND
@ 40, 175 ADD BUTTON oBtn16 GROUP oGr1 BITMAP ".\bitmaps\style16.bmp" SIZE 25, 20 ROUND
@ 64, 70 ADD BUTTON oChk1 GROUP oGr1 BITMAP ".\bitmaps\checkon.bmp" MOSTLEFT SIZE 85, 18 PROMPT "Checkbox" ;
ACTION ( lVal1 := ! lVal1, oChk1:SetFile( If( lVal1, ".\bitmaps\checkon.bmp", ".\bitmaps\checkoff.bmp" ) ) )
@ 10, 05 ADD BUTTON oBtn17 GROUP oGr2 BITMAP ".\bitmaps\unorderedlist16.bmp" SIZE 35, 20 ROUND POPUP
@ 10, 40 ADD BUTTON oBtn18 GROUP oGr2 BITMAP ".\bitmaps\orderedlist16.bmp" SIZE 35, 20 ROUND POPUP
@ 10, 75 ADD BUTTON oBtn19 GROUP oGr2 BITMAP ".\bitmaps\multilevellist16.bmp" SIZE 35, 20 ROUND ;
POPUP MENU oMenu
@ 10, 110 ADD BUTTON oBtn20 GROUP oGr2 BITMAP ".\bitmaps\textalignleft16.bmp" SIZE 25, 20 ROUND ;
ACTION( ChangeSelect( { oBtn20, oBtn21, oBtn22, oBtn23 } ) )
@ 10, 135 ADD BUTTON oBtn21 GROUP oGr2 BITMAP ".\bitmaps\textaligncenter16.bmp" SIZE 25, 20 ROUND ;
ACTION( ChangeSelect( { oBtn21, oBtn20, oBtn22, oBtn23 } ) )
@ 10, 160 ADD BUTTON oBtn22 GROUP oGr2 BITMAP ".\bitmaps\textalignright16.bmp" SIZE 25, 20 ROUND;
ACTION( ChangeSelect( { oBtn22, oBtn21, oBtn20, oBtn23 } ) )
@ 10, 185 ADD BUTTON oBtn23 GROUP oGr2 BITMAP ".\bitmaps\textalignjustify16.bmp" SIZE 25, 20 ROUND;
ACTION( ChangeSelect( { oBtn23, oBtn21, oBtn22, oBtn20 } ) )
@ 40, 05 ADD BUTTON oBtn24 GROUP oGr2 BITMAP ".\bitmaps\fill16.bmp" SIZE 35, 20 ROUND POPUP
@ 40, 40 ADD BUTTON oBtn25 GROUP oGr2 BITMAP ".\bitmaps\borderbottom16.bmp" SIZE 35, 20 ROUND
@ 40, 80 ADD BUTTON oBtn26 GROUP oGr2 BITMAP ".\bitmaps\indentdecrease16.bmp" SIZE 25, 20 ROUND
@ 40, 105 ADD BUTTON oBtn27 GROUP oGr2 BITMAP ".\bitmaps\indentincrease16.bmp" SIZE 25, 20 ROUND
@ 40, 135 ADD BUTTON oBtn28 GROUP oGr2 BITMAP ".\bitmaps\sort16.bmp" SIZE 25, 20 ROUND
@ 40, 160 ADD BUTTON oBtn29 GROUP oGr2 BITMAP ".\bitmaps\paragraphspacing16.bmp" SIZE 25, 20 ROUND
@ 40, 185 ADD BUTTON oBtn30 GROUP oGr2 BITMAP ".\bitmaps\invisiblechars16.bmp" SIZE 25, 20 ROUND
@ 3,5 ADD BUTTON oBtn31 PROMPT "Change"+CRLF+"Styles" BITMAP ".\bitmaps\stylechange32.BMP" GROUP oGr3 ;
ROUND RSIZE 2 SIZE 65,75 TOP
@ 2,5 ADD BUTTON oBtn32 PROMPT "Find" BITMAP ".\bitmaps\find32.BMP" GROUP oGr4 ;
SPLITPOPUP ROUND SIZE 50,65
@ 2, 55 ADD BUTTON oBtn33 GROUP oGr4 BITMAP ".\bitmaps\replace16.BMP" ;
SIZE 80, 20 PROMPT "Replace" MOSTLEFT round ;
ACTION msginfo( "Replace" )
@ 24, 55 ADD BUTTON oBtn34 GROUP oGr4 BITMAP ".\bitmaps\goto16.BMP" ;
SIZE 65, 20 PROMPT "Go To" MOSTLEFT round ;
ACTION msginfo( "Go To" )
@ 46, 55 ADD BUTTON oBtn35 GROUP oGr4 BITMAP ".\bitmaps\select16.BMP" ;
SIZE 70, 20 PROMPT "Select" MOSTLEFT round POPUP
return nil
METHOD BuildMenu()
local oMenu
MENU oMenu 2010
MENUITEM "&Archivo"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
MENUITEM "&Edicion"
MENU
MENUITEM "Item 1" MESSAGE "Item 1 "
MENUITEM "Item 2" MESSAGE "Item 2 "
MENUITEM "Item 3" MESSAGE "Item 3"
SEPARATOR
MENUITEM "Item 4" MESSAGE "Item 4"
SEPARATOR
MENUITEM "Item 5" MESSAGE "Item 5"
MENU 2007
MENUITEM "Item 1" MESSAGE "Item 1"
SEPARATOR
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
ENDMENU
MENUITEM "&Ver"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
MENUITEM "&Datos"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
MENUITEM "&Proceso"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
MENUITEM "&Impresiones"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
MENUITEM "&Herramientas"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
MENUITEM "In&ternet"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
MENUITEM "&Ventanas"
MENU
MENUITEM "Item 1" MESSAGE "Item 1"
MENUITEM "Item 2" MESSAGE "Item 2"
ENDMENU
ENDMENU
return oMenu
Procedure ChangeSelect( aObj )
local n
aObj[ 1 ]:lSelected := .t.
for n = 2 to len( aObj )
aObj[ n ]:lSelected := .f.
aObj[ n ]:Refresh()
next
return
//----------------------------------------------------------------------------//
METHOD BackStage( ) CLASS TApplication
local oBackStage, oSelf := Self
DEFINE BACKSTAGE oBackStage
DEFINE BSBUTTON OF oBackStage PROMPT "Save" ;
BITMAP ".\bitmaps\alphabmp\bs_save.bmp" ACTION Msginfo( oOpt:cPrompt );
GRADIENT { { 1, nRGB( 255, 255, 0 ), nRGB( 255, 255, 255 ) } }
DEFINE BSBUTTON OF oBackStage PROMPT "Save As" ;
BITMAP ".\bitmaps\alphabmp\bs_saveas.bmp" ACTION Msginfo( oOpt:cPrompt );
GRADIENT { { 1, nRGB( 242, 96, 96 ), nRGB( 195, 37, 37 ) } };
COLORTEXT CLR_BLACK, CLR_WHITE
DEFINE BSBUTTON OF oBackStage PROMPT "Open" ;
BITMAP ".\bitmaps\alphabmp\bs_open.bmp" ACTION Msginfo( oOpt:cPrompt )
DEFINE BSBUTTON OF oBackStage PROMPT "Close";
BITMAP ".\bitmaps\alphabmp\bs_close.bmp" ACTION Msginfo( oOpt:cPrompt )
DEFINE BSSELECT OF oBackStage PROMPT "Information";
COLORTEXT NIL, CLR_HRED ACTION Msginfo( oOpt:cPrompt )
DEFINE BSSELECT OF oBackStage PROMPT "New" ACTION Msginfo( oOpt:cPrompt )
DEFINE BSSELECT OF oBackStage PROMPT "Print" ACTION Msginfo( oOpt:cPrompt )
DEFINE BSSELECT OF oBackStage PROMPT "Save / Send" ACTION Msginfo( oOpt:cPrompt );
GRADIENT { { 1, nRGB( 255, 255, 0 ), nRGB( 255, 255, 255 ) } }
DEFINE BSSELECT OF oBackStage PROMPT "Help" ACTION Msginfo( oOpt:cPrompt );
COLORS nRGB( 242, 96, 96 ), nRGB( 195, 37, 37 )
DEFINE BSBUTTON OF oBackStage PROMPT "Option" ;
BITMAP ".\bitmaps\alphabmp\bs_options.bmp" ACTION Msginfo( oOpt:cPrompt )
DEFINE BSBUTTON OF oBackStage PROMPT "Exit" ;
BITMAP ".\bitmaps\alphabmp\bs_exit.bmp" ACTION Msginfo( oSelf:oWnd:End() )
SET BACKSTAGE oBackStage TO ::oRBar
return nil