home *** CD-ROM | disk | FTP | other *** search
- (***************************************
- * WG-VISION 1.0 BEISPIELPROGRAMM *
- ****************************************
- * *
- * Aufblenden eines verschieb- und *
- * skalierbaren Windows (nichtmodal) *
- * *
- ****************************************
- * (c) 1993 Dipl.Phys. Mathias Scholz *
- ***************************************)
-
- {$I COMPILER.INC}
-
- program FTest;
-
- uses WDecl,
- WEvent,
- WApp,
- WDlg;
-
- const cmNewWindow=101;
-
- type TApplication=object(TApp)
- procedure InitMenuBar; virtual;
- procedure HandleEvent; virtual;
- procedure NewWindow;
- end;
-
- PNewWindow=^TNewWindow;
- TNewWindow=object(TWindow)
- constructor Init;
- procedure SetPalette; virtual;
- end;
-
- var MyApp:TApplication;
-
-
- {Implementation TApplication}
-
- procedure TApplication.InitMenuBar;
- begin
- MainMenu('~F~enster',0);
- SubMenu('~T~estfenster',cmNewWindow,0,0,false,false);
- SubMenu('E~x~it Alt-X',cmCloseApplication,0,altX,false,false);
- end;
-
- procedure TApplication.HandleEvent;
- begin
- TProgram.HandleEvent;
- case Event.Command of
- cmNewWindow:NewWindow;
- end; {case}
- end;
-
- procedure TApplication.NewWindow;
- var Window:PNewWindow;
- begin
- Window:=New(PNewWindow, Init);
- InsertDesktop(Window);
- end;
-
- {Implementation TNewWindow}
-
- constructor TNewWindow.Init;
- var R:TRect;
- begin
- R.Assign(60,80,400,280);
- TWindow.Init(R,'Testfenster',winDouble+winPanel+winMenu+winKey);
- SetWindowAttrib(false);
- end;
-
- procedure TNewWindow.SetPalette;
- var I:integer;
- begin
- TWindow.SetPalette;
- for I:=2 to 5 do Palette[I]:=#14;
- Palette[3]:=#7;
- Palette[6]:=#1;
- Palette[7]:=#8;
- end;
-
- {Hauptprogramm}
-
- begin
- MyApp.Init('Fenster-Test');
- MyApp.Run;
- MyApp.Done;
- end.
-