Difference: 0LASubrWidgetApplyTheme (6 vs. 7)

Revision 72012-03-30 - PeteBrower

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.WIDGET APPLY THEME

Line: 19 to 19
  You might want to consider giving this Menu a distinctive name to make it obvious this is not a normal menu, ie, prefix it with a ":" or other special character. The name of this process will be your 'Theme Name'.
Changed:
<
<
Next, you want to assign that name to the field --- .WIDGET THEME NAME somewhere in your application. This is a Detached work field, so you only need to assign it once. You can change this whenever you want. For example, different applications can use different themes just by changing this name. If your Theme Menu is not in the current application, then you should also assign --- .WIDGET THEME AP to the application id that contains the Theme Menu. If this is blank, the subroutine will look in the current application.
>
>
Next, you want to set that name somewhere in your application by calling .WIDGET SET THEME. This sets a Detached work field, so you only need to assign it once. You can change this whenever you want. For example, different applications can use different themes just by changing this name. If your Theme Menu is not in the current application, then you should also set the APPLICATION paramenter of .WIDGET SET THEME to the application id that contains the Theme Menu. If this is blank, the subroutine will look in the current application. You can also use a theme that is in a different version by setting the VERSION parameter of .WIDGET SET THEME.
  Finally, you should add a GOSUB to this subroutine in the Global Pre-Display event point of your Inputs and Menus. You can use the .WIDGET MISSING THEME subroutine to help you find these processes.
Changed:
<
<
You can create more than one theme for use in different processes. This is done by first creating another Menu Theme process with the same base name as your main Theme Menu, and then appending a period and some additional characters. For example, you may want all your File Maintenance processes to have a different look from Data Entry processes. You could define 2 additional theme menu processes, one with ".FM" appended to the name, and one with ".DE" appended to the name. In the Input processes where you want to use the ".FM" theme, go to the Image Editor, Window Properties, and put "FM" as the widget name. Do the same for the Data Entry processes. At runtime, the --- .WIDGET APPLY THEME subroutine will notice the widget name, append it to the base name in --- .WIDGET THEME NAME, and use that process as the theme. You could also simply change --- .WIDGET THEME NAME to point to another theme, but since it is Detached, it will retain that new theme until you change it back.
>
>
You can create more than one theme for use in different processes. This is done by first creating another Menu Theme process with the same base name as your main Theme Menu, and then appending a period and some additional characters. For example, you may want all your File Maintenance processes to have a different look from Data Entry processes. You could define 2 additional theme menu processes, one with ".FM" appended to the name, and one with ".DE" appended to the name. In the Input processes where you want to use the ".FM" theme, go to the Image Editor, Window Properties, and put "FM" as the widget name. Do the same for the Data Entry processes. At runtime, the --- .WIDGET APPLY THEME subroutine will notice the widget name, append it to the base name set with .WIDGET SET THEME, and use that process as the theme. You could also simply change the theme to point to another theme, but since it is Detached, it will retain that new theme until you change it back.
  This subroutine copies micro adjustments, resources, all color settings, fonts, font styles, font sizes, text positions, margins, tiling mode, location type, tooltips, and the settings for the Close, Ok and Help buttons to the GUI attributes of the widgets on the current image. It only replaces default settings, so if you have manually set a font, color or other attribute, that will remain unchanged.
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback