Changeset 90 for trunk/Forms


Ignore:
Timestamp:
Aug 10, 2016, 11:24:45 PM (8 years ago)
Author:
chronos
Message:
  • Added: Acronym export action in menu Tools - Export. Supported formats are CSV and MediaWiki list/table.
Location:
trunk/Forms
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormImport.lfm

    r55 r90  
    99  Position = poScreenCenter
    1010  LCLVersion = '1.6.0.4'
    11   object ButtonImport: TButton
     11  object ButtonProcess: TButton
    1212    Left = 16
    1313    Height = 25
     
    1515    Width = 107
    1616    Caption = 'Process'
    17     OnClick = ButtonImportClick
     17    OnClick = ButtonProcessClick
    1818    TabOrder = 0
    1919  end
     
    2929  object ComboBoxDataFormat: TComboBox
    3030    Left = 264
    31     Height = 28
     31    Height = 34
    3232    Top = 5
    3333    Width = 140
    34     ItemHeight = 20
     34    ItemHeight = 0
    3535    ItemIndex = 0
    3636    Items.Strings = (
     
    4444  object Label1: TLabel
    4545    Left = 153
    46     Height = 20
     46    Height = 24
    4747    Top = 9
    48     Width = 84
     48    Width = 108
    4949    Caption = 'Data format:'
    5050    ParentColor = False
  • trunk/Forms/UFormImport.lrt

    r16 r90  
    11TFORMIMPORT.CAPTION=Import
    2 TFORMIMPORT.BUTTONIMPORT.CAPTION=Process
     2TFORMIMPORT.BUTTONPROCESS.CAPTION=Process
    33TFORMIMPORT.COMBOBOXDATAFORMAT.TEXT=CSV
    44TFORMIMPORT.LABEL1.CAPTION=Data format:
  • trunk/Forms/UFormImport.pas

    r86 r90  
    1515  TFormImport = class(TForm)
    1616    ButtonLoadFromFile: TButton;
    17     ButtonImport: TButton;
     17    ButtonProcess: TButton;
    1818    ComboBoxDataFormat: TComboBox;
    1919    Label1: TLabel;
    2020    Memo1: TMemo;
    2121    OpenDialog1: TOpenDialog;
    22     procedure ButtonImportClick(Sender: TObject);
     22    procedure ButtonProcessClick(Sender: TObject);
    2323    procedure ButtonLoadFromFileClick(Sender: TObject);
    2424  private
     
    4545{ TFormImport }
    4646
    47 procedure TFormImport.ButtonImportClick(Sender: TObject);
     47procedure TFormImport.ButtonProcessClick(Sender: TObject);
    4848begin
    4949  if ComboBoxDataFormat.ItemIndex = 0 then ImportCSV;
     
    5353procedure TFormImport.ButtonLoadFromFileClick(Sender: TObject);
    5454begin
     55  if ComboBoxDataFormat.ItemIndex = 0 then OpenDialog1.DefaultExt := '.csv';
     56  if ComboBoxDataFormat.ItemIndex = 1 then OpenDialog1.DefaultExt := '.txt';
    5557  if OpenDialog1.Execute then
    5658    Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
  • trunk/Forms/UFormMain.lfm

    r87 r90  
    33  Height = 446
    44  Top = 342
    5   Width = 631
     5  Width = 782
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 421
    8   ClientWidth = 631
     7  ClientHeight = 414
     8  ClientWidth = 782
    99  Menu = MainMenu1
    1010  OnClose = FormClose
     
    1717  object Panel1: TPanel
    1818    Left = 0
    19     Height = 395
     19    Height = 388
    2020    Top = 26
    21     Width = 631
     21    Width = 782
    2222    Align = alClient
    2323    BevelOuter = bvNone
    24     ClientHeight = 395
    25     ClientWidth = 631
     24    ClientHeight = 388
     25    ClientWidth = 782
    2626    TabOrder = 1
    2727    object CheckBoxExactMath: TCheckBox
    2828      Left = 8
    29       Height = 24
     29      Height = 28
    3030      Top = 3
    31       Width = 104
     31      Width = 129
    3232      Caption = 'Exact match'
    3333      OnChange = CheckBoxExactMathChange
     
    3838      Height = 30
    3939      Top = 32
    40       Width = 616
     40      Width = 767
    4141      OnChange = ListViewFilter1Change
    4242      Anchors = [akTop, akLeft, akRight]
     
    4444    object ListViewAcronyms: TListView
    4545      Left = 8
    46       Height = 323
     46      Height = 316
    4747      Top = 64
    48       Width = 616
     48      Width = 767
    4949      Anchors = [akTop, akLeft, akRight, akBottom]
    5050      Columns = <     
     
    5454        end     
    5555        item
    56           Caption = 'Description'
     56          Caption = 'Meaning'
    5757          Width = 300
    5858        end     
    5959        item
    6060          Caption = 'Categories'
    61           Width = 300
     61          Width = 347
    6262        end>
    6363      OwnerData = True
     
    7575    Height = 26
    7676    Top = 0
    77     Width = 631
     77    Width = 782
    7878    Caption = 'ToolBar1'
    7979    Images = ImageList1
     
    699699    end
    700700    object MenuItem3: TMenuItem
    701       Action = AManualImport
     701      Action = AImport
    702702    end
    703703    object MenuItem19: TMenuItem
     
    793793      OnExecute = AShowExecute
    794794    end
    795     object AManualImport: TAction
    796       Caption = 'Manual import'
    797       OnExecute = AManualImportExecute
     795    object AImport: TAction
     796      Caption = 'Import'
     797      OnExecute = AImportExecute
    798798    end
    799799    object AFileOpen: TAction
     
    866866      OnExecute = AProcessImportsExecute
    867867      ShortCut = 119
     868    end
     869    object AExport: TAction
     870      Caption = 'Export'
     871      OnExecute = AExportExecute
    868872    end
    869873  end
     
    12901294      Caption = 'Tools'
    12911295      object MenuItem17: TMenuItem
    1292         Action = AManualImport
     1296        Action = AImport
     1297      end
     1298      object MenuItem25: TMenuItem
     1299        Action = AExport
    12931300      end
    12941301      object MenuItem23: TMenuItem
     
    20022009  end
    20032010  object PopupMenuOpenRecent: TPopupMenu
    2004     left = 379
    2005     top = 136
     2011    left = 672
     2012    top = 144
    20062013  end
    20072014end
  • trunk/Forms/UFormMain.lrt

    r51 r90  
    22TFORMMAIN.CHECKBOXEXACTMATH.CAPTION=Exact match
    33TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[0].CAPTION=Name
    4 TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Description
     4TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Meaning
    55TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[2].CAPTION=Categories
    66TFORMMAIN.TOOLBAR1.CAPTION=ToolBar1
     
    99TFORMMAIN.AEXIT.CAPTION=Exit
    1010TFORMMAIN.ASHOW.CAPTION=Show
    11 TFORMMAIN.AMANUALIMPORT.CAPTION=Manual import
     11TFORMMAIN.AIMPORT.CAPTION=Import
    1212TFORMMAIN.AFILEOPEN.CAPTION=Open
    1313TFORMMAIN.AFILENEW.CAPTION=New
     
    2222TFORMMAIN.ASHOWIMPORTFORMATS.CAPTION=Import formats
    2323TFORMMAIN.APROCESSIMPORTS.CAPTION=Process imports
     24TFORMMAIN.AEXPORT.CAPTION=Export
    2425TFORMMAIN.MENUITEM8.CAPTION=File
    2526TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent
  • trunk/Forms/UFormMain.pas

    r87 r90  
    1616
    1717  TFormMain = class(TForm)
     18    AExport: TAction;
    1819    AProcessImports: TAction;
    1920    AShowImportFormats: TAction;
     
    2829    AFileNew: TAction;
    2930    AFileOpen: TAction;
    30     AManualImport: TAction;
     31    AImport: TAction;
    3132    AShow: TAction;
    3233    AExit: TAction;
     
    5758    MenuItem23: TMenuItem;
    5859    MenuItem24: TMenuItem;
     60    MenuItem25: TMenuItem;
    5961    MenuItemToolbar: TMenuItem;
    6062    MenuItem4: TMenuItem;
     
    8890    TrayIcon1: TTrayIcon;
    8991    procedure AExitExecute(Sender: TObject);
     92    procedure AExportExecute(Sender: TObject);
    9093    procedure AFileCloseExecute(Sender: TObject);
    9194    procedure AFileNewExecute(Sender: TObject);
     
    9396    procedure AFileSaveAsExecute(Sender: TObject);
    9497    procedure AFileSaveExecute(Sender: TObject);
    95     procedure AManualImportExecute(Sender: TObject);
     98    procedure AImportExecute(Sender: TObject);
    9699    procedure AProcessImportsExecute(Sender: TObject);
    97100    procedure ASettingsExecute(Sender: TObject);
     
    150153
    151154uses
    152   UFormImport, UFormSettings, UFormCategories, UFormAcronyms,
     155  UFormImport, UFormSettings, UFormCategories, UFormAcronyms, UFormExport,
    153156  UFormImportSources, UFormAbout, UFormImportFormats, UCore;
    154157
     
    199202begin
    200203  Close;
     204end;
     205
     206procedure TFormMain.AExportExecute(Sender: TObject);
     207begin
     208  FormExport.ShowModal;
    201209end;
    202210
     
    270278end;
    271279
    272 procedure TFormMain.AManualImportExecute(Sender: TObject);
     280procedure TFormMain.AImportExecute(Sender: TObject);
    273281begin
    274282  FormImport.ShowModal;
     
    421429    case Column of
    422430      0: Result := CompareString(TAcronymMeaning(Item1).Acronym.Name, TAcronymMeaning(Item2).Acronym.Name);
    423       1: Result := CompareString(TAcronymMeaning(Item1).Description, TAcronymMeaning(Item2).Description);
     431      1: Result := CompareString(TAcronymMeaning(Item1).Name, TAcronymMeaning(Item2).Name);
    424432      2: Result := CompareString(TAcronymMeaning(Item1).Categories.GetString, TAcronymMeaning(Item2).Categories.GetString);
    425433    end;
     
    543551  AFileSave.Enabled := Assigned(Core.AcronymDb) and Core.AcronymDb.Modified;
    544552  AFileSaveAs.Enabled := Assigned(Core.AcronymDb);
    545   AManualImport.Enabled := Assigned(Core.AcronymDb);
     553  AImport.Enabled := Assigned(Core.AcronymDb);
     554  AExport.Enabled := Assigned(Core.AcronymDb);
    546555  AProcessImports.Enabled := Assigned(Core.AcronymDb);
    547556  AShowCategories.Enabled := Assigned(Core.AcronymDb);
Note: See TracChangeset for help on using the changeset viewer.