This class will take a Sheet control and convert it into Metro or “Modern UI” styled window. The sheet/Tab functionality is replaced with a list box on the left using the ce_TabList class. It is designed with a fairly narrow target but as long as you stay within the guidelines it seems to work well :)
Just add a new instance of this class to a window, set a few properties, call the init method and you should be good to go.
This document will not list all the public properties, take a look at the source code for them for now.
Syntax:
themeColors LONG,DIM(25,2)
The dimension of this property are filled with Windows 8 Color Palette values.
Syntax:
promptTabHeader SIGNED
Field equate for the control used to display the name of the selected TAB. The value comes from the TABs PROP:Text and is updated on EVENT:NewSelection.
Syntax:
promptTabDetail SIGNED
Field equate for the control used to display the detail of the selected TAB. The value comes from the TABs PROP:Tip and is updated on EVENT:NewSelection.
Syntax:
promptTabHeaderUpper SIGNED(FALSE)
Convert text to upper case before display.
Syntax:
promptTabDetailUpper SIGNED(TRUE)
Convert text to upper case before display.
Syntax:
buttonClose SIGNED
Field equate for the control used to close the form. The button remains hidden until the last TAB in the Sheet is visible.
Syntax:
buttonOK SIGNED
Field equate for the control used to Ok the form. The button remains hidden until the last TAB in the Sheet is visible.
Syntax:
buttonPrevious SIGNED
Field equate for the control used to navigate to the previous TAB. The button is only visible if the current TAB is not the first TAB on the sheet.
Syntax:
buttonNext SIGNED
Field equate for the control used to navigate to the next TAB. The button is only visible if the current TAB is not the last TAB on the sheet.
Before calling this method you must set the button and prompt properties:
Before using any other methods you must call this Init method.
Syntax:
Init (WindowManager pWM, SIGNED pSheetFeq, BYTE pHideCaption=FALSE)
The window manager to call AddItem on
FEQ value of the Sheet control to be adjusted.
Set this to TRUE and the init method will call SetWindowLong to hide the form caption.
Note
By doing this you will lose min/max functionality.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ThisWindow.Init PROCEDURE
CODE
! ...
! A bunch of other Init stuff happens here, then...
! ...
SELF.Open(Window)
MetroForm.buttonNext = ?ButtonNext
MetroForm.buttonPrevious = ?ButtonPrevious
MetroForm.buttonOK = ?ButtonOK
MetroForm.buttonClose = ?ButtonClose
MetroForm.promptTabDetail = ?PromptTabDetail
MetroForm.promptTabHeader = ?PromptTabHeader
0{PROP:Text} = 'Clarion Metro Wizard Demo v1.3'
MetroForm.Init(SELF, ?CurrentTab, TRUE)
MetroForm.SetHeaderText(0{PROP:Text})
MetroForm.SetListHeaderText('Demo Features')
|
Set the theme to be used for the form highlights.
Syntax:
SetTheme (BYTE pThemeNumber)
Index for the theme to be used. Valid values in 0-25 range.
Note
pThemeNumber=0 is the hardecoded default value not shown in the image above. Colors copied from the original Silverlight Metro Style Wizard project.
1 | MetroForm.SetTheme(1)
|
In addition to the built in SetTheme method you can call this method to manually specify the highlights.
Syntax:
ApplyColors (LONG pDarkColor, LONG pLightColor)
Clarion color value for the dark highlight.
Clarion color value for the light highlight.
1 | MetroForm.ApplyColors(COLOR:Black, COLOR:Silver)
|
Helper method to set the header prompt text
Syntax:
SetHeaderText (STRING pText)
Text for the prompt.
1 | MetroForm.SetHeaderText(0{PROP:Text})
|
Helper method to set the list prompt text
Syntax:
SetListHeaderText (STRING pText)
Text for the prompt.
1 | MetroForm.SetListHeaderText('Demo Features')
|