Overview
TheTTreePageNavigator component provides navigation controls for multi-page tree diagrams. It includes buttons for moving between pages and support for printing page ranges.
Components
TTreePageNavigator
Navigation control for tree pages.Tree- The tree component to navigateOnButtonClicked- Event fired when a button is clicked
Navigation Buttons
The navigator includes the following buttons:nbFirst- Go to first pagenbPrior- Go to previous pagenbNext- Go to next pagenbLast- Go to last page
Usage Examples
Basic Setup
Design-Time Setup
Enable/Disable Buttons
Print Current Page
Print All Pages
Print Page Range
Print Dialog
Handle Button Click Events
Manual Page Navigation
Get Current Page
Get Total Pages
Check if First/Last Page
Navigate Programmatically
Custom Print Title
Print Multiple Copies
Update After Page Change
Combined with Page Controls
Keyboard Navigation
Helper Functions
TreePrintDialog
Creates a print dialog configured for tree page printing.- Automatically configured for page range printing
- MinPage set to 1
- MaxPage set to Tree.Page.Count
- Options include page number selection
- PrintRange set to prPageNums
Print Features
Standard Print
- Prints all pages by default
- Shows print dialog for user selection
- Supports multiple copies
- Respects page range selection
PrintPages Method
- Direct printing without dialog
- Specify exact page range
- FromPage: Starting page (1-based)
- ToPage: Ending page (0 = all pages)
Print Properties
- Printer title from Navigator.Name
- Automatic page breaks
- Uses Tree.ChartPrintRect for layout
- Maintains page state after printing
Events
OnButtonClicked
Fired when any navigator button is clicked.Button States
Buttons are automatically enabled/disabled:-
First/Prior buttons:
- Enabled when
Tree.Page.Page > 1 - Disabled on first page
- Enabled when
-
Next/Last buttons:
- Enabled when
Tree.Page.Page < Tree.Page.Count - Disabled on last page
- Enabled when
-
All buttons:
- Disabled when
Tree.Page.Count = 0 - Disabled when Tree is nil
- Disabled when
Related Components
- TCustomTree - Tree component
- TTreeEditor - Visual editor
- Page Settings - Page configuration
