Changeset 10 for trunk/Forms/UFormEdit.pas
- Timestamp:
- Nov 14, 2012, 10:12:02 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 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.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;
Note:
See TracChangeset
for help on using the changeset viewer.