52 #ifndef __PCL_TreeBox_h
53 #define __PCL_TreeBox_h
57 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
134 return Node(
nullptr );
167 const Node* operator [](
int idx )
const
191 Insert( NumberOfChildren(), node );
221 return !IsExpanded();
350 Node( std::nullptr_t )
358 void* CloneHandle()
const override;
363 child_node_list m_children;
364 bool m_removed =
false;
401 const Node* operator [](
int idx )
const
425 Insert( NumberOfChildren(), n );
460 return !AreMultipleSelectionsEnabled();
471 EnableMultipleSelections( !disable );
500 return NodeByPosition( p.
x, p.
y );
507 return NodeByPosition( p.
x, p.
y );
550 ShowColumn( col, !hide );
567 return PhysicalPixelsToLogical( ColumnWidth( col ) );
574 SetColumnWidth( col, LogicalPixelsToPhysical( width ) );
640 return PhysicalPixelsToLogical( IndentSize() );
647 SetIndentSize( LogicalPixelsToPhysical( size ) );
664 EnableNodeExpansion( !disable );
681 EnableRootDecoration( !disable );
700 EnableAlternateRowColor( !disable );
717 EnableUniformRowHeight( !disable );
730 int w, dum; GetIconSize( w, dum );
return w;
737 int dum, h; GetIconSize( dum, h );
return h;
748 SetIconSize( size, size );
755 GetIconSize( width, height ); width = PhysicalPixelsToLogical( width ); height = PhysicalPixelsToLogical( height );
762 int width, dum; GetIconSize( width, dum );
return PhysicalPixelsToLogical( width );
769 int dum, height; GetIconSize( dum, height );
return PhysicalPixelsToLogical( height );
776 SetIconSize( LogicalPixelsToPhysical( width ), LogicalPixelsToPhysical( height ) );
783 size = LogicalPixelsToPhysical( size );
784 SetIconSize( size, size );
801 EnableHeaderSorting( !disable );
806 void Sort(
int col = 0,
bool ascending =
true );
822 EnableNodeDragging( !disable );
921 EventHandlers() =
default;
922 EventHandlers(
const EventHandlers& ) =
default;
923 EventHandlers& operator =(
const EventHandlers& ) =
default;
929 child_node_list m_children;
931 static pcl::Font FontFromHandle(
void* h )
936 static const void* HandleFromFont(
const pcl::Font& f )
941 static Bitmap BitmapFromHandle(
void* h )
946 static const void* HandleFromBitmap(
const Bitmap& p )
959 friend class TreeBoxEventDispatcher;
Client-side interface to a PixInsight Bitmap object.
Client-side interface to a PixInsight Control object.
Client-side interface to a PixInsight Font object.
A generic point in the two-dimensional space.
component x
Abscissa (horizontal, or X-axis coordinate).
component y
Ordinate (vertical, or Y-axis coordinate).
A generic rectangle in the two-dimensional space.
Generic dynamic array of pointers to objects.
Client-side interface to a PixInsight TreeBox node.
RGBA BackgroundColor(int col) const
Node(TreeBox &parent, int index=-1)
void Disable(bool disable=true)
void Collapse(bool collapse=true)
RGBA TextColor(int col) const
void SetCheckable(bool=true)
const TreeBox & ParentTree() const
int Alignment(int col) const
void SetFont(int col, const pcl::Font &)
pcl::Font Font(int col) const
void Unselect(bool unselect=true)
void SetBackgroundColor(int col, RGBA)
void SetAlignment(int col, int align)
Node(Node &parent, int index)
void Expand(bool expand=true)
Bitmap Icon(int col) const
int NumberOfChildren() const
void Insert(int idx, Node *)
const Node * Child(int idx) const
void Uncheck(bool uncheck=true)
int ChildIndex(const Node *) const
void SetText(int col, const String &)
const Node * Parent() const
void SetSelectable(bool=true)
void SetIcon(int col, const Bitmap &)
String Text(int col) const
bool IsSelectable() const
String ToolTip(int col) const
void SetToolTip(int col, const String &)
void SetTextColor(int col, RGBA)
Client-side interface to a PixInsight TreeBox control.
int ScaledColumnWidth(int col) const
void SetHeaderText(int col, const String &)
void EnableRootDecoration(bool=true)
void EnableNodeExpansion(bool=true)
void DisableMultipleSelections(bool disable=true)
void SetNumberOfColumns(int nCols)
bool IsUniformRowHeightEnabled() const
bool IsNodeExpansionEnabled() const
bool IsAlternateRowColorEnabled() const
int ChildIndex(const Node *) const
int ScaledIndentSize() const
String HeaderText(int col) const
IndirectArray< Node > SelectedNodes() const
bool IsNodeDraggingEnabled() const
void DisableUniformRowHeight(bool disable=true)
void SetNodeIntoView(Node *)
pcl::Rect NodeRect(const Node *) const
const Node * NodeByPosition(int x, int y) const
int HeaderAlignment(int col) const
void SetCurrentNode(Node *)
const Node * Child(int idx) const
void SetScaledIndentSize(int size)
void SetScaledIconSize(int size)
void AdjustColumnWidthToContents(int col)
void EnableNodeDragging(bool=true)
int ColumnWidth(int col) const
bool IsColumnVisible(int col) const
const Node * NodeByPosition(const pcl::Point &p) const
void SetIconSize(int size)
void GetIconSize(int &width, int &height) const
void DisableNodeDragging(bool disable=true)
void DisableAlternateRowColor(bool disable=true)
Node * NodeByPosition(const pcl::Point &p)
void EnableHeaderSorting(bool=true)
void HideHeader(bool hide=true)
const Node * CurrentNode() const
bool IsHeaderSortingEnabled() const
int ScaledIconHeight() const
void SetColumnWidth(int col, int width)
void DisableRootDecoration(bool disable=true)
Node * NodeByPosition(int x, int y)
void DisableHeaderSorting(bool disable=true)
bool AreMultipleSelectionsEnabled() const
void ShowColumn(int col, bool show=true)
int NumberOfChildren() const
void EnableUniformRowHeight(bool=true)
void Sort(int col=0, bool ascending=true)
void SetScaledColumnWidth(int col, int width)
Bitmap HeaderIcon(int col) const
int NumberOfColumns() const
bool IsRootDecorationEnabled() const
void HideColumn(int col, bool hide=true)
bool HasSelectedTopLevelNodes() const
void EnableMultipleSelections(bool enable=true)
void EnableAlternateRowColor(bool=true)
bool IsHeaderVisible() const
void ShowHeader(bool show=true)
void SetHeaderAlignment(int col, int align)
void SetScaledIconSize(int width, int height)
TreeBox(Control &parent=Control::Null())
void Insert(int idx, Node *)
void SetIconSize(int width, int height)
int ScaledIconWidth() const
void SetHeaderIcon(int col, const Bitmap &)
void GetScaledIconSize(int &width, int &height) const
void DisableNodeExpansion(bool disable=true)
static TreeBox & NullTree()
bool AreMultipleSelectionsDisabled() const
Root base class for all user interface objects.
RI Select(RI i, RI j, distance_type k)
void OnNodeEntered(node_event_handler, Control &)
void(Control::*)(TreeBox &) tree_event_handler
void OnNodeSelectionUpdated(tree_event_handler, Control &)
void OnNodeActivated(node_event_handler, Control &)
void OnNodeCollapsed(node_expand_event_handler, Control &)
void OnNodeClicked(node_event_handler, Control &)
void OnCurrentNodeUpdated(node_navigation_event_handler, Control &)
void(Control::*)(TreeBox &, TreeBox::Node &) node_expand_event_handler
void OnNodeDoubleClicked(node_event_handler, Control &)
void OnNodeExpanded(node_expand_event_handler, Control &)
void OnNodeUpdated(node_event_handler, Control &)
void(Control::*)(TreeBox &, TreeBox::Node &, int) node_event_handler
void(Control::*)(TreeBox &, TreeBox::Node &, TreeBox::Node &) node_navigation_event_handler