Ignore:
Timestamp:
Nov 14, 2012, 10:12:02 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Zobrazení ovládacího prvku pro určování odkazů do jiných tabulek.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        44heaptrclog.trc
        55lib
         6Dochazka
  • trunk/Forms/UFormEdit.pas

    r9 r10  
    77uses
    88  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;
    1111
    1212type
    13   TControlType = (ctLabel, ctCheckBox, ctEdit, ctMemo, ctDate, ctTime,
     13  TControlType = (ctLabel, ctCheckBox, ctEdit, ctMemo, ctDate, ctTime, ctDateTime,
    1414    ctComboBox, ctSpinEdit, ctReference);
    1515
     
    2121    ControlType: TControlType;
    2222    TitlePlacement: TAlign;
     23    ReferencedTable: string;
    2324  end;
    2425
     
    5051    procedure FormCreate(Sender: TObject);
    5152    procedure FormDestroy(Sender: TObject);
     53    procedure SpeedButton1Click(Sender: TObject);
    5254  private
    5355    FView: TDataViewForm;
     
    6870
    6971uses
    70   UCore;
     72  UCore, UFormMain;
    7173
    7274{ TDataViewForm }
     
    112114  Values.Free;
    113115  RuntimeControls.Free;
     116end;
     117
     118procedure TFormEdit.SpeedButton1Click(Sender: TObject);
     119begin
     120
    114121end;
    115122
     
    233240       (Rect.Right - Rect.Left) * W, (Rect.Bottom - Rect.Top) * H);
    234241      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;
    235272    end;
    236273  end;
Note: See TracChangeset for help on using the changeset viewer.