home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / SCRPTEXM.PAK / EDITSIZE.SPP < prev    next >
Encoding:
Text File  |  1997-05-06  |  1.3 KB  |  54 lines

  1. //--------------------------------------------------------------------------
  2. // Object Scripting
  3. // Copyright (c) 1996, 1997 by Borland International, All Rights Reserved
  4. //
  5. // EDITSIZE.SPP: Editor Size. Allows easy customization of editor window
  6. //   size and position without changing default values in startup.spp.
  7. //
  8. // USE: Set #defines below for TOP, LEFT, BOTTOM, and RIGHT.
  9. //--------------------------------------------------------------------------
  10. print typeid(module());
  11.  
  12. //
  13. // IDE imports.
  14. //
  15. import IDE;
  16. import editor;
  17.  
  18. //
  19. // Constants for edit window size.
  20. //
  21. #define TOP      1
  22. #define LEFT     1
  23. #define BOTTOM   5800
  24. #define RIGHT    8880
  25.  
  26. ViewID;  // ID of new view.
  27.  
  28. editsize()
  29. {
  30.   IDE.SetRegion("Editor", LEFT, TOP, RIGHT, BOTTOM);
  31. }
  32.  
  33. //
  34. // Apply values set by SetRegion call every time a view is created. The
  35. // ViewCreated event does not mean the view is yet active, but ExpandWindow
  36. // (which applies the values assigned by SetRegion) works on the active
  37. // window. So expand after the first activation of each editor view.
  38. //
  39. on editor:>ViewCreated(newView)
  40. {
  41.   ViewID = newView.Identifier;
  42.   return pass(newView);
  43. }
  44.  
  45. on editor:>ViewActivated(view)
  46. {
  47.   if (ViewID == view.Identifier) {
  48.     IDE.ExpandWindow();
  49.     ViewID = NULL;
  50.   }
  51.   return pass(view);
  52. }
  53.  
  54.