Changeset 85 for trunk/Forms


Ignore:
Timestamp:
Aug 8, 2016, 12:37:58 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: ESC and ENTER keys handling in some dialogs.
Location:
trunk/Forms
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAcronym.lfm

    r69 r85  
    88  ClientWidth = 509
    99  OnClose = FormClose
    10   OnKeyUp = FormKeyUp
    1110  OnShow = FormShow
    1211  Position = poScreenCenter
     
    2625    Width = 361
    2726    Anchors = [akTop, akLeft, akRight]
    28     OnKeyUp = FormKeyUp
     27    OnKeyPress = EditMeaningKeyPress
    2928    TabOrder = 0
    3029  end
     
    4342    Width = 361
    4443    Anchors = [akTop, akLeft, akRight]
    45     OnKeyUp = FormKeyUp
     44    OnKeyPress = EditMeaningKeyPress
    4645    TabOrder = 1
    4746  end
     
    5453    Caption = 'Ok'
    5554    ModalResult = 1
    56     OnKeyUp = FormKeyUp
     55    OnKeyPress = EditMeaningKeyPress
    5756    TabOrder = 7
    5857  end
     
    6564    Caption = 'Cancel'
    6665    ModalResult = 2
    67     OnKeyUp = FormKeyUp
     66    OnKeyPress = EditMeaningKeyPress
    6867    TabOrder = 6
    6968  end
     
    8281    Width = 361
    8382    Anchors = [akTop, akLeft, akRight]
     83    OnKeyPress = EditMeaningKeyPress
    8484    ScrollBars = ssAutoBoth
    8585    TabOrder = 2
     
    101101    ItemHeight = 0
    102102    MultiSelect = True
     103    OnKeyPress = EditMeaningKeyPress
    103104    OnSelectionChange = ListBox1SelectionChange
    104105    PopupMenu = PopupMenuCategory
     
    112113    Width = 75
    113114    Action = ACategoryAdd
     115    OnKeyPress = EditMeaningKeyPress
    114116    TabOrder = 4
    115117  end
     
    120122    Width = 75
    121123    Action = ACategoryRemove
     124    OnKeyPress = EditMeaningKeyPress
    122125    TabOrder = 5
    123126  end
  • trunk/Forms/UFormAcronym.pas

    r33 r85  
    3434    procedure ACategoryAddExecute(Sender: TObject);
    3535    procedure ACategoryRemoveExecute(Sender: TObject);
     36    procedure EditMeaningKeyPress(Sender: TObject; var Key: char);
    3637    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    37     procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    3838    procedure FormShow(Sender: TObject);
    3939    procedure ListBox1SelectionChange(Sender: TObject; User: boolean);
     
    5656
    5757{ TFormAcronym }
    58 
    59 procedure TFormAcronym.FormKeyUp(Sender: TObject; var Key: Word;
    60   Shift: TShiftState);
    61 begin
    62   if Key = 13 then ButtonOk.Click;
    63   if Key = 27 then ButtonCancel.Click;
    64 end;
    6558
    6659procedure TFormAcronym.FormClose(Sender: TObject; var CloseAction: TCloseAction
     
    9487    UpdateInterface;
    9588  end;
     89end;
     90
     91procedure TFormAcronym.EditMeaningKeyPress(Sender: TObject; var Key: char);
     92begin
     93  if Ord(Key) = 13 then ButtonOk.Click;
     94  if Ord(Key) = 27 then ButtonCancel.Click;
    9695end;
    9796
  • trunk/Forms/UFormAcronyms.lfm

    r69 r85  
    22  Left = 426
    33  Height = 558
    4   Top = 184
     4  Top = 251
    55  Width = 740
    66  Caption = 'Acronyms'
     
    3939    OnData = ListViewAcronymsData
    4040    OnDblClick = ListViewAcronymsDblClick
     41    OnKeyPress = ListViewAcronymsKeyPress
    4142    OnResize = ListViewAcronymsResize
    4243    OnSelectItem = ListViewAcronymsSelectItem
  • trunk/Forms/UFormAcronyms.pas

    r51 r85  
    4040    procedure ListViewAcronymsData(Sender: TObject; Item: TListItem);
    4141    procedure ListViewAcronymsDblClick(Sender: TObject);
     42    procedure ListViewAcronymsKeyPress(Sender: TObject; var Key: char);
    4243    procedure ListViewAcronymsResize(Sender: TObject);
    4344    procedure ListViewAcronymsSelectItem(Sender: TObject; Item: TListItem;
     
    8788begin
    8889  AModify.Execute;
     90end;
     91
     92procedure TFormAcronyms.ListViewAcronymsKeyPress(Sender: TObject; var Key: char
     93  );
     94begin
     95  if Key = #27 then Close;
    8996end;
    9097
  • trunk/Forms/UFormCategories.lfm

    r69 r85  
    3333    ViewStyle = vsReport
    3434    OnData = ListViewCategoriesData
     35    OnDblClick = ListViewCategoriesDblClick
     36    OnKeyPress = ListViewCategoriesKeyPress
    3537    OnSelectItem = ListViewCategoriesSelectItem
    3638  end
  • trunk/Forms/UFormCategories.pas

    r51 r85  
    3333    procedure FormShow(Sender: TObject);
    3434    procedure ListViewCategoriesData(Sender: TObject; Item: TListItem);
     35    procedure ListViewCategoriesDblClick(Sender: TObject);
     36    procedure ListViewCategoriesKeyPress(Sender: TObject; var Key: char);
    3537    procedure ListViewCategoriesSelectItem(Sender: TObject; Item: TListItem;
    3638      Selected: Boolean);
     
    130132end;
    131133
     134procedure TFormCategories.ListViewCategoriesDblClick(Sender: TObject);
     135begin
     136  AModify.Execute;
     137end;
     138
     139procedure TFormCategories.ListViewCategoriesKeyPress(Sender: TObject;
     140  var Key: char);
     141begin
     142  if Key = #27 then Close;
     143end;
     144
    132145procedure TFormCategories.ListViewCategoriesSelectItem(Sender: TObject; Item: TListItem;
    133146  Selected: Boolean);
  • trunk/Forms/UFormImportFormats.lfm

    r69 r85  
    3131    OnData = ListView1Data
    3232    OnDblClick = ListView1DblClick
     33    OnKeyPress = ListView1KeyPress
    3334    OnSelectItem = ListView1SelectItem
    3435  end
  • trunk/Forms/UFormImportFormats.pas

    r51 r85  
    3434    procedure ListView1Data(Sender: TObject; Item: TListItem);
    3535    procedure ListView1DblClick(Sender: TObject);
     36    procedure ListView1KeyPress(Sender: TObject; var Key: char);
    3637    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
    3738      Selected: Boolean);
     
    7475begin
    7576  AModify.Execute;
     77end;
     78
     79procedure TFormImportFormats.ListView1KeyPress(Sender: TObject; var Key: char);
     80begin
     81  if Key = #27 then Close;
    7682end;
    7783
  • trunk/Forms/UFormImportSources.lfm

    r76 r85  
    8181    OnData = ListView1Data
    8282    OnDblClick = ListView1DblClick
     83    OnKeyPress = ListView1KeyPress
    8384    OnResize = ListView1Resize
    8485    OnSelectItem = ListView1SelectItem
  • trunk/Forms/UFormImportSources.pas

    r74 r85  
    5151    procedure ListView1Data(Sender: TObject; Item: TListItem);
    5252    procedure ListView1DblClick(Sender: TObject);
     53    procedure ListView1KeyPress(Sender: TObject; var Key: char);
    5354    procedure ListView1Resize(Sender: TObject);
    5455    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
     
    104105begin
    105106  AModify.Execute;
     107end;
     108
     109procedure TFormImportSources.ListView1KeyPress(Sender: TObject; var Key: char);
     110begin
     111  if Key = #27 then Close;
    106112end;
    107113
Note: See TracChangeset for help on using the changeset viewer.