Changeset 17


Ignore:
Timestamp:
May 4, 2016, 12:12:25 PM (9 years ago)
Author:
chronos
Message:
  • Added: Separate form for viewing all acronyms in list.
Location:
trunk
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/AcronymDecoder.lpi

    r15 r17  
    9292      </Item5>
    9393    </RequiredPackages>
    94     <Units Count="8">
     94    <Units Count="9">
    9595      <Unit0>
    9696        <Filename Value="AcronymDecoder.lpr"/>
     
    9898      </Unit0>
    9999      <Unit1>
    100         <Filename Value="UFormMain.pas"/>
    101         <IsPartOfProject Value="True"/>
    102         <ComponentName Value="FormMain"/>
    103         <HasResources Value="True"/>
    104         <ResourceBaseClass Value="Form"/>
     100        <Filename Value="UAcronym.pas"/>
     101        <IsPartOfProject Value="True"/>
    105102      </Unit1>
    106103      <Unit2>
    107         <Filename Value="UAcronym.pas"/>
    108         <IsPartOfProject Value="True"/>
     104        <Filename Value="Forms\UFormCategorySelect.pas"/>
     105        <IsPartOfProject Value="True"/>
     106        <ComponentName Value="FormCategorySelect"/>
     107        <HasResources Value="True"/>
     108        <ResourceBaseClass Value="Form"/>
    109109      </Unit2>
    110110      <Unit3>
    111         <Filename Value="UFormImport.pas"/>
    112         <IsPartOfProject Value="True"/>
    113         <ComponentName Value="FormImport"/>
     111        <Filename Value="Forms\UFormCategories.pas"/>
     112        <IsPartOfProject Value="True"/>
     113        <ComponentName Value="FormCategories"/>
    114114        <HasResources Value="True"/>
    115115        <ResourceBaseClass Value="Form"/>
    116116      </Unit3>
    117117      <Unit4>
    118         <Filename Value="UFormAcronym.pas"/>
     118        <Filename Value="Forms\UFormAcronym.pas"/>
    119119        <IsPartOfProject Value="True"/>
    120120        <ComponentName Value="FormAcronym"/>
     
    123123      </Unit4>
    124124      <Unit5>
    125         <Filename Value="UFormSettings.pas"/>
    126         <IsPartOfProject Value="True"/>
    127         <ComponentName Value="FormSettings"/>
    128         <HasResources Value="True"/>
    129         <ResourceBaseClass Value="Form"/>
     125        <Filename Value="Forms\UFormImport.pas"/>
     126        <IsPartOfProject Value="True"/>
     127        <HasResources Value="True"/>
    130128      </Unit5>
    131129      <Unit6>
    132         <Filename Value="Forms\UFormCategorySelect.pas"/>
    133         <IsPartOfProject Value="True"/>
    134         <ComponentName Value="FormCategorySelect"/>
     130        <Filename Value="Forms\UFormMain.pas"/>
     131        <IsPartOfProject Value="True"/>
     132        <ComponentName Value="FormMain"/>
    135133        <HasResources Value="True"/>
    136134        <ResourceBaseClass Value="Form"/>
    137135      </Unit6>
    138136      <Unit7>
    139         <Filename Value="Forms\UFormCategories.pas"/>
    140         <IsPartOfProject Value="True"/>
    141         <ComponentName Value="FormCategories"/>
    142         <HasResources Value="True"/>
    143         <ResourceBaseClass Value="Form"/>
     137        <Filename Value="Forms\UFormSettings.pas"/>
     138        <IsPartOfProject Value="True"/>
     139        <HasResources Value="True"/>
    144140      </Unit7>
     141      <Unit8>
     142        <Filename Value="Forms\UFormAcronyms.pas"/>
     143        <IsPartOfProject Value="True"/>
     144        <ComponentName Value="FormAcronyms"/>
     145        <HasResources Value="True"/>
     146        <ResourceBaseClass Value="Form"/>
     147      </Unit8>
    145148    </Units>
    146149  </ProjectOptions>
     
    184187    </Linking>
    185188    <Other>
     189      <CompilerMessages>
     190        <IgnoredMessages idx5024="True"/>
     191      </CompilerMessages>
    186192      <CustomOptions Value="-dDEBUG"/>
    187193    </Other>
  • trunk/AcronymDecoder.lpr

    r14 r17  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UFormMain, UAcronym, synapse, UFormImport, Common, SysUtils, TemplateGenerics,
    11   UFormAcronym, CoolTranslator, UFormSettings, UFormCategorySelect,
    12 UFormCategories
     10  Forms, UAcronym, synapse, Common, SysUtils, TemplateGenerics, UFormImport,
     11  CoolTranslator, UFormCategorySelect, UFormMain, UFormAcronym, UFormSettings,
     12  UFormCategories, UFormAcronyms
    1313  { you can add units after this };
    1414
     
    3232  Application.Initialize;
    3333  Application.CreateForm(TFormMain, FormMain);
    34   Application.CreateForm(TFormImport, FormImport);
     34  Application.CreateForm(TFormCategorySelect, FormCategorySelect);
     35  Application.CreateForm(TFormCategories, FormCategories);
     36  Application.CreateForm(TFormAcronyms, FormAcronyms);
    3537  Application.CreateForm(TFormAcronym, FormAcronym);
    3638  Application.CreateForm(TFormSettings, FormSettings);
    37   Application.CreateForm(TFormCategorySelect, FormCategorySelect);
    38   Application.CreateForm(TFormCategories, FormCategories);
     39  Application.CreateForm(TFormImport, FormImport);
    3940  Application.Run;
    4041end.
  • trunk/Forms/UFormAcronym.lfm

    r16 r17  
    1010  OnKeyUp = FormKeyUp
    1111  OnShow = FormShow
    12   LCLVersion = '1.7'
     12  LCLVersion = '1.6.0.4'
    1313  object Label1: TLabel
    1414    Left = 8
    15     Height = 24
     15    Height = 20
    1616    Top = 16
    17     Width = 56
     17    Width = 43
    1818    Caption = 'Name:'
    1919    ParentColor = False
     
    2121  object EditAcronym: TEdit
    2222    Left = 136
    23     Height = 34
     23    Height = 28
    2424    Top = 15
    2525    Width = 361
     
    3030  object Label2: TLabel
    3131    Left = 8
    32     Height = 24
     32    Height = 20
    3333    Top = 49
    34     Width = 79
     34    Width = 61
    3535    Caption = 'Meaning:'
    3636    ParentColor = False
     
    3838  object EditMeaning: TEdit
    3939    Left = 136
    40     Height = 34
     40    Height = 28
    4141    Top = 49
    4242    Width = 361
     
    6969  object Label3: TLabel
    7070    Left = 8
    71     Height = 24
     71    Height = 20
    7272    Top = 88
    73     Width = 103
     73    Width = 79
    7474    Caption = 'Description:'
    7575    ParentColor = False
     
    8686  object Label4: TLabel
    8787    Left = 12
    88     Height = 24
     88    Height = 20
    8989    Top = 208
    90     Width = 96
     90    Width = 74
    9191    Caption = 'Categories:'
    9292    ParentColor = False
     
    104104    ScrollWidth = 358
    105105    TabOrder = 5
    106     TopIndex = -1
    107106  end
    108107  object Button1: TButton
  • trunk/Forms/UFormMain.lfm

    r16 r17  
    11object FormMain: TFormMain
    2   Left = 769
     2  Left = 394
    33  Height = 446
    4   Top = 342
     4  Top = 395
    55  Width = 631
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 414
     7  ClientHeight = 421
    88  ClientWidth = 631
    99  Menu = MainMenu1
     
    1313  OnDestroy = FormDestroy
    1414  OnShow = FormShow
    15   LCLVersion = '1.7'
     15  LCLVersion = '1.6.0.4'
    1616  object ListViewAcronyms: TListView
    1717    Left = 8
    18     Height = 365
     18    Height = 372
    1919    Top = 40
    2020    Width = 613
     
    4646  object EditSearch: TEdit
    4747    Left = 8
    48     Height = 34
     48    Height = 28
    4949    Top = 8
    5050    Width = 611
     
    44244424      OnExecute = AShowCategoriesExecute
    44254425    end
     4426    object AShowAcronyms: TAction
     4427      Caption = 'Acronyms'
     4428      OnExecute = AShowAcronymsExecute
     4429    end
    44264430  end
    44274431  object PersistentForm1: TPersistentForm
     
    44794483    object MenuItem20: TMenuItem
    44804484      Caption = 'View'
     4485      object MenuItem22: TMenuItem
     4486        Action = AShowAcronyms
     4487      end
    44814488      object MenuItem21: TMenuItem
    44824489        Action = AShowCategories
  • trunk/Forms/UFormMain.lrt

    r16 r17  
    1717TFORMMAIN.ASETTINGS.CAPTION=Settings
    1818TFORMMAIN.ASHOWCATEGORIES.CAPTION=Categories
     19TFORMMAIN.ASHOWACRONYMS.CAPTION=Acronyms
    1920TFORMMAIN.MENUITEM8.CAPTION=File
    2021TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent
  • trunk/Forms/UFormMain.pas

    r16 r17  
    1919    AAcronymRemove: TAction;
    2020    AAcronymRemoveAll: TAction;
     21    AShowAcronyms: TAction;
    2122    AShowCategories: TAction;
    2223    ASettings: TAction;
     
    4849    MenuItem20: TMenuItem;
    4950    MenuItem21: TMenuItem;
     51    MenuItem22: TMenuItem;
    5052    MenuItemOpenRecent: TMenuItem;
    5153    MenuItem2: TMenuItem;
     
    7577    procedure AImportExecute(Sender: TObject);
    7678    procedure ASettingsExecute(Sender: TObject);
     79    procedure AShowAcronymsExecute(Sender: TObject);
    7780    procedure AShowCategoriesExecute(Sender: TObject);
    7881    procedure AShowExecute(Sender: TObject);
     
    116119
    117120uses
    118   UFormImport, UFormAcronym, UFormSettings, UFormCategories;
     121  UFormImport, UFormAcronym, UFormSettings, UFormCategories, UFormAcronyms;
    119122
    120123resourcestring
     
    335338end;
    336339
     340procedure TFormMain.AShowAcronymsExecute(Sender: TObject);
     341begin
     342  FormAcronyms.ShowModal;
     343end;
     344
    337345procedure TFormMain.AShowCategoriesExecute(Sender: TObject);
    338346begin
  • trunk/Languages/AcronymDecoder.cs.po

    r16 r17  
    5252msgstr "Kategorie:"
    5353
     54#: tformacronyms.caption
     55msgctxt "tformacronyms.caption"
     56msgid "Acronyms"
     57msgstr "Zkratky"
     58
     59#: tformacronyms.listviewacronyms.columns[0].caption
     60#, fuzzy
     61msgctxt "tformacronyms.listviewacronyms.columns[0].caption"
     62msgid "Name"
     63msgstr "Název"
     64
     65#: tformacronyms.listviewacronyms.columns[1].caption
     66#, fuzzy
     67msgctxt "tformacronyms.listviewacronyms.columns[1].caption"
     68msgid "Description"
     69msgstr "Popis"
     70
     71#: tformacronyms.listviewacronyms.columns[2].caption
     72msgctxt "tformacronyms.listviewacronyms.columns[2].caption"
     73msgid "Categories"
     74msgstr "Kategorie"
     75
    5476#: tformcategories.aadd.caption
    5577msgctxt "tformcategories.aadd.caption"
     
    172194msgstr "Ukázat"
    173195
     196#: tformmain.ashowacronyms.caption
     197msgctxt "tformmain.ashowacronyms.caption"
     198msgid "Acronyms"
     199msgstr "Zkratky"
     200
    174201#: tformmain.ashowcategories.caption
    175202msgctxt "tformmain.ashowcategories.caption"
    176203msgid "Categories"
    177 msgstr ""
     204msgstr "Kategorie"
    178205
    179206#: tformmain.caption
     
    187214
    188215#: tformmain.listviewacronyms.columns[1].caption
     216msgctxt "tformmain.listviewacronyms.columns[1].caption"
    189217msgid "Description"
    190218msgstr "Popis"
     
    270298#: uformcategories.sremovecategory
    271299msgid "Remove category"
    272 msgstr ""
     300msgstr "Odebrat kategorii"
    273301
    274302#: uformcategories.sremovecategoryquery
    275303msgid "Do you really want to remove category?"
    276 msgstr ""
     304msgstr "Opravdu chcete odebrat kategorii?"
    277305
    278306#: uformimport.simportednewacronyms
  • trunk/Languages/AcronymDecoder.po

    r15 r17  
    4242msgstr ""
    4343
     44#: tformacronyms.caption
     45msgctxt "tformacronyms.caption"
     46msgid "Acronyms"
     47msgstr ""
     48
     49#: tformacronyms.listviewacronyms.columns[0].caption
     50msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[0].CAPTION"
     51msgid "Name"
     52msgstr ""
     53
     54#: tformacronyms.listviewacronyms.columns[1].caption
     55msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[1].CAPTION"
     56msgid "Description"
     57msgstr ""
     58
     59#: tformacronyms.listviewacronyms.columns[2].caption
     60msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[2].CAPTION"
     61msgid "Categories"
     62msgstr ""
     63
    4464#: tformcategories.aadd.caption
    4565msgctxt "TFORMCATEGORIES.AADD.CAPTION"
     
    162182msgstr ""
    163183
     184#: tformmain.ashowacronyms.caption
     185msgctxt "TFORMMAIN.ASHOWACRONYMS.CAPTION"
     186msgid "Acronyms"
     187msgstr ""
     188
    164189#: tformmain.ashowcategories.caption
    165190msgctxt "tformmain.ashowcategories.caption"
     
    177202
    178203#: tformmain.listviewacronyms.columns[1].caption
     204msgctxt "tformmain.listviewacronyms.columns[1].caption"
    179205msgid "Description"
    180206msgstr ""
  • trunk/Packages/Common/UListViewSort.pas

    r3 r17  
    7373    procedure UpdateFromListView(ListView: TListView);
    7474    function TextEntered: Boolean;
     75    function TextEnteredCount: Integer;
    7576    function TextEnteredColumn(Index: Integer): Boolean;
    7677    function GetColValue(Index: Integer): string;
     
    120121var
    121122  I: Integer;
    122   NewColumn: TGridColumn;
    123123begin
    124124  with FStringGrid1 do begin
    125     Columns.Clear;
     125    //Columns.Clear;
    126126    while Columns.Count > ListView.Columns.Count do Columns.Delete(Columns.Count - 1);
    127     while Columns.Count < ListView.Columns.Count do NewColumn := Columns.Add;
     127    while Columns.Count < ListView.Columns.Count do Columns.Add;
    128128    for I := 0 to ListView.Columns.Count - 1 do begin
    129129      Columns[I].Width := ListView.Columns[I].Width;
     
    133133
    134134function TListViewFilter.TextEntered: Boolean;
     135begin
     136  Result := TextEnteredCount > 0;
     137end;
     138
     139function TListViewFilter.TextEnteredCount: Integer;
    135140var
    136141  I: Integer;
    137142begin
    138   Result := False;
     143  Result := 0;
    139144  for I := 0 to FStringGrid1.ColCount - 1 do begin
    140145    if FStringGrid1.Cells[I, 0] <> '' then begin
    141       Result := True;
    142       Break;
     146      Inc(Result);
    143147    end;
    144148  end;
  • trunk/UAcronym.pas

    r15 r17  
    66
    77uses
    8   Classes, SysUtils, Contnrs, XMLConf, XMLRead, XMLWrite, DOM, UXMLUtils;
     8  Classes, SysUtils, Contnrs, XMLConf, XMLRead, XMLWrite, DOM, UXMLUtils,
     9  SpecializedList;
    910
    1011type
     
    9293    procedure AssignToStrings(Strings: TStrings);
    9394    procedure AssignFromStrings(Strings: TStrings);
     95    function GetString: string;
    9496  end;
    9597
     
    122124    function AddAcronym(AcronymName, MeaningName: string): TAcronymMeaning;
    123125    procedure RemoveAcronym(AcronymName, MeaningName: string);
     126    procedure AssignToList(List: TListObject);
    124127  end;
    125128
     
    403406    Add(TAcronymCategory(Strings.Objects[I]));
    404407  end;
     408end;
     409
     410function TAcronymCategories.GetString: string;
     411var
     412  I: Integer;
     413begin
     414  Result := '';
     415  for I := 0 to Count - 1 do
     416    Result := Result + TAcronymCategory(Items[I]).Name + ',';
     417  System.Delete(Result, Length(Result), 1);
    405418end;
    406419
     
    704717end;
    705718
     719procedure TAcronymDb.AssignToList(List: TListObject);
     720var
     721  I: Integer;
     722  J: Integer;
     723begin
     724  List.Clear;
     725  for I := 0 to Acronyms.Count - 1 do
     726  with TAcronym(Acronyms[I]) do begin
     727    for J := 0 to Meanings.Count - 1 do
     728    with TAcronymMeaning(Meanings[J]) do begin
     729      List.Add(TAcronymMeaning(Meanings[J]))
     730    end;
     731  end;
     732end;
     733
    706734end.
    707735
Note: See TracChangeset for help on using the changeset viewer.