Changeset 11 for trunk/Forms


Ignore:
Timestamp:
Nov 15, 2012, 6:44:18 AM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Dialog pro nastavení parametrů připojení.
Location:
trunk/Forms
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r10 r11  
    11object FormMain: TFormMain
    2   Left = 377
     2  Left = 306
    33  Height = 455
    4   Top = 138
     4  Top = 127
    55  Width = 733
    66  Caption = 'Attendance'
    7   ClientHeight = 430
     7  ClientHeight = 436
    88  ClientWidth = 733
    99  Menu = MainMenu1
     
    1616  object StatusBar1: TStatusBar
    1717    Left = 0
    18     Height = 21
    19     Top = 409
     18    Height = 20
     19    Top = 416
    2020    Width = 733
    2121    Panels = <>
     
    3939  object PageControl1: TPageControl
    4040    Left = 0
    41     Height = 383
     41    Height = 390
    4242    Top = 26
    4343    Width = 733
     
    5252    object MenuItemSystem: TMenuItem
    5353      Caption = 'System'
     54      object MenuItem3: TMenuItem
     55        Caption = 'Database'
     56        object MenuItem4: TMenuItem
     57          Action = AConnectionSettings
     58        end
     59      end
    5460      object MenuItem1: TMenuItem
    5561        Action = ASetting
     
    7379      Hint = 'Show global setting'
    7480      OnExecute = ASettingExecute
     81      ShortCut = 120
     82    end
     83    object AConnectionSettings: TAction
     84      Caption = 'Connection settings'
     85      OnExecute = AConnectionSettingsExecute
     86      ShortCut = 121
    7587    end
    7688  end
  • trunk/Forms/UFormMain.lrt

    r10 r11  
    11TFORMMAIN.CAPTION=Attendance
    22TFORMMAIN.MENUITEMSYSTEM.CAPTION=System
     3TFORMMAIN.MENUITEM3.CAPTION=Database
    34TFORMMAIN.AEXIT.CAPTION=Exit
    45TFORMMAIN.AEXIT.HINT=Close application
    56TFORMMAIN.ASETTING.CAPTION=Setting
    67TFORMMAIN.ASETTING.HINT=Show global setting
     8TFORMMAIN.ACONNECTIONSETTINGS.CAPTION=Connection settings
  • trunk/Forms/UFormMain.pas

    r10 r11  
    1414
    1515  TFormMain = class(TForm)
     16    AConnectionSettings: TAction;
    1617    ASetting: TAction;
    1718    AExit: TAction;
     
    2021    MainMenu1: TMainMenu;
    2122    MenuItem1: TMenuItem;
     23    MenuItem3: TMenuItem;
     24    MenuItem4: TMenuItem;
    2225    MenuItemSystem: TMenuItem;
    2326    MenuItem2: TMenuItem;
     
    2629    ToolBar1: TToolBar;
    2730    ToolButton1: TToolButton;
     31    procedure AConnectionSettingsExecute(Sender: TObject);
    2832    procedure AExitExecute(Sender: TObject);
    2933    procedure ASettingExecute(Sender: TObject);
     
    4751
    4852uses
    49   UCore, UFormSetting;
     53  UCore, UFormSetting, UFormConnection;
    5054
    5155{$R *.lfm}
     
    108112procedure TFormMain.AExitExecute(Sender: TObject);
    109113begin
    110   Exit;
     114  Close;
     115end;
     116
     117procedure TFormMain.AConnectionSettingsExecute(Sender: TObject);
     118begin
     119  FormConnection.LoadFromDatabase(Core.Database);
     120  if FormConnection.ShowModal = mrOk then begin
     121    FormConnection.SaveToDatabase(Core.Database);
     122    Core.Connect;
     123  end;
    111124end;
    112125
Note: See TracChangeset for help on using the changeset viewer.