Forum > Packages and Libraries
[New Component] ExtTabCtrl - A custom, feature-rich tab control (LGPL)
ovidio:
Hi everyone,
I wanted to share a component I’ve been working on called ExtTabCtrl.
Please, note that I am not a professional programmer. This component started as a hobby project written for my own personal use, but I've decided to share it here in the hope that someone else in the community might find it useful. It has been developed to the best of my (somewhat limited) ability, and it comes with absolutely no warranty.
Indeed, this is my very first post on the forum, although I have been using it quietly for many years as an invaluable source of knowledge. So, I thank this community for all the help and insights I've found here over the years!
What is ExtTabCtrl?
It is a custom tab control component for Lazarus / Free Pascal designed to be a replacement for the standard TPageControl and TTabControl. It uses purely LCL units with no platform-specific {$IFDEF} blocks.
Some of its key features include:
* Five Visual Styles: Supports Flat, Button, Delphi, Chrome, and macOS looks.
* Tab Positions: The component can be positioned Top, Bottom, Left, or Right (with automatic text and image rotation for vertical tabs).
* Close & Add Buttons: Includes per-tab close buttons (visible on active/hovered tabs) and a built-in "Add" button for adding new tabs.
* Drag-to-Reorder: Tabs can be rearranged by dragging, with a visual drop indicator.
* Per-Tab Customization: Each tab can have its own unique background color, accent stripe color, standalone bitmap, visibility state, and font style overrides.
* Navigation: Fully supports mouse-wheel scrolling through overflowing tabs, keyboard arrow navigation, and optional middle-click closing.
Compatibility & Testing
Because it relies entirely on standard LCL code, it is supposed to be multiplatform across Windows, Linux, and macOS. However, because of my current setup, I have only been able to personally test it under Windows and macOS.
Feedback Welcome!
Since I haven't been able to test it on Linux (GTK2/GTK3/Qt5) myself, I would be incredibly grateful if any Linux users could drop it into a test project and let me know how it renders and behaves!
Of course, general feedback, constructive criticisms, suggestions, or bug reports from Windows and macOS users are also highly welcome. Please keep in mind that since this is a hobby project, I might not always be able to provide immediate fixes, but I will do my best.
Source Code / Download:
https://github.com/ovidiopr/ExtTabCtrl
Thank you for your time, and I hope someone finds it helpful!
Ovidio
ALLIGATOR:
--- Code: ---Note for application developers:
The LGPL explicitly allows this component to be linked into commercial,
proprietary, and closed-source applications without requiring
the source code of your overall application to be disclosed,
provided that modifications to the ExtTabCtrl library itself
remain open source under the LGPL.
--- End code ---
I don't understand what you're saying about the license. Are you sure the LGPL allows that?
If so, why does FPC include a special addendum to the LGPL in its library license - one that permits static linking?
https://wiki.lazarus.freepascal.org/licensing
ovidio:
As far as I understand, it does, but I am not sure. In any case, it is my intention to allow it (maybe I will have to add also this exception).
ovidio:
Here are some screenshots. I have added them also on the GitHub page (https://github.com/ovidiopr/ExtTabCtrl)
wp:
Looks nice!
Tested on Linux: the main widgetsets are working (gtk2, gtk3, qt5, qt6). In gtk3 there seems to be some text measuring issue - see attached screenshot. Maybe - since there is lot of activity in the gtk3 widgetset now - this issue is resolved by itself in a few days/weeks.
A few ideas:
- Why is there no mouse-over effect (regarding the tab background color) on the selected tab?
- The mouse-over effect of tab background appears too strong for some Style settings (tested the demo_notebook project).
- Since you are mimicking a row of tabs in a folder I would expect to see a line at the base beyond the right-most tab reaching to the right side of the control (see 2nd screenshot where I added the baseline manually)
Navigation
[0] Message Index
[#] Next page