home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------------------
- // Object Scripting
- // Copyright (c) 1996, 1997 by Borland International, All Rights Reserved
- //
- // CONFIG.SPP: Configure Windows. Resizes and positions IDE windows as
- // they are created. Also maps keys in the default and classic keyboards
- // for buffer manipulation.
- //
- // USE: Set region values in the #defines below, and run script. The
- // following hotkeys are available:
- // Alt-n Next buffer
- // Alt-l Last buffer
- // Alt-b Buffer list
- // Alt-x Expand window
- //--------------------------------------------------------------------------
- print typeid(module());
-
- //
- // Constants for window size/position.
- //
- #define EDITOR_LEFT 1
- #define EDITOR_TOP 1
- #define EDITOR_RIGHT 7700
- #define EDITOR_BOTTOM 6000
- #define PROJECT_LEFT 7701
- #define PROJECT_TOP 1
- #define PROJECT_RIGHT 10000
- #define PROJECT_BOTTOM 6000
- #define MESSAGE_LEFT 1
- #define MESSAGE_TOP 6001
- #define MESSAGE_RIGHT 6666
- #define MESSAGE_BOTTOM 10000
- #define WATCHES_LEFT 6667
- #define WATCHES_TOP 6001
- #define WATCHES_RIGHT 10000
- #define WATCHES_BOTTOM 10000
-
- //
- // IDE imports.
- //
- import IDE;
- import editor;
- import debugger;
-
- config()
- {
- // Set region sizes.
- //
- IDE.SetRegion("Editor", EDITOR_LEFT, EDITOR_TOP, EDITOR_RIGHT,
- EDITOR_BOTTOM);
- IDE.SetRegion("Project", PROJECT_LEFT, PROJECT_TOP, PROJECT_RIGHT,
- PROJECT_BOTTOM);
- IDE.SetRegion("Message", MESSAGE_LEFT, MESSAGE_TOP, MESSAGE_RIGHT,
- MESSAGE_BOTTOM);
- IDE.SetRegion("Watches", WATCHES_LEFT, WATCHES_TOP, WATCHES_RIGHT,
- WATCHES_BOTTOM);
-
- // Other regions that are sized/positioned by this script.
- //
- //IDE.SetRegion("Breakpoints",,,,);
- //IDE.SetRegion("Processes",,,,);
- //IDE.SetRegion("Inspector",,,,);
- //IDE.SetRegion("Evaluator",,,,);
- //IDE.SetRegion("CPU",,,,);
- //IDE.SetRegion("Debugger",,,,);
-
- // Map keys for buffer manipulation.
- //
- MapKeys();
- }
-
- //
- // Expand the appropriate windows when they are created. Be sure to
- // pass first and return the previous handler's return value.
- //
- on IDE:>DoFileOpen(FileName, ToolName, prjNode)
- {
- declare ret = pass(FileName, ToolName, prjNode);
- .ExpandWindow();
- return ret;
- }
-
- on IDE:>FileNew(toolName, fileName)
- {
- declare ret = pass(toolName, fileName);
- .ExpandWindow();
- return ret;
- }
-
- on IDE:>ViewMessage(page)
- {
- declare ret = pass(page);
- .ExpandWindow();
- return ret;
- }
-
- on IDE:>ViewProject()
- {
- declare ret = pass();
- .ExpandWindow();
- return ret;
- }
-
- on IDE:>ProjectNewProject(absPrjFileName)
- {
- declare ret = pass(absPrjFileName);
- .ExpandWindow();
- return ret;
- }
-
- on IDE:>DebugInspect()
- {
- declare ret = pass();
- .ExpandWindow();
- return ret;
- }
-
- on debugger:>Inspect(symbol)
- {
- declare ret = pass(symbol);
- IDE.ExpandWindow();
- return ret;
- }
-
- on debugger:>ViewCpu(address)
- {
- declare ret = pass(address);
- IDE.ExpandWindow();
- return ret;
- }
-
- on debugger:>ViewProcess()
- {
- declare ret = pass();
- IDE.ExpandWindow();
- return ret;
- }
-
- on debugger:>ViewBreakpoint()
- {
- pass();
- IDE.ExpandWindow();
- }
-
- on debugger:>WatchCurrent()
- {
- pass();
- IDE.ExpandWindow();
- }
-
- on debugger:>ViewWatch()
- {
- pass();
- IDE.ExpandWindow();
- }
-
- //
- // Map keys in the default and classic keyboards for buffer manipulation.
- //
- MapKeys()
- {
- if (IDE.KeyboardAssignmentFile == "default.kbd" ||
- IDE.KeyboardAssignmentFile == "classic.kbd") {
-
- declare kb = IDE.KeyboardManager.GetKeyboard("Editor");
- kb.Assign("<Alt-n>", "editor.NextBuffer();");
- kb.Assign("<Alt-l>", "editor.PreviousBuffer();");
- kb.Assign("<Alt-b>", "editor.BufferList();");
- kb.Assign("<Alt-x>", "IDE.ExpandWindow();");
- }
- }
-