Changeset 7 for trunk/Forms
- Timestamp:
- May 9, 2015, 12:00:33 AM (10 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r6 r7 10 10 OnCreate = FormCreate 11 11 OnDestroy = FormDestroy 12 OnKeyDown = FormKeyDown 12 13 OnShow = FormShow 13 LCLVersion = '1. 3'14 LCLVersion = '1.5' 14 15 object PaintBox1: TPaintBox 15 16 Left = 0 … … 19 20 Align = alClient 20 21 OnClick = PaintBox1Click 22 OnResize = PaintBox1Resize 21 23 end 22 24 object MainMenu1: TMainMenu -
trunk/Forms/UFormMain.pas
r6 r7 29 29 procedure FormCreate(Sender: TObject); 30 30 procedure FormDestroy(Sender: TObject); 31 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 31 32 procedure FormShow(Sender: TObject); 32 33 procedure PaintBox1Click(Sender: TObject); 34 procedure PaintBox1Resize(Sender: TObject); 33 35 private 34 36 SerialText: string; 37 OriginalBounds: TRect; 38 OriginalWindowState: TWindowState; 39 ScreenBounds: TRect; 35 40 procedure SerialDeviceReceiveDataSync; 36 41 procedure SerialDeviceReceiveData(Data: TMemory); 42 procedure VideoDeviceRedraw(Sender: TObject); 43 procedure SwitchFullScreen; 37 44 public 38 45 Kernel: TKernel; … … 55 62 NewApp: TApp; 56 63 SerialDevice: TBaseSerialDevice; 57 NewScreen: TScreen;64 VideoDevice: TBaseVideoDevice; 58 65 begin 59 66 Kernel := TKernel.Create; … … 62 69 SerialDevice := TBaseSerialDevice.Create; 63 70 SerialDevice.Name := 'Serial0'; 71 SerialDevice.ClassName := 'Serial port'; 64 72 SerialDevice.OnReceiveData := SerialDeviceReceiveData; 65 73 Kernel.Devices.Add(SerialDevice); 74 75 VideoDevice := TBaseVideoDevice.Create; 76 VideoDevice.Name := 'Video0'; 77 VideoDevice.ClassName := 'Graphic card'; 78 VideoDevice.OnRedraw := VideoDeviceRedraw; 79 VideoDevice.DPI := Screen.PixelsPerInch; 80 VideoDevice.VideoMemorySize := Point(PaintBox1.Width, PaintBox1.Height);; 81 Kernel.Devices.Add(VideoDevice); 82 66 83 NewApp := TAppClock.Create; 67 84 Kernel.Apps.Add(NewApp); 68 NewScreen := TScreen.Create;69 NewScreen.Size := Point(PaintBox1.Width, PaintBox1.Height);70 NewScreen.DPI := Screen.PixelsPerInch;71 Kernel.Screens.Add(NewScreen);72 85 end; 73 86 … … 79 92 procedure TFormMain.AFullscreenExecute(Sender: TObject); 80 93 begin 81 94 SwitchFullScreen; 95 { AFullscreen.Checked := not AFullscreen.Checked; 96 if AFullscreen.Checked then begin 97 WindowState := wsFullScreen; 98 BorderStyle := bsNone; 99 end else begin 100 BorderStyle := bsSingle; 101 WindowState := wsNormal; 102 end; 103 } 82 104 end; 83 105 … … 87 109 end; 88 110 111 procedure TFormMain.SwitchFullScreen; 112 begin 113 if WindowState <> wsFullScreen then begin 114 // To full screen 115 OriginalWindowState := WindowState; 116 OriginalBounds := BoundsRect; 117 118 WindowState := wsFullScreen; 119 end else begin 120 // From full screen 121 WindowState := OriginalWindowState; 122 BoundsRect := OriginalBounds; 123 {$IFDEF MSWINDOWS} 124 BorderStyle := bsSizeable; 125 {$ENDIF} 126 if OriginalWindowState = wsMaximized then 127 WindowState := wsMaximized 128 else 129 with OriginalBounds do 130 SetBounds(Left, Top, Right - Left, Bottom - Top) ; 131 {$IFDEF LINUX} 132 BorderStyle := bsSizeable; 133 {$ENDIF} 134 end; 135 end; 136 89 137 procedure TFormMain.FormDestroy(Sender: TObject); 90 138 begin 91 139 Kernel.Free; 140 end; 141 142 procedure TFormMain.FormKeyDown(Sender: TObject; var Key: Word; 143 Shift: TShiftState); 144 begin 145 92 146 end; 93 147 … … 100 154 begin 101 155 156 end; 157 158 procedure TFormMain.PaintBox1Resize(Sender: TObject); 159 begin 102 160 end; 103 161 … … 114 172 end; 115 173 174 procedure TFormMain.VideoDeviceRedraw(Sender: TObject); 175 begin 176 177 end; 178 116 179 end. 117 180 -
trunk/Forms/UFormTerminal.lfm
r6 r7 1 1 object FormTerminal: TFormTerminal 2 Left = 3272 Left = 590 3 3 Height = 240 4 Top = 344 Top = 496 5 5 Width = 320 6 6 Caption = 'FormTerminal' 7 7 ClientHeight = 240 8 8 ClientWidth = 320 9 LCLVersion = '1. 3'9 LCLVersion = '1.5' 10 10 object Memo1: TMemo 11 11 Left = 0
Note:
See TracChangeset
for help on using the changeset viewer.