Changeset 40 for trunk/Forms


Ignore:
Timestamp:
Mar 9, 2012, 8:11:13 AM (13 years ago)
Author:
chronos
Message:
  • Added: Remember last password in login dialog.
  • Fixed: Some Add, Edit, View, Select dialog display.
Location:
trunk/Forms
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemAdd.pas

    r37 r40  
    124124    Panel1.Controls[I].Free;
    125125
    126   Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' +
    127     IntToStr(SelectedItemId));
     126  //Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' +
     127  //  IntToStr(SelectedItemId));
    128128
    129129  // Load column names
  • trunk/Forms/UItemList.pas

    r39 r40  
    117117  NewItemEditForm: TItemEditForm;
    118118begin
    119   if Assigned(ListView1.Selected) then begin
     119  if Assigned(ListView1.Selected) then
     120  try
    120121    NewItemEditForm := TItemEditForm.Create(nil);
    121122    NewItemEditForm.SelectedObject.Assign(SelectedObject);
    122123    NewItemEditForm.SelectedItemId := Integer(ListView1.Selected.Data);
    123124    NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name;
    124     MainForm.SetMainPanelForm(NewItemEditForm);
     125    NewItemEditForm.ShowModal;
     126  finally
     127    NewItemEditForm.Free;
    125128  end;
    126129end;
     
    130133  NewItemAddForm: TItemAddForm;
    131134begin
    132   NewItemAddForm := TItemAddForm.Create(nil);
    133   NewItemAddForm.SelectedObject.Assign(SelectedObject);
    134   NewItemAddForm.SelectedItemId := Integer(ListView1.Selected.Data);
    135   NewItemAddForm.Caption := NewItemAddForm.Caption + ' ' + SelectedObject.Name;
    136   MainForm.SetMainPanelForm(NewItemAddForm);
     135  try
     136    NewItemAddForm := TItemAddForm.Create(nil);
     137    NewItemAddForm.SelectedObject.Assign(SelectedObject);
     138    //NewItemAddForm.SelectedItemId := Integer(ListView1.Selected.Data);
     139    NewItemAddForm.Caption := NewItemAddForm.Caption + ' ' + SelectedObject.Name;
     140    NewItemAddForm.ShowModal;
     141  finally
     142    NewItemAddForm.Free;
     143  end;
    137144end;
    138145
  • trunk/Forms/UItemView.pas

    r36 r40  
    5656{$R *.lfm}
    5757
     58resourcestring
     59  SExpectedOneRow = 'Expected one row';
     60
    5861{ TItemViewForm }
    5962
     
    106109  NewItemEditForm: TItemEditForm;
    107110begin
    108   Close;
    109   NewItemEditForm := TItemEditForm.Create(nil);
    110   NewItemEditForm.SelectedObject.Assign(SelectedObject);
    111   NewItemEditForm.SelectedItemId := SelectedItemId;
    112   NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name;
    113   MainForm.SetMainPanelForm(NewItemEditForm);
     111  try
     112    NewItemEditForm := TItemEditForm.Create(nil);
     113    NewItemEditForm.SelectedObject.Assign(SelectedObject);
     114    NewItemEditForm.SelectedItemId := SelectedItemId;
     115    NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name;
     116    NewItemEditForm.ShowModal;
     117  finally
     118    NewItemEditForm.Free;
     119  end;
    114120end;
    115121
     
    156162  // Load column names
    157163
    158   if Report.Count = 1 then
     164  if Report.Count > 1 then raise Exception.Create(SExpectedOneRow);
     165  if Report.Count > 0 then
    159166  for I := 0 to Report.Columns.Count - 1 do begin
    160167    DataType := TReportColumn(Report.Columns[I]).CustomType;
  • trunk/Forms/ULoginForm.lfm

    r30 r40  
    11object LoginForm: TLoginForm
    22  Left = 312
    3   Height = 163
     3  Height = 177
    44  Top = 186
    5   Width = 433
     5  Width = 451
    66  BorderIcons = [biSystemMenu]
    77  BorderStyle = bsDialog
    88  Caption = 'Login'
    9   ClientHeight = 163
    10   ClientWidth = 433
     9  ClientHeight = 177
     10  ClientWidth = 451
    1111  OnClose = FormClose
    1212  OnShow = FormShow
     
    3131    Left = 112
    3232    Height = 25
    33     Top = 128
     33    Top = 144
    3434    Width = 75
    3535    Caption = 'Close'
    3636    ModalResult = 11
    3737    OnClick = ButtonCancelClick
    38     TabOrder = 5
     38    TabOrder = 6
    3939  end
    4040  object ButtonLogin: TButton
    4141    Left = 16
    4242    Height = 25
    43     Top = 128
     43    Top = 144
    4444    Width = 75
    4545    Caption = 'Login'
     
    4747    ModalResult = 1
    4848    OnClick = ButtonLoginClick
    49     TabOrder = 4
     49    TabOrder = 5
    5050  end
    5151  object EditUserName: TEdit
     
    8484  object Image1: TImage
    8585    Left = 272
    86     Height = 140
     86    Height = 156
    8787    Top = 12
    88     Width = 152
     88    Width = 168
    8989  end
    9090  object EditPassword: TEdit
     
    9797    TabOrder = 3
    9898  end
     99  object CheckBoxRememberPassword: TCheckBox
     100    Left = 16
     101    Height = 17
     102    Top = 121
     103    Width = 120
     104    Caption = 'Remember password'
     105    TabOrder = 4
     106  end
    99107end
  • trunk/Forms/ULoginForm.lrt

    r27 r40  
    66TLOGINFORM.LABEL3.CAPTION=Connection:
    77TLOGINFORM.BUTTONCHANGE.CAPTION=Change
     8TLOGINFORM.CHECKBOXREMEMBERPASSWORD.CAPTION=Remember password
  • trunk/Forms/ULoginForm.pas

    r30 r40  
    1717    ButtonCancel: TButton;
    1818    ButtonLogin: TButton;
     19    CheckBoxRememberPassword: TCheckBox;
    1920    ComboBoxConnection: TComboBox;
    2021    EditUserName: TEdit;
     
    5051  Core.LastProfile := ComboBoxConnection.ItemIndex;
    5152  Core.LastPassword := EditPassword.Text;
     53  Core.RememberPassword := CheckBoxRememberPassword.Checked;
    5254end;
    5355
    5456procedure TLoginForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    5557begin
    56   MainForm.PersistentForm.Save(Self);
     58  //MainForm.PersistentForm.Save(Self);
    5759end;
    5860
    5961procedure TLoginForm.FormShow(Sender: TObject);
    6062begin
    61   MainForm.PersistentForm.Load(Self);
     63  //MainForm.PersistentForm.Load(Self);
    6264  EditUserName.Text := Core.LastUserName;
    63   EditPassword.Text := '';
     65  EditPassword.Text := Core.LastPassword;
    6466  EditPassword.SetFocus;
     67  CheckBoxRememberPassword.Checked := Core.RememberPassword;
    6568  Core.Profiles.FillStrings(ComboBoxConnection.Items);
    6669  ComboBoxConnection.ItemIndex := Core.LastProfile;
  • trunk/Forms/UMainForm.lfm

    r39 r40  
    11object MainForm: TMainForm
    2   Left = 307
     2  Left = 242
    33  Height = 446
    4   Top = 126
     4  Top = 129
    55  Width = 640
    66  ActiveControl = PanelMenu
  • trunk/Forms/UMainForm.pas

    r39 r40  
    288288    Core.System.Types.Clear;
    289289    FreeAndNil(Core.Client);
     290    UpdateInterface;
    290291  end;
    291292end;
Note: See TracChangeset for help on using the changeset viewer.