summaryrefslogtreecommitdiff
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
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.
-rw-r--r--examples/apps/uidesigner/vfdforms.pas1
-rw-r--r--examples/gui/alignment_resize/alignment_resize.lpi55
-rw-r--r--examples/gui/alignment_resize/alignment_resize.lpr240
-rw-r--r--examples/gui/alignment_resize/extrafpc.cfg5
-rw-r--r--extras/tiopf/tiOPFfpGUI.lpk10
-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
-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
18 files changed, 1152 insertions, 66 deletions
diff --git a/examples/apps/uidesigner/vfdforms.pas b/examples/apps/uidesigner/vfdforms.pas
index c7407a84..d7fc4657 100644
--- a/examples/apps/uidesigner/vfdforms.pas
+++ b/examples/apps/uidesigner/vfdforms.pas
@@ -127,7 +127,6 @@ type
implementation
uses
- vfdmain,
fpgfx,
gui_iniutils,
gfx_constants;
diff --git a/examples/gui/alignment_resize/alignment_resize.lpi b/examples/gui/alignment_resize/alignment_resize.lpi
new file mode 100644
index 00000000..0da35584
--- /dev/null
+++ b/examples/gui/alignment_resize/alignment_resize.lpi
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<CONFIG>
+ <ProjectOptions>
+ <PathDelim Value="/"/>
+ <Version Value="6"/>
+ <General>
+ <Flags>
+ <SaveOnlyProjectUnits Value="True"/>
+ </Flags>
+ <SessionStorage Value="InProjectDir"/>
+ <MainUnit Value="0"/>
+ <IconPath Value="./"/>
+ <TargetFileExt Value=""/>
+ <Title Value="alignment_resize"/>
+ </General>
+ <VersionInfo>
+ <ProjectVersion Value=""/>
+ </VersionInfo>
+ <PublishOptions>
+ <Version Value="2"/>
+ <IgnoreBinaries Value="False"/>
+ <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+ <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+ </PublishOptions>
+ <RunParams>
+ <local>
+ <FormatVersion Value="1"/>
+ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ </local>
+ </RunParams>
+ <RequiredPackages Count="1">
+ <Item1>
+ <PackageName Value="fpgui_toolkit"/>
+ <MinVersion Minor="6" Release="2" Valid="True"/>
+ </Item1>
+ </RequiredPackages>
+ <Units Count="1">
+ <Unit0>
+ <Filename Value="alignment_resize.lpr"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="alignment_resize"/>
+ </Unit0>
+ </Units>
+ </ProjectOptions>
+ <CompilerOptions>
+ <Version Value="5"/>
+ <CodeGeneration>
+ <Generate Value="Faster"/>
+ </CodeGeneration>
+ <Other>
+ <CustomOptions Value="-FUunits"/>
+ <CompilerPath Value="$(CompPath)"/>
+ </Other>
+ </CompilerOptions>
+</CONFIG>
diff --git a/examples/gui/alignment_resize/alignment_resize.lpr b/examples/gui/alignment_resize/alignment_resize.lpr
new file mode 100644
index 00000000..8c6b2b03
--- /dev/null
+++ b/examples/gui/alignment_resize/alignment_resize.lpr
@@ -0,0 +1,240 @@
+program alignment_resize;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes, SysUtils, fpgfx, gfxbase, gui_form, gui_button, gui_panel, gui_label,
+ gui_radiobutton, gui_memo;
+
+type
+
+ TMainForm = class(TfpgForm)
+ private
+ procedure btnGoClicked(Sender: TObject);
+ procedure btnResetClicked(Sender: TObject);
+ procedure PanelResized(Sender: TObject);
+ public
+ {@VFD_HEAD_BEGIN: MainForm}
+ btnName1: TfpgButton;
+ btnName2: TfpgButton;
+ pnlName1: TfpgPanel;
+ btnName3: TfpgButton;
+ btnName4: TfpgButton;
+ btnName5: TfpgButton;
+ btnName6: TfpgButton;
+ lblName1: TfpgLabel;
+ pnlName2: TfpgPanel;
+ rbName1: TfpgRadioButton;
+ rbName2: TfpgRadioButton;
+ rbName3: TfpgRadioButton;
+ memName1: TfpgMemo;
+ {@VFD_HEAD_END: MainForm}
+ procedure AfterCreate; override;
+ end;
+
+{@VFD_NEWFORM_DECL}
+
+
+
+{@VFD_NEWFORM_IMPL}
+
+procedure TMainForm.btnGoClicked(Sender: TObject);
+begin
+ if rbName1.Checked then
+ begin
+ pnlName1.SetPosition(4, 68, 240, 192);
+ end
+ else if rbName2.Checked then
+ begin
+ pnlName1.Width := 240;
+ pnlName1.Height := 192;
+ pnlName1.UpdateWindowPosition;
+ end
+ else if rbName3.Checked then
+ begin
+ pnlName1.MoveAndResizeBy(0, 0, 100, 100);
+ end;
+end;
+
+procedure TMainForm.btnResetClicked(Sender: TObject);
+begin
+ pnlName1.SetPosition(4, 68, 140, 92);
+end;
+
+procedure TMainForm.PanelResized(Sender: TObject);
+begin
+ memName1.Lines.Insert(0, FormatDateTime('HH:mm:ss', Time) + ' Panel.OnResize');
+end;
+
+procedure TMainForm.AfterCreate;
+begin
+ {@VFD_BODY_BEGIN: MainForm}
+ Name := 'MainForm';
+ SetPosition(316, 186, 467, 284);
+ WindowTitle := 'Runtime resize/alignment test';
+ WindowPosition := wpScreenCenter;
+ Sizeable := False;
+
+ btnName1 := TfpgButton.Create(self);
+ with btnName1 do
+ begin
+ Name := 'btnName1';
+ SetPosition(4, 4, 80, 24);
+ Text := 'Go';
+ FontDesc := '#Label1';
+ ImageName := '';
+ OnClick := @btnGoClicked;
+ end;
+
+ btnName2 := TfpgButton.Create(self);
+ with btnName2 do
+ begin
+ Name := 'btnName2';
+ SetPosition(4, 32, 80, 24);
+ Text := 'Reset';
+ FontDesc := '#Label1';
+ ImageName := '';
+ TabOrder := 1;
+ OnClick := @btnResetClicked;
+ end;
+
+ pnlName1 := TfpgPanel.Create(self);
+ with pnlName1 do
+ begin
+ Name := 'pnlName1';
+ SetPosition(4, 68, 140, 92);
+ Text := '';
+ BackgroundColor := clDarkKhaki;
+ OnResize := @PanelResized;
+ end;
+
+ btnName3 := TfpgButton.Create(pnlName1);
+ with btnName3 do
+ begin
+ Name := 'btnName3';
+ SetPosition(8, 8, 24, 24);
+ Text := '1';
+ FontDesc := '#Label1';
+ ImageName := '';
+ end;
+
+ btnName4 := TfpgButton.Create(pnlName1);
+ with btnName4 do
+ begin
+ Name := 'btnName4';
+ SetPosition(108, 8, 24, 24);
+ Anchors := [anRight,anTop];
+ Text := '2';
+ FontDesc := '#Label1';
+ ImageName := '';
+ TabOrder := 1;
+ end;
+
+ btnName5 := TfpgButton.Create(pnlName1);
+ with btnName5 do
+ begin
+ Name := 'btnName5';
+ SetPosition(8, 60, 24, 24);
+ Anchors := [anLeft,anBottom];
+ Text := '3';
+ FontDesc := '#Label1';
+ ImageName := '';
+ TabOrder := 2;
+ end;
+
+ btnName6 := TfpgButton.Create(pnlName1);
+ with btnName6 do
+ begin
+ Name := 'btnName6';
+ SetPosition(108, 60, 24, 24);
+ Anchors := [anRight,anBottom];
+ Text := '4';
+ FontDesc := '#Label1';
+ ImageName := '';
+ TabOrder := 3;
+ end;
+
+ lblName1 := TfpgLabel.Create(self);
+ with lblName1 do
+ begin
+ Name := 'lblName1';
+ SetPosition(272, 4, 116, 16);
+ FontDesc := '#Label2';
+ Text := 'Update method';
+ end;
+
+ pnlName2 := TfpgPanel.Create(self);
+ with pnlName2 do
+ begin
+ Name := 'pnlName2';
+ SetPosition(256, 12, 4, 264);
+ Style := bsLowered;
+ Text := '';
+ end;
+
+ rbName1 := TfpgRadioButton.Create(self);
+ with rbName1 do
+ begin
+ Name := 'rbName1';
+ SetPosition(288, 28, 172, 20);
+ Checked := True;
+ FontDesc := '#Label1';
+ TabOrder := 5;
+ Text := 'SetPosition()';
+ end;
+
+ rbName2 := TfpgRadioButton.Create(self);
+ with rbName2 do
+ begin
+ Name := 'rbName2';
+ SetPosition(288, 48, 172, 20);
+ FontDesc := '#Label1';
+ TabOrder := 6;
+ Text := 'UpdateWindowPosition()';
+ end;
+
+ rbName3 := TfpgRadioButton.Create(self);
+ with rbName3 do
+ begin
+ Name := 'rbName3';
+ SetPosition(288, 68, 172, 20);
+ FontDesc := '#Label1';
+ TabOrder := 7;
+ Text := 'MoveAndResizeBy()';
+ end;
+
+ memName1 := TfpgMemo.Create(self);
+ with memName1 do
+ begin
+ Name := 'memName1';
+ SetPosition(272, 104, 184, 164);
+ FontDesc := '#Edit1';
+ TabOrder := 8;
+ end;
+
+ {@VFD_BODY_END: MainForm}
+end;
+
+
+procedure MainProc;
+var
+ frm: TMainForm;
+begin
+ fpgApplication.Initialize;
+ frm := TMainForm.Create(nil);
+ try
+ frm.Show;
+ fpgApplication.Run;
+ finally
+ frm.Free;
+ end;
+end;
+
+begin
+ MainProc;
+end.
+
+
diff --git a/examples/gui/alignment_resize/extrafpc.cfg b/examples/gui/alignment_resize/extrafpc.cfg
new file mode 100644
index 00000000..073dc4b6
--- /dev/null
+++ b/examples/gui/alignment_resize/extrafpc.cfg
@@ -0,0 +1,5 @@
+-FUunits
+-Fu../../../lib
+-Xs
+-XX
+-CX
diff --git a/extras/tiopf/tiOPFfpGUI.lpk b/extras/tiopf/tiOPFfpGUI.lpk
index 5906feb0..64b458ad 100644
--- a/extras/tiopf/tiOPFfpGUI.lpk
+++ b/extras/tiopf/tiOPFfpGUI.lpk
@@ -55,19 +55,15 @@
<UnitName Value="tiRtfReport"/>
</Item8>
</Files>
- <RequiredPkgs Count="3">
+ <RequiredPkgs Count="2">
<Item1>
- <PackageName Value="FCL"/>
- <MinVersion Major="1" Valid="True"/>
+ <PackageName Value="fpgui_toolkit"/>
+ <MinVersion Minor="6" Release="2" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="tiOPF"/>
<MinVersion Major="2" Release="3" Valid="True"/>
</Item2>
- <Item3>
- <PackageName Value="fpgui_package"/>
- <MinVersion Minor="5" Valid="True"/>
- </Item3>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)/"/>
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.
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;