diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-29 11:45:32 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-29 11:45:32 +0200 |
commit | 11bc52823dca1cd5121be21d14c5eed85db6f8b6 (patch) | |
tree | 8d611fb262190c82cecb1ddb7b522225a00d022c /docview/components/richtext | |
parent | 44e9e57ff13ca40e16fc8b73f1140b526d14482e (diff) | |
download | fpGUI-11bc52823dca1cd5121be21d14c5eed85db6f8b6.tar.xz |
richview: neatened up the CreateDefaultMenu() method.
The code is more human readable now.
Diffstat (limited to 'docview/components/richtext')
-rw-r--r-- | docview/components/richtext/RichTextView.pas | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/docview/components/richtext/RichTextView.pas b/docview/components/richtext/RichTextView.pas index 9d5f4b76..4c63f013 100644 --- a/docview/components/richtext/RichTextView.pas +++ b/docview/components/richtext/RichTextView.pas @@ -364,7 +364,7 @@ Type function LinkFromIndex( const CharIndexToFind: longint): string; - Published + published property Align; property BackgroundColor default clBoxColor; //property ParentColor; @@ -544,16 +544,20 @@ begin FDefaultMenu := TfpgPopupMenu.Create(nil); FDefaultMenu.OnShow := @DefaultMenuPopup; - FSelectAllMI := FDefaultMenu.AddMenuItem('Select &All', '', @SelectAllMIClick); + with FDefaultMenu do + begin + FSelectAllMI := AddMenuItem('Select &All', '', @SelectAllMIClick); + FCopyMI := AddMenuItem('&Copy', '', @CopyMIClick); + AddMenuItem('-', '', nil); + FRefreshMI := AddMenuItem('&Refresh', '', @RefreshMIClick); + AddMenuItem('-', '', nil); + FSmoothScrollMI := AddMenuItem('&Smooth Scrolling', '', @SmoothScrollMIClick); + FWordWrapMI := AddMenuItem('&Word Wrap', '', @WordWrapMIClick); + FDebugMI := AddMenuItem('&Debug', '', @DebugMIClick); + end; + FSelectAllMI.Enabled := False; // TODO: implement me - FCopyMI := FDefaultMenu.AddMenuItem('&Copy', '', @CopyMIClick); FCopyMI.Enabled := False; // TODO: implement me - FDefaultMenu.AddMenuItem('-', '', nil); - FRefreshMI := FDefaultMenu.AddMenuItem('&Refresh', '', @RefreshMIClick); - FDefaultMenu.AddMenuItem('-', '', nil); - FSmoothScrollMI := FDefaultMenu.AddMenuItem('&Smooth Scrolling', '', @SmoothScrollMIClick); - FWordWrapMI := FDefaultMenu.AddMenuItem('&Word Wrap', '', @WordWrapMIClick); - FDebugMI := FDefaultMenu.AddMenuItem('&Debug', '', @DebugMIClick); end; Procedure TRichTextView.SelectAllMIClick( Sender: TObject ); |