OMultiPanel - the ultimate TSplitter replacement for Delphi & Lazarus

Latest Version

1.3 (2013/09/02)

Basic info

OMultiPanel is a TSplitter replacement that allows you to split windows percentually. It can also be understood as a TGridPanel replacement with the ability to resize the cells with mouse (and the limitation of 1 row or column).

Features

  • Easy to use - just place controls into a TOMultiPanel container.
  • Easy to customize - the width, color and the whole paint procedure of splitters can be defined for every TOMultiPanel separately or application-wide.
  • Unlimited number of controls can be organized in one OMultiPanel in a row or a column. You can place an OMultiPanel into another OMultiPanel and so build complex grid designs.
  • ParentBackground support: the splitters can be transparent (OMultiPanel can render parent background - e.g. the gradient of Windows XP TabSheet).
  • Supported Delphi versions: Delphi 6 - Delphi XE4 VCL (32+64 bit).
  • Supported Lazarus versions: Lazarus 1.0.8 Win32/Win64/Linux/Mac OSX

Screenshots

OMultiPanel nested example

Video

Installation

  1. Add the directory with OMultiPanel.pas to Delphi library directory.
  2. Install package\OMultiPanel_Design.dpk

License

OMultiPanel is licensed under MPL 1.1/GPL 3/LGPL 3 tri-license.

MPL: http://www.mozilla.org/MPL/1.1/
GPL: http://www.gnu.org/licenses/gpl-3.0.html
LGPL: http://www.gnu.org/licenses/lgpl-3.0.html

Change log

OMULTIPANEL RELEASE INFORMATION
===============================

  Version 1.2 (2013-04-16)
    - Lazarus support (Win32, Win64, Linux, Mac OSX)
    - Delphi 6 support
    - Save configuration to INI (SavePositionsToIniFile,
      LoadPositionsFromIniFile)

  Version 1.1 (2013-03-23)
    - License changed to MPL/GPL/LGPL.

  Version 1.1 (2012-10-24)
    - Delphi XE3 Support
    - ParentBackground support
    - Hover property (if you update from 1.0, please change your
      TOnPaintSizingBar and TOnPaintSizingBarMethod event handlers
      according to the help).

  Version 1.0 (2012-08-02)
    - first public release

Download

Please be sure you check the license information before downloading any of the files below.

OMultiPanel with source code

TOMultiPanel

Properties

NameTypeDescription
PanelCollectionTOMultiPanelCollectionPanel Collection of TOMultiPanelItem (see TOMultiPanelItem below for more information).
PanelTypeTPanelType ptHorizontal - controls will be organized in a row.
ptVertical - controls will be organized in a column.
MinPositionDoubleMinimal panel size in OMultiPanel size (1 = 100%).
SplitterSizeIntegerSplitter size in pixel.
SplitterColorTColorSplitter color. Use clNone if you want a transparent splitter.
SplitterHoverColorTColorSplitter color when the user moves mouse over it. Use clNone if you want a transparent splitter.

Events

NameTypeDescription
OnSplitterMovedTNotifyEventFired when user moves a splitter.
OnPaintSizingBarTOnPaintSizingBar TOnPaintSizingBar = procedure(Sender: TOCustomMultiPanel; aCanvas: TCanvas; aBarRect: TRect; aHover: Boolean) of Object;

Use this event to paint splitters of a TOMultiPanel.

Functions & procedures

procedure LoadPositionsFromRegistry(aReg: TRegIniFile); overload;
procedure LoadPositionsFromRegistry(aReg: TRegIniFile; const aSection, aIdent: String); overload;
procedure SavePositionsToRegistry(aReg: TRegIniFile); overload;
procedure SavePositionsToRegistry(aReg: TRegIniFile; const aSection, aIdent: String); overload;
Load/Save panel size into registry. If you use LoadPositionsFromRegistry(aReg: TRegIniFile), the aSection and aIdent parameters will be automatically determined from TOMultiPanel owner and name.
procedure LoadPositionsFromIniFile(aIni: TCustomIniFile); overload;
procedure LoadPositionsFromIniFile(aIni: TCustomIniFile const aSection, aIdent: String); overload;
procedure SavePositionsToIniFile(aIni: TCustomIniFile); overload;
procedure SavePositionsToIniFile(aIni: TCustomIniFile const aSection, aIdent: String); overload;
Load/Save panel size into an ini file. If you use LoadPositionsFromIniFile(aIni: TCustomIniFile), the aSection and aIdent parameters will be automatically determined from TOMultiPanel owner and name.

TOMultiPanelItem

Properties

NameTypeDescription
ControlTControlControl in this cell.
PositionDoublePosition of the splitter at the right side / under the control in OMultiPanel size units (1 = 100%).
The last panel has always Position = 1.
Example: You have 3 cells in your OMultiPanel with the positions 0.333, 0.666 and 1 - the cells have equal size.
VisibleBooleanSet this property to show/hide the cell.
IndexIntegerIndex of the cell (0 = first).

Global variables

Use these variables to define default properties of new created OMultiPanels. The variables should be declared before the first TOMultiPanel was created (e.g. in the initialization section):
NameTypeDescription
OMP_SplitterColorTColorSplitterColor
OMP_SplitterHoverColorTColorSplitterHoverColor
OMP_SplitterSizeIntegerSplitterSize

Global method variables

NameTypeDescription
OMP_OnPaintSizingBarTOnPaintSizingBarMethod TOnPaintSizingBarMethod = procedure(Sender: TOCustomMultiPanel; aCanvas: TCanvas; aBarRect: TRect; aHover: Boolean);

Use a paint procedure to override default painting of all OMultiPanels that have not defined an OnPaintSizingBar event handler.

Contact me for more information (you can write in czech/english/german/russian): Email