home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
p2demo21.exe
/
PEL
/
STARTUP.PEL
< prev
next >
Wrap
Text File
|
1995-03-20
|
8KB
|
210 lines
# $Header: P:\source\wmacros\startup.pev 1.87 20 Mar 1995 17:28:42 NOBLE $
## $Tabs:4 7$
##############################################################################
#
# Compuware Corporation
# 31440 Northwestern Highway
# Farmington Hills, Michigan 48334-2564
#
# This source code listing contains information that is
# proprietary to Compuware Corporation and may not be copied
# duplicated, translated, transmitted, stored, retrieved
# or in any manner or by any method conveyed or disclosed
# to a third party or parties without express written
# permission from Compuware Corporation.
#
#
##############################################################################
#### $Workfile: startup.pel $: System startup processing
global temp_create_new_bufwin = FALSE;
###
# The startup() function controls the overall initialization and
# customization of the Sage Professional Editor. For certain special
# applications it may be desirable to modify or replace startup() in order to
# override normal startup behavior. However, caution is advised.
#
# The recommended location for routine customizations is (a) in the
# local_setup() function in LOCAL.PEL, (b) in the PVCSEDIT.CFG config file,
# or (c) in both locations. Local_setup() provides the fastest
# initialization, and is the preferred location for customizations that
# change infrequently. Items in the configuration file execute a little more
# slowly, but are easily changed. Presently, all the customizations provided
# by setup are placed in the config file, and override local_setup(). This
# permits multiple users or projects to share a base configuration of the
# editor, yet easily allows local customizations.
#
global function startup()
{
process_background( DISABLE_FOREGROUND, function_id("do_startup") )
}
global function do_startup()
{
local menu
local tbhand
local is_visible
###
# The items contained within this function are customizable, though
# few will want to change them here:
local save_flags;
pause_on_error = 1 # DO prompt after each error
attach_event_handler( EVENT.EDITOR_RUNNING, "setup_global_keycodes" )
# this dll contains all of the default resources used by the editor.
use_resource_file(resource_dll)
optional_function( "default_status_bar" )
###
# Load the config buffer so it is available to read sections from
# without having to be repeatedly loaded and unloaded.
#
get_config_buffer()
###
# Setup GUI objects.
#
optional_function( "create_default_toolbar" ) # set up default toolbar
optional_function( "gui_menu" ) # set up default menu
optional_function( "cpe_popup_create" ) # set up default popupmenu
# the attach help call without the window handle
# causes the help file to be attached with the editor window
#
attach_help(editor_helpfile)
attach_event_handler(EVENT.HELP_INVOKED, "display_help HelpTOC")
attach_event_handler(EVENT.EXIT_EDITOR, "exit_editor")
attach_event_handler(EVENT.MOUSE_RIGHT_DOWN, "mouse_right_down")
attach_event_handler(EVENT.MOUSE_RIGHT_UP, "mouse_right_up")
attach_event_handler(EVENT.RMOUSE_DRAG, "mouse_right_drag")
attach_event_handler(EVENT.LMOUSE_DRAG, "lmouse_drag")
attach_event_handler(EVENT.MOUSE_LEFT_DOWN, "mouse_left_down")
attach_event_handler(EVENT.MOUSE_LEFT_UP, "mouse_left_up")
attach_event_handler(EVENT.RESIZE_EDITWIN, "resize_editwin")
attach_event_handler(EVENT.EDITOR_RUNNING, "editor_start")
attach_event_handler(EVENT.FILE_DROPPED, "file_dropped")
attach_event_handler(EVENT.NEW_EDIT_FILE, "new_edit_file" )
attach_event_handler(EVENT.NEW_CURNT_BUFFER, "syntax_new_buffer" )
attach_event_handler(EVENT.EMULATION_CHANGED, "delete_mapped_menu" )
attach_event_handler(EVENT.UNABLE_TO_OPEN_FILE, "catch_file_open_error" )
attach_event_handler( EVENT.FIRST_MOD, "file_access_first_mod_handler" )
attach_event_handler( EVENT.UNMOD, "file_access_unmod_handler" )
attach_event_handler( EVENT.NEW_EDIT_FILE, "file_access_file_open_handler" )
attach_event_handler( EVENT.WINDOW_CREATED, "new_window" )
attach_event_handler( EVENT.TRACKING_DONE, "create_track_window" )
###
# initialize language structure
#
optional_function("load_user_extensions");
optional_function("load_user_compilers");
optional_function("load_user_syntax_colors"); # Colors need to be loaded before styles
optional_function("load_user_styles"); # Styles need to be loaded before types so the default categories will get the right colors.
syntax_loaded["__styles"] = TRUE;
optional_function("load_user_types"); # Types need to be loaded after styles so the default categories will have the right colors.
optional_function("load_factory_default_templates");
###
# Set default_word_delimiter to what we think they want
#
default_word_delimiter = "~!@#$%^&*()+{}|:\"<>?`-=[]\\;',./";
word_delimiter = default_word_delimiter;
###
# implement hard-wired user customization:
#
optional_function( "local_setup" )
###
# decide now whether to show the toolbar or not. Before, there where
# problems where id's and things set from an emulation weren't set because
# the toolbar didn't exist yet.
#
optional_function( "toggle_toolbar", 1 )
###
# Read soft-wired configuration and state information from the config file
#
optional_function( "read_config_file" )
###
# Implement hard-wired user settings customization:
#
optional_function( "local_settings" )
###
# Kill the config buffer we loaded earlier
#
delete_config_buffer()
###
# Initialize the Xpediter+ event handlers
#
optional_function( "xpp_init" )
###
# Process command line options and create buffers for all files
# named on the command line
#
process_command_line()
###
# If no emulation mode has been defined by setup or config then
# use "cua". This may override some of the settings
# defined in local_setup or in the config file, (notably
# default_window_flags, search_flags, and calls to the
# assign_key function).
#
if ( emulation_mode == "" )
{
optional_function( "cua" )
# toggle_linenumbers( 2 )
}
###
# The Last thing we need to do is place the copyright notice on the
# status line
#
optional_function( "default_status_bar", 1 )
notify( version" - (c) 1994,1995 Compuware Corp. All Rights Reserved." );
optional_function( "restore_status_bar" )
# Due to an apparent problem between CommonView and Windows, we need to
# force an update of the MDI menu after the windows have been created
# Also need to make sure status bar and toolbar menu items are properly
# checked
optional_function( "modify_mdi_menu", mdi_mode )
optional_function( "toggle_status_bar", 1, status_bar_flags)
###
# When startup() exits, the editor will create a full-screen window,
# Next it will ensure that current_window is a non-system window
# and current_buffer is attached. (These steps are omitted if they
# have already been performed by the config file or local_setup().)
#
# Then the editor will begin processing keyboard input.
#
display_redraw()
}