GUI Commands User GuideVersion 2.1 |
||
Mac OS RendererThe Mac has different conventions from most other platforms for rendering buttons and menus. GUI Commands automatically installs a special renderer on the Mac that ensures:
The following examples show how the exact same face configurations are rendered on Windows and the Mac:
Overriding the Default BehaviourIt is possible to override this default behaviour by configuring the static properties of the // turn menu icons and mnemonics back on for the Mac MacOSFaceRenderer.setMenuMnemonicsEnabled(true); MacOSFaceRenderer.setMenuIconsEnabled(true); // turn button mnemonics back on for the Mac MacOSFaceRenderer.setButtonMnemonicsEnabled(true); Gotcha'sPlease note that there are some issues using Apple's Aqua look and feel under certain button configurations (namely with text positioned under the icon). You may want to consider the excellent Quaqua Look and Feel to overcome these limitations. Quaqua IntegrationToolbar ButtonsQuaqua provides the capability of rendering toolbar buttons in various styles. GUI commands provides a special
property on toggle groups to automatically render toolbar buttons using Quaqua's inbuilt styles. The two available
styles are rounded and tabbed. When using the rounded style, the first and last members of the toggle group are
automatically configured with the The following example demonstrates configuring a toggle group to generate rounded buttons on toolbars: group!style-group@face.text=Text Styles group!style-group@face.clientProperties[Quaqua.Toolbar.style]=rounded group!style-group@toggle=true group!style-group@exclusive=false group!style-group@members=bold, italic, underline The following image shows examples of both the rounded and tabbed toolbar styles.
Using Client PropertiesBoth Quaqua and the standard Aqua look and feels allow you to specifiy client properties to control the
appearance of buttons on the Mac. You can specify any number of client properties in your standard
face configuration to control your button appearance as required. The following are examples of configuring
the Aqua command@face.text=Push Me command@face.clientProperties[JButton.buttonType]=toggle The list of valid styles is covered in the Java Development Guide for Mac OS X. While the JButton.buttonType property is useful, a much greater level of control over button styles can be
achieved using GUI Commands with the Quaqua look and feel. The following examples configures the
command@face.text=Quaqua command@face.icon=images/smile.gif command@face.clientProperties[Quaqua.Button.style]=square
|
||