PCL
pcl::FontComboBox Class Reference

A ComboBox descendant class to select font faces. More...

#include <FontComboBox.h>

+ Inheritance diagram for pcl::FontComboBox:

Public Types

using font_event_handler = void(Control::*)(FontComboBox &sender, const String &font)
 
- Public Types inherited from pcl::ComboBox
using edit_event_handler = void(Control::*)(ComboBox &sender)
 
using item_event_handler = void(Control::*)(ComboBox &sender, int itemIndex)
 
- 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

 FontComboBox (Control &parent=Control::Null())
 
 ~FontComboBox () override
 
void AddFixedPitchFonts ()
 
void AddGreekFonts ()
 
void AddItalicFonts ()
 
void AddLatinFonts ()
 
void AddScalableFonts ()
 
void AddStandardFontFamilies ()
 
void AddWritingSystem (const String &writingSystem)
 
pcl::Font CurrentFont (double size=12.0) const
 
String CurrentFontFace () const
 
void OnFontHighlighted (font_event_handler handler, Control &receiver)
 
void OnFontSelected (font_event_handler handler, Control &receiver)
 
void RemoveFixedPitchFonts ()
 
void RemoveGreekFonts ()
 
void RemoveItalicFonts ()
 
void RemoveLatinFonts ()
 
void RemoveScalableFonts ()
 
void RemoveStandardFontFamilies ()
 
void RemoveWritingSystem (const String &writingSystem)
 
void ResetFonts ()
 
void SetCurrentFont (const pcl::Font &font)
 
void SetCurrentFont (const String &face)
 
- Public Member Functions inherited from pcl::ComboBox
 ComboBox (Control &parent=Control::Null())
 
 ~ComboBox () override
 
void AddItem (const String &text, const Bitmap &icon=Bitmap::Null())
 
template<class C >
void AddItems (const C &c)
 
template<class FI >
void AddItems (FI i, FI j)
 
void Clear ()
 
void ClearEditText ()
 
void ClearItemIcon (int index)
 
void ClearItemText (int index)
 
int CurrentItem () const
 
void DisableAutoCompletion (bool disable=true)
 
void DisableEdit (bool disable=true)
 
String EditText () const
 
void EnableAutoCompletion (bool=true)
 
void EnableEdit (bool=true)
 
int FindItem (const String &text, int fromIdx=0, bool exactMatch=false, bool caseSensitive=false) const
 
void GetIconSize (int &width, int &height) const
 
void GetScaledIconSize (int &width, int &height) const
 
void HideList ()
 
int IconHeight () const
 
int IconWidth () const
 
void InsertItem (int index, const String &text, const Bitmap &icon=Bitmap::Null())
 
template<class C >
void InsertItems (int index, const C &c)
 
template<class FI >
void InsertItems (int index, FI i, FI j)
 
bool IsAutoCompletionEnabled () const
 
bool IsEditEnabled () const
 
Bitmap ItemIcon (int index) const
 
String ItemText (int index) const
 
int MaxVisibleItemCount () const
 
int MinItemCharWidth () const
 
int NumberOfItems () const
 
void OnEditTextUpdated (edit_event_handler handler, Control &receiver)
 
void OnItemHighlighted (item_event_handler handler, Control &receiver)
 
void OnItemSelected (item_event_handler handler, Control &receiver)
 
void RemoveItem (int index)
 
int ScaledIconHeight () const
 
int ScaledIconWidth () const
 
void SetCurrentItem (int index)
 
void SetEditText (const String &)
 
void SetIconSize (int size)
 
void SetIconSize (int width, int height)
 
void SetItemIcon (int index, const Bitmap &)
 
void SetItemText (int index, const String &)
 
void SetMaxVisibleItemCount (int)
 
void SetMinItemCharWidth (int)
 
void SetScaledIconSize (int size)
 
void SetScaledIconSize (int width, int height)
 
void ShowList ()
 
- 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)
 

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

FontComboBox is a utility class that provides a simple list with all the installed fonts on the system, plus the set of standard font families - see the FontFamily namespace for the supported set of standard font families in the PixInsight/PCL platform.

Optionally, FontComboBox can restrict the list of font items to include only scalable, bitmapped or fixed-pitch fonts. The fonts list can also be restricted as a function of the available writing systems (Latin, Greek, Cyrillic, and so on).

See also
Font, ComboBox, FontFamily

Definition at line 86 of file FontComboBox.h.

Constructor & Destructor Documentation

◆ FontComboBox()

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

Constructs a FontComboBox as a child control of parent.

A default set of ComboBox items is created for the full set of fonts currently installed on the system.

◆ ~FontComboBox()

pcl::FontComboBox::~FontComboBox ( )
inlineoverride

Destroys a FontComboBox control.

Definition at line 101 of file FontComboBox.h.

Member Function Documentation

◆ AddFixedPitchFonts()

void pcl::FontComboBox::AddFixedPitchFonts ( )

Adds a list of ComboBox items corresponding to all fixed-pitch fonts currently installed on the system.

See also
RemoveFixedPitchFonts()

◆ AddGreekFonts()

void pcl::FontComboBox::AddGreekFonts ( )
inline

Adds items for all installed fonts that support the Greek writing system.

This is a convenience member function, equivalent to: AddWritingSystem( "Greek" ).

See also
RemoveGreekFonts(), AddLatinFonts()

Definition at line 290 of file FontComboBox.h.

◆ AddItalicFonts()

void pcl::FontComboBox::AddItalicFonts ( )

Adds a list of ComboBox items corresponding to all italic fonts currently installed on the system.

See also
RemoveItalicFonts()

◆ AddLatinFonts()

void pcl::FontComboBox::AddLatinFonts ( )
inline

Adds items for all installed fonts that support the Latin writing system.

This is a convenience member function, equivalent to: AddWritingSystem( "Latin" ).

See also
RemoveLatinFonts(), AddGreekFonts()

Definition at line 266 of file FontComboBox.h.

◆ AddScalableFonts()

void pcl::FontComboBox::AddScalableFonts ( )

Adds a list of ComboBox items corresponding to all scalable fonts currently installed on the system.

See also
RemoveScalableFonts()

◆ AddStandardFontFamilies()

void pcl::FontComboBox::AddStandardFontFamilies ( )

Adds a list of ComboBox items corresponding to the standard font families available on the PixInsight/PCL platform. This includes the following fonts: Default, SansSerif, Serif, Script, Monospace, Decorative, and Symbol.

Note
The list of standard font families is always prepended at the beginning of the existing set of items.
See also
RemoveStandardFontFamilies()

◆ AddWritingSystem()

void pcl::FontComboBox::AddWritingSystem ( const String writingSystem)

Adds a list of ComboBox items corresponding to all installed fonts that support the specified writing system.

See also
RemoveWritingSystem()

◆ CurrentFont()

pcl::Font pcl::FontComboBox::CurrentFont ( double  size = 12.0) const
inline

Returns a Font object that corresponds to the currently selected ComboBox item, or a null font object (Font::Null()) if no item is currently selected.

Parameters
sizeThe size in points of the returned font.

This is a convenience member function, equivalent to: Font( CurrentFontFace(), size ).

See also
CurrentFontFace(), SetCurrentFont( const String& ), SetCurrentFont( const Font& )

Definition at line 128 of file FontComboBox.h.

◆ CurrentFontFace()

String pcl::FontComboBox::CurrentFontFace ( ) const

Returns the face name of the font that corresponds to the currently selected ComboBox item, or an empty string if no item is currently selected.

See also
CurrentFont(), SetCurrentFont( const String& ), SetCurrentFont( const Font& )

◆ RemoveFixedPitchFonts()

void pcl::FontComboBox::RemoveFixedPitchFonts ( )

Removes all existing ComboBox items that correspond to fixed-pitch fonts.

See also
AddFixedPitchFonts()

◆ RemoveGreekFonts()

void pcl::FontComboBox::RemoveGreekFonts ( )
inline

Removes all existing ComboBox items that correspond to installed fonts supporting the Greek writing system.

See also
AddGreekFonts(), RemoveLatinFonts()

Definition at line 301 of file FontComboBox.h.

◆ RemoveItalicFonts()

void pcl::FontComboBox::RemoveItalicFonts ( )

Removes all existing ComboBox items that correspond to italic fonts.

See also
AddItalicFonts()

◆ RemoveLatinFonts()

void pcl::FontComboBox::RemoveLatinFonts ( )
inline

Removes all existing ComboBox items that correspond to installed fonts supporting the Latin writing system.

See also
AddLatinFonts(), RemoveGreekFonts()

Definition at line 277 of file FontComboBox.h.

◆ RemoveScalableFonts()

void pcl::FontComboBox::RemoveScalableFonts ( )

Removes all existing ComboBox items that correspond to scalable fonts.

See also
AddScalableFonts()

◆ RemoveStandardFontFamilies()

void pcl::FontComboBox::RemoveStandardFontFamilies ( )

Removes all existing ComboBox items that correspond to standard font families available on the PixInsight/PCL platform. See AddStandardFontFamilies() for more information.

See also
AddStandardFontFamilies()

◆ RemoveWritingSystem()

void pcl::FontComboBox::RemoveWritingSystem ( const String writingSystem)

Removes all existing ComboBox items that correspond to installed fonts supporting the specified writing system.

See also
AddWritingSystem()

◆ ResetFonts()

void pcl::FontComboBox::ResetFonts ( )

Resets this FontComboBox control to its default state: Replaces the current list of ComboBox items with a new set corresponding to the standard font families available on the PixInsight/PCL platform, plus all installed fonts on the system.

See also
AddStandardFontFamilies(), AddScalableFonts(), AddFixedPitchFonts(), AddItalicFonts(), AddWritingSystem()

◆ SetCurrentFont() [1/2]

void pcl::FontComboBox::SetCurrentFont ( const pcl::Font font)
inline

Selects the ComboBox item corresponding to the specified font.

If the specified font doesn't correspond to an installed or standard font family, or if font is Font::Null(), this member function leaves the ComboBox control with no selection, i.e. with its selected index equal to -1.

This is a convenience member function, equivalent to: SetCurrentFont( font.Face() ).

See also
SetCurrentFont( const String& ), CurrentFont(), CurrentFontFace()

Definition at line 158 of file FontComboBox.h.

References pcl::Font::Face().

◆ SetCurrentFont() [2/2]

void pcl::FontComboBox::SetCurrentFont ( const String face)

Selects the ComboBox item corresponding to the specified font face.

If the specified face doesn't correspond to an installed or standard font family, or if an empty string is specified, this member function leaves the ComboBox control with no selection, i.e. with its selected index equal to -1.

See also
SetCurrentFont( const Font& ), CurrentFont(), CurrentFontFace()

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