summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-09-17 15:11:39 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-09-17 15:11:39 +0000
commit62315fc3d566047896a37eb6c6e721c6c8072f46 (patch)
tree2056a7a3970beea62c25d75f4aa1649e19d2f148
parent64721019859c52c10e0d2d5ad8e4ce56985088cd (diff)
downloadfpGUI-62315fc3d566047896a37eb6c6e721c6c8072f46.tar.xz
Designer: minor fix with the Grid Resolution.
* GUI: Made the PasswordMode a property of TfpgEdit.
-rw-r--r--examples/apps/uidesigner/vfdmain.pas16
-rw-r--r--src/gui/gui_edit.pas12
2 files changed, 23 insertions, 5 deletions
diff --git a/examples/apps/uidesigner/vfdmain.pas b/examples/apps/uidesigner/vfdmain.pas
index cd3413e4..28c598d3 100644
--- a/examples/apps/uidesigner/vfdmain.pas
+++ b/examples/apps/uidesigner/vfdmain.pas
@@ -39,6 +39,7 @@ type
TMainDesigner = class(TObject)
private
procedure SetEditedFileName(const Value: string);
+ procedure LoadGridResolution;
protected
FDesigners: TList;
FFile: TVFDFile;
@@ -307,8 +308,8 @@ begin
// options
SaveComponentNames := True;
- GridResolution := gINI.ReadInteger('Options', 'GridResolution', 4);
-
+ LoadGridResolution;
+
FEditedFileName := '';
end;
@@ -408,7 +409,7 @@ begin
try
if frm.ShowModal = 1 then
begin
- GridResolution := gINI.ReadInteger('Options', 'GridResolution', 4);
+ LoadGridResolution;
frmMain.mru.MaxItems := gINI.ReadInteger('Options', 'MRUFileCount', 4);
frmMain.mru.ShowFullPath := gINI.ReadBool('Options', 'ShowFullPath', True);
end;
@@ -428,5 +429,14 @@ begin
frmMain.WindowTitle := 'fpGUI Designer v' + program_version + ' - ' + s;
end;
+procedure TMainDesigner.LoadGridResolution;
+begin
+ case gINI.ReadInteger('Options', 'GridResolution', 2) of
+ 1: GridResolution := 2;
+ 2: GridResolution := 4;
+ 3: GridResolution := 8;
+ end;
+end;
+
end.
diff --git a/src/gui/gui_edit.pas b/src/gui/gui_edit.pas
index ad04f01d..41b9cddc 100644
--- a/src/gui/gui_edit.pas
+++ b/src/gui/gui_edit.pas
@@ -18,6 +18,7 @@ type
TfpgEdit = class(TfpgCustomEdit)
private
FOnChange: TNotifyEvent;
+ FPasswordMode: boolean;
FText: string;
FMaxLength: integer;
FCursorPos: integer;
@@ -31,6 +32,7 @@ type
function GetFontDesc: string;
procedure SetBackgroundColor(const AValue: TfpgColor);
procedure SetFontDesc(const AValue: string);
+ procedure SetPasswordMode(const AValue: boolean);
procedure SetText(const AValue: string);
procedure DeleteSelection;
procedure DoCopy;
@@ -45,11 +47,11 @@ type
procedure HandleMouseEnter; override;
procedure HandleMouseExit; override;
public
- PasswordMode: boolean;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function SelectionText: string;
property Font: TfpgFont read FFont;
+ property PasswordMode: boolean read FPasswordMode write SetPasswordMode;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
published
property Text: string read FText write SetText;
@@ -96,7 +98,7 @@ begin
FSelStart := FCursorPos;
FSelOffset := 0;
FDrawOffset := 0;
- PasswordMode := False;
+ FPasswordMode := False;
FOnChange := nil;
end;
@@ -155,6 +157,12 @@ begin
RePaint;
end;
+procedure TfpgEdit.SetPasswordMode(const AValue: boolean);
+begin
+ if FPasswordMode=AValue then exit;
+ FPasswordMode:=AValue;
+end;
+
procedure TfpgEdit.DeleteSelection;
begin
if FSelOffset <> 0 then