summaryrefslogtreecommitdiff
path: root/src/gui/fpg_edit.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2009-10-09 13:04:58 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2009-10-09 13:04:58 +0200
commit37649f9b72fd7a011734a68331fc65a705ceeba3 (patch)
tree42ad59a79974eebd8da0532bcb4c07fec60cbb73 /src/gui/fpg_edit.pas
parentfadfba1cd838c8f0f8ac61aed2bd3586324a66f8 (diff)
downloadfpGUI-37649f9b72fd7a011734a68331fc65a705ceeba3.tar.xz
New ReadOnly property for Edit components, but not implemented yet.
So far it's just a "dummy" property that does nothing. Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
Diffstat (limited to 'src/gui/fpg_edit.pas')
-rw-r--r--src/gui/fpg_edit.pas10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/fpg_edit.pas b/src/gui/fpg_edit.pas
index 4624972b..c7e31225 100644
--- a/src/gui/fpg_edit.pas
+++ b/src/gui/fpg_edit.pas
@@ -54,6 +54,7 @@ type
FOnChange: TNotifyEvent;
FMaxLength: integer;
FSelecting: Boolean;
+ FReadOnly: Boolean;
procedure Adjust(UsePxCursorPos: boolean = false); virtual;
procedure AdjustTextOffset(UsePxCursorPos: boolean); virtual;
procedure AdjustDrawingInfo; virtual;
@@ -75,6 +76,7 @@ type
procedure DefaultPopupPaste(Sender: TObject);
procedure DefaultPopupClearAll(Sender: TObject);
procedure SetDefaultPopupMenuItemsState;
+ procedure SetReadOnly(const AValue: Boolean);
protected
FFont: TfpgFont;
FSideMargin: integer;
@@ -115,6 +117,7 @@ type
property MaxLength: Integer read FMaxLength write FMaxLength;
property PasswordMode: Boolean read FPasswordMode write SetPasswordMode default False;
property PopupMenu: TfpgPopupMenu read FPopupMenu write FPopupMenu;
+ property ReadOnly: Boolean read FReadOnly write SetReadOnly default False;
property Text: String read FText write SetText;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
public
@@ -996,6 +999,7 @@ begin
FAutoSelect := True;
FSelecting := False;
FHideSelection := True;
+ FReadOnly := False;
FSideMargin := 3;
FHeightMargin := 2;
FMaxLength := 0; // no limit
@@ -1167,6 +1171,12 @@ begin
end;
end;
+procedure TfpgBaseEdit.SetReadOnly(const AValue: Boolean);
+begin
+ if FReadOnly = AValue then exit;
+ FReadOnly := AValue;
+end;
+
function TfpgBaseEdit.GetMarginAdjustment: integer;
begin
Result := FSideMargin;