home *** CD-ROM | disk | FTP | other *** search
- unit GVApp;
-
- { Unit GVApp enthält die Typen TProgram und TApplication }
-
-
- interface
-
- uses Dos, Objects, Drivers, Memory, Views, GVViews, GVDialog, GVMenus;
-
- const
-
- { TApplication palette }
-
- CColor = #03#00#07#12#15#07#12#15#00#15#07#15#01#00#15#01#00#15#07#00#15#08+
- #15#00#07#08#07#07#15#00#07#07#07#15#01#00#15#01#00#15#07#00#15#08+
- #15#00#07#08#07#07#15#00#07#11#07#15#01#00#15#01#00#15#07#00#15#08+
- #15#00#07#08#07#07#15#00#07#15#07#15#01#00#15#01#00#15#07#00#15#08+
- #15#00#07#08#07#00#00#15#04#04#07#07#00#09#07#00#14#15#06#12#12#12+
- #08#00#09#00#07#15#00#15#14#14#07#07#07#08#15#15#07#02#00#00#15#07+
- #00#15#00#00#15#15#00#15#07;
-
- { Standard application commands }
-
- cmNew = 30;
- cmOpen = 31;
- cmSave = 32;
- cmSaveAs = 33;
- cmSaveAll = 34;
- cmChangeDir = 35;
- cmDosShell = 36;
- cmCloseAll = 37;
-
- { Standard application help contexts }
-
- { Note: range $FF00 - $FFFF of help contexts are reserved }
-
- hcNew = $FF01;
- hcOpen = $FF02;
- hcSave = $FF03;
- hcSaveAs = $FF04;
- hcSaveAll = $FF05;
- hcChangeDir = $FF06;
- hcDosShell = $FF07;
- hcExit = $FF08;
-
- hcUndo = $FF10;
- hcCut = $FF11;
- hcCopy = $FF12;
- hcPaste = $FF13;
- hcClear = $FF14;
-
- hcTile = $FF20;
- hcCascade = $FF21;
- hcCloseAll = $FF22;
- hcResize = $FF23;
- hcZoom = $FF24;
- hcNext = $FF25;
- hcPrev = $FF26;
- hcClose = $FF27;
-
- type
-
- { TDeskTop object }
-
- PDeskTop = ^TDeskTop;
- TDeskTop = object(TGGroup)
- Background: PBackground;
- constructor Init(var Bounds: TRect);
- constructor Load(var S: TStream);
- procedure Store(var S: TStream);
- procedure Cascade(var R: TRect);
- procedure Draw; virtual;
- procedure HandleEvent(var Event: TEvent); virtual;
- procedure InitBackground; virtual;
- procedure Tile(var R: TRect);
- procedure TileError; virtual;
- end;
-
- { TProgram object }
-
- { Palette layout }
- { 1 = TBackground }
- { 2- 9 = TMenuView/TStatusLine }
- { 10- 31 = TWindow (White) }
- { 32- 53 = TWindow (Gray) }
- { 54- 75 = TWindow (Cyan) }
- { 76-138 = TDialog }
-
- { 94 = StaticText and StaticSign }
- { 95 = Label normal text }
- { 96 = Label selected text }
- { 97 = Label normal shortcut }
- { 98 = Label selected shortcut }
- { 99 = Label normal background }
- { 100 = Label selected background }
- { 101 = Icon normal background }
- { 102 = Icon selected background }
- { 103 = Button background }
- { 104 = Button normal text }
- { 105 = Button default text }
- { 106 = Button selected text }
- { 107 = Button disabled text }
- { 108 = Button normal shortcut }
- { 109 = Button default shortcut }
- { 110 = Button selected shortcut }
- { 111 = Button border }
- { 112 = Button lines }
- { 113 = Regler frame selected }
- { 114 = Regler frame normal }
- { 115 = Regler frame disabled }
- { 116 = Regler background }
- { 117 = Cluster normal text }
- { 118 = Cluster selected text }
- { 119 = Cluster normal shortcut }
- { 120 = Cluster selected shortcut }
- { 121 = Cluster normal background }
- { 122 = Cluster selected background }
- { 123 = Cluster disabled background
- { 124 = Cluster disabled text }
- { 125 = InputLine passive }
- { 126 = InputLine active }
- { 127 = InputLine selected }
- { 128 = InputLine arrows }
- { 129 = InputLine frame }
- { 130 = InputLine text }
- { 131 = InputLine cursor }
- { 132 = Arrowfield background }
- { 133 = Arrowfield icon }
- { 134 = ListViewer background }
- { 135 = ListViewer frame }
- { 136 = ListViewer normal text }
- { 137 = ListViewer selected text }
- { 138 = ListViewer normal background }
- { 139 = ListViewer selected background }
- { 140 = InfoPane text }
- { 141 = InfoPane background }
-
- PProgram = ^TProgram;
- TProgram = object(TGGroup)
- constructor Init;
- destructor Done; virtual;
- function CanMoveFocus: Boolean;
- procedure DoneEvents; virtual;
- function ExecuteDialog (P: PDialog; Data: Pointer): Word;
- procedure GetEvent(var Event: TEvent); virtual;
- function GetPalette: PPalette; virtual;
- procedure HandleEvent(var Event: TEvent); virtual;
- procedure Idle; virtual;
- procedure InitDesktop; virtual;
- procedure InitEvents; virtual;
- procedure InitMenuBar; virtual;
- procedure InitScreen; virtual;
- procedure InitStatusLine; virtual;
- function InsertWindow(P: PWindow): PWindow;
- procedure OutOfMemory; virtual;
- procedure PutEvent(var Event: TEvent); virtual;
- procedure Run; virtual;
- function ValidView(P: PGView): PGView;
- end;
-
- { TApplication object }
-
- PApplication = ^TApplication;
- TApplication = object(TProgram)
- constructor Init;
- destructor Done; virtual;
- procedure Cascade;
- procedure DosShell;
- procedure GetTileRect(var R: TRect); virtual;
- procedure HandleEvent(var Event: TEvent); virtual;
- procedure Tile;
- procedure WriteShellMsg; virtual;
- end;
-
- { Standard menus and status lines }
-
- function StdStatusKeys(Next: PStatusItem): PStatusItem;
-
- function StdFileMenuItems(Next: PMenuItem): PMenuItem;
- function StdEditMenuItems(Next: PMenuItem): PMenuItem;
- function StdWindowMenuItems(Next: PMenuItem): PMenuItem;
-
- { GVApp registration procedure }
-
- procedure RegisterGVApp;
-
- const
-
- { language constants }
-
- lfEnglish = 1;
- lfGerman = 2;
-
- { Public variables }
-
- Application: PProgram = nil;
- Desktop: PDesktop = nil;
- MenuBar: PMenuView = nil;
- StatusLine: PStatusLine = nil;
-
- Language: Byte = lfGerman;
- Language = lfEnglish;
- Language = lfGerman;
-
- { Stream registration records }
-
- RDeskTop: TStreamRec = (
- ObjType: 46;
- VmtLink: Ofs(TypeOf(TDeskTop)^);
- Load: @TDeskTop.Load;
- Store: @TDeskTop.Store);
-
- implementation
-