Skip to content

Instantly share code, notes, and snippets.

@Irwin1985
Created October 23, 2020 07:48
Show Gist options
  • Save Irwin1985/add202d97ffcad53b1ffb585db3f8a25 to your computer and use it in GitHub Desktop.
Save Irwin1985/add202d97ffcad53b1ffb585db3f8a25 to your computer and use it in GitHub Desktop.
tab = DEFINE PAD identifier
PROMPT string
LAYOUT string
[CONTEXT string]
[COLOR number]
[ONCLICK callFunc]
[PICTURE string]
[SKIP [FOR expression]]
[VISIBLE boolean]
[KEY keylabel]
[BINDKEY boolean]
group = DEFINE GROUP OF identifier
PROMPT string
[GROUPING boolean]
[SHOWBUTTON boolean]
[CONTEXT string]
[TOOLTIP string]
[DESCTEXT string]
[ONCLICK callFunc]
[VISIBLE boolean]
[KEY keylabel]
[BINDKEY boolean]
control = DEFINE BUTTON identifier OF identifier
PROMPT string
[WIDTH number]
[HEIGHT number]
[ENABLED boolean]
[BEGIN GROUP boolean]
[TOOLTIP string]
[DESCTEXT string]
[ONCLICK callFunc]
[PICTURE string]
[SKIP [FOR expression]]
[VISIBLE boolean]
[KEY keylabel]
[BINDKEY boolean]
controlAction = ON BUTTON identifier ACTIVATE POPUP identifier
| ON SELECTION BUTTON identifier callFunc
submenu = DEFINE BAR number OF identifier
PROMPT string
[PICTURE string]
[SKIP [FOR expression]]
[VISIBLE boolean]
[KEY keylabel]
[BINDKEY keylabel]
submenuAction = ON BAR number OF identifier ACTIVATE POPUP identifier
| ON SELECTION BAR number OF identifier callFunc
@Irwin1985
Copy link
Author

esta gramática está en notación EBNF pero se puede seguir fácilmente ya que los identificadores son bastante descriptivos. Por ahora cubre el ciclo de creación de un elemento partiendo desde su jerarquía más alta que sería el TAB, luego el GROUP, el CONTROL, la acción del control que puede ser un botón o un popup (submenu). En caso de ser un botón simplemente se define la llamada a la función (u objeto) asociada al elemento.

En caso de ser un submenu se debe usar el comando DEFINE BAR X tantas veces como se necesite y por cada DEFINE BAR X se debe implementar un ON BAR X.

Ejemplo:

DEFINE PAD tabClientes PROMPT "&Clientes" LAYOUT "Tab"
DEFINE GROUP OF tabClientes PROMPT "Grupo de Clientes"
DEFINE BUTTON btnABMClientes OF tabClientes PROMPT "Mantenimiento de clientes"
ON SELECTION BUTTON btnABMClientes oClientes.Mantenimiento()

El ejemplo anterior crea un tab con un botón que invoca al objeto oClientes.Mantenimiento() cuando se hace clic sobre él.

PD: los comandos sin corchetes son obligatorios, el resto es opcional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment