WordListUnit.pas 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {
  2. TIGCC IDE
  3. Copyright (C) 2000-2004 Sebastian Reichelt
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. }
  16. unit WordListUnit;
  17. interface
  18. uses
  19. SourceEditUnit,
  20. Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  21. StdCtrls, ExtCtrls;
  22. type
  23. TWordListForm = class(TForm)
  24. Button1: TButton;
  25. Button2: TButton;
  26. ColorDlg: TColorDialog;
  27. Bevel1: TBevel;
  28. Bevel2: TBevel;
  29. Button3: TButton;
  30. Button4: TButton;
  31. ListStrings: TMemo;
  32. CaseSensitiveBox: TCheckBox;
  33. procedure FormCreate(Sender: TObject);
  34. procedure FormDestroy(Sender: TObject);
  35. procedure Button1Click(Sender: TObject);
  36. procedure Button2Click(Sender: TObject);
  37. procedure FormShow(Sender: TObject);
  38. procedure FormClose(Sender: TObject; var Action: TCloseAction);
  39. procedure CaseSensitiveBoxClick(Sender: TObject);
  40. private
  41. public
  42. List: TWordList;
  43. end;
  44. var
  45. WordListForm: TWordListForm;
  46. implementation
  47. {$R *.DFM}
  48. uses
  49. StyleSelectionUnit;
  50. procedure TWordListForm.FormCreate(Sender: TObject);
  51. begin
  52. List := TWordList.Create (nil);
  53. end;
  54. procedure TWordListForm.FormDestroy(Sender: TObject);
  55. begin
  56. List.Free;
  57. end;
  58. procedure TWordListForm.Button1Click(Sender: TObject);
  59. begin
  60. ColorDlg.Color := List.Color;
  61. if ColorDlg.Execute then begin
  62. List.Color := ColorDlg.Color;
  63. List.CustomColor := True;
  64. end;
  65. end;
  66. procedure TWordListForm.Button2Click(Sender: TObject);
  67. begin
  68. with TStyleSelectionForm.Create (Self) do try
  69. CustomStyle := List.CustomStyle;
  70. Style := List.Style;
  71. if ShowModal = mrOK then begin
  72. List.CustomStyle := CustomStyle;
  73. List.Style := Style;
  74. end;
  75. finally
  76. Free;
  77. end;
  78. end;
  79. procedure TWordListForm.FormShow(Sender: TObject);
  80. begin
  81. ListStrings.Lines.Assign (List.Words);
  82. CaseSensitiveBox.Checked := List.CaseSensitive;
  83. end;
  84. procedure TWordListForm.FormClose(Sender: TObject;
  85. var Action: TCloseAction);
  86. begin
  87. List.Words.Assign (ListStrings.Lines);
  88. end;
  89. procedure TWordListForm.CaseSensitiveBoxClick(Sender: TObject);
  90. begin
  91. List.CaseSensitive := CaseSensitiveBox.Checked;
  92. end;
  93. end.