summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui_form.pas17
-rw-r--r--src/gui/gui_memo.pas33
-rw-r--r--src/gui/gui_mru.pas12
-rw-r--r--src/gui/gui_panel.pas1
-rw-r--r--src/gui/gui_tab.pas2
5 files changed, 49 insertions, 16 deletions
diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas
index 18cd1960..b75a5638 100644
--- a/src/gui/gui_form.pas
+++ b/src/gui/gui_form.pas
@@ -55,6 +55,8 @@ type
procedure AdjustWindowStyle; override;
procedure SetWindowParameters; override;
procedure SetWindowTitle(const ATitle: string); override;
+ procedure SetHeight(const AValue: TfpgCoord); override;
+ procedure SetWidth(const AValue: TfpgCoord); override;
procedure MsgActivate(var msg: TfpgMessageRec); message FPGM_ACTIVATE;
procedure MsgDeActivate(var msg: TfpgMessageRec); message FPGM_DEACTIVATE;
procedure MsgClose(var msg: TfpgMessageRec); message FPGM_CLOSE;
@@ -66,7 +68,7 @@ type
procedure HandleResize(awidth, aheight: TfpgCoord); override;
procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override;
procedure DoOnClose(var CloseAction: TCloseAction); virtual;
-
+ // properties
property Sizeable: boolean read FSizeable write FSizeable;
property ModalResult: integer read FModalResult write FModalResult;
property FullScreen: boolean read FFullScreen write FFullScreen default False;
@@ -157,6 +159,18 @@ begin
inherited SetWindowTitle(ATitle);
end;
+procedure TfpgBaseForm.SetHeight(const AValue: TfpgCoord);
+begin
+ if Sizeable then
+ inherited SetHeight(AValue);
+end;
+
+procedure TfpgBaseForm.SetWidth(const AValue: TfpgCoord);
+begin
+ if Sizeable then
+ inherited SetWidth(AValue);
+end;
+
procedure TfpgBaseForm.MsgActivate(var msg: TfpgMessageRec);
begin
if (fpgApplication.TopModalForm = nil) or (fpgApplication.TopModalForm = self) then
@@ -239,6 +253,7 @@ begin
FMinHeight := 32;
FModalResult := 0;
FFullScreen := False;
+ FIsContainer := True;
end;
procedure TfpgBaseForm.AfterCreate;
diff --git a/src/gui/gui_memo.pas b/src/gui/gui_memo.pas
index fc4a0f86..34e4cef9 100644
--- a/src/gui/gui_memo.pas
+++ b/src/gui/gui_memo.pas
@@ -126,16 +126,27 @@ type
TfpgMemoStrings = class(TStringList)
protected
Memo: TfpgMemo;
+ procedure RefreshMemo;
public
constructor Create(AMemo: TfpgMemo); reintroduce;
destructor Destroy; override;
function Add(const s: String): Integer; override;
- procedure Delete(Index: Integer); override;
procedure Clear; override;
+ procedure Delete(Index: Integer); override;
+ procedure Insert(Index: Integer; const S: string); override;
end;
{ TfpgMemoStrings }
+procedure TfpgMemoStrings.RefreshMemo;
+begin
+ if Assigned(Memo) and (Memo.HasHandle) then
+ begin
+ Memo.Invalidate;
+ Memo.UpdateScrollBars;
+ end;
+end;
+
constructor TfpgMemoStrings.Create(AMemo: TfpgMemo);
begin
inherited Create;
@@ -151,22 +162,27 @@ end;
function TfpgMemoStrings.Add(const s: String): Integer;
begin
Result := inherited Add(s);
- if Assigned(Memo) and (Memo.HasHandle) then
- Memo.Invalidate;
+ RefreshMemo;
end;
procedure TfpgMemoStrings.Delete(Index: Integer);
begin
+// writeln('Delete''s Index = ', Index);
inherited Delete(Index);
- if Assigned(Memo) and (Memo.HasHandle) then
- Memo.Invalidate;
+ RefreshMemo;
+end;
+
+procedure TfpgMemoStrings.Insert(Index: Integer; const S: string);
+begin
+// writeln('Insert''s Index = ', Index);
+ inherited Insert(Index, S);
+ RefreshMemo;
end;
procedure TfpgMemoStrings.Clear;
begin
inherited Clear;
- if Assigned(Memo) and (Memo.HasHandle) then
- Memo.Invalidate;
+ RefreshMemo;
end;
@@ -349,7 +365,6 @@ begin
selep := FSelStartPos;
selsl := FSelEndLine;
selsp := FSelEndPos;
-
end;
for n := selsl to selel do
@@ -376,7 +391,7 @@ begin
SetLineText(selsl, ls);
end;
- for n := selsl + 1 to selel do
+ for n := selsl to selel do
FLines.Delete(n);
FCursorPos := selsp;
diff --git a/src/gui/gui_mru.pas b/src/gui/gui_mru.pas
index 1c97dc58..4e4d9e9e 100644
--- a/src/gui/gui_mru.pas
+++ b/src/gui/gui_mru.pas
@@ -32,12 +32,12 @@ type
TfpgMRU = class(TComponent)
private
FItems: TStringList;
- FMaxItems: Word;
+ FMaxItems: Integer;
FShowFullPath: boolean;
FParentMenuItem: TfpgPopupMenu;
// FIniFilePath: string;
FOnClick: TMRUClickEvent;
- procedure SetMaxItems(const AValue: Word);
+ procedure SetMaxItems(const AValue: Integer);
// procedure SetIniFilePath(const AValue: string);
procedure SetParentMenuItem(const AValue: TfpgPopupMenu);
procedure SetShowFullPath(const AValue: boolean);
@@ -56,7 +56,7 @@ type
function RemoveItem(const FileName : string) : boolean;
procedure LoadMRU;
published
- property MaxItems: Word read FMaxItems write SetMaxItems default 4;
+ property MaxItems: Integer read FMaxItems write SetMaxItems default 4;
// property IniFilePath: string read FIniFilePath write SetIniFilePath;
property ShowFullPath: boolean read FShowFullPath write SetShowFullPath default True;
property ParentMenuItem: TfpgPopupMenu read FParentMenuItem write SetParentMenuItem;
@@ -76,7 +76,7 @@ type
{ TfpgMRU }
-procedure TfpgMRU.SetMaxItems(const AValue: Word);
+procedure TfpgMRU.SetMaxItems(const AValue: Integer);
begin
if AValue <> FMaxItems then
begin
@@ -84,8 +84,8 @@ begin
FMaxItems := 1
else
begin
- if AValue > MaxInt then
- FMaxItems := High(Word) - 1
+ if AValue > High(Word) then // 65535 should be enough
+ FMaxItems := High(Word)
else
begin
FMaxItems := AValue;
diff --git a/src/gui/gui_panel.pas b/src/gui/gui_panel.pas
index 2e4280c5..fc9df44d 100644
--- a/src/gui/gui_panel.pas
+++ b/src/gui/gui_panel.pas
@@ -241,6 +241,7 @@ begin
FHeight := 80;
FFocusable := True; // otherwise children can't get focus
FBackgroundColor := Parent.BackgroundColor;
+ FIsContainer := True;
end;
{TfpgBevel}
diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas
index adda9f58..29d3c5dc 100644
--- a/src/gui/gui_tab.pas
+++ b/src/gui/gui_tab.pas
@@ -200,6 +200,7 @@ begin
FFocusable := True;
FBackgroundColor := Parent.BackgroundColor;
FTextColor := Parent.TextColor;
+ FIsContainer := True;
end;
destructor TfpgTabSheet.Destroy;
@@ -784,6 +785,7 @@ begin
FPages := TList.Create;
FWidth := 150;
FHeight := 100;
+ FIsContainer := True;
FTextColor := Parent.TextColor;
FBackgroundColor := Parent.BackgroundColor;