summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-27 12:45:47 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-27 12:45:47 +0000
commiteb703bcee1956bcf075a64eaae2756eb7d48ed42 (patch)
tree856c1aa072a1d243c638bbff163da66bc94e4e2f /src/corelib
parent328be13f54585df2851894ef8f81358fdc27c5cb (diff)
downloadfpGUI-eb703bcee1956bcf075a64eaae2756eb7d48ed42.tar.xz
* Introduced a new property to TfpgWidget, called IsContainer for all
components that act like containers (Panel, Form, etc). This optimizes the Component Alignment calls. * All resizing calls now get routed through DoUpdateWindowPosition() so they have a more consistent execution path. * OnResize now get fired when components get resized, and not just for Forms. * HandleAlignments() is now only called when needed. * Fixed the bug where Alignment didn't work when components are resized at runtime. * Removed compiler warnings form gui_mru.pas unit. * Memo's scrollbar now gets adjusted correctly when it's text is modified via code. * Minor bug fix when deleting line in a Memo component. The 'Index out of Bounds' error still occurs though. That will be fixed shortly.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/fpgfx.pas4
-rw-r--r--src/corelib/gdi/fpgui_toolkit.lpk328
-rw-r--r--src/corelib/gdi/fpgui_toolkit.pas23
-rw-r--r--src/corelib/gfx_popupwindow.pas1
-rw-r--r--src/corelib/gfx_widget.pas101
-rw-r--r--src/corelib/gfxbase.pas34
-rw-r--r--src/corelib/x11/fpgui_toolkit.lpk328
-rw-r--r--src/corelib/x11/fpgui_toolkit.pas23
8 files changed, 800 insertions, 42 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas
index bc2fb866..13ed1eaa 100644
--- a/src/corelib/fpgfx.pas
+++ b/src/corelib/fpgfx.pas
@@ -43,10 +43,10 @@ const
TextFlagsDflt = [txtLeft, txtTop, txtEnabled];
// Used for the internal message queue
- cMessageQueueSize = 512;
+ cMessageQueueSize = 1024;
// version and name constants
- fpGUIVersion = '0.6.1';
+ fpGUIVersion = '0.6.2';
fpGUIName = 'fpGUI Toolkit';
diff --git a/src/corelib/gdi/fpgui_toolkit.lpk b/src/corelib/gdi/fpgui_toolkit.lpk
new file mode 100644
index 00000000..243f958f
--- /dev/null
+++ b/src/corelib/gdi/fpgui_toolkit.lpk
@@ -0,0 +1,328 @@
+<?xml version="1.0"?>
+<CONFIG>
+ <Package Version="3">
+ <Name Value="fpgui_toolkit"/>
+ <Author Value="Graeme Geldenhuys"/>
+ <CompilerOptions>
+ <Version Value="5"/>
+ <SearchPaths>
+ <OtherUnitFiles Value="../;../../gui/;../../gui/db/"/>
+ <UnitOutputDirectory Value="../../../lib"/>
+ </SearchPaths>
+ <Parsing>
+ <SyntaxOptions>
+ <CStyleOperator Value="False"/>
+ <AllowLabel Value="False"/>
+ <CPPInline Value="False"/>
+ </SyntaxOptions>
+ </Parsing>
+ <CodeGeneration>
+ <Generate Value="Faster"/>
+ </CodeGeneration>
+ <Other>
+ <CompilerPath Value="$(CompPath)"/>
+ </Other>
+ </CompilerOptions>
+ <Description Value="fpGUI Toolkit
+"/>
+ <License Value="Modified LGPL
+"/>
+ <Version Minor="6" Release="2"/>
+ <Files Count="70">
+ <Item1>
+ <Filename Value="../stdimages.inc"/>
+ <Type Value="Include"/>
+ </Item1>
+ <Item2>
+ <Filename Value="../fpgfx.pas"/>
+ <UnitName Value="fpgfx"/>
+ </Item2>
+ <Item3>
+ <Filename Value="../gfxbase.pas"/>
+ <UnitName Value="gfxbase"/>
+ </Item3>
+ <Item4>
+ <Filename Value="../gfx_cmdlineparams.pas"/>
+ <UnitName Value="gfx_cmdlineparams"/>
+ </Item4>
+ <Item5>
+ <Filename Value="../gfx_command_intf.pas"/>
+ <UnitName Value="gfx_command_intf"/>
+ </Item5>
+ <Item6>
+ <Filename Value="../gfx_constants.pas"/>
+ <UnitName Value="gfx_constants"/>
+ </Item6>
+ <Item7>
+ <Filename Value="../gfx_extinterpolation.pas"/>
+ <UnitName Value="gfx_extinterpolation"/>
+ </Item7>
+ <Item8>
+ <Filename Value="../gfx_imagelist.pas"/>
+ <UnitName Value="gfx_imagelist"/>
+ </Item8>
+ <Item9>
+ <Filename Value="../gfx_imgfmt_bmp.pas"/>
+ <UnitName Value="gfx_imgfmt_bmp"/>
+ </Item9>
+ <Item10>
+ <Filename Value="../gfx_msgqueue.inc"/>
+ <Type Value="Include"/>
+ </Item10>
+ <Item11>
+ <Filename Value="../gfx_pofiles.pas"/>
+ <UnitName Value="gfx_pofiles"/>
+ </Item11>
+ <Item12>
+ <Filename Value="../gfx_popupwindow.pas"/>
+ <UnitName Value="gfx_popupwindow"/>
+ </Item12>
+ <Item13>
+ <Filename Value="../gfx_stdimages.pas"/>
+ <UnitName Value="gfx_stdimages"/>
+ </Item13>
+ <Item14>
+ <Filename Value="../gfx_stringhashlist.pas"/>
+ <UnitName Value="gfx_stringhashlist"/>
+ </Item14>
+ <Item15>
+ <Filename Value="../gfx_translations.pas"/>
+ <UnitName Value="gfx_translations"/>
+ </Item15>
+ <Item16>
+ <Filename Value="../gfx_utf8utils.pas"/>
+ <UnitName Value="gfx_UTF8utils"/>
+ </Item16>
+ <Item17>
+ <Filename Value="../gfx_utils.pas"/>
+ <UnitName Value="gfx_utils"/>
+ </Item17>
+ <Item18>
+ <Filename Value="../gfx_widget.pas"/>
+ <UnitName Value="gfx_widget"/>
+ </Item18>
+ <Item19>
+ <Filename Value="../gfx_wuline.pas"/>
+ <UnitName Value="gfx_wuline"/>
+ </Item19>
+ <Item20>
+ <Filename Value="../keys.inc"/>
+ <Type Value="Include"/>
+ </Item20>
+ <Item21>
+ <Filename Value="../lang_afrikaans.inc"/>
+ <Type Value="Include"/>
+ </Item21>
+ <Item22>
+ <Filename Value="../lang_english.inc"/>
+ <Type Value="Include"/>
+ </Item22>
+ <Item23>
+ <Filename Value="../lang_french.inc"/>
+ <Type Value="Include"/>
+ </Item23>
+ <Item24>
+ <Filename Value="../lang_german.inc"/>
+ <Type Value="Include"/>
+ </Item24>
+ <Item25>
+ <Filename Value="../lang_italian.inc"/>
+ <Type Value="Include"/>
+ </Item25>
+ <Item26>
+ <Filename Value="../lang_portuguese.inc"/>
+ <Type Value="Include"/>
+ </Item26>
+ <Item27>
+ <Filename Value="../lang_russian.inc"/>
+ <Type Value="Include"/>
+ </Item27>
+ <Item28>
+ <Filename Value="../lang_spanish.inc"/>
+ <Type Value="Include"/>
+ </Item28>
+ <Item29>
+ <Filename Value="../predefinedcolors.inc"/>
+ <Type Value="Include"/>
+ </Item29>
+ <Item30>
+ <Filename Value="gfx_impl.pas"/>
+ <UnitName Value="gfx_impl"/>
+ </Item30>
+ <Item31>
+ <Filename Value="gfx_utils_impl.inc"/>
+ <Type Value="Include"/>
+ </Item31>
+ <Item32>
+ <Filename Value="gfx_x11.pas"/>
+ <UnitName Value="gfx_x11"/>
+ </Item32>
+ <Item33>
+ <Filename Value="_netlayer.pas"/>
+ <UnitName Value="_netlayer"/>
+ </Item33>
+ <Item34>
+ <Filename Value="x11_keyconv.pas"/>
+ <UnitName Value="x11_keyconv"/>
+ </Item34>
+ <Item35>
+ <Filename Value="x11_xft.pas"/>
+ <UnitName Value="x11_xft"/>
+ </Item35>
+ <Item36>
+ <Filename Value="../../gui/promptuserdialog.inc"/>
+ <Type Value="Include"/>
+ </Item36>
+ <Item37>
+ <Filename Value="../../gui/gui_animation.pas"/>
+ <UnitName Value="gui_animation"/>
+ </Item37>
+ <Item38>
+ <Filename Value="../../gui/gui_basegrid.pas"/>
+ <UnitName Value="gui_basegrid"/>
+ </Item38>
+ <Item39>
+ <Filename Value="../../gui/gui_bevel.pas"/>
+ <UnitName Value="gui_bevel"/>
+ </Item39>
+ <Item40>
+ <Filename Value="../../gui/gui_button.pas"/>
+ <UnitName Value="gui_button"/>
+ </Item40>
+ <Item41>
+ <Filename Value="../../gui/gui_checkbox.pas"/>
+ <UnitName Value="gui_checkbox"/>
+ </Item41>
+ <Item42>
+ <Filename Value="../../gui/gui_combobox.pas"/>
+ <UnitName Value="gui_combobox"/>
+ </Item42>
+ <Item43>
+ <Filename Value="../../gui/gui_customgrid.pas"/>
+ <UnitName Value="gui_customgrid"/>
+ </Item43>
+ <Item44>
+ <Filename Value="../../gui/gui_dialogs.pas"/>
+ <UnitName Value="gui_dialogs"/>
+ </Item44>
+ <Item45>
+ <Filename Value="../../gui/gui_editcombo.pas"/>
+ <UnitName Value="gui_editcombo"/>
+ </Item45>
+ <Item46>
+ <Filename Value="../../gui/gui_edit.pas"/>
+ <UnitName Value="gui_edit"/>
+ </Item46>
+ <Item47>
+ <Filename Value="../../gui/gui_form.pas"/>
+ <UnitName Value="gui_form"/>
+ </Item47>
+ <Item48>
+ <Filename Value="../../gui/gui_gauge.pas"/>
+ <UnitName Value="gui_gauge"/>
+ </Item48>
+ <Item49>
+ <Filename Value="../../gui/gui_grid.pas"/>
+ <UnitName Value="gui_grid"/>
+ </Item49>
+ <Item50>
+ <Filename Value="../../gui/gui_hyperlink.pas"/>
+ <UnitName Value="gui_hyperlink"/>
+ </Item50>
+ <Item51>
+ <Filename Value="../../gui/gui_iniutils.pas"/>
+ <UnitName Value="gui_iniutils"/>
+ </Item51>
+ <Item52>
+ <Filename Value="../../gui/gui_label.pas"/>
+ <UnitName Value="gui_label"/>
+ </Item52>
+ <Item53>
+ <Filename Value="../../gui/gui_listbox.pas"/>
+ <UnitName Value="gui_listbox"/>
+ </Item53>
+ <Item54>
+ <Filename Value="../../gui/gui_listview.pas"/>
+ <UnitName Value="gui_listview"/>
+ </Item54>
+ <Item55>
+ <Filename Value="../../gui/gui_memo.pas"/>
+ <UnitName Value="gui_memo"/>
+ </Item55>
+ <Item56>
+ <Filename Value="../../gui/gui_menu.pas"/>
+ <UnitName Value="gui_menu"/>
+ </Item56>
+ <Item57>
+ <Filename Value="../../gui/gui_mru.pas"/>
+ <UnitName Value="gui_mru"/>
+ </Item57>
+ <Item58>
+ <Filename Value="../../gui/gui_panel.pas"/>
+ <UnitName Value="gui_panel"/>
+ </Item58>
+ <Item59>
+ <Filename Value="../../gui/gui_popupcalendar.pas"/>
+ <UnitName Value="gui_popupcalendar"/>
+ </Item59>
+ <Item60>
+ <Filename Value="../../gui/gui_progressbar.pas"/>
+ <UnitName Value="gui_progressbar"/>
+ </Item60>
+ <Item61>
+ <Filename Value="../../gui/gui_radiobutton.pas"/>
+ <UnitName Value="gui_radiobutton"/>
+ </Item61>
+ <Item62>
+ <Filename Value="../../gui/gui_scrollbar.pas"/>
+ <UnitName Value="gui_scrollbar"/>
+ </Item62>
+ <Item63>
+ <Filename Value="../../gui/gui_style.pas"/>
+ <UnitName Value="gui_style"/>
+ </Item63>
+ <Item64>
+ <Filename Value="../../gui/gui_tab.pas"/>
+ <UnitName Value="gui_tab"/>
+ </Item64>
+ <Item65>
+ <Filename Value="../../gui/gui_trackbar.pas"/>
+ <UnitName Value="gui_trackbar"/>
+ </Item65>
+ <Item66>
+ <Filename Value="../../gui/gui_tree.pas"/>
+ <UnitName Value="gui_tree"/>
+ </Item66>
+ <Item67>
+ <Filename Value="../../gui/logo.inc"/>
+ <Type Value="Include"/>
+ </Item67>
+ <Item68>
+ <Filename Value="../../gui/messagedialog.inc"/>
+ <Type Value="Include"/>
+ </Item68>
+ <Item69>
+ <Filename Value="../../gui/newdirdialog.inc"/>
+ <Type Value="Include"/>
+ </Item69>
+ <Item70>
+ <Filename Value="../../gui/db/fpgui_db.pas"/>
+ <UnitName Value="fpgui_db"/>
+ </Item70>
+ </Files>
+ <LazDoc Paths="../../../docs/xml/corelib/;../../../docs/xml/corelib/x11/;../../../docs/xml/corelib/gdi/;../../../docs/xml/gui/"/>
+ <RequiredPkgs Count="1">
+ <Item1>
+ <PackageName Value="FCL"/>
+ <MinVersion Major="1" Valid="True"/>
+ </Item1>
+ </RequiredPkgs>
+ <UsageOptions>
+ <UnitPath Value="$(PkgOutDir)/"/>
+ </UsageOptions>
+ <PublishOptions>
+ <Version Value="2"/>
+ <IgnoreBinaries Value="False"/>
+ </PublishOptions>
+ </Package>
+</CONFIG>
diff --git a/src/corelib/gdi/fpgui_toolkit.pas b/src/corelib/gdi/fpgui_toolkit.pas
new file mode 100644
index 00000000..85c6b743
--- /dev/null
+++ b/src/corelib/gdi/fpgui_toolkit.pas
@@ -0,0 +1,23 @@
+{ This file was automatically created by Lazarus. Do not edit!
+This source is only used to compile and install the package.
+ }
+
+unit fpgui_toolkit;
+
+interface
+
+uses
+ fpgfx, gfxbase, gfx_cmdlineparams, gfx_command_intf, gfx_constants,
+ gfx_extinterpolation, gfx_imagelist, gfx_imgfmt_bmp, gfx_pofiles,
+ gfx_popupwindow, gfx_stdimages, gfx_stringhashlist, gfx_translations,
+ gfx_UTF8utils, gfx_utils, gfx_widget, gfx_wuline, gfx_impl, gfx_x11,
+ _netlayer, x11_keyconv, x11_xft, gui_animation, gui_basegrid, gui_bevel,
+ gui_button, gui_checkbox, gui_combobox, gui_customgrid, gui_dialogs,
+ gui_editcombo, gui_edit, gui_form, gui_gauge, gui_grid, gui_hyperlink,
+ gui_iniutils, gui_label, gui_listbox, gui_listview, gui_memo, gui_menu,
+ gui_mru, gui_panel, gui_popupcalendar, gui_progressbar, gui_radiobutton,
+ gui_scrollbar, gui_style, gui_tab, gui_trackbar, gui_tree, fpgui_db;
+
+implementation
+
+end.
diff --git a/src/corelib/gfx_popupwindow.pas b/src/corelib/gfx_popupwindow.pas
index e19b8642..8fb37b2c 100644
--- a/src/corelib/gfx_popupwindow.pas
+++ b/src/corelib/gfx_popupwindow.pas
@@ -284,6 +284,7 @@ begin
FDontCloseWidget := nil;
Parent := nil;
FPopupFrame := False;
+ FIsContainer := True;
end;
procedure TfpgPopupWindow.ShowAt(AWidget: TfpgWidget; x, y: TfpgCoord);
diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas
index 85bf059b..03df3577 100644
--- a/src/corelib/gfx_widget.pas
+++ b/src/corelib/gfx_widget.pas
@@ -60,6 +60,7 @@ type
FHint: string;
FBackgroundColor: TfpgColor;
FTextColor: TfpgColor;
+ FIsContainer: Boolean;
procedure SetBackgroundColor(const AValue: TfpgColor); virtual;
procedure SetTextColor(const AValue: TfpgColor); virtual;
function GetClientBounds: TfpgRect; virtual;
@@ -67,9 +68,11 @@ type
procedure SetParent(const AValue: TfpgWidget); reintroduce;
procedure SetEnabled(const AValue: boolean); virtual;
procedure SetVisible(const AValue: boolean); virtual;
- procedure DoAlign(aalign: TAlign);
+ procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override;
+ procedure DoAlign(AAlign: TAlign);
+ procedure DoResize;
procedure HandlePaint; virtual;
- procedure HandleResize(awidth, aheight: TfpgCoord); virtual;
+ procedure HandleResize(AWidth, AHeight: TfpgCoord); virtual;
procedure HandleMove(x, y: TfpgCoord); virtual;
procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); virtual;
procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); virtual;
@@ -116,6 +119,7 @@ type
property FormDesigner: TObject read FFormDesigner write FFormDesigner;
property Parent: TfpgWidget read GetParent write SetParent;
property ActiveWidget: TfpgWidget read FActiveWidget write SetActiveWidget;
+ property IsContainer: Boolean read FIsContainer;
property Visible: boolean read FVisible write SetVisible default True;
property Enabled: boolean read FEnabled write SetEnabled default True;
property TabOrder: integer read FTabOrder write FTabOrder;
@@ -200,6 +204,24 @@ begin
end;
end;
+procedure TfpgWidget.DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord);
+var
+ dw: integer;
+ dh: integer;
+begin
+// writeln('DoUpdateWindowPosition - ', Classname);
+ dw := FWidth - FPrevWidth;
+ dh := FHeight - FPrevHeight;
+
+ if IsContainer and FDirty then
+ HandleAlignments(dw, dh);
+
+ inherited DoUpdateWindowPosition(aleft, atop, awidth, aheight);
+ if FDirty and ((dw <> 0) or (dh <> 0)) then
+ DoResize;
+ FDirty := False;
+end;
+
procedure TfpgWidget.SetBackgroundColor(const AValue: TfpgColor);
begin
if FBackgroundColor <> AValue then
@@ -241,16 +263,17 @@ begin
Loading;
{$endif}
- FOnScreen := False;
- FVisible := True;
- FActiveWidget := nil;
- FEnabled := True;
- FFocusable := False;
- FFocused := False;
- FTabOrder := 0;
- FAnchors := [anLeft, anTop];
- FAlign := alNone;
- FHint := '';
+ FIsContainer := False;
+ FOnScreen := False;
+ FVisible := True;
+ FActiveWidget := nil;
+ FEnabled := True;
+ FFocusable := False;
+ FFocused := False;
+ FTabOrder := 0;
+ FAnchors := [anLeft, anTop];
+ FAlign := alNone;
+ FHint := '';
FBackgroundColor := clWindowBackground;
FTextColor := clText1;
@@ -868,25 +891,13 @@ end;
procedure TfpgWidget.MsgResize(var msg: TfpgMessageRec);
begin
+// writeln('MsgResize - ', Classname);
HandleResize(msg.Params.rect.Width, msg.Params.rect.Height);
if FFormDesigner <> nil then
begin
FFormDesigner.Dispatch(msg);
end;
- if Assigned(FOnResize) then
- FOnResize(Self);
-end;
-
-procedure TfpgWidget.HandleResize(awidth, aheight: TfpgCoord);
-var
- dw: integer;
- dh: integer;
-begin
- dw := awidth - FWidth;
- dh := aheight - FHeight;
- FWidth := Max(awidth, FMinWidth);
- FHeight := Max(aheight, FMinHeight);
- HandleAlignments(dw, dh);
+ DoResize;
end;
procedure TfpgWidget.MsgMove(var msg: TfpgMessageRec);
@@ -898,10 +909,17 @@ begin
end;
end;
+procedure TfpgWidget.HandleResize(AWidth, AHeight: TfpgCoord);
+begin
+// writeln('HandleResize - ', Classname);
+ Width := Max(awidth, FMinWidth);
+ Height := Max(aheight, FMinHeight);
+end;
+
procedure TfpgWidget.HandleMove(x, y: TfpgCoord);
begin
- FLeft := x;
- FTop := y;
+ Left := x;
+ Top := y;
end;
procedure TfpgWidget.HandleAlignments(dwidth, dheight: TfpgCoord);
@@ -915,6 +933,7 @@ var
begin
if (csLoading in ComponentState) then
Exit; //==>
+// writeln('HandleAlignments - ', Classname);
FAlignRect := GetClientBounds;
DoAlign(alTop);
@@ -958,19 +977,19 @@ procedure TfpgWidget.MoveAndResize(ALeft, ATop, AWidth, AHeight: TfpgCoord);
begin
if HasHandle then
begin
- if (aleft <> FLeft) or (atop <> FTop) then
- HandleMove(aleft, atop);
- if (awidth <> FWidth) or (aheight <> FHeight) then
- HandleResize(awidth, aheight);
+ if (ALeft <> FLeft) or (ATop <> FTop) then
+ HandleMove(ALeft, ATop);
+ if (AWidth <> FWidth) or (AHeight <> FHeight) then
+ HandleResize(AWidth, AHeight);
UpdateWindowPosition;
end
else
begin
// When the widget is created, it's position will be applied
- FLeft := ALeft;
- FTop := ATop;
- FWidth := AWidth;
- FHeight := AHeight;
+ Left := ALeft;
+ Top := ATop;
+ Width := AWidth;
+ Height := AHeight;
end;
end;
@@ -1008,7 +1027,7 @@ begin
end;
end;
-procedure TfpgWidget.DoAlign(aalign: TAlign);
+procedure TfpgWidget.DoAlign(AAlign: TAlign);
var
alist: TList;
w: TfpgWidget;
@@ -1019,7 +1038,7 @@ begin
if Components[n] is TfpgWidget then
begin
w := TfpgWidget(Components[n]);
- if w.Align = aalign then
+ if w.Align = AAlign then
alist.Add(w);
end;
@@ -1064,6 +1083,12 @@ begin
alist.Free;
end;
+procedure TfpgWidget.DoResize;
+begin
+ if Assigned(FOnResize) then
+ FOnResize(Self);
+end;
+
procedure TfpgWidget.SetPosition(aleft, atop, awidth, aheight: TfpgCoord);
begin
MoveAndResize(aleft, atop, awidth, aheight);
diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas
index 8757deda..b249d486 100644
--- a/src/corelib/gfxbase.pas
+++ b/src/corelib/gfxbase.pas
@@ -358,9 +358,14 @@ type
FLeft: TfpgCoord;
FWidth: TfpgCoord;
FHeight: TfpgCoord;
+ FPrevTop: TfpgCoord;
+ FPrevLeft: TfpgCoord;
+ FPrevWidth: TfpgCoord;
+ FPrevHeight: TfpgCoord;
FMinWidth: TfpgCoord;
FMinHeight: TfpgCoord;
FCanvas: TfpgCanvasBase;
+ FDirty: Boolean;
function HandleIsValid: boolean; virtual; abstract;
procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); virtual; abstract;
procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); virtual; abstract;
@@ -377,6 +382,8 @@ type
procedure AllocateWindowHandle;
procedure ReleaseWindowHandle;
procedure SetWindowTitle(const ATitle: string); virtual;
+ procedure SetTop(const AValue: TfpgCoord); virtual;
+ procedure SetLeft(const AValue: TfpgCoord); virtual;
procedure SetHeight(const AValue: TfpgCoord); virtual;
procedure SetWidth(const AValue: TfpgCoord); virtual;
public
@@ -400,8 +407,8 @@ type
property HasHandle: boolean read HandleIsValid;
property WindowType: TWindowType read FWindowType write FWindowType;
property WindowAttributes: TWindowAttributes read FWindowAttributes write FWindowAttributes;
- property Left: TfpgCoord read FLeft write FLeft;
- property Top: TfpgCoord read FTop write FTop;
+ property Left: TfpgCoord read FLeft write SetLeft;
+ property Top: TfpgCoord read FTop write SetTop;
property Width: TfpgCoord read FWidth write SetWidth;
property Height: TfpgCoord read FHeight write SetHeight;
property MinWidth: TfpgCoord read FMinWidth write FMinWidth;
@@ -947,24 +954,47 @@ begin
DoSetWindowTitle(ATitle);
end;
+procedure TfpgWindowBase.SetTop(const AValue: TfpgCoord);
+begin
+ if FTop = AValue then
+ Exit;
+ FPrevTop := FTop;
+ FTop := AValue;
+ FDirty := True;
+end;
+
+procedure TfpgWindowBase.SetLeft(const AValue: TfpgCoord);
+begin
+ if FLeft = AValue then
+ Exit;
+ FPrevLeft := FHeight;
+ FLeft := AValue;
+ FDirty := True;
+end;
+
procedure TfpgWindowBase.SetHeight(const AValue: TfpgCoord);
begin
if FHeight = AValue then
Exit;
+ FPrevHeight := FHeight;
FHeight := AValue;
+ FDirty := True;
end;
procedure TfpgWindowBase.SetWidth(const AValue: TfpgCoord);
begin
if FWidth = AValue then
Exit;
+ FPrevWidth := FWidth;
FWidth := AValue;
+ FDirty := True;
end;
constructor TfpgWindowBase.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FMouseCursor := mcDefault;
+ FDirty := True;
end;
procedure TfpgWindowBase.AfterConstruction;
diff --git a/src/corelib/x11/fpgui_toolkit.lpk b/src/corelib/x11/fpgui_toolkit.lpk
new file mode 100644
index 00000000..243f958f
--- /dev/null
+++ b/src/corelib/x11/fpgui_toolkit.lpk
@@ -0,0 +1,328 @@
+<?xml version="1.0"?>
+<CONFIG>
+ <Package Version="3">
+ <Name Value="fpgui_toolkit"/>
+ <Author Value="Graeme Geldenhuys"/>
+ <CompilerOptions>
+ <Version Value="5"/>
+ <SearchPaths>
+ <OtherUnitFiles Value="../;../../gui/;../../gui/db/"/>
+ <UnitOutputDirectory Value="../../../lib"/>
+ </SearchPaths>
+ <Parsing>
+ <SyntaxOptions>
+ <CStyleOperator Value="False"/>
+ <AllowLabel Value="False"/>
+ <CPPInline Value="False"/>
+ </SyntaxOptions>
+ </Parsing>
+ <CodeGeneration>
+ <Generate Value="Faster"/>
+ </CodeGeneration>
+ <Other>
+ <CompilerPath Value="$(CompPath)"/>
+ </Other>
+ </CompilerOptions>
+ <Description Value="fpGUI Toolkit
+"/>
+ <License Value="Modified LGPL
+"/>
+ <Version Minor="6" Release="2"/>
+ <Files Count="70">
+ <Item1>
+ <Filename Value="../stdimages.inc"/>
+ <Type Value="Include"/>
+ </Item1>
+ <Item2>
+ <Filename Value="../fpgfx.pas"/>
+ <UnitName Value="fpgfx"/>
+ </Item2>
+ <Item3>
+ <Filename Value="../gfxbase.pas"/>
+ <UnitName Value="gfxbase"/>
+ </Item3>
+ <Item4>
+ <Filename Value="../gfx_cmdlineparams.pas"/>
+ <UnitName Value="gfx_cmdlineparams"/>
+ </Item4>
+ <Item5>
+ <Filename Value="../gfx_command_intf.pas"/>
+ <UnitName Value="gfx_command_intf"/>
+ </Item5>
+ <Item6>
+ <Filename Value="../gfx_constants.pas"/>
+ <UnitName Value="gfx_constants"/>
+ </Item6>
+ <Item7>
+ <Filename Value="../gfx_extinterpolation.pas"/>
+ <UnitName Value="gfx_extinterpolation"/>
+ </Item7>
+ <Item8>
+ <Filename Value="../gfx_imagelist.pas"/>
+ <UnitName Value="gfx_imagelist"/>
+ </Item8>
+ <Item9>
+ <Filename Value="../gfx_imgfmt_bmp.pas"/>
+ <UnitName Value="gfx_imgfmt_bmp"/>
+ </Item9>
+ <Item10>
+ <Filename Value="../gfx_msgqueue.inc"/>
+ <Type Value="Include"/>
+ </Item10>
+ <Item11>
+ <Filename Value="../gfx_pofiles.pas"/>
+ <UnitName Value="gfx_pofiles"/>
+ </Item11>
+ <Item12>
+ <Filename Value="../gfx_popupwindow.pas"/>
+ <UnitName Value="gfx_popupwindow"/>
+ </Item12>
+ <Item13>
+ <Filename Value="../gfx_stdimages.pas"/>
+ <UnitName Value="gfx_stdimages"/>
+ </Item13>
+ <Item14>
+ <Filename Value="../gfx_stringhashlist.pas"/>
+ <UnitName Value="gfx_stringhashlist"/>
+ </Item14>
+ <Item15>
+ <Filename Value="../gfx_translations.pas"/>
+ <UnitName Value="gfx_translations"/>
+ </Item15>
+ <Item16>
+ <Filename Value="../gfx_utf8utils.pas"/>
+ <UnitName Value="gfx_UTF8utils"/>
+ </Item16>
+ <Item17>
+ <Filename Value="../gfx_utils.pas"/>
+ <UnitName Value="gfx_utils"/>
+ </Item17>
+ <Item18>
+ <Filename Value="../gfx_widget.pas"/>
+ <UnitName Value="gfx_widget"/>
+ </Item18>
+ <Item19>
+ <Filename Value="../gfx_wuline.pas"/>
+ <UnitName Value="gfx_wuline"/>
+ </Item19>
+ <Item20>
+ <Filename Value="../keys.inc"/>
+ <Type Value="Include"/>
+ </Item20>
+ <Item21>
+ <Filename Value="../lang_afrikaans.inc"/>
+ <Type Value="Include"/>
+ </Item21>
+ <Item22>
+ <Filename Value="../lang_english.inc"/>
+ <Type Value="Include"/>
+ </Item22>
+ <Item23>
+ <Filename Value="../lang_french.inc"/>
+ <Type Value="Include"/>
+ </Item23>
+ <Item24>
+ <Filename Value="../lang_german.inc"/>
+ <Type Value="Include"/>
+ </Item24>
+ <Item25>
+ <Filename Value="../lang_italian.inc"/>
+ <Type Value="Include"/>
+ </Item25>
+ <Item26>
+ <Filename Value="../lang_portuguese.inc"/>
+ <Type Value="Include"/>
+ </Item26>
+ <Item27>
+ <Filename Value="../lang_russian.inc"/>
+ <Type Value="Include"/>
+ </Item27>
+ <Item28>
+ <Filename Value="../lang_spanish.inc"/>
+ <Type Value="Include"/>
+ </Item28>
+ <Item29>
+ <Filename Value="../predefinedcolors.inc"/>
+ <Type Value="Include"/>
+ </Item29>
+ <Item30>
+ <Filename Value="gfx_impl.pas"/>
+ <UnitName Value="gfx_impl"/>
+ </Item30>
+ <Item31>
+ <Filename Value="gfx_utils_impl.inc"/>
+ <Type Value="Include"/>
+ </Item31>
+ <Item32>
+ <Filename Value="gfx_x11.pas"/>
+ <UnitName Value="gfx_x11"/>
+ </Item32>
+ <Item33>
+ <Filename Value="_netlayer.pas"/>
+ <UnitName Value="_netlayer"/>
+ </Item33>
+ <Item34>
+ <Filename Value="x11_keyconv.pas"/>
+ <UnitName Value="x11_keyconv"/>
+ </Item34>
+ <Item35>
+ <Filename Value="x11_xft.pas"/>
+ <UnitName Value="x11_xft"/>
+ </Item35>
+ <Item36>
+ <Filename Value="../../gui/promptuserdialog.inc"/>
+ <Type Value="Include"/>
+ </Item36>
+ <Item37>
+ <Filename Value="../../gui/gui_animation.pas"/>
+ <UnitName Value="gui_animation"/>
+ </Item37>
+ <Item38>
+ <Filename Value="../../gui/gui_basegrid.pas"/>
+ <UnitName Value="gui_basegrid"/>
+ </Item38>
+ <Item39>
+ <Filename Value="../../gui/gui_bevel.pas"/>
+ <UnitName Value="gui_bevel"/>
+ </Item39>
+ <Item40>
+ <Filename Value="../../gui/gui_button.pas"/>
+ <UnitName Value="gui_button"/>
+ </Item40>
+ <Item41>
+ <Filename Value="../../gui/gui_checkbox.pas"/>
+ <UnitName Value="gui_checkbox"/>
+ </Item41>
+ <Item42>
+ <Filename Value="../../gui/gui_combobox.pas"/>
+ <UnitName Value="gui_combobox"/>
+ </Item42>
+ <Item43>
+ <Filename Value="../../gui/gui_customgrid.pas"/>
+ <UnitName Value="gui_customgrid"/>
+ </Item43>
+ <Item44>
+ <Filename Value="../../gui/gui_dialogs.pas"/>
+ <UnitName Value="gui_dialogs"/>
+ </Item44>
+ <Item45>
+ <Filename Value="../../gui/gui_editcombo.pas"/>
+ <UnitName Value="gui_editcombo"/>
+ </Item45>
+ <Item46>
+ <Filename Value="../../gui/gui_edit.pas"/>
+ <UnitName Value="gui_edit"/>
+ </Item46>
+ <Item47>
+ <Filename Value="../../gui/gui_form.pas"/>
+ <UnitName Value="gui_form"/>
+ </Item47>
+ <Item48>
+ <Filename Value="../../gui/gui_gauge.pas"/>
+ <UnitName Value="gui_gauge"/>
+ </Item48>
+ <Item49>
+ <Filename Value="../../gui/gui_grid.pas"/>
+ <UnitName Value="gui_grid"/>
+ </Item49>
+ <Item50>
+ <Filename Value="../../gui/gui_hyperlink.pas"/>
+ <UnitName Value="gui_hyperlink"/>
+ </Item50>
+ <Item51>
+ <Filename Value="../../gui/gui_iniutils.pas"/>
+ <UnitName Value="gui_iniutils"/>
+ </Item51>
+ <Item52>
+ <Filename Value="../../gui/gui_label.pas"/>
+ <UnitName Value="gui_label"/>
+ </Item52>
+ <Item53>
+ <Filename Value="../../gui/gui_listbox.pas"/>
+ <UnitName Value="gui_listbox"/>
+ </Item53>
+ <Item54>
+ <Filename Value="../../gui/gui_listview.pas"/>
+ <UnitName Value="gui_listview"/>
+ </Item54>
+ <Item55>
+ <Filename Value="../../gui/gui_memo.pas"/>
+ <UnitName Value="gui_memo"/>
+ </Item55>
+ <Item56>
+ <Filename Value="../../gui/gui_menu.pas"/>
+ <UnitName Value="gui_menu"/>
+ </Item56>
+ <Item57>
+ <Filename Value="../../gui/gui_mru.pas"/>
+ <UnitName Value="gui_mru"/>
+ </Item57>
+ <Item58>
+ <Filename Value="../../gui/gui_panel.pas"/>
+ <UnitName Value="gui_panel"/>
+ </Item58>
+ <Item59>
+ <Filename Value="../../gui/gui_popupcalendar.pas"/>
+ <UnitName Value="gui_popupcalendar"/>
+ </Item59>
+ <Item60>
+ <Filename Value="../../gui/gui_progressbar.pas"/>
+ <UnitName Value="gui_progressbar"/>
+ </Item60>
+ <Item61>
+ <Filename Value="../../gui/gui_radiobutton.pas"/>
+ <UnitName Value="gui_radiobutton"/>
+ </Item61>
+ <Item62>
+ <Filename Value="../../gui/gui_scrollbar.pas"/>
+ <UnitName Value="gui_scrollbar"/>
+ </Item62>
+ <Item63>
+ <Filename Value="../../gui/gui_style.pas"/>
+ <UnitName Value="gui_style"/>
+ </Item63>
+ <Item64>
+ <Filename Value="../../gui/gui_tab.pas"/>
+ <UnitName Value="gui_tab"/>
+ </Item64>
+ <Item65>
+ <Filename Value="../../gui/gui_trackbar.pas"/>
+ <UnitName Value="gui_trackbar"/>
+ </Item65>
+ <Item66>
+ <Filename Value="../../gui/gui_tree.pas"/>
+ <UnitName Value="gui_tree"/>
+ </Item66>
+ <Item67>
+ <Filename Value="../../gui/logo.inc"/>
+ <Type Value="Include"/>
+ </Item67>
+ <Item68>
+ <Filename Value="../../gui/messagedialog.inc"/>
+ <Type Value="Include"/>
+ </Item68>
+ <Item69>
+ <Filename Value="../../gui/newdirdialog.inc"/>
+ <Type Value="Include"/>
+ </Item69>
+ <Item70>
+ <Filename Value="../../gui/db/fpgui_db.pas"/>
+ <UnitName Value="fpgui_db"/>
+ </Item70>
+ </Files>
+ <LazDoc Paths="../../../docs/xml/corelib/;../../../docs/xml/corelib/x11/;../../../docs/xml/corelib/gdi/;../../../docs/xml/gui/"/>
+ <RequiredPkgs Count="1">
+ <Item1>
+ <PackageName Value="FCL"/>
+ <MinVersion Major="1" Valid="True"/>
+ </Item1>
+ </RequiredPkgs>
+ <UsageOptions>
+ <UnitPath Value="$(PkgOutDir)/"/>
+ </UsageOptions>
+ <PublishOptions>
+ <Version Value="2"/>
+ <IgnoreBinaries Value="False"/>
+ </PublishOptions>
+ </Package>
+</CONFIG>
diff --git a/src/corelib/x11/fpgui_toolkit.pas b/src/corelib/x11/fpgui_toolkit.pas
new file mode 100644
index 00000000..85c6b743
--- /dev/null
+++ b/src/corelib/x11/fpgui_toolkit.pas
@@ -0,0 +1,23 @@
+{ This file was automatically created by Lazarus. Do not edit!
+This source is only used to compile and install the package.
+ }
+
+unit fpgui_toolkit;
+
+interface
+
+uses
+ fpgfx, gfxbase, gfx_cmdlineparams, gfx_command_intf, gfx_constants,
+ gfx_extinterpolation, gfx_imagelist, gfx_imgfmt_bmp, gfx_pofiles,
+ gfx_popupwindow, gfx_stdimages, gfx_stringhashlist, gfx_translations,
+ gfx_UTF8utils, gfx_utils, gfx_widget, gfx_wuline, gfx_impl, gfx_x11,
+ _netlayer, x11_keyconv, x11_xft, gui_animation, gui_basegrid, gui_bevel,
+ gui_button, gui_checkbox, gui_combobox, gui_customgrid, gui_dialogs,
+ gui_editcombo, gui_edit, gui_form, gui_gauge, gui_grid, gui_hyperlink,
+ gui_iniutils, gui_label, gui_listbox, gui_listview, gui_memo, gui_menu,
+ gui_mru, gui_panel, gui_popupcalendar, gui_progressbar, gui_radiobutton,
+ gui_scrollbar, gui_style, gui_tab, gui_trackbar, gui_tree, fpgui_db;
+
+implementation
+
+end.