home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------------------
- // Object Scripting
- // Copyright (c) 1996, 1997 by Borland International, All Rights Reserved
- //
- // EDITSIZE.SPP: Editor Size. Allows easy customization of editor window
- // size and position without changing default values in startup.spp.
- //
- // USE: Set #defines below for TOP, LEFT, BOTTOM, and RIGHT.
- //--------------------------------------------------------------------------
- print typeid(module());
-
- //
- // IDE imports.
- //
- import IDE;
- import editor;
-
- //
- // Constants for edit window size.
- //
- #define TOP 1
- #define LEFT 1
- #define BOTTOM 5800
- #define RIGHT 8880
-
- ViewID; // ID of new view.
-
- editsize()
- {
- IDE.SetRegion("Editor", LEFT, TOP, RIGHT, BOTTOM);
- }
-
- //
- // Apply values set by SetRegion call every time a view is created. The
- // ViewCreated event does not mean the view is yet active, but ExpandWindow
- // (which applies the values assigned by SetRegion) works on the active
- // window. So expand after the first activation of each editor view.
- //
- on editor:>ViewCreated(newView)
- {
- ViewID = newView.Identifier;
- return pass(newView);
- }
-
- on editor:>ViewActivated(view)
- {
- if (ViewID == view.Identifier) {
- IDE.ExpandWindow();
- ViewID = NULL;
- }
- return pass(view);
- }
-
-