#Include 'FiveWin.ch'
#include 'Ribbon.ch'
GLOBAL oRibbon,;
oBtn_RR, oBtn_SR,;
oBtn_RE, oBtn_CH, oBtn_CO,;
oBtn_RP
//--------------------------------------------------------------------------------------------------
PROCEDURE uMain()
Local aScreen := { GetSysMetrics( 4 ) + GetSysMetrics( 17 ),; //height of caption and screen }
GetSysMetrics( 16 ),; //width of client area
GetSysMetrics( 0 ),; //width of screen
GetSysMetrics( 1 ) } //height of screen
DEFINE WINDOW oMDIFrame TITLE "Ribbon flicker" MDI;
From 0, 0 To aScreen[1],aScreen[2] PIXEL; //fullscreen desktop screen \
MENU uBuildMenu()
DEFINE RIBBONBAR oRibbon WINDOW oMDIFrame;
PROMPT 'ONE', 'TWO', 'THREE';
HEIGHT 112 TOPMARGIN 26
ADD GROUP oGrp_PUR_N3 RIBBON oRIBBON TO OPTION 1;
PROMPT "one.1" width 120
@ 05, 10 ADD BUTTON GROUP oGrp_PUR_N3;
SIZE 50, 58 PROMPT '&1';
SPLITPOPUP ROUND;
ACTION msginfo('1.1')
@ 05, 62 ADD BUTTON GROUP oGrp_PUR_N3;
SIZE 50, 58 PROMPT '&2';
SPLITPOPUP ROUND ;
ACTION msginfo('1.2')
//-----------------------------------------------------------------------------------------------------------------------------
ADD GROUP oGrp_INV_N3 RIBBON oRIBBON TO OPTION 2;
PROMPT "two.1" width 120
@ 05, 10 ADD BUTTON oBtn_RR GROUP oGrp_INV_N3;
SIZE 50, 58 PROMPT "&Here";
SPLITPOPUP ROUND;
ACTION uDlgOnMDIChild()
@ 05, 62 ADD BUTTON oBtn_SR GROUP oGrp_INV_N3;
SIZE 50, 58 PROMPT "&2";
SPLITPOPUP ROUND ;
ACTION msginfo('2.1')
ADD GROUP oGrp_COS_N3 RIBBON oRIBBON TO OPTION 2;
PROMPT "two.2" width 210
@ 05, 10 ADD BUTTON oBtn_RE GROUP oGrp_COS_N3;
SIZE 50, 58 PROMPT "&1";
SPLITPOPUP ROUND;
ACTION msginfo('2.1')
@ 05, 62 ADD BUTTON oBtn_CH GROUP oGrp_COS_N3;
SIZE 70, 58 PROMPT "&2";
SPLITPOPUP ROUND ;
ACTION msginfo('2.2')
@ 05, 133 ADD BUTTON oBtn_CO GROUP oGrp_COS_N3;
SIZE 70, 58 PROMPT "&3";
SPLITPOPUP ROUND ;
ACTION msginfo('2.3')
ADD GROUP oGrp_INV_RE RIBBON oRIBBON TO OPTION 2;
PROMPT "three.3" width 210 BITMAP 'ribbontip'
@ 05, 10 ADD BUTTON oBtn_RP GROUP oGrp_INV_RE;
SIZE 70, 58 PROMPT "&1";
SPLITPOPUP ROUND ;
ACTION msginfo('3.1')
//------------------
ACTIVATE WINDOW oMDIFrame Maximized;
ON INIT ( oRibbon:SetOption( 2 ),;
oMDIFrame:aMinMaxInfo := {,,,,,,oMDIFrame:nWidth,oMDIFrame:nHeight} )
RETURN
//--------------------------------------------------------------------------------------------------
STATIC FUNCTION uBuildMenu()
LOCAL oMenu
MENU oMenu
ENDMENU
RETURN( oMenu )
//--------------------------------------------------------------------------------------------------
PROCEDURE uDlgOnMDIChild()
LOCAL oWnd, oDlg
LOCAL oGrp,;
oSay,;
oGet
LOCAL oFont
LOCAL cGet := 'themed apps'
DEFINE FONT oFont NAME "Verdana" SIZE 0, -16
DEFINE WINDOW oWnd TITLE "xBrowse" MDICHILD;
FROM 0,0 TO 0, 0;
OF oMDIFrame PIXEL
DEFINE DIALOG oDlg RESOURCE 'DLG_CONTENT';
OF oWnd PIXEL;
FONT oFont
REDEFINE GROUP ID 1001;
OF oDlg TRANSPARENT
REDEFINE SAY ID 1003;
OF oDlg TRANSPARENT
REDEFINE GET oGet VAR cGet;
ID 1002 OF oDlg UPDATE
ACTIVATE DIALOG oDlg NOWAIT;
ON PAINT uDialogGradient( hDC, oDlg, { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }, .F. );
ON INIT oDlg:SetBrush( TBrush():New() );
VALID .F. //no esc-key
//oWnd:oClient := oDlg
oWnd:bResized := {|| oDlg:SetSize( oWnd:oWndClient:nWidth-3,;
oWnd:oWndClient:nHeight-3) }
ACTIVATE WINDOW oWnd;
ON PAINT uDialogGradient( hDC, oWnd, { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }, .F. );
ON INIT ( oWnd:nHeight := Min(oMDIFrame:oWndClient:nHeight,800),;
oWnd:nWidth := Max(oMDIFrame:oWndClient:nWidth, 1280),;
oWnd:SetBrush( TBrush():New() ) )
RETURN
//--------------------------------------------------------------------------------------------------
FUNCTION uDialogGradient( hDC, oDlg, aGrad, lPos )
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, lPos )
ReleaseDC( hDC )
RETURN NIL