Mike Clark
Member
Progress 9.1d02 under Windows
I have a smart window on which is a Browser. I have 'attached' a trigger to the Browser
ON F12 OF BROWSE-2 IN FRAME fMain
DO:
run dosomething.
END.
What the user wants is the ability to have F12 fire at any point in the window not just when focus is on the Browser.
I have tried inserting other Triggers against the Frame but nothing happens.
Is this possible?
Tia.
Mike
Code as follows
/* Connected Databases
imprint PROGRESS
*/
&Scoped-define WINDOW-NAME wibookenq
/*------------------------------------------------------------------------
File:
Description: from cntnrwin.w - ADM SmartWindow Template
Input Parameters:
<none>
Output Parameters:
<none>
History: New V9 Version - January 15, 1998
------------------------------------------------------------------------*/
/* This .W file was created with the Progress AB. */
/*----------------------------------------------------------------------*/
/* Create an unnamed pool to store all the widgets created
by this procedure. This is a good default which assures
that this procedure's triggers and internal procedures
will execute in this procedure's storage, and that proper
cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
/* *************************** Definitions ************************** */
/* Parameters Definitions --- */
/* Local Variable Definitions --- */
/* ******************** Preprocessor Definitions ******************** */
&Scoped-define PROCEDURE-TYPE SmartWindow
&Scoped-define DB-AWARE no
&Scoped-define ADM-CONTAINER WINDOW
&Scoped-define ADM-SUPPORTED-LINKS Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source
/* Name of first Frame and/or Browse and/or first Query */
&Scoped-define FRAME-NAME fMain
&Scoped-define BROWSE-NAME BROWSE-2
/* Internal Tables (found by Frame, Query & Browse Queries) */
&Scoped-define INTERNAL-TABLES book
/* Definitions for BROWSE BROWSE-2 */
&Scoped-define FIELDS-IN-QUERY-BROWSE-2 book.bookcode book.isbn book.shorttitle book.author book.author-code book.binding
&Scoped-define ENABLED-FIELDS-IN-QUERY-BROWSE-2
&Scoped-define SELF-NAME BROWSE-2
&Scoped-define QUERY-STRING-BROWSE-2 FOR EACH book NO-LOCK BY book.bookcode INDEXED-REPOSITION
&Scoped-define OPEN-QUERY-BROWSE-2 OPEN QUERY {&SELF-NAME} FOR EACH book NO-LOCK BY book.bookcode INDEXED-REPOSITION.
&Scoped-define TABLES-IN-QUERY-BROWSE-2 book
&Scoped-define FIRST-TABLE-IN-QUERY-BROWSE-2 book
/* Definitions for FRAME fMain */
&Scoped-define OPEN-BROWSERS-IN-QUERY-fMain ~
~{&OPEN-QUERY-BROWSE-2}
/* Standard List Definitions */
&Scoped-Define ENABLED-OBJECTS BROWSE-2 BtnView BtnCancel RECT-2
/* Custom List Definitions */
/* List-1,List-2,List-3,List-4,List-5,List-6 */
/* *********************** Control Definitions ********************** */
/* Define the widget handle for the window */
DEFINE VAR wibookenq AS WIDGET-HANDLE NO-UNDO.
/* Definitions of the field level widgets */
DEFINE BUTTON BtnCancel AUTO-END-KEY DEFAULT
LABEL "&Done"
SIZE 15 BY 1.14
BGCOLOR 8 .
DEFINE BUTTON BtnView DEFAULT
LABEL "&View Book"
SIZE 14 BY 2 TOOLTIP "Book Details relating to this Bibliography"
BGCOLOR 8 FONT 6.
DEFINE RECTANGLE RECT-2
EDGE-PIXELS 4 GRAPHIC-EDGE NO-FILL
SIZE 150 BY 3.81.
/* Query definitions */
DEFINE QUERY BROWSE-2 FOR
book SCROLLING.
/* Browse definitions */
DEFINE BROWSE BROWSE-2
QUERY BROWSE-2 NO-LOCK DISPLAY
book.bookcode FORMAT "x(13)" COLUMN-LABEL "Book Code"
book.isbn COLUMN-LABEL "ISBN" FORMAT "x(15)"
book.shorttitle COLUMN-LABEL "Title"
book.author COLUMN-LABEL "Author" FORMAT "x(50)"
book.author-code COLUMN-LABEL "Author Code"
book.binding COLUMN-LABEL "Binding"
WITH NO-ROW-MARKERS SEPARATORS SIZE 152 BY 15.48
BGCOLOR 15 FGCOLOR 0 ROW-HEIGHT-CHARS .57 EXPANDABLE.
/* ************************ Frame Definitions *********************** */
DEFINE FRAME fMain
BROWSE-2 AT ROW 2.19 COL 1
BtnView AT ROW 18.86 COL 6
BtnCancel AT ROW 19.33 COL 26
RECT-2 AT ROW 17.91 COL 3
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1.24
SIZE 152.8 BY 21
DEFAULT-BUTTON BtnView.
/* *********************** Procedure Settings ************************ */
/* Settings for THIS-PROCEDURE
Type: SmartWindow
Allow: Basic,Browse,DB-Fields,Query,Smart,Window
Container Links: Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source
Other Settings: COMPILE
*/
/* ************************* Create Window ************************** */
IF SESSION
ISPLAY-TYPE = "GUI":U THEN
CREATE WINDOW wibookenq ASSIGN
HIDDEN = YES
TITLE = "Book Enquiry"
HEIGHT = 21.24
WIDTH = 152.8
MAX-HEIGHT = 28.81
MAX-WIDTH = 160
VIRTUAL-HEIGHT = 28.81
VIRTUAL-WIDTH = 160
RESIZE = no
SCROLL-BARS = no
STATUS-AREA = no
BGCOLOR = ?
FGCOLOR = ?
THREE-D = yes
MESSAGE-AREA = no
SENSITIVE = yes.
ELSE {&WINDOW-NAME} = CURRENT-WINDOW.
/* END WINDOW DEFINITION */
/* ************************* Included-Libraries *********************** */
{src/adm2/containr.i}
/* *********** Runtime Attributes and AppBuilder Settings *********** */
/* SETTINGS FOR WINDOW wibookenq
VISIBLE,,RUN-PERSISTENT */
/* SETTINGS FOR FRAME fMain
*/
/* BROWSE-TAB BROWSE-2 1 fMain */
ASSIGN
BROWSE-2:ALLOW-COLUMN-SEARCHING IN FRAME fMain = TRUE
BROWSE-2:COLUMN-RESIZABLE IN FRAME fMain = TRUE.
IF SESSION
ISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wibookenq)
THEN wibookenq:HIDDEN = yes.
/* Setting information for Queries and Browse Widgets fields */
/* Query rebuild information for BROWSE BROWSE-2
*/ /* BROWSE BROWSE-2 */
/* ************************ Control Triggers ************************ */
&Scoped-define SELF-NAME wibookenq
ON END-ERROR OF wibookenq /* Book Enquiry */
OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO:
/* This case occurs when the user presses the "Esc" key.
In a persistently run window, just ignore this. If we did not, the
application would exit. */
IF THIS-PROCEDURE
ERSISTENT THEN RETURN NO-APPLY.
END.
ON F12 OF wibookenq /* Book Enquiry */
DO:
MESSAGE "in f12 of wibookenq" VIEW-AS ALERT-BOX.
/* this is never called */
END.
ON WINDOW-CLOSE OF wibookenq /* Book Enquiry */
DO:
/* This ADM code must be left here in order for the SmartWindow
and its descendents to terminate properly on exit. */
APPLY "CLOSE":U TO THIS-PROCEDURE.
RETURN NO-APPLY.
END.
&Scoped-define BROWSE-NAME BROWSE-2
&Scoped-define SELF-NAME BROWSE-2
ON F12 OF BROWSE-2 IN FRAME fMain
DO:
MESSAGE "in f12 of browse" VIEW-AS ALERT-BOX.
END.
&Scoped-define SELF-NAME BtnCancel
ON CHOOSE OF BtnCancel IN FRAME fMain /* Done */
DO:
RUN exitObject.
END.
&Scoped-define SELF-NAME BtnView
ON CHOOSE OF BtnView IN FRAME fMain /* View Book */
DO:
MESSAGE "In Viewbook" VIEW-AS ALERT-BOX.
END.
&UNDEFINE SELF-NAME
/* *************************** Main Block *************************** */
/* Include custom Main Block code for SmartWindows. */
{src/adm2/windowmn.i}
/* ********************** Internal Procedures *********************** */
PROCEDURE adm-create-objects :
/*------------------------------------------------------------------------------
Purpose: Create handles for all SmartObjects used in this procedure.
After SmartObjects are initialized, then SmartLinks are added.
Parameters: <none>
------------------------------------------------------------------------------*/
END PROCEDURE.
PROCEDURE disable_UI :
/*------------------------------------------------------------------------------
Purpose: DISABLE the User Interface
Parameters: <none>
Notes: Here we clean-up the user-interface by deleting
dynamic widgets we have created and/or hide
frames. This procedure is usually called when
we are ready to "clean-up" after running.
------------------------------------------------------------------------------*/
/* Delete the WINDOW we created */
IF SESSION
ISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wibookenq)
THEN DELETE WIDGET wibookenq.
IF THIS-PROCEDURE
ERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
END PROCEDURE.
PROCEDURE enable_UI :
/*------------------------------------------------------------------------------
Purpose: ENABLE the User Interface
Parameters: <none>
Notes: Here we display/view/enable the widgets in the
user-interface. In addition, OPEN all queries
associated with each FRAME and BROWSE.
These statements here are based on the "Other
Settings" section of the widget Property Sheets.
------------------------------------------------------------------------------*/
ENABLE BROWSE-2 BtnView BtnCancel RECT-2
WITH FRAME fMain IN WINDOW wibookenq.
{&OPEN-BROWSERS-IN-QUERY-fMain}
VIEW wibookenq.
END PROCEDURE.
PROCEDURE exitObject :
/*------------------------------------------------------------------------------
Purpose: Window-specific override of this procedure which destroys
its contents and itself.
Notes:
------------------------------------------------------------------------------*/
APPLY "CLOSE":U TO THIS-PROCEDURE.
RETURN.
END PROCEDURE.
I have a smart window on which is a Browser. I have 'attached' a trigger to the Browser
ON F12 OF BROWSE-2 IN FRAME fMain
DO:
run dosomething.
END.
What the user wants is the ability to have F12 fire at any point in the window not just when focus is on the Browser.
I have tried inserting other Triggers against the Frame but nothing happens.
Is this possible?
Tia.
Mike
Code as follows
/* Connected Databases
imprint PROGRESS
*/
&Scoped-define WINDOW-NAME wibookenq
/*------------------------------------------------------------------------
File:
Description: from cntnrwin.w - ADM SmartWindow Template
Input Parameters:
<none>
Output Parameters:
<none>
History: New V9 Version - January 15, 1998
------------------------------------------------------------------------*/
/* This .W file was created with the Progress AB. */
/*----------------------------------------------------------------------*/
/* Create an unnamed pool to store all the widgets created
by this procedure. This is a good default which assures
that this procedure's triggers and internal procedures
will execute in this procedure's storage, and that proper
cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
/* *************************** Definitions ************************** */
/* Parameters Definitions --- */
/* Local Variable Definitions --- */
/* ******************** Preprocessor Definitions ******************** */
&Scoped-define PROCEDURE-TYPE SmartWindow
&Scoped-define DB-AWARE no
&Scoped-define ADM-CONTAINER WINDOW
&Scoped-define ADM-SUPPORTED-LINKS Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source
/* Name of first Frame and/or Browse and/or first Query */
&Scoped-define FRAME-NAME fMain
&Scoped-define BROWSE-NAME BROWSE-2
/* Internal Tables (found by Frame, Query & Browse Queries) */
&Scoped-define INTERNAL-TABLES book
/* Definitions for BROWSE BROWSE-2 */
&Scoped-define FIELDS-IN-QUERY-BROWSE-2 book.bookcode book.isbn book.shorttitle book.author book.author-code book.binding
&Scoped-define ENABLED-FIELDS-IN-QUERY-BROWSE-2
&Scoped-define SELF-NAME BROWSE-2
&Scoped-define QUERY-STRING-BROWSE-2 FOR EACH book NO-LOCK BY book.bookcode INDEXED-REPOSITION
&Scoped-define OPEN-QUERY-BROWSE-2 OPEN QUERY {&SELF-NAME} FOR EACH book NO-LOCK BY book.bookcode INDEXED-REPOSITION.
&Scoped-define TABLES-IN-QUERY-BROWSE-2 book
&Scoped-define FIRST-TABLE-IN-QUERY-BROWSE-2 book
/* Definitions for FRAME fMain */
&Scoped-define OPEN-BROWSERS-IN-QUERY-fMain ~
~{&OPEN-QUERY-BROWSE-2}
/* Standard List Definitions */
&Scoped-Define ENABLED-OBJECTS BROWSE-2 BtnView BtnCancel RECT-2
/* Custom List Definitions */
/* List-1,List-2,List-3,List-4,List-5,List-6 */
/* *********************** Control Definitions ********************** */
/* Define the widget handle for the window */
DEFINE VAR wibookenq AS WIDGET-HANDLE NO-UNDO.
/* Definitions of the field level widgets */
DEFINE BUTTON BtnCancel AUTO-END-KEY DEFAULT
LABEL "&Done"
SIZE 15 BY 1.14
BGCOLOR 8 .
DEFINE BUTTON BtnView DEFAULT
LABEL "&View Book"
SIZE 14 BY 2 TOOLTIP "Book Details relating to this Bibliography"
BGCOLOR 8 FONT 6.
DEFINE RECTANGLE RECT-2
EDGE-PIXELS 4 GRAPHIC-EDGE NO-FILL
SIZE 150 BY 3.81.
/* Query definitions */
DEFINE QUERY BROWSE-2 FOR
book SCROLLING.
/* Browse definitions */
DEFINE BROWSE BROWSE-2
QUERY BROWSE-2 NO-LOCK DISPLAY
book.bookcode FORMAT "x(13)" COLUMN-LABEL "Book Code"
book.isbn COLUMN-LABEL "ISBN" FORMAT "x(15)"
book.shorttitle COLUMN-LABEL "Title"
book.author COLUMN-LABEL "Author" FORMAT "x(50)"
book.author-code COLUMN-LABEL "Author Code"
book.binding COLUMN-LABEL "Binding"
WITH NO-ROW-MARKERS SEPARATORS SIZE 152 BY 15.48
BGCOLOR 15 FGCOLOR 0 ROW-HEIGHT-CHARS .57 EXPANDABLE.
/* ************************ Frame Definitions *********************** */
DEFINE FRAME fMain
BROWSE-2 AT ROW 2.19 COL 1
BtnView AT ROW 18.86 COL 6
BtnCancel AT ROW 19.33 COL 26
RECT-2 AT ROW 17.91 COL 3
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1.24
SIZE 152.8 BY 21
DEFAULT-BUTTON BtnView.
/* *********************** Procedure Settings ************************ */
/* Settings for THIS-PROCEDURE
Type: SmartWindow
Allow: Basic,Browse,DB-Fields,Query,Smart,Window
Container Links: Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source
Other Settings: COMPILE
*/
/* ************************* Create Window ************************** */
IF SESSION

CREATE WINDOW wibookenq ASSIGN
HIDDEN = YES
TITLE = "Book Enquiry"
HEIGHT = 21.24
WIDTH = 152.8
MAX-HEIGHT = 28.81
MAX-WIDTH = 160
VIRTUAL-HEIGHT = 28.81
VIRTUAL-WIDTH = 160
RESIZE = no
SCROLL-BARS = no
STATUS-AREA = no
BGCOLOR = ?
FGCOLOR = ?
THREE-D = yes
MESSAGE-AREA = no
SENSITIVE = yes.
ELSE {&WINDOW-NAME} = CURRENT-WINDOW.
/* END WINDOW DEFINITION */
/* ************************* Included-Libraries *********************** */
{src/adm2/containr.i}
/* *********** Runtime Attributes and AppBuilder Settings *********** */
/* SETTINGS FOR WINDOW wibookenq
VISIBLE,,RUN-PERSISTENT */
/* SETTINGS FOR FRAME fMain
*/
/* BROWSE-TAB BROWSE-2 1 fMain */
ASSIGN
BROWSE-2:ALLOW-COLUMN-SEARCHING IN FRAME fMain = TRUE
BROWSE-2:COLUMN-RESIZABLE IN FRAME fMain = TRUE.
IF SESSION

THEN wibookenq:HIDDEN = yes.
/* Setting information for Queries and Browse Widgets fields */
/* Query rebuild information for BROWSE BROWSE-2
*/ /* BROWSE BROWSE-2 */
/* ************************ Control Triggers ************************ */
&Scoped-define SELF-NAME wibookenq
ON END-ERROR OF wibookenq /* Book Enquiry */
OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO:
/* This case occurs when the user presses the "Esc" key.
In a persistently run window, just ignore this. If we did not, the
application would exit. */
IF THIS-PROCEDURE

END.
ON F12 OF wibookenq /* Book Enquiry */
DO:
MESSAGE "in f12 of wibookenq" VIEW-AS ALERT-BOX.
/* this is never called */
END.
ON WINDOW-CLOSE OF wibookenq /* Book Enquiry */
DO:
/* This ADM code must be left here in order for the SmartWindow
and its descendents to terminate properly on exit. */
APPLY "CLOSE":U TO THIS-PROCEDURE.
RETURN NO-APPLY.
END.
&Scoped-define BROWSE-NAME BROWSE-2
&Scoped-define SELF-NAME BROWSE-2
ON F12 OF BROWSE-2 IN FRAME fMain
DO:
MESSAGE "in f12 of browse" VIEW-AS ALERT-BOX.
END.
&Scoped-define SELF-NAME BtnCancel
ON CHOOSE OF BtnCancel IN FRAME fMain /* Done */
DO:
RUN exitObject.
END.
&Scoped-define SELF-NAME BtnView
ON CHOOSE OF BtnView IN FRAME fMain /* View Book */
DO:
MESSAGE "In Viewbook" VIEW-AS ALERT-BOX.
END.
&UNDEFINE SELF-NAME
/* *************************** Main Block *************************** */
/* Include custom Main Block code for SmartWindows. */
{src/adm2/windowmn.i}
/* ********************** Internal Procedures *********************** */
PROCEDURE adm-create-objects :
/*------------------------------------------------------------------------------
Purpose: Create handles for all SmartObjects used in this procedure.
After SmartObjects are initialized, then SmartLinks are added.
Parameters: <none>
------------------------------------------------------------------------------*/
END PROCEDURE.
PROCEDURE disable_UI :
/*------------------------------------------------------------------------------
Purpose: DISABLE the User Interface
Parameters: <none>
Notes: Here we clean-up the user-interface by deleting
dynamic widgets we have created and/or hide
frames. This procedure is usually called when
we are ready to "clean-up" after running.
------------------------------------------------------------------------------*/
/* Delete the WINDOW we created */
IF SESSION

THEN DELETE WIDGET wibookenq.
IF THIS-PROCEDURE

END PROCEDURE.
PROCEDURE enable_UI :
/*------------------------------------------------------------------------------
Purpose: ENABLE the User Interface
Parameters: <none>
Notes: Here we display/view/enable the widgets in the
user-interface. In addition, OPEN all queries
associated with each FRAME and BROWSE.
These statements here are based on the "Other
Settings" section of the widget Property Sheets.
------------------------------------------------------------------------------*/
ENABLE BROWSE-2 BtnView BtnCancel RECT-2
WITH FRAME fMain IN WINDOW wibookenq.
{&OPEN-BROWSERS-IN-QUERY-fMain}
VIEW wibookenq.
END PROCEDURE.
PROCEDURE exitObject :
/*------------------------------------------------------------------------------
Purpose: Window-specific override of this procedure which destroys
its contents and itself.
Notes:
------------------------------------------------------------------------------*/
APPLY "CLOSE":U TO THIS-PROCEDURE.
RETURN.
END PROCEDURE.