Difference between revisions of "TTDINotebook"
Dopidaniel (talk | contribs) |
Dopidaniel (talk | contribs) |
||
Line 28: | Line 28: | ||
* Allow to close Tabs with Mouse Middle Button | * Allow to close Tabs with Mouse Middle Button | ||
* Allows Close All Tabs | * Allows Close All Tabs | ||
+ | |||
== Download == | == Download == | ||
Line 54: | Line 55: | ||
== Methods and Properties == | == Methods and Properties == | ||
+ | * '''procedure ShowFormInPage( AForm: TForm; ImageIndex : Integer = -1 );''' | ||
+ | Show a already created Form in a new Page. If there is an Page that already owns this Form variable, it will bring it to front, rather than create a new Page. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | * '''Function CanCloseAPage( APageIndex: Integer): Boolean;''' | ||
+ | This will fire ''OnCloseQuery'' of the Internal Form reference to a APageIndex Tab, and Returns True if it can be Closed. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | * '''Function CanCloseAllPages: Boolean;''' | ||
+ | The same as above, but will check All Tabs | ||
+ | |||
+ | ---- | ||
+ | |||
+ | * '''procedure ScrollPage( ToForward: Boolean );''' | ||
+ | Go to Next ou Prior Page, depending ToForward parameter | ||
+ | |||
+ | ---- | ||
+ | |||
+ | * '''procedure CheckInterface;''' | ||
+ | Check the TDI Interface, enabling/disabling internal components (This method is called from inside) | ||
== Note == | == Note == | ||
[[Category:Components]] | [[Category:Components]] |
Revision as of 16:17, 29 May 2012
About
* A Tabbed GUI Interface
Lazarus does not have full support for MDI interface yet, and commercial applications need to open several windows at once without ShowModal.
However, the MDI interface concept has several problems, which may confuse the novice user. A more complete study on the advantages and disadvantages of the MDI can be found at wikipedia
The intention of this component is to provide a simple way to create an TDI interface, similar to that described in Wikipedia.
I used TExtendedNotebook as a base component, introducing new methods and properties to provide support for TDI. Very few changes will be needed in your code, and component TTDINotebook will handle the entire process of creation and destruction of the tabs and menus automatically.
Author
Author: Daniel Simões de Almeida
License
Key Features
- Automatically takes care of Creation and Destruction of the tabs,
- Automatically takes care of Main Menu Items related to tabs
- Automatically Close the tabs when the Internal Form is Closed or Destroyed
- Allows you to display a background image in a corner of the Form
- Respects the Max Constraint of Internal Forms, centralizing it on the Tab
- Respects the Internal Forms OnCloseQuery event when closing a Tab
- Allows customization of Labels and Images of the Menu Items Tabs
- Allow to close Tabs with Mouse Middle Button
- Allows Close All Tabs
Download
- The package can be downloaded from the Lazarus CCR SVN repository.
- You will need a SVN Client
On Windows you can use TortoiseSVN
On Linux, use: svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/tdi
Dependencies / System Requirements
- None
Screenshot
Installation
- Download the package on a directory of your preference
- Open Package File: tdi.lpk.
- Install the Package and let Lazarus rebuild.
How to Use
- Please open Project tdi\Demo\TDIDemo.lpi
- I believe studying the sources and observing the Demo working is the best way to explain the component
Methods and Properties
- procedure ShowFormInPage( AForm: TForm; ImageIndex : Integer = -1 );
Show a already created Form in a new Page. If there is an Page that already owns this Form variable, it will bring it to front, rather than create a new Page.
- Function CanCloseAPage( APageIndex: Integer): Boolean;
This will fire OnCloseQuery of the Internal Form reference to a APageIndex Tab, and Returns True if it can be Closed.
- Function CanCloseAllPages: Boolean;
The same as above, but will check All Tabs
- procedure ScrollPage( ToForward: Boolean );
Go to Next ou Prior Page, depending ToForward parameter
- procedure CheckInterface;
Check the TDI Interface, enabling/disabling internal components (This method is called from inside)