Changeset 15 for trunk/Forms/UFormEdit.pas
- Timestamp:
- Nov 15, 2012, 12:34:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.