Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Ask Reuben 19 - How To Implement Global Actions / Global On Idle  (Read 4455 times)
Reuben B.
Four Js
Posts: 1049

« on: May 08, 2020, 04:25:53 am »

Run any software and chances are there is a TopMenu option and/or Toolbar entry that is available throughout the application.  A good example being the Help->About menu option you might have been used to seeing in most Windows applications. 

To implement an action in a Genero application that is available in every dialog (MENU, PROMPT, INPUT, CONSTRUCT, DISPLAY ARRAY, INPUT ARRAY, DIALOG) requires adding the ON ACTION action-name CALL function() syntax to EVERY dialog statement in your code base and maintaining that.  Using the preprocessor you can define a directive so that every time the compiler comes to a dialog statement, it adds any ON ACTION code you want to be available in every dialog.  This makes your code easier to maintain and helps ensure consistency and uniformity as you don't have to worry about adding the ON ACTION syntax to every dialog yourself. 

The same technique can also be used to add ON IDLE to every dialog statement in your code base and help ensure that the ON IDLE will be triggered anywhere and not omitted.

I have used this technique in the past for adding multiple actions to dialogs.  These can include the equivalent of the About window, a Debug window, Contact Us, a Fast Navigation window, Wizards, Documentation, and miscellaneous array functionality.


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of
Contributor to
Pages: [1]
  Reply  |  Print  
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines