Changeset 15 for trunk/Forms
- Timestamp:
- Nov 15, 2012, 12:34:33 PM (12 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormEdit.lfm
r10 r15 1 1 object FormEdit: TFormEdit 2 Left = 3 832 Left = 368 3 3 Height = 341 4 4 Top = 172 5 Width = 5 385 Width = 553 6 6 Caption = 'Edit item' 7 7 ClientHeight = 341 8 ClientWidth = 5 388 ClientWidth = 553 9 9 OnCreate = FormCreate 10 10 OnDestroy = FormDestroy 11 11 LCLVersion = '1.1' 12 12 object ButtonOk: TButton 13 Left = 4 5613 Left = 471 14 14 Height = 25 15 15 Top = 305 … … 21 21 end 22 22 object ButtonCancel: TButton 23 Left = 3 6823 Left = 383 24 24 Height = 25 25 25 Top = 305 … … 34 34 Height = 2 35 35 Top = 297 36 Width = 5 2336 Width = 538 37 37 Anchors = [akLeft, akRight, akBottom] 38 38 end 39 39 object PanelControls: TPanel 40 Left = 441 Height = 47342 Top = 443 Width = 5 3040 Left = 0 41 Height = 290 42 Top = 0 43 Width = 553 44 44 Align = alTop 45 45 Anchors = [akTop, akLeft, akRight, akBottom] 46 BorderSpacing.Around = 447 46 BevelOuter = bvNone 48 47 TabOrder = 2 -
trunk/Forms/UFormEdit.pas
r10 r15 48 48 ButtonOk: TButton; 49 49 ButtonCancel: TButton; 50 CalcEdit1: TCalcEdit; 50 51 PanelControls: TPanel; 51 52 procedure FormCreate(Sender: TObject); … … 244 245 NewControl := TDateEdit.Create(Self); 245 246 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);247 TDateEdit(NewControl).Date := SQLToDateTime(Values.Values[Name]); 248 NewControl.SetBounds(Rect.Left * W, Rect.Top * H, 249 (Rect.Right - Rect.Left) * W - TEditButton(NewControl).Button.Width, (Rect.Bottom - Rect.Top) * H); 249 250 NewControl.Show; 250 251 end else … … 252 253 NewControl := TEdit.Create(Self); 253 254 NewControl.Parent := PanelControls; 254 TEdit(NewControl).Text := TimeToStr( MySQLStrToFloat(Values.Values[Name]));255 TEdit(NewControl).Text := TimeToStr(SQLToTime(Values.Values[Name])); 255 256 NewControl.SetBounds(Rect.Left * W, Rect.Top * H, 256 257 (Rect.Right - Rect.Left) * W, (Rect.Bottom - Rect.Top) * H); … … 258 259 end else 259 260 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); 261 NewControl := TEditButton.Create(Self); 262 NewControl.Parent := PanelControls; 263 TEditButton(NewControl).Text := Values.Values[Name]; 264 FormMain.ImageList1.GetBitmap(4, TEditButton(NewControl).Glyph); 265 NewControl.SetBounds(Rect.Left * W, Rect.Top * H, 266 (Rect.Right - Rect.Left) * W - TEditButton(NewControl).Button.Width, 267 (Rect.Bottom - Rect.Top) * H); 271 268 NewControl.Show; 272 269 end;
Note:
See TracChangeset
for help on using the changeset viewer.