home *** CD-ROM | disk | FTP | other *** search
- (***************************************
- * WG-VISION 1.0 BEISPIELPROGRAMM *
- ****************************************
- * *
- * Anzeige des Tastaturstatus in der *
- * Statuszeile des Desktop *
- * *
- ****************************************
- * (c) 1993 Dipl.Phys. Mathias Scholz *
- ***************************************)
-
- {$I COMPILER.INC}
-
- program StatusB;
-
- uses WApp,
- WDecl,
- WDlg,
- WDriver,
- WUtils,
- WEvent,
- Graph;
-
-
- const cmNewWindow = 103;
-
- type TApplication=object(TApp)
- procedure InitMenuBar; virtual;
- procedure HandleEvent; virtual;
- procedure StatusBar; virtual;
- procedure NewWindow;
- end;
-
- var MyApp:TApplication;
-
-
- {Implementation TApplication}
-
- procedure TApplication.InitMenuBar;
- begin
- MainMenu('~F~enster',0);
- SubMenu('~F~enster aufblenden',cmNewWindow,0,0,false,false);
- SubMenu('E~x~it Alt-X',cmCloseApplication,0,altX,false,false);
- end;
-
- procedure TApplication.HandleEvent;
- var I:integer;
-
- procedure HandleStatusBar;
- begin
- if Keyb.CapsLock and (GetPixel(254,GetMaxY-16)=LightGray) then
- begin
- Mouse.HideMouse;
- FBar(250,GetMaxY-18,258,GetMaxY-12,LightCyan);
- Mouse.ShowMouse;
- end;
- if not (Keyb.CapsLock) and (GetPixel(254,GetMaxY-16)=LightCyan) then
- begin
- Mouse.HideMouse;
- FBar(250,GetMaxY-18,258,GetMaxY-12,LightGray);
- Mouse.ShowMouse;
- end;
- if Keyb.NumLock and (GetPixel(350,GetMaxY-16)=LightGray) then
- begin
- Mouse.HideMouse;
- FBar(346,GetMaxY-18,354,GetMaxY-12,LightCyan);
- Mouse.ShowMouse;
- end;
- if not (Keyb.NumLock) and (GetPixel(350,GetMaxY-16)=LightCyan) then
- begin
- Mouse.HideMouse;
- FBar(346,GetMaxY-18,354,GetMaxY-12,LightGray);
- Mouse.ShowMouse;
- end;
- if Keyb.ScrollLock and (GetPixel(470,GetMaxY-16)=LightGray) then
- begin
- Mouse.HideMouse;
- FBar(466,GetMaxY-18,474,GetMaxY-12,LightCyan);
- Mouse.ShowMouse;
- end;
- if not (Keyb.ScrollLock) and (GetPixel(470,GetMaxY-16)=LightCyan) then
- begin
- Mouse.HideMouse;
- FBar(466,GetMaxY-18,474,GetMaxY-12,LightGray);
- Mouse.ShowMouse;
- end;
- if Keyb.LShiftKey and (GetPixel(547,GetMaxY-16)=LightGray) then
- begin
- Mouse.HideMouse;
- FBar(544,GetMaxY-18,551,GetMaxY-12,LightCyan);
- Mouse.ShowMouse;
- end;
- if not (Keyb.LShiftKey) and (GetPixel(547,GetMaxY-16)=LightCyan) then
- begin
- Mouse.HideMouse;
- FBar(544,GetMaxY-18,551,GetMaxY-12,LightGray);
- Mouse.ShowMouse;
- end;
- if Keyb.RShiftKey and (GetPixel(561,GetMaxY-16)=LightGray) then
- begin
- Mouse.HideMouse;
- FBar(559,GetMaxY-18,566,GetMaxY-12,LightCyan);
- Mouse.ShowMouse;
- end;
- if not (Keyb.RShiftKey) and (GetPixel(561,GetMaxY-16)=LightCyan) then
- begin
- Mouse.HideMouse;
- FBar(559,GetMaxY-18,566,GetMaxY-12,LightGray);
- Mouse.ShowMouse;
- end;
- end;
-
- {------}
-
- begin
- TProgram.HandleEvent;
- HandleStatusBar;
- case Event.Command of
- cmNewWindow : NewWindow;
- end; {case}
- end;
-
- procedure TApplication.NewWindow;
- var R:TRect;
- Window:PWindow;
- begin
- R.Assign(60,80,440,280);
- Window:=New(PWindow, Init(R,'Beispiel',winDouble+winPanel+winMenu+winKey));
- InsertDesktop(Window);
- end;
-
- procedure TApplication.StatusBar;
- var I:integer;
- begin
- FBar(4,GetMaxY-26,GetMaxX-4,GetMaxY-4,LightGray);
- D3Frame(6,GetMaxY-24,GetMaxX-6,GetMaxY-6,Black,White);
- SetColor(Red);
- OutTextXY(15,GetMaxY-18,'Tataturstatus');
- SetColor(Black);
- OutTextXY(15,GetMaxY-18,' Caps Lock Num Lock Scroll Lock Shift');
- D3Frame(249,GetMaxY-19,259,GetMaxY-11,Black,White);
- D3Frame(345,GetMaxY-19,355,GetMaxY-11,Black,White);
- D3Frame(465,GetMaxY-19,475,GetMaxY-11,Black,White);
- D3Frame(543,GetMaxY-19,552,GetMaxY-11,Black,White);
- D3Frame(558,GetMaxY-19,567,GetMaxY-11,Black,White);
- end;
-
- {Hauptprogramm}
-
- begin
- MyApp.Init('Statusbar mit Tastaturstatusanzeige');
- MyApp.Run;
- MyApp.Done;
- end.
-