summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-09-15 15:10:54 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-09-15 15:10:54 +0000
commit1d06a785c01488d51f094b0ed663a3adcb6bd4cb (patch)
tree6e7048c660a4e4450c9186e1f002f49c9bfd9737 /src/gui
parent04a50267a8bdccd0060a98f06000e7021c0b22c5 (diff)
downloadfpGUI-1d06a785c01488d51f094b0ed663a3adcb6bd4cb.tar.xz
* Added experimental PopupMenu poperty to TfpgMemo.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui_memo.pas15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/gui_memo.pas b/src/gui/gui_memo.pas
index e4f56ccb..7774289b 100644
--- a/src/gui/gui_memo.pas
+++ b/src/gui/gui_memo.pas
@@ -29,7 +29,8 @@ uses
gfxbase,
fpgfx,
gfx_widget,
- gui_scrollbar;
+ gui_scrollbar,
+ gui_menu;
type
@@ -58,6 +59,7 @@ type
FHScrollBar: TfpgScrollBar;
FWrapping: boolean;
FLongestLineWidth: TfpgCoord;
+ FPopupMenu: TfpgPopupMenu;
function GetFontDesc: string;
procedure SetFontDesc(const AValue: string);
procedure RecalcLongestLine;
@@ -83,6 +85,7 @@ type
procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); override;
procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override;
procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override;
+ procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override;
procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override;
procedure HandleResize(dwidth, dheight: integer); override;
procedure HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); override;
@@ -102,6 +105,7 @@ type
property TabWidth: integer read FTabWidth write FTabWidth;
property Text: TfpgString read GetText write SetText;
property UseTabs: boolean read FUseTabs write FUseTabs default False;
+ property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu;
published
property BackgroundColor default clBoxColor;
property FontDesc: string read GetFontDesc write SetFontDesc;
@@ -276,7 +280,7 @@ end;
constructor TfpgMemo.Create(AOwner: TComponent);
begin
- inherited;
+ inherited Create(AOwner);
Focusable := True;
FFont := fpgGetFont('#Edit1');
FHeight := FFont.Height * 3 + 4;
@@ -1212,6 +1216,13 @@ begin
Repaint;
end;
+procedure TfpgMemo.HandleRMouseUp(x, y: integer; shiftstate: TShiftState);
+begin
+ inherited HandleRMouseUp(x, y, shiftstate);
+ if Assigned(PopupMenu) then
+ PopupMenu.ShowAt(self, x, y);
+end;
+
procedure TfpgMemo.HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState);
var
n: integer;