PCL
pcl::Edit Class Reference

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

#include <Edit.h>

+ Inheritance diagram for pcl::Edit:

Public Types

typedef void(Control::* caret_event_handler) (Edit &sender, int oldPos, int newPos)
 
typedef void(Control::* edit_event_handler) (Edit &sender)
 
typedef void(Control::* selection_event_handler) (Edit &sender, int newStart, int newEnd)
 
typedef void(Control::* text_event_handler) (Edit &sender, const String &)
 
- Public Types inherited from pcl::Frame
typedef FrameStyle::value_type style
 
- Public Types inherited from pcl::Control
typedef void(Control::* child_event_handler) (Control &sender, Control &child)
 
typedef void(Control::* close_event_handler) (Control &sender, bool &allowClose)
 
typedef void(Control::* event_handler) (Control &sender)
 
typedef void(Control::* file_drag_event_handler) (Control &sender, const pcl::Point &pos, const StringList &files, unsigned modifiers, bool &wantsFiles)
 
typedef void(Control::* file_drop_event_handler) (Control &sender, const pcl::Point &pos, const StringList &files, unsigned modifiers)
 
typedef void(Control::* keyboard_event_handler) (Control &sender, int key, unsigned modifiers, bool &wantsKey)
 
typedef void(Control::* mouse_button_event_handler) (Control &sender, const pcl::Point &pos, int button, unsigned buttons, unsigned modifiers)
 
typedef void(Control::* mouse_event_handler) (Control &sender, const pcl::Point &pos, unsigned buttons, unsigned modifiers)
 
typedef void(Control::* mouse_wheel_event_handler) (Control &sender, const pcl::Point &pos, int delta, unsigned buttons, unsigned modifiers)
 
typedef void(Control::* move_event_handler) (Control &sender, const pcl::Point &newPos, const pcl::Point &oldPos)
 
typedef void(Control::* paint_event_handler) (Control &sender, const pcl::Rect &updateRect)
 
typedef void(Control::* resize_event_handler) (Control &sender, int newWidth, int newHeight, int oldWidth, int oldHeight)
 
typedef void(Control::* view_drag_event_handler) (Control &sender, const pcl::Point &pos, const View &view, unsigned modifiers, bool &wantsView)
 
typedef void(Control::* view_drop_event_handler) (Control &sender, const pcl::Point &pos, const View &view, unsigned modifiers)
 

Public Member Functions

 Edit (const String &text=String(), Control &parent=Control::Null())
 
virtual ~Edit ()
 
int CaretPosition () const
 
void Clear ()
 
void ClearModified (bool clear=true)
 
void DisablePasswordMode (bool disable=true)
 
void EnablePasswordMode (bool=true)
 
void End ()
 
void GetSelection (int &selStart, int &selEnd) const
 
bool HasSelection () const
 
void Home ()
 
bool IsLeftAligned () const
 
bool IsModified () const
 
bool IsPasswordMode () const
 
bool IsReadOnly () const
 
bool IsRightAligned () const
 
int MaxLength () const
 
void OnCaretPositionUpdated (caret_event_handler, Control &)
 
void OnEditCompleted (edit_event_handler, Control &)
 
void OnReturnPressed (edit_event_handler, Control &)
 
void OnSelectionUpdated (selection_event_handler, Control &)
 
void OnTextUpdated (text_event_handler, Control &)
 
void SelectAll (bool=true)
 
String SelectedText () const
 
void SetCaretPosition (int)
 
void SetLeftAlignment (bool left=true)
 
void SetMaxLength (int)
 
void SetModified (bool=true)
 
void SetReadOnly (bool=true)
 
void SetReadWrite (bool rw=true)
 
void SetRightAlignment (bool right=true)
 
void SetSelection (int selStart, int selEnd)
 
void SetText (const String &)
 
void SetUnlimitedLength ()
 
String Text () const
 
void Unselect (bool unsel=true)
 
- Public Member Functions inherited from pcl::Frame
 Frame (Control &parent=Control::Null())
 
virtual ~Frame ()
 
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 (Control &parent=Null(), uint32=0)
 
 Control (const Control &)=delete
 
 Control (Control &&)=delete
 
virtual ~Control ()
 
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
 
pcl::Point ControlToLocal (const Control &w, const pcl::Point &p) const
 
void ControlToLocal (const Control &, int &x, int &y) 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 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
 
pcl::Point LocalToControl (const Control &w, const pcl::Point &p) const
 
void LocalToControl (const Control &, int &x, int &y) 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 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
 
void Restyle ()
 
Point ScaledCursorHotSpot (int xHot, int yHot) const
 
Point ScaledCursorHotSpot (const Point &hotSpot) 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 (int dx, int dy)
 
void Scroll (const pcl::Point &d, const pcl::Rect &r)
 
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 (int h)
 
void SetFixedHeight ()
 
void SetFixedSize (int w, int h)
 
void SetFixedSize ()
 
void SetFixedWidth (int w)
 
void SetFixedWidth ()
 
void SetFocusStyle (FocusStyles)
 
void SetFont (const pcl::Font &)
 
void SetForegroundColor (RGBA)
 
void SetHighlightColor (RGBA)
 
void SetHighlightedTextColor (RGBA)
 
void SetInfoText (const String &)
 
void SetMaxHeight (int h)
 
void SetMaxHeight ()
 
void SetMaxSize (int w, int h)
 
void SetMaxSize ()
 
void SetMaxWidth (int w)
 
void SetMaxWidth ()
 
void SetMinHeight (int h)
 
void SetMinHeight ()
 
void SetMinSize (int w, int h)
 
void SetMinSize ()
 
void SetMinWidth (int w)
 
void SetMinWidth ()
 
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 (int x, int y, const String &text, const Control &control=Control::Null(), const Rect &rect=Rect(0))
 
static void ShowToolTip (const Point &pos, 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

Edit controls are single-line plain text edit controls.

Definition at line 75 of file Edit.h.

Member Typedef Documentation

◆ caret_event_handler

typedef void(Control::* pcl::Edit::caret_event_handler) (Edit &sender, int oldPos, int newPos)

#

Definition at line 336 of file Edit.h.

◆ edit_event_handler

typedef void(Control::* pcl::Edit::edit_event_handler) (Edit &sender)

#

Definition at line 328 of file Edit.h.

◆ selection_event_handler

typedef void(Control::* pcl::Edit::selection_event_handler) (Edit &sender, int newStart, int newEnd)

#

Definition at line 340 of file Edit.h.

◆ text_event_handler

typedef void(Control::* pcl::Edit::text_event_handler) (Edit &sender, const String &)

#

Definition at line 332 of file Edit.h.

Constructor & Destructor Documentation

◆ Edit()

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

Constructs an Edit object with the specified text, as a child control of parent.

◆ ~Edit()

virtual pcl::Edit::~Edit ( )
inlinevirtual

Destroys an Edit control.

Definition at line 88 of file Edit.h.

Member Function Documentation

◆ CaretPosition()

int pcl::Edit::CaretPosition ( ) const

Returns the current caret position in this Edit control.

◆ Clear()

void pcl::Edit::Clear ( )
inline

Removes all the text in this edit control.

Definition at line 105 of file Edit.h.

◆ ClearModified()

void pcl::Edit::ClearModified ( bool  clear = true)
inline

Clears or sets the modified status for this Edit control.

This is a convenience member function, equivalent to: SetModified( !clear )

Definition at line 147 of file Edit.h.

◆ DisablePasswordMode()

void pcl::Edit::DisablePasswordMode ( bool  disable = true)
inline

Disables the password display mode for this Edit control.

This is a convenience member function, equivalent to: EnablePasswordMode( !disable )

See also
IsPasswordMode(), EnablePasswordMode()

Definition at line 178 of file Edit.h.

◆ EnablePasswordMode()

void pcl::Edit::EnablePasswordMode ( bool  = true)

Enables the password display mode for this Edit control.

See also
IsPasswordMode(), DisablePasswordMode()

◆ End()

void pcl::Edit::End ( )
inline

Moves the caret to the end of the text line in this Edit control.

Definition at line 283 of file Edit.h.

◆ GetSelection()

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

Gets the limits of the current selection in this Edit control.

Parameters
[out]selStartThe index of the first selected character.
[out]selEndThe index of the last selected character plus one.

When selStart is equal to selEnd, there is no selection in this edit control.

◆ HasSelection()

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

Returns true iff there are one or more selected characters in this Edit control.

Definition at line 249 of file Edit.h.

◆ Home()

void pcl::Edit::Home ( )
inline

Moves the caret to the beginning of the text line in this Edit control.

Definition at line 275 of file Edit.h.

◆ IsLeftAligned()

bool pcl::Edit::IsLeftAligned ( ) const
inline

Returns true iff the text in this Edit control is left-aligned.

Definition at line 296 of file Edit.h.

◆ IsModified()

bool pcl::Edit::IsModified ( ) const

Returns true iff the text in this Edit control has been modified.

◆ IsPasswordMode()

bool pcl::Edit::IsPasswordMode ( ) const

Returns true iff this Edit control is in password display mode.

In password mode, the text in an edit control is always displayed as a sequence of asterisks. This does not affect the actual text; the password mode only changes the way characters are displayed.

See also
EnablePasswordMode(), DisablePasswordMode()

◆ IsReadOnly()

bool pcl::Edit::IsReadOnly ( ) const

Returns true iff this Edit control is in read-only mode.

◆ IsRightAligned()

bool pcl::Edit::IsRightAligned ( ) const

Returns true iff the text in this Edit control is right-aligned.

◆ MaxLength()

int pcl::Edit::MaxLength ( ) const

Returns the maximum allowed length for the text in this Edit control.

◆ OnCaretPositionUpdated()

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

#

◆ OnEditCompleted()

void pcl::Edit::OnEditCompleted ( edit_event_handler  ,
Control  
)

#

◆ OnReturnPressed()

void pcl::Edit::OnReturnPressed ( edit_event_handler  ,
Control  
)

#

◆ OnSelectionUpdated()

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

#

◆ OnTextUpdated()

void pcl::Edit::OnTextUpdated ( text_event_handler  ,
Control  
)

#

◆ SelectAll()

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

Selects all the text in this edit control.

◆ SelectedText()

String pcl::Edit::SelectedText ( ) const

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

◆ SetCaretPosition()

void pcl::Edit::SetCaretPosition ( int  )

Sets the current caret position in this Edit control.

◆ SetLeftAlignment()

void pcl::Edit::SetLeftAlignment ( bool  left = true)
inline

Disables or enables right-alignment for the text in this edit control.

This is a convenience member function, equivalent to: SetRightAlignment( !left )

Definition at line 312 of file Edit.h.

◆ SetMaxLength()

void pcl::Edit::SetMaxLength ( int  )

Sets the maximum allowed length for the text in this Edit control.

The default length limit is int_max, which in practice represents no length limit.

◆ SetModified()

void pcl::Edit::SetModified ( bool  = true)

Sets or clears the modified status for this Edit control.

◆ SetReadOnly()

void pcl::Edit::SetReadOnly ( bool  = true)

Enables or disables the read-only mode for this Edit control.

◆ SetReadWrite()

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

Disables or enables the read-only mode for this Edit control.

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

Definition at line 126 of file Edit.h.

◆ SetRightAlignment()

void pcl::Edit::SetRightAlignment ( bool  right = true)

Enables or disables right-alignment for the text in this edit control.

◆ SetSelection()

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

Sets the limits of the current selection in this Edit control.

Parameters
selStartThe index of the first selected character.
selEndThe index of the last selected character plus one.

When selStart is equal to selEnd, there is no selection in this edit control.

◆ SetText()

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

Sets the current button text.

◆ SetUnlimitedLength()

void pcl::Edit::SetUnlimitedLength ( )
inline

Enables unlimited length for the text in this Edit control.

This is a convenience member function, equivalent to: SetMaxLength( int_max )

Definition at line 202 of file Edit.h.

◆ Text()

String pcl::Edit::Text ( ) const

Returns the current edit text.

◆ Unselect()

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

Clears the existing selection, if any, in this edit control.

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

Definition at line 218 of file Edit.h.


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