Sign in Join
Wiki copytemporary

TPairSplitter: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-A TPairSplitter ![](/wiki-images/9/9c/Tpairsplitter.png) is a component that can be placed on a panel or form and provides two [[TPairSplitterSide]] sub-components.
2-
3-In the example below, a [[TPaintBox]] item is dropped onto each TPairSplitterSide.
1+A TPairSplitter [![tpairsplitter.png](/wiki-images/6/62/tpairsplitter.png)](</File:tpairsplitter.png>) is a component that can be placed on a panel or form and provides two [[TPairSplitterSide]] sub-components.
42
5-![](/wiki-images/7/7c/Component-TPairSplitter.png)
3+In the example below, a [[TPaintBox]] item is dropped onto each TPairSplitterSide.
64
7-``` pascal
5+[![component-TPairSplitter.png](/wiki-images/9/9e/component-TPairSplitter.png)](</File:component-TPairSplitter.png>)
6+```
87unit Unit1;
9-
10-{$mode objfpc}{$H+}
8+
9+ {$mode objfpc}{$H+}
10+
11+ interface
12+
13+ uses
14+ Classes, SysUtils, Forms,
15+ Controls, PairSplitter, ExtCtrls;
16+
17+ type
18+ TForm1 = class(TForm)
19+ PaintBox1: TPaintBox;
20+ PaintBox2: TPaintBox;
21+ PairSplitter1: TPairSplitter;
22+ PairSplitterSide1: TPairSplitterSide;
23+ PairSplitterSide2: TPairSplitterSide;
24+ end;
25+
26+ var
27+ Form1: TForm1;
28+
29+ implementation
30+
31+ {$R *.lfm}
32+
33+ { TForm1 }
34+
35+ end.
36+```
1137
12-interface
38+## Differences in TSplitter and TPairSplitter behaviour
1339
14-uses
15- Classes, SysUtils, Forms,
16- Controls, PairSplitter, ExtCtrls;
40+[![lossy=false](/wiki-images/1/1b/SplitterVariationsAndResize.png)](</File:SplitterVariationsAndResize.png> "lossy=false")
1741
18-type
19- TForm1 = class(TForm)
20- PaintBox1: TPaintBox;
21- PaintBox2: TPaintBox;
22- PairSplitter1: TPairSplitter;
23- PairSplitterSide1: TPairSplitterSide;
24- PairSplitterSide2: TPairSplitterSide;
25- end;
42+**TPairSplitter** behaves and looks like a [[TSplitter]] with two TPanel client areas attached to each side of it in a single control. The TPairSplitter control itself is usually set to alClient to fill its parent space entirely. Each side can be filled with other controls, which usually are also set to alClient. The property **SplitterType** controls wether to use horizontal or vertical splitting.
2643
27-var
28- Form1: TForm1;
44+The divider position in between the containers is defined by the property **Position** in terms of pixels (absolute positioning). A TPairSplitter behaves exactly like a TSplitter during run-time in terms of distribution of additional space when resizing the outer container element: There is one side that acts like the fixed part as if aligned to alTop/alBottom or alLeft/alRight (depending on split orientation vertically or horizontally) and one that acts like if aligned to alClient. Additional space will be distributed asymmetrically, that is only the alClient part will receive additional space in both directions (becomes evident considering the absolute pixel value of the position property which is not recomputed automatically).
2945
30-implementation
46+The splitter divider element cannot be manipulated by mouse during design-time, but can be adjusted by the position property in the Object Inspector. Changing the width/height of controls on either side does not work during design-time (neither using the mouse nor the Object Inspector). This is probably true for run-time also, since the position property is to be used in this case.
3147
32-{$R *.lfm}
48+By using the position property, an evenly distribution of additional space can be achieved easily in code by making an assignment in the OnResize event handler like: `Splitter.Position := Splitter.Width div 2`. This is not exactly the same as a proportional distribution though, which would need to store and restore a position value before/after the resizing. If something like that is needed, see the article on [[TSplitter|TSplitter and AnchorSides]].
3349
34-{ TForm1 }
50+## See also
3551
36-end.
37-```
52+ * [TPairSplitter doc](<http://lazarus-ccr.sourceforge.net/docs//lcl/pairsplitter/tpairsplitter.html> "doc:/lcl/pairsplitter/tpairsplitter.html")
53+ * [[TSplitter]]
3854
39-## See also
55+
4056
41-- [[doc:/lcl/pairsplitter/tpairsplitter.html|TPairSplitter doc]]
42-- [[TSplitter]]
57+[[LCL Components]] Component Tab | Components
58+---|---
59+[[Standard tab|Standard]] | [[TMainMenu]] • [[TPopupMenu]] • [[TButton]] • [[TLabel]] • [[TEdit]] • [[TMemo]] • [[TToggleBox]] • [[TCheckBox]] • [[TRadioButton]] • [[TListBox]] • [[TComboBox]] • [[TScrollBar]] • [[TGroupBox]] • [[TRadioGroup]] • [[TCheckGroup]] • [[TPanel]] • [[TFrame]] • [[TActionList]]
60+[[Additional tab|Additional]] | [[TBitBtn]] • [[TSpeedButton]] • [[TStaticText]] • [[TImage]] • [[TShape]] • [[TBevel]] • [[TPaintBox]] • [[TNotebook]] • [[TLabeledEdit]] • [[TSplitter]] • [[TTrayIcon]] • [[TControlBar]] • [[TFlowPanel]] • [[TMaskEdit]] • [[TCheckListBox]] • [[TScrollBox]] • [[TApplicationProperties]] • [[TStringGrid]] • [[TDrawGrid]] • TPairSplitter • [[TColorBox]] • [[TColorListBox]] • [[TValueListEditor]]
61+[[Common Controls tab|Common Controls]] | [[TTrackBar]] • [[TProgressBar]] • [[TTreeView]] • [[TListView]] • [[TStatusBar]] • [[TToolBar]] • [[TCoolBar]] • [[TUpDown]] • [[TPageControl]] • [[TTabControl]] • [[THeaderControl]] • [[TImageList]] • [[TPopupNotifier]] • [[TDateTimePicker]]
62+[[Dialogs tab|Dialogs]] | [[TOpenDialog]] • [[TSaveDialog]] • [[TSelectDirectoryDialog]] • [[TColorDialog]] • [[TFontDialog]] • [[TFindDialog]] • [[TReplaceDialog]] • [[TTaskDialog]] • [[TOpenPictureDialog]] • [[TSavePictureDialog]] • [[TCalendarDialog]] • [[TCalculatorDialog]] • [[TPrinterSetupDialog]] • [[TPrintDialog]] • [[TPageSetupDialog]]
63+[[Data Controls tab|Data Controls]] | [[TDBNavigator]] • [[TDBText]] • [[TDBEdit]] • [[TDBMemo]] • [[TDBImage]] • [[TDBListBox]] • [[TDBLookupListBox]] • [[TDBComboBox]] • [[TDBLookupComboBox]] • [[TDBCheckBox]] • [[TDBRadioGroup]] • [[TDBCalendar]] • [[TDBGroupBox]] • [[TDBGrid]] • [[TDBDateTimePicker]]
64+[[Data Access tab|Data Access]] | [[TDataSource]] • [[TCSVDataSet]] • [[TSdfDataSet]] • [[TBufDataset]] • [[TFixedFormatDataSet]] • [[TDbf]] • [[TMemDataset]]
65+[[System tab|System]] | [[TTimer]] • [[TIdleTimer]] • [[TLazComponentQueue]] • [[THTMLHelpDatabase]] • [[THTMLBrowserHelpViewer]] • [[TAsyncProcess]] • [[TProcessUTF8]] • [[TProcess]] • [[TSimpleIPCClient]] • [[TSimpleIPCServer]] • [[TXMLConfig]] • [[TEventLog]] • [[TServiceManager]] • [[TCHMHelpDatabase]] • [[TLHelpConnector]]
66+[[Misc tab|Misc]] | [[TColorButton]] • [[TSpinEdit]] • [[TFloatSpinEdit]] • [[TArrow]] • [[TCalendar]] • [[TEditButton]] • [[TFileNameEdit]] • [[TDirectoryEdit]] • [[TDateEdit]] • [[TTimeEdit]] • [[TCalcEdit]] • [[TFileListBox]] • [[TFilterComboBox]] • [[TComboBoxEx]] • [[TCheckComboBox]] • [[TButtonPanel]] • [[TShellTreeView]] • [[TShellListView]] • [[TXMLPropStorage]] • [[TINIPropStorage]] • [[TJSONPropStorage]] • [[TIDEDialogLayoutStorage]] • [[TMRUManager]] • [[TStrHolder]]
67+[[LazControls tab|LazControls]] | [[TCheckBoxThemed]] • [[TDividerBevel]] • [[TExtendedNotebook]] • [[TListFilterEdit]] • [[TListViewFilterEdit]] • [[TLvlGraphControl]] • [[TShortPathEdit]] • [[TSpinEditEx]] • [[TFloatSpinEditEx]] • [[TTreeFilterEdit]] • [[TExtendedTabControl]] •
68+[[RTTI tab|RTTI]] | [[TTIEdit]] • [[TTIComboBox]] • [[TTIButton]] • [[TTICheckBox]] • [[TTILabel]] • [[TTIGroupBox]] • [[TTIRadioGroup]] • [[TTICheckGroup]] • [[TTICheckListBox]] • [[TTIListBox]] • [[TTIMemo]] • [[TTICalendar]] • [[TTIImage]] • [[TTIFloatSpinEdit]] • [[TTISpinEdit]] • [[TTITrackBar]] • [[TTIProgressBar]] • [[TTIMaskEdit]] • [[TTIColorButton]] • [[TMultiPropertyLink]] • [[TTIPropertyGrid]] • [[TTIGrid]]
69+[[SQLdb tab|SQLdb]] | [[TSQLQuery]] • [[TSQLTransaction]] • [[TSQLScript]] • [[TSQLConnector]] • [[TMSSQLConnection]] • [[TSybaseConnection]] • [[TPQConnection]] • [[TPQTEventMonitor]] • [[TOracleConnection]] • [[TODBCConnection]] • [[TMySQL40Connection]] • [[TMySQL41Connection]] • [[TMySQL50Connection]] • [[TMySQL51Connection]] • [[TMySQL55Connection]] • [[TMySQL56Connection]] • [[TMySQL57Connection]] • [[TSQLite3Connection]] • [[TIBConnection]] • [[TFBAdmin]] • [[TFBEventMonitor]] • [[TSQLDBLibraryLoader]]
70+[[Pascal Script tab|Pascal Script]] | [[TPSScript]] • [[TPSScriptDebugger]] • [[TPSDllPlugin]] • [[TPSImport Classes]] • [[TPSImport DateUtils]] • [[TPSImport ComObj]] • [[TPSImport DB]] • [[TPSImport Forms]] • [[TPSImport Controls]] • [[TPSImport StdCtrls]] • [[TPSCustomPlugin]]
71+[[SynEdit tab|SynEdit]] | [[TSynEdit]] • [[TSynCompletion]] • [[TSynAutoComplete]] • [[TSynMacroRecorder]] • [[TSynExporterHTML]] • [[TSynPluginSyncroEdit]] • [[TSynPasSyn]] • [[TSynFreePascalSyn]] • [[TSynCppSyn]] • [[TSynJavaSyn]] • [[TSynPerlSyn]] • [[TSynHTMLSyn]] • [[TSynXMLSyn]] • [[TSynLFMSyn]] • [[TSynDiffSyn]] • [[TSynUNIXShellScriptSyn]] • [[TSynCssSyn]] • [[TSynPHPSyn]] • [[TSynTeXSyn]] • [[TSynSQLSyn]] • [[TSynPythonSyn]] • [[TSynVBSyn]] • [[TSynAnySyn]] • [[TSynMultiSyn]] • [[TSynBatSyn]] • [[TSynIniSyn]] • [[TSynPoSyn]]
72+[[Chart tab|Chart]] | [[TChart]] • [[TListChartSource]] • [[TRandomChartSource]] • [[TUserDefinedChartSource]] • [[TCalculatedChartSource]] • [[TDbChartSource]] • [[TChartToolset]] • [[TChartAxisTransformations]] • [[TChartStyles]] • [[TChartLegendPanel]] • [[TChartNavScrollBar]] • [[TChartNavPanel]] • [[TIntervalChartSource]] • [[TDateTimeIntervalChartSource]] • [[TChartListBox]] • [[TChartExtentLink]] • [[TChartImageList]]
73+[[IPro tab|IPro]] | [[TIpFileDataProvider]] • [[TIpHtmlDataProvider]] • [[TIpHttpDataProvider]] • [[TIpHtmlPanel]]
74+[[Virtual Controls tab|Virtual Controls]] | [[TVirtualDrawTree]] • [[TVirtualStringTree]] • [[TVTHeaderPopupMenu]]
4375
4476---
45-*From the Free Pascal wiki, page "TPairSplitter", as it stood on 2020-03-01 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
77+*From the Free Pascal wiki, page "TPairSplitter", as the Internet Archive kept it on 2025-06-16, last changed on 2024-11-17. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history