Section Editor
Beta Draft
Author: (Author's Name)
Date Last Updated: (Date)
Scheduled Release: (Release Number)
Revision History
The following revisions have been made to this document:
Date: (date)
Revision: (rev-no)
Developer: (developer)
Summary of Changes: (summary)
Copyright © 2000 by Progress Software Corporation ("PSC"), 14 Oak Park, Bedford, MA 01730, and other contributors as listed below. All Rights Reserved.
The Initial Developer of the Original Code is PSC. The Original Code is Progress IDE code released to open source December 1, 2000.
The contents of this file are subject to the Possenet Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. A copy of the License is available as of the date of this notice at http://www.possenet.org/license.html
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. You should refer to the License for the specific language governing rights and limitations under the License.
Contributors
Jane Contributor, Joe Contributor
Contents
1. Overview
2. Architecture
2.1 Source File Descriptions and Program Call Structure
2.2 How the AppBuilder Runs Section Editor Functionality
2.3 Section Editor Command Calls
2.4 User Interface and Internal Structures
3. Primary Data Structures
3.1 Variables
3.2 Temp-Tables
3.2.1 Details about the _tSPECIAL and the _tOFFSET Fields
3.2.2 Details about the _SEW Temp-Table
4. Primary Algorithms and Processes
4.1 File Menu
4.2 Edit Menu
4.3 Insert Menu
4.4 Search Menu
4.5 Compile Menu
4.6 Help Menu
5. Advanced Topics
5.1 Editing the Section Editor Using the AppBuilder
5.1.1 Procedure to Delete a Persistent Version of _semain.w
5.2 Multiple Section Editor Windows
5.2.1 Section Editor Preferences
5.2.2 Shared Variable hSecEd
5.2.3 Section Editor Procedure Handle
5.2.4 Call_sew_getHandle Procedure
5.2.5 Call_sew_setHandle Procedure
5.2.6 check_UIB_current_window Procedure
5.2.7 Section Editor ENTRY Trigger
5.2.8 Design Window Focus
5.2.9 Section Editor Window Placement
5.2.10 File Close and Close Windows
6. Dependencies
7. Source Files
8. Build Process and Requirements
9. Execution Methods
10. Test Requirements and Strategies
11. Supplementary Information
12. Related Documentation
The AppBuilder’s Section Editor allows you to edit the 4GL code sections of an AppBuilder procedure file. There are three ways to access the Section Editor's functionality: menu options, mouse operations, and keyboard commands.
This section describes general architectural considerations about the Section Editor, including:
· Source file descriptions and program call structure
· AppBuilder and Section Editor functionality
· Section Editor command calls
· Section Editor startup processing
· User interface and internal structures
2.1 Source File Descriptions and Program Call Structure
Procedure file _semain.w creates the Section Editor’s main window, user interface elements, event triggers, primary data structures, and manages the events to the main window. It is a persistently run procedure and is located in the adeuib directory. It primarily calls internal procedures defined in _seprocs.i (which is included into _semain.w) from triggers it defines to respond to various user interface events. Procedure file _semain.w is an AppBuilder file; it is recommended that you edit it using the AppBuilder. Include file _seprocs.i is a freeform include file and you can edit it using a Procedure Window or the Procedure Editor.
2.2 How the AppBuilder Runs Section Editor Functionality
The AppBuilder runs Section Editor functionality through the AppBuilder’s internal procedure call_sew (defined in uibmproa.i). Procedure call_sew accepts character input parameter p_secommand, which represents the Section Editor command that the AppBuilder wants to execute. Procedure call_sew in turn runs Section Editor internal procedure SecEdWindow to execute the requested Section Editor functionality.
2.3 Section Editor Command Calls
The Section Editor’s functionality is primarily accessed using its command call interface. The Section Editor commands are character strings of the form “SE_COMMAND”. The Section Editor processes command calls through its internal procedure SecEdWindow (defined in _seprocs.i).
The following Table lists the Section Editor commands used to run Section Editor functionality.
Note: In the following Table descriptions, the acrynom SEW stands for Section Editor Window.
Table 1. Section Editor Command Calls to Procedure SecEdWindow
Command
Description
“” (Null)
Opens or changes this SEW to a specific code section.
SE_OPEN
Opens this Section Editor window.
SE_ERROR
Displays the code section of this SEW that contains a compile/syntax error.
SE_STORE
Stores the current code section of this SEW to _TRG record, regardless of what the current design window is in AppBuilder. This command is only called when closing all windows in AppBuilder, which is where AppBuilder wants to store the code of a SEW even if the AppBuilder’s current design window is different from the called one. (for example, multiple Section Editor window’s open).
SE_STORE_WIN
Stores current code section of this SEW to _TRG record when this Section Editor's design window is the current AppBuilder design window. For example, you can use this call before a design window is run or before a code preview.
SE_STORE_SELECTED
Stores the current code section of this Section Editor window to _TRG record when the current Section Editor widget is selected in the design window. This command is used for Cut, Copy, Duplicate, Delete, and Copy to File in situations where the AppBuilder wants to store the code only if its one of the selected widgets for the AppBuilder Edit command.
SE_PROPS
Updates this SEW display and publishes the "SE_UPDATE_WIDGETS" event. This call is used in cases where a widget name or label changes in AppBuilder. For example, if a design window's file name changes or a widget name changes, the AppBuilder sends this call to that design window's SEW, which then refreshes its own display, as needed.
SE_HIDE
Hides this SEW if it is currently visible. This is done anytime the AppBuilder becomes disabled. For example, the AppBuilder hides all SEW's before a design window is run. The SEW adds the prefix "SE_HIDDEN " to its title to indicate the window was visible and has been requested to hide itself. Later, when the AppBuilder issues the SE_VIEW command, the SEW checks its title for the prefix: · If the prefix is there, the SEW is made visible and the prefix is removed. · If the prefix is not there, the SEW does not make itself visible. This prevents SEW's from being made visible when they were not before any disabling of the AppBuilder.
SE_VIEW
Makes this SEW visible if it was visible before the AppBuilder was disabled.
Note: See the SE_HIDE Command in this table for additional information.
SE_ADD
Adds an object name to this SEW's widget list. Publishes the "SE_UPDATE_WIDGETS" event, too.
SE_DELETE
Deletes an object from this SEW's widget list. Changes the SEW to edit a section of the new current object is in the design window. For example, the SEW is open to a trigger for button in a design window. The user deletes the button. The AppBuilder switches to some other object as the current object makes the SE_DELETE call to the appropriate SEW. The SEW removes the button from its widget list and changes to the Triggers section for the new current widget in the design window.
SE_UNDO
Adds an object name to this SEW's widget list and publishes the "SE_UPDATE_WIDGETS" event. SE_UNDO is generated when choosing the Edit->Undo option in the AppBuilder, such as when undoing the cut or delete of an object in a design window. The undo of cut and delete are the only undo events that affect the widget list used by the Section Editor (widgets are added to the list).
SE_CLOSE
Closes this SEW. This is the same as choosing the Section->Close menu option. If the multiple SEW preference is active, the deletes the SEW persistent procedure and its widgets.
Calls Section Editor internal procedure SEClose to perform the actual close operation. For this command only, SEClose publishes the "SE_CLOSE" event. The Code References window detects this to see if it should close, too.
SE_CLOSE_SELECTED
Closes this SEW only if it is the SEW for the current AppBuilder design window. Does not delete the SEW persistent procedure, or its widgets.
For example: The AppBuilder passes this command along when a design window is switched between alternate layouts. That design window's SEW is closed by the AppBuilder.
SE_EXIT
Closes this SEW. This is the same as choosing the Section->Close menu option. This command always deletes the SEW persistent procedure and its widgets. Calls Section Editor internal procedure SEClose to perform the actual exit operation. For this command only, SEClose publishes the "SE_EXIT" event. The Code References window detects this to see if it should close, too.
2.4 User Interface and Internal Structures
The following table lists the Section Editor user interface elements and the internal program variables that represent that interface element.
Table 2. User Interface Elements and Their Program Variables
User Interface Element
Widget Type
Description
Section Editor Window
Window
h_sewin handle variable
Section
Combo Box
isection character widget variable
ON
Combo Box
se_event character widget variable
OF
Combo Box
wname character widget variable
Name
Combo Box
se_event (Procedure names and Function names)
List
Button
btn_List widget variable
New
Button
btn_New widget variable
Insert Call
Button
btn_Pcall widget variable
Rename
Button
btn_Rename widget variable
DB Required
Checkbox
db_required logical widget variable
Private
Checkbox
private_block logical widget variable
Read-Only
Text
read_only text widget variable
Edit Area
Editor
txt IN FRAME f_edit – editor widget reference
Menubar
Menu
MENU mnb_SectionEd
Popup menu
Menu
Statically defined in adecomm/dedit.i
The Section Editor uses a combination of variables, work-tables, and an editor widget as its primary data structures. These elements are discussed in this section.
The following table lists several important variables that the Section Editor defines. These variables are used throughout the Section Editor code.
Table 3. Key Variables Defined by the Section Editor
Variable Name
Data Type
Description
win_recid
Recid
Record id of the design window for which this Section Editor is open. The recid is that of an _U record.
h_sewin
Handle
Handle to Section Editor window
h_win_trig
Handle
Handle to design window for which the Section Editor is editing code.
The following table lists several important shared variables defined by AppBuilder in adeuib/sharvars.i that are used to manage the Section Editor, or that the Section Editor references in executing its behavior.
Table 4. Key Shared Variables Defined by AppBuilder (sharvars.i) for the Section Editor
Variable Name
Data Type
Description
se_section
Character
Identifies the general class, or type, of code section to which a specific code section belongs. One of the following values: _CUSTOM, _CONTROL, _PROCEDURE, _FUNCTION: · The types of _CUSTOM sections (Definitions, Main Block, and Library) are indicated by se_event. · _CONTROL value indicates the Triggers section, with se_event being the specific trigger. · _PROCEDURE and _FUNCTION values indicate Procedures and Functions sections, with se_event being the name of the specific procedure or function.
se_recid
Recid
Identifies the type of record id of the widget that owns the code section that the SEW is editing. The following details describe how the recid is determined: · If the section (se_section) is a _CONTROL (Triggers) section, then the recid is that of a _U record for most widgets. If the widget is a browse or data-object column, then the recid is that of a _BC record. · All other sections are considered under the ownership of the design window, and se_recid takes on win_recid's value (a recid of a _U record).
se_event
Character
Identifies a specific code block of a general section (se_section). The types of code blocks are determined as follows: · When the section is Triggers, its value is the event name. · When the section is Definitions, its value is _DEFINITIONS. · When the section is Main Block, its value is _MAIN-BLOCK. · When the section is Library, its value is _INCLUDED-LIBRARIES. · When the section is Procedures or Functions, its value is the procedure name or function name.
_dblclick_section_ed
Logical
Determines if a property sheet or the section editor should come up on the double click of an object.
_multiple_section_ed
Logical
Determines if multiple Section Editors will be displayed. The default value is False.
_default_function_type
Character
Determines what the default return type is when creating a new function in the Section Editor. The initial value is Character. The setting is saved to the AppBuilder section of the Environment file.
err_msg
Character
Identifies the first error message from the last compile attempt in the AppBuilder. The Section Editor displays this message, as needed.
_err_recid
Recid
Identifies the record ID of the trigger temp-table record (_TRG) that contains the trigger code that caused a syntax error when using the Compile menu options in the AppBuilder or Section Editor.
_h_cur_widg
Handle
Indicates the handle of the currently active widget.
_h_mlmgr
Handle
Indicates the Procedure handle of the Method Library Manager. See the AB Method Libraries Open Source document for more information.
_h_uib
Handle
Identifies the handle of the AppBuilder's main procedure.
_h_win
Handle
Identifies the handle of the current design window in AppBuilder.
_h_CodeRefs
Handle
Identifies the procedure handle of the Insert Code References window.
Temp-table _TRG stores all code sections for all design windows open in the AppBuilder, one _TRG record for each code section. _TRG temp-table is defined in include file triggers.i, contained in the adeuib directory.
Table 5. Fields of the _TRG Temp-Table, identifies and briefly describes most of the fields of the _TRG Temp-Table. The _tSPECIAL and _tOFFSET fields are thoroughly described separately in Table 6.
Table 5. Fields of the _TRG Temp-Table
Field Name
Data Type
Description
_tSECTION
Character
Identifies the general class or type of code section to which a specific code section belongs. Note: .See the se_section variable information in Table 3. Key Shared Variables Defined by AppBuilder (sharvars.i) for Section Editor in section 3.1Variables
_pRECID
Recid
Identifies the record id (_P) of the design window procedure owning the code section.
_wRECID
Recid
Identifies the record id (_U or _BC) of the widget that owns the code section. Note: See se_recid in Table 6. Key Shared Variables Defined by AppBuilder (sharvars.i) for the Section Editor.
_seq
--
Unused field
_tEVENT
Character
Identifies a specific code block of the general section. Note: See the se_event variable information in Table 3. Key Shared Variables Defined by AppBuilder (sharvars.i) for Section Editor in section 3.1Variables.
_tCODE
Character
Stores a section’s code block. A value of unknown (?) indicates this is a special code section and its actual value is a generated one.
_tOFFSET-END
Integer
Obsolete field. Was at one time used with _tOFFSET for locating a code section with a compile error.
_STATUS
Character
Identifies the status indicator of a code section. The default value of “NORMAL” indicates the code section is active and available for editing or code generating. A “DELETED” value indicates the section has been deleted and is not to be displayed for editing or used in generating the file.
_xRECID
Recid
Links a code section record (_TRG) to an XFTR record (_XFTR) defined for it.
_tLocation
Integer
Stores an _XFTR location id so that a code section’s XFTR’s can be organized by where in the file an XFTR is stored. Preprocessor definitions in adeuib/pre_prec.i specify the location id’s
_tTYPE
Character
Stores an AppBuilder widget type defined by the universal widget record field _U._TYPE. Examples: BUTTON, MENUBAR, QUERY
_DB-REQUIRED
Logical
Identifies a code section as to whether or not it requires a connected database to compile successfully.
_PRIVATE-BLOCK
Logical
Identifies a code section as to whether or not it is a private code block.
3.2.1 Details about the _tSPECIAL and the _tOFFSET Fields
This section discusses the
· _tSPECIAL field
· _tOFFSET field
3.2.1.1 _tSPECIAL Field and Special Handling Status
The _tSPECIAL field, a character data type, indicates whether or not a code section requires special handling by the AppBuilder or Section Editor.
3.2.1.1.1 Code Sections that Do Not Require Special Handling
Code sections that don't require special handling are those that the user can edit and for which the AppBuilder or Section Editor provides no special handling. Examples of code sections that do not require special handling include: the Definitions and Main Block sections, triggers, and user-created procedures and functions. The _tSPECIAL field has a value of unknown (?) for such code sections; any other value indicates the section does require special handling.
3.2.1.1.2 Code Sections that Do Require Special Handling
Code sections that require special handling are AppBuilder-maintained procedures, such as enable_ui and disable_ui. Each AppBuilder-maintained procedure has its own unique internal _tSPECIAL value.
For example, _ENABLE-UI is the value used to indicate that the AppBuilder and SEW handle the code section as the AppBuilder-maintained enable_ui procedure. This enables such features as Read-Only and automatic code generation for the displayed code section.
3.2.1.1.1.1. User-editable Code Sections that Require Special Handling
The following table identifies and describes code sections that require special handling, but that the user can edit.
Table 6. User-editable Code Sections that Require Special Handling
User-editable Code Sections that Require Special Handling
Description
OCX events
The _tSPECIAL values are prefixed with "OCX." and are of the form "OCX.event". For example, "OCX.click".
WebSpeed event procedures
The _tSPECIAL values are prefixed with "WEB." and are of the form "WEB.event".
Free-Form Query events Open-Query and Display-Fields
For Display-Fields, _tSPECIAL value is "_DISPLAY-FIELDS". For Open-Query, _tSPECIAL value is "_OPEN-QUERY".
3.2.1.2 _tOFFSET Field And AppBuilder Processing Details
The _tOFFSET field, an integer data type, stores the beginning offsets of a code section when a procedure file is generated (for example: check syntax, run, debug, code preview, save, and so forth).
The AppBuilder uses the offset
· To identify the code section in which a compile error occurs
· To display that section in the Section Editor, or position the cursor in the Code Preview window to show a syntax error.
The file that the AppBuilder generates is often comprised of more than just the code sections accessible to the user in the Section Editor. Therefore, as the AppBuilder writes each code section of a procedure file, it stores the section’s beginning byte offsets with respect to the generated file. If a compile error is detected during file generation, the Section Editor compares the COMPILER:FILE-OFFSET attribute with _tOFFSET field to determine if a code section contains the line with the error.
Note: See the check_store_trg and set_cursor procedures, defined in adeuib/_seprocs.i, for examples of the use of _tOFFSET, and procedure adeshar/_gen4gl.p to see how _tOFFSET’s values are calculated.
3.2.2 Details about the _SEW Temp-Table
The Section Editor defines and uses work-table _SEW (defined in _semain.w). The Section Editor creates one _SEW record to track its current design window and code section information. The following table describes the fields in _SEW.
Table 7. Key Fields of the _SEW Temp-Table
Field Name
Data Type
Description
_psection
Character
The general class or type of code section to which a specific code section belongs. See the se_section variable information in Table 3. .Key Shared Variables Defined by AppBuilder (sharvars.i) for Section Editor in section 3.1Variables.
_precid
Recid
Identifies the recid (_U or _BC) of the widget that owns the code section. See se_recid in Table 3. Key Shared Variables Defined by AppBuilder (sharvars.i) for Section Editor in section 3.1Variables.able “Key Shared Variables”.
_pevent
Character
Identifies a specific code block of the general section. See se_event in Table 3. Key Shared Variables Defined by AppBuilder (sharvars.i) for Section Editor in section 3.1Variables.
_TRG_Recid
Recid
Identifies the recid of the _TRG record for current code section of the Section Editor window.
_U_Recid
Recid
Holds same value as _precid. Not widely used.
_hwin
Handle
Identifies the window handle to this SEW's design window. See win_recid in .Table 3. .Key Shared Variables Defined by AppBuilder (sharvars.i) for Section Editor in section 3.1Variables.
4 Primary Algorithms and Processes
This section
· Describes the Section Editor menu
· Presents information about the procedure associated with each menu item.
Note: Unless otherwise noted, all procedures are defined in adeuib/_seprocs.i.
Menu Item
Procedure (File)
Print Section
PrintSection
Close Window
SEClose (INPUT "SE_CLOSE":u).
Menu Item
Procedure (File)
Undo
EditUndo (adecomm/pedit.i)
Undo All
UndoChange
Cut
EditCut (adecomm/pedit.i)
Copy
EditCopy (adecomm/pedit.i)
Paste
EditPaste (adecomm/pedit.i)
Delete Definitions / Trigger /Main Block /Procedure / Function
DeleteBlock
Format Selection Indent Unindent Comment Uncomment
Submenu access to formatting options. ApplyTAppBuilder (adecomm/pedit.i) ApplyBackTAppBuilder (adecomm/pedit.i) CommentSelection (h_Editor, YES) (ade comm/pedit.i) CommentSelection (h_Editor NO) (ade comm/pedit.i)
Menu Item
Procedure (File)
Database Fields
InsertDBFields
Event Name
InsertEventName
Procedure Call
InsertProcName
Preprocessor Name
InsertPreProcName
Query
InsertQuery
Object Name
InsertWidgetName
File Contents
insert_file ("CONTENTS":U, txt:HANDLE IN FRAME f_edit).
File Name
insert_file ("NAME":U, txt:HANDLE IN FRAME f_edit).
Menu Item
Procedure (File)
Find
FindText (adecomm/psearch.i)
Find Next
FindNext (adecomm/psearch.i)
Find Previous
FindPrev (adecomm/psearch.i)
Replace
Trigger: ON CHOOSE OF MENU-ITEM m_Replace (_semain.w). Does call ReplaceText (adecomm/psearch.i), but other coding is necessary to support Search All Sections option.
Menu Item
Procedure (File)
Check Syntax
Check Syntax
Menu It
Procedure (File)
Press F1 in Edit Area
EditHelp (adecomm/pedit.i)
Help Topics
RUN adecomm/_adehelp.p (INPUT "AB":u, INPUT "TOPICS":u, IPUT {&Section_Editor_Contents} , INPUT ?)
Section Editor Help / F1 in edit area
RUN se_help (INPUT 0). Displays Section Editor window help if no text is selected. If text is selected, displays syntax help on selection.
Messages
RUN prohelp/ _msgs.p
Recent Messages
RUN prohelp/ _rentmsg.p
5.1 Editing the Section Editor Using the AppBuilder
The file used to run the Section Editor, adeuib/_semain.w, is an AppBuilder procedure file. Progress recommends that you use the AppBuilder to edit it. If you change _semain.w, or its included procedure file adeuib/_seprocs.i, and want to test the changes, you may need to delete any persistently running version of procedure adeuib/_semain.w.
5.1.1 Procedure to Delete a Persistent Version of _semain.w
To delete the persistently running version of _semain.w, follow this procedure:
Note: You can see the persistent procedure adeshar/_mlmgr.p running during an AppBuilder session using the Procedure Object Viewer ProTool (you must turn off the Procedure Viewer's "Hide ADE Procedures" option to see the procedure).
1. Access the Procedure Object Viewer ProTool.
2. Turn off the "Hide ADE Procedures" option.
3. Select the adeuib/_semain.w entry you want to delete and choose the Delete button.
Once you delete the existing _semain.w persistent procedure, you can choose options in the AppBuilder that display the Section Editor. This should compile and persistently run the local copy of _semain.w so you can test your changes.
5.2 Multiple Section Editor Windows
This section highlights several important development issues regarding multiple Section Editor Window support.
5.2.1 Section Editor Preferences
A new _multiple_section_ed shared variable in adeuib/sharvars.i holds the logical "Display multiple Section Editors" value. The files adeuib/_getpref.p and _putpref.p were updated to read and write the value to the Windows Registry.
5.2.1.1. Many to One Section Editors
In the case where the end user has many Section Editors open and then deselects the "Display multiple Section Editors" preference, except for the design window that has focus, each design window's _P._hSecEd variable is re-pointed to the single Section Editor instance.
5.2.1.1 One to Many Section Editors
In the case where several design windows are open, all parented to a single Section Editor, each design window's _P._hSecEd variable points to that Section Editor. If the user then selects the "Display multiple Section Editors" preference, changing it to TRUE, the design window with focus continues to use the single Section Editor.
All other design window connections to the single Section Editor are broken; that is, their _P._hSecEd variable is cleared. Design Window Focus), a new Section Editor instance is created for these windows; see he information in section 5.2.8 Design Window Focus.
The key shared variable used by the AppBuilder to access the Section Editor is hSecEd and the key procedure where access to the Section Editor is achieved is call_sew in adeuib/uibmproa.i. To support multiple Section Editors, variable hSecEd points to the correct Section Editor window for whatever design window is requesting Section Editor access (e.g., "edit code") or when commands are sent to the Section Editor (e.g., "store code" or "hide"). AppBuilder sets the hSecEd value to the appropriate Section Editor procedure handle using the procedure object's _P._hSecEd field. If the value is not a valid Section Editor procedure handle, then the AppBuilder starts a Section Editor window and assigns the newly created procedure handle to the _P._hSecEd field and to the hSecEd shared variable.
5.2.3 Section Editor Procedure Handle
Each design window stores its associated Section Editor procedure handle in the _P._hSecEd field.
5.2.4 Call_sew_getHandle Procedure
Procedure call_sew_getHandle (defined in uibmproa.i) sets and returns the handle to a design window's Section Editor procedure. Starts new Section Editor windows, as needed, and sets the procedure object's Section Editor handle field _P._hSecEd and the shared hSecEd variable to the appropriate values.
5.2.5 Call_sew_setHandle Procedure
When focus enters a Section Editor window, it's important to have the AppBuilder update its internal variable hSecEd to the procedure handle of the entered window. Since hSecEd is not directly available in the Section Editor code, a procedure is needed in uibmproa.i to set the Section Editor handle variable hSecEd. This is accomplished with procedure call_se_setHandle and is defined in uibmproa.i.
5.2.6 check_UIB_current_window Procedure
Procedure check_UIB_current_window in _seprocs.i is also called when the Section Editor window is entered and when someone calls the Section Editor code to store trigger code. It is called to ensure the current design window in the AppBuilder matches the Section Editor being entered.
5.2.7 Section Editor ENTRY Trigger
The calls to AppBuilder procedures check_UIB_current_window and call_sew_setHandle come from an ENTRY trigger in the SE _semain.w code. Since _semain.w is an AppBuilder-maintained window file, the trigger is added to _semain.w using the AppBuilder. Here are the key processing points in the ENTRY trigger.
ON ENTRY OF h_sewin /* Section Editor */
DO:
DEFINE VARIABLE WinHandle AS WIDGET-HANDLE NO-UNDO.
/*Set current design window to the one for this section editor.*/
RUN check_UIB_current_window.
.
.
/*Set global setting for current section editor to this one. */
RUN call_sew_setHandle IN _h_uib (THIS-PROCEDURE:HANDLE).
/* Set se_event and se_section to their current values for this SE instance. */
.
.
END.
When changing focus from one design window to another, the shared hSecEd variable is updated to the design window's _P._hSecEd value that has focus.
5.2.9 Section Editor Window Placement
The code that handles where the Section Editor initially displays on the screen is in the SecEdWindow procedure in _seprocs.i. The result of running this code is that the Section Editor window's initial location is just below the AppBuilder main window, flush right to the screen edge.
IF SE_Created = FALSE THEN DO:
ASSIGN h_sewin:ROW = (_h_menu_win:HEIGHT+3) NO-ERROR.
ASSIGN h_sewin:COLUMN = (SESSION:WIDTH-h_sewin:WIDTH)-1 NO-ERROR.
ENABLE isection btn_list btn_pcall se_event btn_new btn_rename wname txt WITH FRAME f_edit.
END.
The problem that arises with multiple Section Editors, each using the same code above, is that they overlap each other and there is no affordance to indicate this condition. Some other rule is needed for multiple Section Editor window placement.
5.2.10 File Close and Close Windows
The File Close and Close Windows menu items re-point the hSecEd variable to the current design window's Section Editor window procedure handle, which is retrieved from the _P._hSecEd temp-table field.
If the Multiple Section Editor feature is off when the Section Editor window is closed, the Section Editor window is hidden and its persistent procedure remains running. This improves performance when the Section Editor is requested to open again because a persistent procedure doesn't have to be started again (the persistent procedure that is currently running is used). If the Multiple Section Editor feature is on when a Section Editor is closed, the Section Editor window and its persistent procedure are deleted from memory. This prevents extra Section Editor persistent procedures from being orphaned (that is, unusable).
Not Applicable
Code for this product is principally located in the ADE adeuib directory. Additionally, code is used from the adecomm and adeshar directories. See the ADE Common and Shared Routines Open Source document for detailed information about these directories.
8 Build Process and Requirements
Not Applicable
Not Applicable
10 Test Requirements and Strategies
Not Applicable
Not Applicable
This section identifies additional information available in the standard Progress documentation set and the Open Source web environment. These documents provide additional information about the Section Editor and how to modify it:
· Section Editor Online Help
· AppBuilder Developer's Guide
· AppBuilder OpenSource online documents