Difference: 0LASubrWidgetApplyTheme (3 vs. 4)

Revision 42012-02-14 - JeanNeron

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 whenver 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 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.
 
Changed:
<
<
Finally, you should add a GOSUB to this subroutine in the Global Pre-Display event point of your Inputs and Menus.
>
>
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.
  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 you all 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.
 
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