PCL
pcl::SectionBar Class Reference

A control to manage collapsible sections of interface windows and dialogs. More...

#include <SectionBar.h>

+ Inheritance diagram for pcl::SectionBar:

Public Types

using check_event_handler = void(Control::*)(SectionBar &sender, bool checked)
 
using section_event_handler = void(Control::*)(SectionBar &sender, Control &section, bool start)
 
- Public Types inherited from pcl::Control
using child_event_handler = void(Control::*)(Control &sender, Control &child)
 
using close_event_handler = void(Control::*)(Control &sender, bool &allowClose)
 
using event_handler = void(Control::*)(Control &sender)
 
using file_drag_event_handler = void(Control::*)(Control &sender, const pcl::Point &pos, const StringList &files, unsigned modifiers, bool &wantsFiles)
 
using file_drop_event_handler = void(Control::*)(Control &sender, const pcl::Point &pos, const StringList &files, unsigned modifiers)
 
using keyboard_event_handler = void(Control::*)(Control &sender, int key, unsigned modifiers, bool &wantsKey)
 
using mouse_button_event_handler = void(Control::*)(Control &sender, const pcl::Point &pos, int button, unsigned buttons, unsigned modifiers)
 
using mouse_event_handler = void(Control::*)(Control &sender, const pcl::Point &pos, unsigned buttons, unsigned modifiers)
 
using mouse_wheel_event_handler = void(Control::*)(Control &sender, const pcl::Point &pos, int delta, unsigned buttons, unsigned modifiers)
 
using move_event_handler = void(Control::*)(Control &sender, const pcl::Point &newPos, const pcl::Point &oldPos)
 
using paint_event_handler = void(Control::*)(Control &sender, const pcl::Rect &updateRect)
 
using resize_event_handler = void(Control::*)(Control &sender, int newWidth, int newHeight, int oldWidth, int oldHeight)
 
using view_drag_event_handler = void(Control::*)(Control &sender, const pcl::Point &pos, const View &view, unsigned modifiers, bool &wantsView)
 
using view_drop_event_handler = void(Control::*)(Control &sender, const pcl::Point &pos, const View &view, unsigned modifiers)
 

Public Member Functions

 SectionBar (Control &parent=Null())
 
 ~SectionBar () override
 
void Check ()
 
void DisableTitleCheckBox (bool disable=true)
 
void Enable (bool enabled=true) override
 
void EnableTitleCheckBox (bool=true)
 
bool HasTitleCheckBox () const
 
void HideSection ()
 
bool IsChecked () const
 
bool IsEnabled () const override
 
void OnCheck (check_event_handler handler, Control &receiver)
 
void OnToggleSection (section_event_handler handler, Control &receiver)
 
ControlSection ()
 
const ControlSection () const
 
void SetChecked (bool checked=true)
 
void SetSection (Control &)
 
void SetSectionVisible (bool visible=true)
 
void SetTitle (const String &title)
 
void ShowSection ()
 
String Title () const
 
void Uncheck ()
 
- Public Member Functions inherited from pcl::Control
 Control (const Control &)=delete
 
 Control (Control &&)=delete
 
 Control (Control &parent=Null(), uint32=0)
 
 ~Control () override
 
void ActivateRealTimePreview ()
 
void ActivateTrackView ()
 
void ActivateWindow ()
 
void AdjustToContents ()
 
RGBA AlternateCanvasColor () const
 
RGBA BackgroundColor () const
 
pcl::Rect BoundsRect () const
 
void BringToFront ()
 
RGBA ButtonColor () const
 
RGBA ButtonTextColor () const
 
bool CanUpdate () const
 
RGBA CanvasColor ()
 
ControlChildByPos (const pcl::Point &p) const
 
ControlChildByPos (int x, int y) const
 
pcl::Rect ChildrenRect () const
 
ControlChildToFocus () const
 
void ClearInfoText ()
 
int ClientHeight () const
 
pcl::Rect ClientRect () const
 
int ClientWidth () const
 
void ControlToLocal (const Control &, int &x, int &y) const
 
pcl::Point ControlToLocal (const Control &w, const pcl::Point &p) const
 
pcl::Cursor Cursor () const
 
void DeactivateRealTimePreview ()
 
void DeactivateTrackView ()
 
void Disable (bool disabled=true)
 
void DisableExpansion (bool horzDisable=true, bool vertDisable=true)
 
void DisableMouseTracking (bool disable=true)
 
void DisableUpdates (bool disable=true)
 
double DisplayPixelRatio () const
 
void EnableExpansion (bool horzEnable=true, bool vertEnable=true)
 
void EnableMouseTracking (bool=true)
 
void EnableUpdates (bool enable=true)
 
void EnsureLayoutUpdated ()
 
void EnsureUnique () override
 
void Focus (bool focus=true)
 
ControlFocusedChild () const
 
FocusStyles FocusStyle () const
 
pcl::Font Font () const
 
RGBA ForegroundColor () const
 
int FrameHeight () const
 
pcl::Rect FrameRect () const
 
int FrameWidth () const
 
pcl::Cursor GetCursor () const
 
pcl::Font GetFont () const
 
void GetMaxSize (int &w, int &h) const
 
void GetMinSize (int &w, int &h) const
 
void GetScaledMaxSize (int &w, int &h) const
 
void GetScaledMinSize (int &w, int &h) const
 
pcl::Sizer GetSizer () const
 
pcl::Point GlobalToLocal (const pcl::Point &p) const
 
void GlobalToLocal (int &x, int &y) const
 
int Height () const
 
void Hide ()
 
RGBA HighlightColor () const
 
RGBA HighlightedTextColor () const
 
String InfoText () const
 
bool IsActiveWindow () const
 
bool IsAncestorOf (const Control &) const
 
bool IsFixedHeight () const
 
bool IsFixedWidth () const
 
bool IsFocused () const
 
bool IsHidden () const
 
bool IsHorizontalExpansionEnabled () const
 
bool IsMaximized () const
 
bool IsMinimized () const
 
bool IsModal () const
 
bool IsMouseTrackingEnabled () const
 
bool IsRealTimePreviewActive () const
 
bool IsTrackViewActive () const
 
bool IsUnderMouse () const
 
bool IsVerticalExpansionEnabled () const
 
bool IsVisible () const
 
bool IsWindow () const
 
void LocalToControl (const Control &, int &x, int &y) const
 
pcl::Point LocalToControl (const Control &w, const pcl::Point &p) const
 
pcl::Point LocalToGlobal (const pcl::Point &p) const
 
void LocalToGlobal (int &x, int &y) const
 
pcl::Point LocalToParent (const pcl::Point &p) const
 
void LocalToParent (int &x, int &y) const
 
int LogicalPixelsToPhysical (int size) const
 
int LogicalPixelsToResource (int size) const
 
int MaxHeight () const
 
int MaxWidth () const
 
int MinHeight () const
 
int MinWidth () const
 
void Move (const pcl::Point &p)
 
void Move (int x, int y)
 
ControlNextSiblingToFocus () const
 
void OnChildCreate (child_event_handler, Control &)
 
void OnChildDestroy (child_event_handler, Control &)
 
void OnClose (close_event_handler, Control &)
 
void OnDestroy (event_handler, Control &)
 
void OnEnter (event_handler, Control &)
 
void OnFileDrag (file_drag_event_handler, Control &)
 
void OnFileDrop (file_drop_event_handler, Control &)
 
void OnGetFocus (event_handler, Control &)
 
void OnHide (event_handler, Control &)
 
void OnKeyPress (keyboard_event_handler, Control &)
 
void OnKeyRelease (keyboard_event_handler, Control &)
 
void OnLeave (event_handler, Control &)
 
void OnLoseFocus (event_handler, Control &)
 
void OnMouseDoubleClick (mouse_event_handler, Control &)
 
void OnMouseMove (mouse_event_handler, Control &)
 
void OnMousePress (mouse_button_event_handler, Control &)
 
void OnMouseRelease (mouse_button_event_handler, Control &)
 
void OnMouseWheel (mouse_wheel_event_handler, Control &)
 
void OnMove (move_event_handler, Control &)
 
void OnPaint (paint_event_handler, Control &)
 
void OnResize (resize_event_handler, Control &)
 
void OnShow (event_handler, Control &)
 
void OnViewDrag (view_drag_event_handler, Control &)
 
void OnViewDrop (view_drop_event_handler, Control &)
 
Controloperator= (const Control &)=delete
 
Controloperator= (Control &&)=delete
 
ControlParent () const
 
pcl::Point ParentToLocal (const pcl::Point &p) const
 
void ParentToLocal (int &x, int &y) const
 
int PhysicalPixelsToLogical (int size) const
 
pcl::Point Position () const
 
void Repaint ()
 
void Repaint (const pcl::Rect &r)
 
void Repaint (int x0, int y0, int x1, int y1)
 
void Resize (int w, int h)
 
double ResourcePixelRatio () const
 
int ResourcePixelsToLogical (int size) const
 
void Restyle ()
 
Point ScaledCursorHotSpot (const Point &hotSpot) const
 
Point ScaledCursorHotSpot (int xHot, int yHot) const
 
int ScaledMaxHeight () const
 
int ScaledMaxWidth () const
 
int ScaledMinHeight () const
 
int ScaledMinWidth () const
 
template<class R >
String ScaledResource (R resource) const
 
template<class S >
String ScaledStyleSheet (S cssCode, int fontDPI=0) const
 
void Scroll (const pcl::Point &d)
 
void Scroll (const pcl::Point &d, const pcl::Rect &r)
 
void Scroll (int dx, int dy)
 
void Scroll (int dx, int dy, int x0, int y0, int x1, int y1)
 
void SendToBack ()
 
void SetAlternateCanvasColor (RGBA)
 
void SetBackgroundColor (RGBA)
 
void SetButtonColor (RGBA)
 
void SetButtonTextColor (RGBA)
 
void SetCanvasColor (RGBA)
 
void SetChildToFocus (Control &)
 
void SetClientRect (const pcl::Rect &r)
 
void SetClientRect (int x0, int y0, int x1, int y1)
 
void SetCursor (const pcl::Cursor &)
 
void SetCursorToParent ()
 
void SetFixedHeight ()
 
void SetFixedHeight (int h)
 
void SetFixedSize ()
 
void SetFixedSize (int w, int h)
 
void SetFixedWidth ()
 
void SetFixedWidth (int w)
 
void SetFocusStyle (FocusStyles)
 
void SetFont (const pcl::Font &)
 
void SetForegroundColor (RGBA)
 
void SetHighlightColor (RGBA)
 
void SetHighlightedTextColor (RGBA)
 
void SetInfoText (const String &)
 
void SetMaxHeight ()
 
void SetMaxHeight (int h)
 
void SetMaxSize ()
 
void SetMaxSize (int w, int h)
 
void SetMaxWidth ()
 
void SetMaxWidth (int w)
 
void SetMinHeight ()
 
void SetMinHeight (int h)
 
void SetMinSize ()
 
void SetMinSize (int w, int h)
 
void SetMinWidth ()
 
void SetMinWidth (int w)
 
void SetNextSiblingToFocus (Control &)
 
void SetParent (Control &)
 
void SetRealTimePreviewActive (bool=true)
 
void SetScaledFixedHeight (int h)
 
void SetScaledFixedSize (int w, int h)
 
void SetScaledFixedWidth (int w)
 
void SetScaledMaxHeight (int h)
 
void SetScaledMaxSize (int w, int h)
 
void SetScaledMaxWidth (int w)
 
void SetScaledMinHeight (int h)
 
void SetScaledMinSize (int w, int h)
 
void SetScaledMinWidth (int w)
 
void SetSizer (pcl::Sizer &)
 
void SetStyleSheet (const String &css)
 
void SetTextColor (RGBA)
 
void SetToolTip (const String &)
 
void SetTrackViewActive (bool=true)
 
void SetVariableHeight ()
 
void SetVariableSize ()
 
void SetVariableWidth ()
 
void SetVisible (bool visible)
 
void SetWindowOpacity (double)
 
void SetWindowTitle (const String &)
 
void Show ()
 
pcl::Sizer Sizer () const
 
void StackUnder (Control &)
 
String StyleSheet () const
 
RGBA TextColor () const
 
String ToolTip () const
 
void Unfocus ()
 
void Update ()
 
void Update (const pcl::Rect &r)
 
void Update (int x0, int y0, int x1, int y1)
 
pcl::Rect VisibleRect () const
 
int Width () const
 
ControlWindow () const
 
double WindowOpacity () const
 
String WindowTitle () const
 
int X () const
 
int Y () const
 
- Public Member Functions inherited from pcl::UIObject
virtual ~UIObject () noexcept(false)
 
bool IsAlias () const
 
bool IsGarbage () const
 
bool IsNull () const
 
bool IsSameObject (const UIObject &o) const
 
bool IsUnique () const
 
String ObjectId () const
 
IsoString ObjectType () const
 
bool operator< (const UIObject &o) const
 
bool operator== (const UIObject &o) const
 
size_type RefCount () const
 
void SetObjectId (const String &id)
 

Additional Inherited Members

- Static Public Member Functions inherited from pcl::Control
static void HideToolTip ()
 
static ControlNull ()
 
static void ShowToolTip (const Point &pos, const String &text, const Control &control=Control::Null(), const Rect &rect=Rect(0))
 
static void ShowToolTip (int x, int y, const String &text, const Control &control=Control::Null(), const Rect &rect=Rect(0))
 
static String ToolTipText ()
 
- Static Public Member Functions inherited from pcl::UIObject
static UIObjectNull ()
 
- Protected Member Functions inherited from pcl::UIObject
 UIObject ()=default
 
 UIObject (const UIObject &x)
 
 UIObject (UIObject &&x)
 
UIObjectoperator= (const UIObject &x)
 
UIObjectoperator= (UIObject &&x)
 

Detailed Description

SectionBar manages collapsible/extensible sections on processing interfaces and dialogs. It includes a section title label and an icon that represents the current collapsed/extended state.

When a SectionBar control is clicked, it toggles visibility of a section control and adjusts the height of the top-level parent window to fit to its new contents. SectionBar is useful to organize complex user interfaces and is extensively used by most standard process interfaces in PixInsight.

See also
ProcessInterface, Dialog

Definition at line 87 of file SectionBar.h.

Constructor & Destructor Documentation

◆ SectionBar()

pcl::SectionBar::SectionBar ( Control parent = Null())

Constructs a SectionBar as a child control of parent.

◆ ~SectionBar()

pcl::SectionBar::~SectionBar ( )
override

Destroys a SectionBar object.

Member Function Documentation

◆ Check()

void pcl::SectionBar::Check ( )
inline

A convenient synonym for SetChecked( true ).

Definition at line 205 of file SectionBar.h.

◆ DisableTitleCheckBox()

void pcl::SectionBar::DisableTitleCheckBox ( bool  disable = true)
inline

Removes (or creates) the check box in this SectionBar.

See also
EnableTitleCheckBox(), HasTitleCheckBox(), IsChecked(), OnCheck()

Definition at line 172 of file SectionBar.h.

◆ Enable()

void pcl::SectionBar::Enable ( bool  enabled = true)
overridevirtual

Enables (or disables) this SectionBar object.

When a SectionBar object is disabled, its section control is also disabled, and in case it has a title checkbox, it is also disabled. However, the collapse/extend functionality of SectionBar is unaffected by its enabled/disabled state.

See also
IsEnabled()

Reimplemented from pcl::Control.

◆ EnableTitleCheckBox()

void pcl::SectionBar::EnableTitleCheckBox ( bool  = true)

Creates (or removes) a check box in this SectionBar.

See also
DisableTitleCheckBox(), HasTitleCheckBox(), IsChecked(), OnCheck()

◆ HasTitleCheckBox()

bool pcl::SectionBar::HasTitleCheckBox ( ) const
inline

Returns true iff this SectionBar is checkable.

See also
EnableTitleCheckBox(), DisableTitleCheckBox(), IsChecked(), OnCheck()

Definition at line 155 of file SectionBar.h.

◆ HideSection()

void pcl::SectionBar::HideSection ( )
inline

A convenient synonym for SetSectionVisible( false ).

Definition at line 264 of file SectionBar.h.

◆ IsChecked()

bool pcl::SectionBar::IsChecked ( ) const
inline

Returns true iff there is a check box in this SectionBar and it is currently checked.

See also
SetChecked(), EnableTitleCheckBox(), HasTitleCheckBox(), OnCheck()

Definition at line 183 of file SectionBar.h.

◆ IsEnabled()

bool pcl::SectionBar::IsEnabled ( ) const
inlineoverridevirtual

Returns true iff this SectionBar object is enabled.

See also
Enable()

Reimplemented from pcl::Control.

Definition at line 223 of file SectionBar.h.

◆ Section() [1/2]

Control& pcl::SectionBar::Section ( )
inline

Returns a reference to the section control managed by this SectionBar.

See also
SetSection()

Definition at line 118 of file SectionBar.h.

References pcl::Control::Null().

◆ Section() [2/2]

const Control& pcl::SectionBar::Section ( ) const
inline

Returns a reference to the immutable section control managed by this SectionBar.

See also
SetSection()

Definition at line 107 of file SectionBar.h.

References pcl::Control::Null().

◆ SetChecked()

void pcl::SectionBar::SetChecked ( bool  checked = true)

Checks or unchecks the check box in this SectionBar.

The enabled state of the section control (if there is one) will be automatically toggled according to the state of the check box: the section control will be enabled if the check box is checked; it will be disabled otherwise.

Note
If this SectionBar is not checkable, this function is ignored.
See also
IsChecked(), EnableTitleCheckBox(), HasTitleCheckBox(), OnCheck()

◆ SetSection()

void pcl::SectionBar::SetSection ( Control )

Sets the section control managed by this SectionBar.

See also
Section()

◆ SetSectionVisible()

void pcl::SectionBar::SetSectionVisible ( bool  visible = true)

Shows or hides the section control managed by this SectionBar.

In general, this function should be used instead of simply calling Control::SetVisible() (or Control::Show()/ControlHide()). This function ensures that the parent control (typically a process interface) regenerates its layout correctly after changing visibility of the section control.

See also
ShowSection(), HideSection()

◆ SetTitle()

void pcl::SectionBar::SetTitle ( const String title)
inline

Sets the title of this SectionBar.

See also
Title()

Definition at line 145 of file SectionBar.h.

◆ ShowSection()

void pcl::SectionBar::ShowSection ( )
inline

A convenient synonym for SetSectionVisible( true ).

Definition at line 256 of file SectionBar.h.

◆ Title()

String pcl::SectionBar::Title ( ) const
inline

Returns the title of this SectionBar.

See also
SetTitle()

Definition at line 135 of file SectionBar.h.

◆ Uncheck()

void pcl::SectionBar::Uncheck ( )
inline

A convenient synonym for SetChecked( false ).

Definition at line 213 of file SectionBar.h.


The documentation for this class was generated from the following file: