PCL
pcl::TextBox Class Reference

Client-side interface to a PixInsight TextBox control. More...

#include <TextBox.h>

+ Inheritance diagram for pcl::TextBox:

Public Types

using caret_event_handler = void(Control::*)(TextBox &sender, int oldPos, int newPos)
 
using selection_event_handler = void(Control::*)(TextBox &sender, int newStart, int newEnd)
 
using unicode_event_handler = void(Control::*)(TextBox &sender, const String &)
 
- Public Types inherited from pcl::Frame
using style = FrameStyle::value_type
 
- 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

 TextBox (const String &text=String(), Control &parent=Control::Null())
 
 ~TextBox () override
 
int CaretPosition () const
 
void Clear ()
 
void Delete ()
 
void End ()
 
void GetSelection (int &selStart, int &selEnd) const
 
bool HasSelection () const
 
void Home ()
 
void Insert (const String &text)
 
bool IsReadOnly () const
 
void OnCaretPositionUpdated (caret_event_handler, Control &)
 
void OnSelectionUpdated (selection_event_handler, Control &)
 
void OnTextUpdated (unicode_event_handler, Control &)
 
void SelectAll (bool=true)
 
String SelectedText () const
 
void SetCaretPosition (int)
 
template<class S >
void SetPlainText (const S &text)
 
void SetReadOnly (bool ro=true)
 
void SetReadWrite (bool rw=true)
 
void SetSelection (int selStart, int selEnd)
 
void SetText (const String &)
 
String Text () const
 
void Unselect (bool unsel=true)
 
- Public Member Functions inherited from pcl::Frame
 Frame (Control &parent=Control::Null())
 
 ~Frame () override
 
int BorderWidth () const
 
int LineWidth () const
 
int ScaledBorderWidth () const
 
int ScaledLineWidth () const
 
void SetLineWidth (int)
 
void SetScaledLineWidth (int width)
 
void SetStyle (style)
 
style Style () const
 
- 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
 
virtual void Enable (bool enabled=true)
 
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
 
virtual bool IsEnabled () 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)
 

Static Public Member Functions

template<class S >
static S PlainText (const S &text)
 
- 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 ()
 

Additional Inherited Members

- 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

TextBox is a multiline, plain text output control. A TextBox control implements the entire text output functionality of a PixInsight console; refer to the Console class for full information about console output capabilities.

See also
Console, CodeEditor

Definition at line 80 of file TextBox.h.

Member Typedef Documentation

◆ caret_event_handler

using pcl::TextBox::caret_event_handler = void (Control::*)( TextBox& sender, int oldPos, int newPos )

#

Definition at line 271 of file TextBox.h.

◆ selection_event_handler

using pcl::TextBox::selection_event_handler = void (Control::*)( TextBox& sender, int newStart, int newEnd )

#

Definition at line 275 of file TextBox.h.

◆ unicode_event_handler

using pcl::TextBox::unicode_event_handler = void (Control::*)( TextBox& sender, const String& )

#

Definition at line 267 of file TextBox.h.

Constructor & Destructor Documentation

◆ TextBox()

pcl::TextBox::TextBox ( const String text = String(),
Control parent = Control::Null() 
)

Constructs a TextBox as a child control of parent with the specified initial text.

◆ ~TextBox()

pcl::TextBox::~TextBox ( )
inlineoverride

Destroys a TextBox control.

Definition at line 93 of file TextBox.h.

Member Function Documentation

◆ CaretPosition()

int pcl::TextBox::CaretPosition ( ) const

#

◆ Clear()

void pcl::TextBox::Clear ( )
inline

Clears (removes) the text in this TextBox control.

Definition at line 132 of file TextBox.h.

◆ Delete()

void pcl::TextBox::Delete ( )

#

◆ End()

void pcl::TextBox::End ( )
inline

#

Definition at line 245 of file TextBox.h.

◆ GetSelection()

void pcl::TextBox::GetSelection ( int &  selStart,
int &  selEnd 
) const

Gets the current text selection in this TextBox control.

Parameters
selStartIndex of the first selected character.
selEndIndex of the last selected character plus one.

When selStart < selEnd, there is a text selection in this TextBox. Both indexes are zero-based.

See also
SetSelection()

◆ HasSelection()

bool pcl::TextBox::HasSelection ( ) const
inline

Returns true iff this TextBox control has a valid selection.

Definition at line 213 of file TextBox.h.

◆ Home()

void pcl::TextBox::Home ( )
inline

#

Definition at line 238 of file TextBox.h.

◆ Insert()

void pcl::TextBox::Insert ( const String text)

#

◆ IsReadOnly()

bool pcl::TextBox::IsReadOnly ( ) const

Returns true iff this TextBox control is in read-only state.

See also
SetReadOnly(), SetReadWrite()

◆ OnCaretPositionUpdated()

void pcl::TextBox::OnCaretPositionUpdated ( caret_event_handler  ,
Control  
)

#

◆ OnSelectionUpdated()

void pcl::TextBox::OnSelectionUpdated ( selection_event_handler  ,
Control  
)

#

◆ OnTextUpdated()

void pcl::TextBox::OnTextUpdated ( unicode_event_handler  ,
Control  
)

#

◆ PlainText()

template<class S >
static S pcl::TextBox::PlainText ( const S &  text)
inlinestatic

Returns a string that can be used to write the specified text to a TextBox control as plain text, that is without interpreting tags or character entities.

Definition at line 113 of file TextBox.h.

◆ SelectAll()

void pcl::TextBox::SelectAll ( bool  = true)

Selects all the text in this TextBox control.

See also
Unselect(), GetSelection(), SetSelection()

◆ SelectedText()

String pcl::TextBox::SelectedText ( ) const

Returns the selected text in this TextBox control, or an empty string if there is no selection.

See also
GetSelection(), SetSelection(), SelectAll(), Unselect()

◆ SetCaretPosition()

void pcl::TextBox::SetCaretPosition ( int  )

#

◆ SetPlainText()

template<class S >
void pcl::TextBox::SetPlainText ( const S &  text)
inline

Sets the plain text of this TextBox control.

This member function is equivalent to SetText( PlainText( text ) ).

Definition at line 124 of file TextBox.h.

◆ SetReadOnly()

void pcl::TextBox::SetReadOnly ( bool  ro = true)

Enables or disables the read-only state of this TextBox control.

See also
SetReadWrite(), IsReadOnly()

◆ SetReadWrite()

void pcl::TextBox::SetReadWrite ( bool  rw = true)
inline

Disables or enables the read-only state of this TextBox control.

This is a convenience member function, equivalent to SetReadOnly( !rw )

See also
SetReadOnly(), IsReadOnly()

Definition at line 159 of file TextBox.h.

◆ SetSelection()

void pcl::TextBox::SetSelection ( int  selStart,
int  selEnd 
)

Sets a new text selection in this TextBox control.

Parameters
selStartIndex of the first selected character.
selEndIndex of the last selected character plus one.

When selStart < selEnd, there is a text selection in this TextBox. Both indexes are zero-based.

See also
GetSelection()

◆ SetText()

void pcl::TextBox::SetText ( const String )

Sets the text of this TextBox control.

◆ Text()

String pcl::TextBox::Text ( ) const

Returns the current text of this TextBox control.

◆ Unselect()

void pcl::TextBox::Unselect ( bool  unsel = true)
inline

Clears the current text selection in this TextBox.

This member function does not delete the selected text; it only removes the selection.

See also
SelectAll(), GetSelection(), SetSelection()

Definition at line 179 of file TextBox.h.


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