Changeset 10 for trunk/Forms
- Timestamp:
- Nov 14, 2012, 10:12:02 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 4 4 heaptrclog.trc 5 5 lib 6 Dochazka
-
- Property svn:ignore
-
trunk/Forms/UFormEdit.lfm
r9 r10 39 39 object PanelControls: TPanel 40 40 Left = 4 41 Height = 28541 Height = 473 42 42 Top = 4 43 43 Width = 530 -
trunk/Forms/UFormEdit.pas
r9 r10 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Buttons, ExtCtrls, Spin, SpecializedList, SpecializedDictionary, UDataView,10 USqlDatabase;9 Buttons, ExtCtrls, Spin, ComCtrls, EditBtn, SpecializedList, 10 SpecializedDictionary, UDataView, USqlDatabase; 11 11 12 12 type 13 TControlType = (ctLabel, ctCheckBox, ctEdit, ctMemo, ctDate, ctTime, 13 TControlType = (ctLabel, ctCheckBox, ctEdit, ctMemo, ctDate, ctTime, ctDateTime, 14 14 ctComboBox, ctSpinEdit, ctReference); 15 15 … … 21 21 ControlType: TControlType; 22 22 TitlePlacement: TAlign; 23 ReferencedTable: string; 23 24 end; 24 25 … … 50 51 procedure FormCreate(Sender: TObject); 51 52 procedure FormDestroy(Sender: TObject); 53 procedure SpeedButton1Click(Sender: TObject); 52 54 private 53 55 FView: TDataViewForm; … … 68 70 69 71 uses 70 UCore ;72 UCore, UFormMain; 71 73 72 74 { TDataViewForm } … … 112 114 Values.Free; 113 115 RuntimeControls.Free; 116 end; 117 118 procedure TFormEdit.SpeedButton1Click(Sender: TObject); 119 begin 120 114 121 end; 115 122 … … 233 240 (Rect.Right - Rect.Left) * W, (Rect.Bottom - Rect.Top) * H); 234 241 NewControl.Show; 242 end else 243 if ControlType = ctDate then begin 244 NewControl := TDateEdit.Create(Self); 245 NewControl.Parent := PanelControls; 246 TDateEdit(NewControl).Date := MySQLStrToFloat(Values.Values[Name]); 247 NewControl.SetBounds(Rect.Left * W, Rect.Top * H, 248 (Rect.Right - Rect.Left) * W - 28, (Rect.Bottom - Rect.Top) * H); 249 NewControl.Show; 250 end else 251 if ControlType = ctTime then begin 252 NewControl := TEdit.Create(Self); 253 NewControl.Parent := PanelControls; 254 TEdit(NewControl).Text := TimeToStr(MySQLStrToFloat(Values.Values[Name])); 255 NewControl.SetBounds(Rect.Left * W, Rect.Top * H, 256 (Rect.Right - Rect.Left) * W, (Rect.Bottom - Rect.Top) * H); 257 NewControl.Show; 258 end else 259 if ControlType = ctReference then begin 260 NewControl := TEdit.Create(Self); 261 NewControl.Parent := PanelControls; 262 TEdit(NewControl).Text := Values.Values[Name]; 263 NewControl.SetBounds(Rect.Left * W, Rect.Top * H, 264 (Rect.Right - Rect.Left) * W - 28, (Rect.Bottom - Rect.Top) * H); 265 NewControl.Show; 266 NewControl := TBitBtn.Create(Self); 267 NewControl.Parent := PanelControls; 268 TBitBtn(NewControl).Caption := ''; 269 NewControl.SetBounds(Rect.Right * W - 28, Rect.Top * H, 24, 24); 270 FormMain.ImageList1.GetBitmap(4, TBitBtn(NewControl).Glyph); 271 NewControl.Show; 235 272 end; 236 273 end; -
trunk/Forms/UFormMain.lfm
r8 r10 5 5 Width = 733 6 6 Caption = 'Attendance' 7 ClientHeight = 43 67 ClientHeight = 430 8 8 ClientWidth = 733 9 9 Menu = MainMenu1 … … 16 16 object StatusBar1: TStatusBar 17 17 Left = 0 18 Height = 2 019 Top = 4 1618 Height = 21 19 Top = 409 20 20 Width = 733 21 21 Panels = <> … … 39 39 object PageControl1: TPageControl 40 40 Left = 0 41 Height = 3 9041 Height = 383 42 42 Top = 26 43 43 Width = 733 -
trunk/Forms/UFormMain.pas
r9 r10 67 67 STerminal = 'Terminal'; 68 68 SUser = 'User'; 69 SDate = 'Date'; 69 70 STime = 'Time'; 70 71 SOperation = 'Operation'; … … 191 192 with Items do begin 192 193 AddItem(STime, 'Time', ctDate, True, Bounds(0, 0, 1, 1)); 193 AddItem(SUser, 'User', ctReference, True, Bounds(3, 0, 1, 1)); 194 AddItem(SOperation, 'Operation', ctReference, True, Bounds(0, 1, 1, 1)); 195 AddItem(STerminal, 'Terminal', ctReference, True, Bounds(3, 1, 1, 1)); 194 with AddItem(SUser, 'User', ctReference, True, Bounds(3, 0, 1, 1)) do 195 ReferencedTable := 'User'; 196 with AddItem(SOperation, 'Operation', ctReference, True, Bounds(0, 1, 1, 1)) do 197 ReferencedTable := 'User'; 198 with AddItem(STerminal, 'Terminal', ctReference, True, Bounds(3, 1, 1, 1)) do 199 ReferencedTable := 'User'; 196 200 end; 197 201 Name := 'Passage'; … … 204 208 with NewDataView do begin 205 209 with Columns do begin 210 AddItem(SDate, 'Date', True, 80); 206 211 AddItem(SUser, 'User', True, 80); 207 212 AddItem(STimeFrom, 'TimeFrom', True, 120); … … 213 218 end; 214 219 DataViewLists.Add(NewDataView); 220 NewDataView2 := TDataViewForm.Create; 221 with NewDataView2 do begin 222 with Items do begin 223 AddItem(SUser, 'User', ctReference, True, Bounds(1, 0, 1, 1)); 224 AddItem(SDate, 'Date', ctDate, True, Bounds(3, 0, 1, 1)); 225 AddItem(STimeFrom, 'TimeFrom', ctTime, True, Bounds(1, 1, 1, 1)); 226 AddItem(STimeTo, 'TimeTo', ctTime, True, Bounds(3, 1, 1, 1)); 227 end; 228 Name := 'Attendance'; 229 Caption := SAttendance; 230 ImageIndex := 14; 231 end; 232 DataViewForms.Add(NewDataView2); 215 233 216 234 NewDataView := TDataViewList.Create;
Note:
See TracChangeset
for help on using the changeset viewer.