Changeset 19 for trunk/Forms


Ignore:
Timestamp:
Jun 14, 2011, 12:20:15 PM (13 years ago)
Author:
george
Message:
  • Added: Import existed database structure form.
Location:
trunk/Forms
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.lfm

    r13 r19  
    182182      OnExecute = AInitSystemValuesExecute
    183183    end
     184    object AImportStructure: TAction
     185      Caption = 'Import structure...'
     186      OnExecute = AImportStructureExecute
     187    end
    184188  end
    185189  object PopupMenuItem: TPopupMenu
     
    332336        Action = AInitSystemValues
    333337      end
     338      object MenuItem20: TMenuItem
     339        Action = AImportStructure
     340      end
    334341    end
    335342    object MenuItem12: TMenuItem
  • trunk/Forms/UMainForm.lrt

    r11 r19  
    1919TMAINFORM.ASETTINGS.HINT=Settings
    2020TMAINFORM.AINITSYSTEMVALUES.CAPTION=Init system values
     21TMAINFORM.AIMPORTSTRUCTURE.CAPTION=Import structure...
    2122TMAINFORM.MENUITEM13.CAPTION=Server
    2223TMAINFORM.MENUITEM11.CAPTION=View
  • trunk/Forms/UMainForm.pas

    r17 r19  
    1515
    1616  TMainForm = class(TForm)
     17  published
    1718    AConnect: TAction;
     19    AImportStructure: TAction;
    1820    AInitSystemValues: TAction;
    1921    ASettings: TAction;
     
    5052    MenuItem19: TMenuItem;
    5153    MenuItem2: TMenuItem;
     54    MenuItem20: TMenuItem;
    5255    MenuItem3: TMenuItem;
    5356    MenuItem4: TMenuItem;
     
    6669    procedure AConnectExecute(Sender: TObject);
    6770    procedure AExitExecute(Sender: TObject);
     71    procedure AImportStructureExecute(Sender: TObject);
    6872    procedure AInitSystemValuesExecute(Sender: TObject);
    6973    procedure AItemAddExecute(Sender: TObject);
     
    124128uses
    125129  UItemView, UItemEdit, UItemAdd, ULoginForm, USettingForm, UApplicationInfo,
    126   UCore;
     130  UCore, UImportStructureForm;
    127131
    128132{$R *.lfm}
     
    340344        '`Min` int NOT NULL,' +
    341345        '`Max` int NOT NULL,' +
     346        'KEY `CustomType` (`CustomType`),' +
     347        'PRIMARY KEY (`Id`)' +
     348        ') ENGINE=InnoDB  DEFAULT CHARSET=utf8');
     349    end;
     350
     351    if Tables.IndexOf(TypeFloat) = -1 then begin
     352      Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeFloat + '` ( ' +
     353        '`Id` int(11) NOT NULL AUTO_INCREMENT,' +
     354        '`CustomType` int NOT NULL,' +
     355        '`Default` float NOT NULL,' +
     356        '`Min` float NOT NULL,' +
     357        '`Max` float NOT NULL,' +
    342358        'KEY `CustomType` (`CustomType`),' +
    343359        'PRIMARY KEY (`Id`)' +
     
    555571begin
    556572  Close;
     573end;
     574
     575procedure TMainForm.AImportStructureExecute(Sender: TObject);
     576begin
     577  ImportStructureForm.ShowModal;
    557578end;
    558579
  • trunk/Forms/USettingForm.lfm

    r18 r19  
    11object SettingForm: TSettingForm
    2   Left = 355
     2  Left = 371
    33  Height = 328
    4   Top = 166
     4  Top = 138
    55  Width = 446
    66  Caption = 'Settings'
     
    4646  end
    4747  object Label2: TLabel
    48     Left = 9
     48    Left = 8
    4949    Height = 14
    5050    Top = 38
Note: See TracChangeset for help on using the changeset viewer.