Rhino C++ API  8.6
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
CRhinoUiComboBox Class Reference

#include <RhinoSdkUiComboBox.h>

Inheritance diagram for CRhinoUiComboBox:
CRhinoUiOptionsListCtrlComboBox CRhinoUiOptionsListCtrlColorComboBox CRhinoUiOptionsListCtrlFontComboBox CRhinoUiOptionsListCtrlGroupComboBox CRhinoUiOptionsListCtrlLinetypeComboBox CRhinoUiOptionsListCtrlPrintWidthComboBox CRhinoUiOptionsListCtrlLayerComboBox

Public Types

enum  color_swatch_draw_style { square_swatch = 0, diamond_swatch, circle_swatch, force_32bit_image_list = 0xFFFFFFFF }
 
enum  print_width_options {
  default_width = 0, no_print_width = - 1, by_layer_width = -10, by_parent_width = -15,
  list_box_error_width = -100, force_32bit_plot_width_option = 0xFFFFFFFF
}
 

Public Member Functions

 CRhinoUiComboBox ()
 
virtual ~CRhinoUiComboBox ()
 
int AddColorItem (LPCTSTR lpsColorName, COLORREF color, bool link_to_color_dialog=false)
 
int AddFontItem (const LOGFONT &lf)
 
int AddLayer (const CRhinoLayer &layer)
 
int AddLinetype (const ON_Linetype &linetype)
 
int AddPrintWidthItem (double cx)
 
COLORREF ColorFromListIndex (int iIndex, COLORREF crError=CRhinoUiPaintManager::error_color) const
 
bool ColorIsByLayer (COLORREF cr) const
 
bool ColorIsByParent (COLORREF cr) const
 
ON_wString ColorNameFromColorRef (COLORREF cr)
 
color_swatch_draw_style ColorSwatchDrawStyle () const
 
virtual int CompareItem (LPCOMPAREITEMSTRUCT)
 
bool CreateAsOwnerDraw () const
 
virtual void DeleteItem (LPDELETEITEMSTRUCT)
 
virtual void DrawItem (LPDRAWITEMSTRUCT)
 
int FillLayerList (CRhinoDoc *doc, bool bUseSortedList, int(*compare)(const CRhinoLayer *, const CRhinoLayer *, void *)=NULL, int(*cull)(const CRhinoLayer *, void *)=NULL, void *p=0)
 
int FillLinetypeList (CRhinoDoc *doc, bool bUseSortedList, bool bIncludeByLayer, bool bIncludeByParent, bool bReadDefaultLinetypeFile, int(*compare)(const CRhinoLinetype *, const CRhinoLinetype *, void *)=NULL, int(*cull)(const CRhinoLinetype *, void *)=NULL, void *p=NULL)
 
int FillUsingInstalledFonts (bool bIncludeTrueType=true, bool bIncludeNonTrueType=true)
 
int FillUsingStandardColorList (bool bIncludeByLayerColor=true, bool bIncludeCustomColor=true, bool bIncludeByParentColor=true, bool bIncludeByDisplayColor=false)
 
int FillUsingStandardPrintWidths (bool bIncludeByLayer, bool bIncludeDefault, bool bIncludeByParent, bool bIncludeNoPrint, bool bIncludeHairline)
 
CRhinoUiComboBoxItemDataGetComboBoxItemData (int iIndex) const
 
COLORREF GetCurColor () const
 
int GetCurColor (COLORREF &color) const
 
int GetCurFont (LOGFONT &lf_out)
 
const RhinoUiLayerComboBoxItemDataGetCurLayer () const
 
const RhinoUiLinetypeComboBoxItemDataGetCurLinetype () const
 
const RhinoUiPrintWidthComboBoxItemDataGetCurPrintWidth () const
 
int GetFontIndex (const LOGFONT &lf)
 
int GetFontIndex (LPCTSTR lpsFontFace)
 
bool GetTextFromListIndex (int iIndex, CString &sResult) const
 
class CRhinoUiPopDownLayerWndLayerPopDownWindow () const
 
UUID LayerUUIDFromListIndex (int iIndex) const
 
RhinoUiLinetypeComboBoxItemDataLinetypeDataFromListIndex (int iIndex) const
 
const ON_LinetypeLinetypeReadFromFile (const UUID &uuiid) const
 
UUID LinetypeUUIDFromListIndex (int iIndex) const
 
int ListIndexFromLayerUUID (const UUID &uuid) const
 
int ListIndexFromLinetypeUUID (const UUID &uuid) const
 
int ListIndexFromPrintWidth (double cx) const
 
virtual void MeasureItem (LPMEASUREITEMSTRUCT)
 
virtual CRhinoUiComboBoxItemDataNewCRhinoUiComboBoxItemData (CRhinoUiComboBoxItemData::class_type ct) const
 
afx_msg void OnCbnDropDown ()
 
afx_msg void OnCbnSelchange ()
 
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct)
 
virtual void OnCustomColorChanged (COLORREF cr, int iItemIndex)
 
afx_msg void OnDestroy ()
 
afx_msg void OnEditKillFocus ()
 
afx_msg void OnEditUpdate ()
 
afx_msg void OnLButtonDblClk (UINT nFlags, CPoint point)
 
afx_msg void OnLButtonDown (UINT nFlags, CPoint point)
 
void OnPrintWidthEditKillFocus ()
 
void OnPrintWidthEditUpdate ()
 
RhinoUiPrintWidthComboBoxItemDataPrintWidthDataFromListIndex (int iIndex) const
 
double PrintWidthFromString ()
 
color_swatch_draw_style SetColorSwatchDrawStyle (color_swatch_draw_style style)
 
bool SetCreateAsOwnerDraw (bool b)
 
COLORREF SetCurColor (COLORREF cr)
 
int SetCurFont (const LOGFONT &lf)
 
int SetCurFont (LPCTSTR lpsFontFace)
 
UUID SetCurLayer (UUID uuid, COLORREF cr)
 
UUID SetCurLinetype (UUID uuid)
 
double SetCurPrintWidth (double cx)
 
bool SetCustomColor (COLORREF cr)
 

Static Public Member Functions

static UUID ByLayerLinetypeID ()
 
static UUID ByParentLinetypeID ()
 
static UUID ContinuousLinetypeID ()
 
static bool GetPrintWidthDisplayString (double cx, ON_wString &result)
 
static UUID ListBoxErrorUUID ()
 
static bool ReadPrintWidthFile (const wchar_t *lpsFileName, ON_SimpleArray< double > &widths, bool bQuietly)
 

Protected Types

enum  change_mode { cm_selchange = 0, cm_editupdate, cm_nochange, force_32bit_change_mode = 0xFFFFFFFF }
 

Protected Member Functions

virtual LRESULT DefWindowProc (UINT message, WPARAM wParam, LPARAM lParam)
 
void DestroyLayerPopDownWnd ()
 
virtual BOOL32 OnChildNotify (UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult)
 
virtual BOOL32 OnWndMsg (UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult)
 
virtual void PostNcDestroy ()
 
virtual void PreSubclassWindow ()
 
virtual BOOL32 PreTranslateMessage (MSG *pMsg)
 virtual overrides More...
 
virtual void ShowLayerPopDownWnd (HWND hWnd, bool bShow)
 
virtual LRESULT WindowProc (UINT message, WPARAM wParam, LPARAM lParam)
 

Protected Attributes

bool m_bIncludeNonTrueType
 
bool m_bIncludeTrueType
 
bool m_bInOnPrintWidthEditKillFocus
 
bool m_bShowReferenceLayers
 
change_mode m_change_mode
 
COLORREF m_crCustom
 
RhinoUiColorComboBoxItemData m_current_color
 CRhinoUiComboBoxItemData m_current;. More...
 
RhinoUiFontComboBoxItemData m_current_font
 
RhinoUiLayerComboBoxItemData m_current_layer
 
RhinoUiLinetypeComboBoxItemData m_current_linetype
 
RhinoUiPrintWidthComboBoxItemData m_current_print_width
 
CRhinoUiComboBoxItemData::class_type m_fill_class_type
 
ON_ObjectArray< ON_Linetypem_from_file_linetypes
 
class CRhinoUiPopDownLayerWndm_pWndLayerPopDown
 
color_swatch_draw_style m_swatch_style
 

Friends

void CRhinoUiPopDownLayerWnd::HidePopUpWindow ()
 
int CALLBACK RhinoUiComboBoxEnumFontProc (const LOGFONT *, const TEXTMETRIC *, DWORD, LPARAM)
 

Member Enumeration Documentation

◆ change_mode

Enumerator
cm_selchange 
cm_editupdate 
cm_nochange 
force_32bit_change_mode 

for internal use only, this allows adding additional values without breaking the SDK in the future

◆ color_swatch_draw_style

These styles are only applied to owner draw versions of the combo box that include color swatches such as Color combos and Layer combos

Enumerator
square_swatch 
diamond_swatch 
circle_swatch 
force_32bit_image_list 

for internal use only, this allows adding additional values without breaking the SDK in the future

◆ print_width_options


Print width UI

Enumerator
default_width 
no_print_width 
by_layer_width 
by_parent_width 
list_box_error_width 
force_32bit_plot_width_option 

for internal use only, this allows adding additional values without breaking the SDK in the future

Constructor & Destructor Documentation

◆ CRhinoUiComboBox()

CRhinoUiComboBox::CRhinoUiComboBox ( )

Description: Constructor

◆ ~CRhinoUiComboBox()

virtual CRhinoUiComboBox::~CRhinoUiComboBox ( )
virtual

Description: Destructor

Member Function Documentation

◆ AddColorItem()

int CRhinoUiComboBox::AddColorItem ( LPCTSTR  lpsColorName,
COLORREF  color,
bool  link_to_color_dialog = false 
)

Description: Used to add a color item to list. To see the font names you must either use the CBS_OWERDRAWFIXED style or set m_bMakeOwnerDraw prior to creating this control. ///< Parameters: lpsColorName [in] Display text associated with color color [in] Color returned when item is selected and drawn when combo box is visible link_to_color_dialog [in] If this is true then color dialog will be displayed when item is selected. Returns: Zero or greater which is list index of added item or -1 on error.

See Also: CRhinoUiComboBox::ColorFromListIndex()

◆ AddFontItem()

int CRhinoUiComboBox::AddFontItem ( const LOGFONT &  lf)

Description: Add font description to list. To see font sample you must either use the CBS_OWERDRAWFIXED style or set m_bMakeOwnerDraw prior to creating this control.

Parameters: lf [in] Font to add to the list

Returns: Zero based index of new item in list or -1 on error.

See Also: CRhinoUiComboBox::GetFontIndex() CRhinoUiComboBox::GetCurFont()

◆ AddLayer()

int CRhinoUiComboBox::AddLayer ( const CRhinoLayer layer)

Description: Add layer name and color to list. Item is added as CRhinoUiComboBoxItemData::ct_color data type.

Parameters: layer [in] Layer to add to list.

Returns: Zero based index of new item in list or -1 on error.

See Also: CRhinoUiCombo::FillLayerList()

◆ AddLinetype()

int CRhinoUiComboBox::AddLinetype ( const ON_Linetype linetype)

Description: Add linetype to the list box. Item is added as CRhinoUiComboBoxItemData::ct_linetype data type.

Parameters: linetype [in] Linetype to add to list. bReadFromFile [in] Linetype is not currently in the document linetype table, it is a default linetype or was read from a linetype definition file.

Returns: Zero based index of new item in list or -1 on error.

See Also: CRhinoUiCombo::FillLinetypeList()

◆ AddPrintWidthItem()

int CRhinoUiComboBox::AddPrintWidthItem ( double  cx)

Description: Add a print width value to list.

Parameters: cx [in] Width value to add to the list

Returns: Zero based index of new item in list or -1 on error.

See Also: CRhinoUiComboBox::print_width_options CRhinoUiComboBox::FillUsingStandardWidths()

◆ ByLayerLinetypeID()

static UUID CRhinoUiComboBox::ByLayerLinetypeID ( )
static

Description: Call this method to get the UUID associated with the "By Layer" linetype item in this combo box.

Returns: UUID associated with "By Layer" comob box item

◆ ByParentLinetypeID()

static UUID CRhinoUiComboBox::ByParentLinetypeID ( )
static

Description: Call this method to get the UUID associated with the "By Parent" linetype item in this combo box.

Returns: UUID associated with "By Parent" comob box item

◆ ColorFromListIndex()

COLORREF CRhinoUiComboBox::ColorFromListIndex ( int  iIndex,
COLORREF  crError = CRhinoUiPaintManager::error_color 
) const

Description: Get color associated with combo box item. CRhinoUiComboBoxItemData::ct_color.

Parameters: iIndex [in] Index of item to get color for. crError = color to be returned in case of error.

Returns: Color associated with list item or crError on error

See Also: CRhinoUiComboBox::AddColorItem()

◆ ColorIsByLayer()

bool CRhinoUiComboBox::ColorIsByLayer ( COLORREF  cr) const

Description: Check color to see if it is By Layer color.

Parameters: cr [in] Color to check

Returns: Returns true if cr is equal to CRhinoUiPaintManager::bylayer_color indicating that cr is an invalid RGB value.

See Also: CRhinoUiPaintManager::bylayer_color CRhinoUiComboBox::ColorFromListIndex()

◆ ColorIsByParent()

bool CRhinoUiComboBox::ColorIsByParent ( COLORREF  cr) const

Description: Check color to see if it is By Parent color.

Parameters: cr [in] Color to check

Returns: Returns true if cr is equal to CRhinoUiPaintManager::byparent_color indicating that cr is an invalid RGB value.

See Also: CRhinoUiPaintManager::byparent_color CRhinoUiComboBox::ColorFromListIndex()

◆ ColorNameFromColorRef()

ON_wString CRhinoUiComboBox::ColorNameFromColorRef ( COLORREF  cr)

Description: Get string associated with color value.

Parameters: cr [in] Color to check for.

Returns: Combo box string associated with RGB value

See Also: CRhinoUiComboBox::AddColorItem()

◆ ColorSwatchDrawStyle()

color_swatch_draw_style CRhinoUiComboBox::ColorSwatchDrawStyle ( ) const

Description: Call this method to determine how color swatches are drawn in owner draw versions of the combo box that include a color swatch.

Returns: Returns color swatch draw style, see CRhinoUiComboBoxItem::color_swatch_draw_style for options.

See Also: CRhinoUiComboBoxItem::color_swatch_draw_style CRhinoUiComboBoxItem::ColorSwatchDrawStyle()

◆ CompareItem()

virtual int CRhinoUiComboBox::CompareItem ( LPCOMPAREITEMSTRUCT  )
virtual

◆ ContinuousLinetypeID()

static UUID CRhinoUiComboBox::ContinuousLinetypeID ( )
static

Linetype combo UI

Description: Call this method to get the UUID associated with the "Continuous" linetype item in this combo box.

Returns: UUID associated with "Continuous" comob box item

◆ CreateAsOwnerDraw()

bool CRhinoUiComboBox::CreateAsOwnerDraw ( ) const

Description: Flag which tells control to ensure that it is owner draw when it is created so that font and color previews are visible.

Returns: If true then combo box style will be modified to include CBS_OWNERDRAW fixed if not owner draw when created.

See Also: CRhinoUiComboBoxItem::SetCreateAsOwnerDraw()

◆ DefWindowProc()

virtual LRESULT CRhinoUiComboBox::DefWindowProc ( UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
protectedvirtual

◆ DeleteItem()

virtual void CRhinoUiComboBox::DeleteItem ( LPDELETEITEMSTRUCT  )
virtual

◆ DestroyLayerPopDownWnd()

void CRhinoUiComboBox::DestroyLayerPopDownWnd ( )
protected

◆ DrawItem()

virtual void CRhinoUiComboBox::DrawItem ( LPDRAWITEMSTRUCT  )
virtual

◆ FillLayerList()

int CRhinoUiComboBox::FillLayerList ( CRhinoDoc doc,
bool  bUseSortedList,
int(*)(const CRhinoLayer *, const CRhinoLayer *, void *)  compare = NULL,
int(*)(const CRhinoLayer *, void *)  cull = NULL,
void *  p = 0 
)

Layer combo is a modified color combo

Description: Populate list control with layers associated with active CRhinoDoc. To see the layer color swatches you must either use the CBS_OWERDRAWFIXED style or set m_bMakeOwnerDraw prior to creating this control.

Parameters: doc [in] Document containing layer table to read bUseSortedList [in] If true then use the default layer list returned by CRhinoLayerTable::GetSortedList() compare [in] Only valid if bUseSortedList is false. If so and compare is not NULL then CRhinoLayerTable::Sort() is called using the compare parameter prior to calling CRhinoLayerTable::GetSortedList(). cull [in] Only valid if bUseSortedList is false. If so and cull is not NULL then CRhinoLayerTable::Sort() is called using the cull parameter prior to calling CRhinoLayerTable::GetSortedList(). p [in] Passed to CRhinoLayerTable::Sort() if it is called Returns: Returns number of layers added to list box.

See Also: class CRhinoLayerTable CRhinoLayerTable::Sort() CRhinoLayerTable::GetSortedList()

◆ FillLinetypeList()

int CRhinoUiComboBox::FillLinetypeList ( CRhinoDoc doc,
bool  bUseSortedList,
bool  bIncludeByLayer,
bool  bIncludeByParent,
bool  bReadDefaultLinetypeFile,
int(*)(const CRhinoLinetype *, const CRhinoLinetype *, void *)  compare = NULL,
int(*)(const CRhinoLinetype *, void *)  cull = NULL,
void *  p = NULL 
)

Description: Populate list control with linetypes associated with the specified CRhinoDoc.

Parameters: doc [in] Document containing linetype table to read bUseSortedList [in] If true then use the default linetype returned by CRhinoLinetypeTable::GetSortedList(); otherwise iterate the linetype table and apply the compare and cull methods is specified. bIncludeByLayer [in] If true then "By Layer" option is added to the top of the list bIncludeByParent [in] If true then "By Parent" option is added to the top of the list bReadDefaultLinetypeFile [in] If true then the default linetype table is read and linetypes are added to the bottom of the list. compare [in] Only valid if bUseSortedList is false. If so and compare is not NULL then CRhinoLinetypeTable::Sort() is called using the compare parameter prior to calling CRhinoLinetypeTable::GetSortedList(). cull [in] Only valid if bUseSortedList is false. If so and cull is not NULL then CRhinoLinetypeTable::Sort() is called using the cull parameter prior to calling CRhinoLinetypeTable::GetSortedList(). p [in] Passed to CRhinoLinetypeTable::Sort() if it is called Returns: Returns number of layers added to list box.

See Also: class CRhinoLayerTable CRhinoLayerTable::Sort() CRhinoLayerTable::GetSortedList()

◆ FillUsingInstalledFonts()

int CRhinoUiComboBox::FillUsingInstalledFonts ( bool  bIncludeTrueType = true,
bool  bIncludeNonTrueType = true 
)

Font combo UI

Description: Enumerate fonts installed on system and add them to the list. To see the font sample you must either use the CBS_OWERDRAWFIXED style or set m_bMakeOwnerDraw prior to creating this control.

Parameters: bIncludeTrueType [in] If true then true type fonts are added to the list. bIncludeNonTrueType [in] If true then non true type fonts are added to the list.

Returns: Number of fonts added to the list. To see the font names you must either use the CBS_OWERDRAWFIXED style or set m_bMakeOwnerDraw prior to creating this control.

See Also: CRhinoUiComboBox::AddFontItem()

◆ FillUsingStandardColorList()

int CRhinoUiComboBox::FillUsingStandardColorList ( bool  bIncludeByLayerColor = true,
bool  bIncludeCustomColor = true,
bool  bIncludeByParentColor = true,
bool  bIncludeByDisplayColor = false 
)

Color combo UI

Description: Populate combo box using base Rhino colors. If bIncludeByLayerColor is true then the first item in the list is "By Layer". If bIncludeCustomColor is true then the last item is "Other" which displays color dialog when selected.

Standard color list: By Layer Black White Red Yellow Green Cyan Blue Magenta Other

To see color swatches you must either use the CBS_OWERDRAWFIXED style or set m_bMakeOwnerDraw prior to creating this control.

Parameters: bIncludeByLayerColor [in] Include "By Layer" option as first item in list. bIncludeByParentColor [in] Include "By Parent" option as second item in list. bIncludeCustomColor [in] Include "Other" option as last item in list. If "Other" is selected a color dialog appears.

Returns: If list is filled correctly then true is returned otherwise false is returned indicating there was an error.

See Also: CRhinoUiComboBoxItemData::class_type CRhinoUiComboBox::ClassType()

◆ FillUsingStandardPrintWidths()

int CRhinoUiComboBox::FillUsingStandardPrintWidths ( bool  bIncludeByLayer,
bool  bIncludeDefault,
bool  bIncludeByParent,
bool  bIncludeNoPrint,
bool  bIncludeHairline 
)

Description: Populate list control with linetypes associated with the specified CRhinoDoc.

Parameters: bIncludeByLayer [in] If true then "By Layer" option is added to top of list; otherwise it is not bIncludeDefault [in] If true then "Default" option is added to top of list; otherwise it is not bIncludeByParent [in] If true then "By Parent" option is added to top of list; otherwise it is not bIncludeNoPrint [in] If true then "By Print" option is added to top of list; otherwise it is not bIncludeHairline [in] If true then "Hairline" option is added to top of list; otherwise it is not

Returns: Returns number of widths added to list box.

See Also: CRhinoUiComboBox::print_width_options CRhinoUiComboBox::GetPrintWidthDisplayString()

◆ GetComboBoxItemData()

CRhinoUiComboBoxItemData* CRhinoUiComboBox::GetComboBoxItemData ( int  iIndex) const

Description: Get item data pointer associated with list item.

Parameters: iIndex [in] Zero based index of list item to check.

Returns: Pointer to data item associated with iIndex. Returns NULL if iIndex is invalid or there is no pointer associated with item at iIndex.

See Also: CRhinoUiComboBoxItemData CRhinoUiComboBox::ClassType()

◆ GetCurColor() [1/2]

COLORREF CRhinoUiComboBox::GetCurColor ( ) const

Description: Get color associated with current selection.

Returns: Returns RGB value associated with currently selected item. If no item is selected then CRhinoUiPaintManager::error_color is returned.

See Also: CRhinoUiComboBox::ColorFromListIndex() CRhinoUiComboBox::ColorIsByLayer()

◆ GetCurColor() [2/2]

int CRhinoUiComboBox::GetCurColor ( COLORREF &  color) const

Description: Get color associated with current selection and return the current selection index.

Returns: Returns LB_ERROR if nothing is selected otherwise; zero based index of the curret list item and sets color equal to the selected color.

See Also: CRhinoUiComboBox::ColorFromListIndex() CRhinoUiComboBox::ColorIsByLayer() CRhinoUiComboBox::GetCurColor()

◆ GetCurFont()

int CRhinoUiComboBox::GetCurFont ( LOGFONT &  lf_out)

Description: Get LOGFONT associated with currently selected item.

Parameters: lf_out [out] Currently selected LOGFONT is copied here.

Returns: Zero based index of currently selected item whos LOGFONT was copied. A value of LB_ERROR indicates there is no current selection. A value of -2 indicates there was a current selection but it did not contain associated font data.

See Also: CRhinoUiComboBox::SetCurFont() CComboBox::GetCurSel() LB_ERROR

◆ GetCurLayer()

const RhinoUiLayerComboBoxItemData* CRhinoUiComboBox::GetCurLayer ( ) const

Description: Get layer index associated with current selection.

Returns: Returns a RhinoUiLayerComboBoxItemData pointer associated with current selection or NULL if none is found.

See Also: CRhinoUiComboBox::FillLayerList() CRhinoUiComboBox::SetCurLayer()

◆ GetCurLinetype()

const RhinoUiLinetypeComboBoxItemData* CRhinoUiComboBox::GetCurLinetype ( ) const

Description: Get linetype index associated with current selection.

Returns: Returns linetype index for the currently selected linetype. If no item is selected then -1 is returned.

See Also: CRhinoUiComboBox::FillLinetypeList() CRhinoUiComboBox::SetCurLinetypeIndex()

◆ GetCurPrintWidth()

const RhinoUiPrintWidthComboBoxItemData* CRhinoUiComboBox::GetCurPrintWidth ( ) const

Description: Get print width data associated with current selection.

Returns: Returns print width data for the currently selected linetype. If no item is selected then NULL is returned.

See Also: CRhinoUiComboBox::FillUsingStandardWidths() CRhinoUiComboBox::SetCurPrintWidth()

◆ GetFontIndex() [1/2]

int CRhinoUiComboBox::GetFontIndex ( const LOGFONT &  lf)

Description: Find list item associated with a particular font face name.

Parameters: lf[in] Font face name to search for. String comparison is not case sensitive.

Returns: Zero based index of list item that matched font name or -1 if not found.

See Also: CRhinoUiComboBox::AddFontItem()

◆ GetFontIndex() [2/2]

int CRhinoUiComboBox::GetFontIndex ( LPCTSTR  lpsFontFace)

Description: Find list item associated with a particular font face name.

Parameters: lpsFontFace[in] Font face name to search for. String comparison is not case sensitive.

Returns: Zero based index of list item that matched font name or -1 if not found.

See Also: CRhinoUiComboBox::AddFontItem()

◆ GetPrintWidthDisplayString()

static bool CRhinoUiComboBox::GetPrintWidthDisplayString ( double  cx,
ON_wString result 
)
static

Description: Create display string from width value.

Parameters: cx [in] If cx is equal to one of the CRhinoUiComboBox::print_width_options then the appropriate display string is created. If cx is not a CRhinoUiComboBox::print_width_options and is less than 0.0 then a error string is generated. If cx is >= 0.0 then cx is formatted as a string and returned. result [out] Buffer to receive the display string.

Returns: If cx is equal to one of the CRhinoUiComboBox::print_width_options then the appropriate display string is copied to result and true is returned. If cx is not a CRhinoUiComboBox::print_width_options and is less than 0.0 then result will be an empty string and false will be returned. If cx is >= 0.0 then cx is formatted as a string, placed in result and true is returned.

See Also: CRhinoUiComboBox::print_width_options CRhinoUiComboBox::FillUsingStandardWidths()

◆ GetTextFromListIndex()

bool CRhinoUiComboBox::GetTextFromListIndex ( int  iIndex,
CString &  sResult 
) const

Description: Get text associated with a combo box list item. First checks to see if list box contains a string, if it does then then the string is returned. If no string or an empty string is found at iIndex then checks associated CRhinoUiComboBoxItemData pointer associated with iIndex. If a CRhinoUiComboBoxItemData* item is associated with iIndex then CRhinoUiComboBoxItemData::Text() is returned.

Parameters: iIndex [in] Zero based index of string in list box sResult [out] CString object to receive result

Returns: If string is associated with item and value paced in sResult true is returned otherwerise false is returned.

See Also: CRhinoUiComboBoxItemData::Text()

◆ LayerPopDownWindow()

class CRhinoUiPopDownLayerWnd* CRhinoUiComboBox::LayerPopDownWindow ( ) const

◆ LayerUUIDFromListIndex()

UUID CRhinoUiComboBox::LayerUUIDFromListIndex ( int  iIndex) const

Description: Get layer index associated with combo box item.

Parameters: iIndex [in] Index of combo box item to get the layer index for.

Returns: Layer index associated with comob box item or -1 on error

See Also: CRhinoUiComboBox::AddLayer() CRhinoUiComboBox::LayerUUIDFromListIndex()

◆ LinetypeDataFromListIndex()

RhinoUiLinetypeComboBoxItemData* CRhinoUiComboBox::LinetypeDataFromListIndex ( int  iIndex) const

Description: Get linetype information associated with combo box item.

Parameters: iIndex [in] Index of combo box item to get the linetype index for.

Returns: Linetype data associated with comob box item or NULL on error

See Also: CRhinoUiComboBox::AddLinetype() CRhinoUiComboBox::LinetypeUUIDFromListIndex()

◆ LinetypeReadFromFile()

const ON_Linetype* CRhinoUiComboBox::LinetypeReadFromFile ( const UUID &  uuiid) const

Description: Call this method to get the linetype associated with a item which was read from a linetype definition file. When the combo box fills the list with these items it generates unique UUIDs for each item and addes them to an internal list.

Parameters: uuid [in] UUID of linetype to find

Returns: Returns a pointer to the ON_Linetype which was read from a file or NULL if not found.

See Also: CRhinoUiComboBox::FillLinetypeList()

◆ LinetypeUUIDFromListIndex()

UUID CRhinoUiComboBox::LinetypeUUIDFromListIndex ( int  iIndex) const

Description: Get linetype UUID associated with combo box item.

Parameters: iIndex [in] Index of combo box item to get the linetype uuid for.

Returns: Linetype UUID associated with comob box item or ON_nil_uuid on error

See Also: CRhinoUiComboBox::AddLinetype() CRhinoUiComboBox::LinetypeIndexFromListIndex()

◆ ListBoxErrorUUID()

static UUID CRhinoUiComboBox::ListBoxErrorUUID ( )
static

Description: Call this method to get the UUID returned when there is no current selection or and error condition was found.

Returns: UUID associated with error condition or no selection

◆ ListIndexFromLayerUUID()

int CRhinoUiComboBox::ListIndexFromLayerUUID ( const UUID &  uuid) const

Description: Call this method to get the list box index associated with the specified layer UUID

Parameters: uuid [in] UUID of layer to find

Returns: List box index for matching item or -1 if not found

See Also: CRhinoUiComboBox::AddLayer() CRhinoUiComboBox::LayerIndexFromListIndex()

◆ ListIndexFromLinetypeUUID()

int CRhinoUiComboBox::ListIndexFromLinetypeUUID ( const UUID &  uuid) const

Description: Call this method to get the list box index associated with the specified linetype UUID

Parameters: uuid [in] UUID of linetype to find

Returns: List box index for matching item or -1 if not found

See Also: CRhinoUiComboBox::AddLinetype() CRhinoUiComboBox::LinetypeIndexFromListIndex()

◆ ListIndexFromPrintWidth()

int CRhinoUiComboBox::ListIndexFromPrintWidth ( double  cx) const

Description: Call this method to get the list box index associated with the specified print width

Parameters: uuid [in] UUID of print width to find

Returns: List box index for matching item or -1 if not found

See Also: CRhinoUiComboBox::AddPrintWidth() CRhinoUiComboBox::PrintWidthIndexFromListIndex()

◆ MeasureItem()

virtual void CRhinoUiComboBox::MeasureItem ( LPMEASUREITEMSTRUCT  )
virtual

Standard CComboBox overrides

Reimplemented in CRhinoUiOptionsListCtrlComboBox.

◆ NewCRhinoUiComboBoxItemData()

virtual CRhinoUiComboBoxItemData* CRhinoUiComboBox::NewCRhinoUiComboBoxItemData ( CRhinoUiComboBoxItemData::class_type  ct) const
virtual

Description: This method is called when adding color items to the combo box list box. Override this method if you want to derive a class from CRhinoUiComboBoxItemData and provide additional data members and methods.

Parameters: ct [in] type of control data being requested.

See Also: CRhinoUiComboBoxItemData CRhinoUiComboBoxItemData::class_type

◆ OnCbnDropDown()

afx_msg void CRhinoUiComboBox::OnCbnDropDown ( )

◆ OnCbnSelchange()

afx_msg void CRhinoUiComboBox::OnCbnSelchange ( )

◆ OnChildNotify()

virtual BOOL32 CRhinoUiComboBox::OnChildNotify ( UINT  message,
WPARAM  wParam,
LPARAM  lParam,
LRESULT *  pResult 
)
protectedvirtual

◆ OnCreate()

afx_msg int CRhinoUiComboBox::OnCreate ( LPCREATESTRUCT  lpCreateStruct)

◆ OnCustomColorChanged()

virtual void CRhinoUiComboBox::OnCustomColorChanged ( COLORREF  cr,
int  iItemIndex 
)
virtual

Description: Called when color dialog is closed by pressing the OK button.

Parameters: cr [in] Color returned by color dialog. iItemIndex [in] List index for item that caused the color dialog to be displayed.

◆ OnDestroy()

afx_msg void CRhinoUiComboBox::OnDestroy ( )

Message map methods

◆ OnEditKillFocus()

afx_msg void CRhinoUiComboBox::OnEditKillFocus ( )

◆ OnEditUpdate()

afx_msg void CRhinoUiComboBox::OnEditUpdate ( )

◆ OnLButtonDblClk()

afx_msg void CRhinoUiComboBox::OnLButtonDblClk ( UINT  nFlags,
CPoint  point 
)

◆ OnLButtonDown()

afx_msg void CRhinoUiComboBox::OnLButtonDown ( UINT  nFlags,
CPoint  point 
)

◆ OnPrintWidthEditKillFocus()

void CRhinoUiComboBox::OnPrintWidthEditKillFocus ( )

Description: This method is called when a CBN_EDITCHANGE message is received and this combo box The current value in the edit control is validated and converted to a valid width if possible.

See Also: CRhinoUiComboBox::PrintWidthFromString() CRhinoUiComboBox::OnEditKillFocus()

◆ OnPrintWidthEditUpdate()

void CRhinoUiComboBox::OnPrintWidthEditUpdate ( )

Description: This method is called when a CBN_EDITUPDATE message is received and this combo box The current value in the edit control is validated and converted to a valid width if possible.

See Also: CRhinoUiComboBox::PrintWidthFromString() CRhinoUiComboBox::OnEditKillFocus()

◆ OnWndMsg()

virtual BOOL32 CRhinoUiComboBox::OnWndMsg ( UINT  message,
WPARAM  wParam,
LPARAM  lParam,
LRESULT *  pResult 
)
protectedvirtual

◆ PostNcDestroy()

virtual void CRhinoUiComboBox::PostNcDestroy ( )
protectedvirtual

◆ PreSubclassWindow()

virtual void CRhinoUiComboBox::PreSubclassWindow ( )
protectedvirtual

◆ PreTranslateMessage()

virtual BOOL32 CRhinoUiComboBox::PreTranslateMessage ( MSG *  pMsg)
protectedvirtual

virtual overrides

Reimplemented in CRhinoUiOptionsListCtrlComboBox.

◆ PrintWidthDataFromListIndex()

RhinoUiPrintWidthComboBoxItemData* CRhinoUiComboBox::PrintWidthDataFromListIndex ( int  iIndex) const

Description: Get plot width information associated with combo box item.

Parameters: iIndex [in] Index of combo box item to get the plot width for.

Returns: Plot width data associated with comob box item or NULL on error

See Also: CRhinoUiComboBox::AddPlotWidth()

◆ PrintWidthFromString()

double CRhinoUiComboBox::PrintWidthFromString ( )

Description: Call this method to convert the current string in the combo box edit control to a width value.

Returns: Returns a CRhinoUiComboBox::print_width_options or valid width value on success or list_box_error_width on failure.

See Also: CRhinoUiComboBox::OnPrintWidthEditKillFocus() CRhinoUiComboBox::OnEditKillFocus()

◆ ReadPrintWidthFile()

static bool CRhinoUiComboBox::ReadPrintWidthFile ( const wchar_t *  lpsFileName,
ON_SimpleArray< double > &  widths,
bool  bQuietly 
)
static

Description: Read default print widths from specified file.

Parameters: lpsFileName [in] Name of file to read widths [out] Width values will be added to this list bQueitly [in] If this is true then this function will fail quietly otherwise a message box will appear on error.

Returns: Returns true if file was successfully opened and read.

See Also: CRhinoUiComboBox::FillUsingStandardWidths()

◆ SetColorSwatchDrawStyle()

color_swatch_draw_style CRhinoUiComboBox::SetColorSwatchDrawStyle ( color_swatch_draw_style  style)

Description: Call this method to control how color swatches are drawn in owner draw versions of the combo box that include a color swatch.

Parameters: style [in] New swatch draw style, see CRhinoUiComboBoxItem::color_swatch_draw_style for options.

Returns: Returns previous value.

See Also: CRhinoUiComboBoxItem::color_swatch_draw_style CRhinoUiComboBoxItem::ColorSwatchDrawStyle()

◆ SetCreateAsOwnerDraw()

bool CRhinoUiComboBox::SetCreateAsOwnerDraw ( bool  b)

Description: Set flag which tells control to ensure that it is owner draw when it is created so that font and color previews are visible.

Parameters: b [in] New value for create flag.

Returns: Returns previous value.

See Also: CRhinoUiComboBoxItem::CreateAsOwnerDraw()

◆ SetCurColor()

COLORREF CRhinoUiComboBox::SetCurColor ( COLORREF  cr)

Description: Get color associated with current selection and return the current selection index.

Returns: Returns LB_ERROR if nothing is selected otherwise; zero based index of the curret list item and sets color equal to the selected color.

See Also: CRhinoUiComboBox::ColorFromListIndex() CRhinoUiComboBox::ColorIsByLayer() CRhinoUiComboBox::GetCurColor() Description: Find list item with specified color and set it as currently selected item.

Parameters: cr [in] Check each item in list for color that matches and make the first one found current selection.

Returns: Color of previously selected item or CRhinoUiPaintManager::error_color on error.

See Also: CRhinoUiPaintManager::error_color CRhinoUiComboBox::ColorFromListIndex() CRhinoUiComboBox::ColorIsByLayer()

◆ SetCurFont() [1/2]

int CRhinoUiComboBox::SetCurFont ( const LOGFONT &  lf)

Description: Find item in list that has same font face and make it the current selection. Nothing happens if font face name is not found in the list.

Parameters: lf [in] LOGFONT Structure containing font face name.

Returns: A return value greater than or equal to zero is the zero based index of previously selected item. A value of LB_ERROR indicates that there was not previous selection. A value of -2 indicates there was and error and the selection was not changed.

See Also: CRhinoUiComboBox::GetCurFont() LB_ERROR CComboBox::SetCurSel()

◆ SetCurFont() [2/2]

int CRhinoUiComboBox::SetCurFont ( LPCTSTR  lpsFontFace)

Description: Find item in list that has same font face and make it the current selection. Nothing happens if font face name is not found in the list.

Parameters: lpsFontFace [in] Font face name.

Returns: A return value greater than or equal to zero is the zero based index of previously selected item. A value of LB_ERROR indicates that there was not previous selection. A value of -2 indicates there was and error and the selection was not changed.

See Also: LB_ERROR CComboBox::SetCurSel()

◆ SetCurLayer()

UUID CRhinoUiComboBox::SetCurLayer ( UUID  uuid,
COLORREF  cr 
)

Description: Find list item with specified layer index and set it as currently selected item.

Parameters: uuid [in] Check each item in list for a layer UUID that matches and make the first one found the current selection.

Returns: Layer UUID of previously selected item or ListBoxErrorUUID() if there was no previous selection.

See Also: CRhinoUiComboBox::GetCurLayer() CRhinoUiComboBox::FillLayerList()

◆ SetCurLinetype()

UUID CRhinoUiComboBox::SetCurLinetype ( UUID  uuid)

Description: Find list item with specified linetype index and set it as currently selected item.

Parameters: iLinetypeIndex [in] Check each item in list for a linetype index that matches and make the first one found the current selection.

Returns: Linetype index of previously selected item or -1 on error. /// See Also: CRhinoUiComboBox::GetCurLinetypeIndex() CRhinoUiComboBox::FillLinetypeList()

◆ SetCurPrintWidth()

double CRhinoUiComboBox::SetCurPrintWidth ( double  cx)

Description: Find list item with specified print width set it as currently selected item.

Parameters: cx [in] Check each item in list for a print width that matches and make the first one found the current selection.

Returns: Print width of previously selected item or list_box_error_width on error.

See Also: CRhinoUiComboBox::GetCurLinetypeIndex() CRhinoUiComboBox::list_box_error_width

◆ SetCustomColor()

bool CRhinoUiComboBox::SetCustomColor ( COLORREF  cr)

◆ ShowLayerPopDownWnd()

virtual void CRhinoUiComboBox::ShowLayerPopDownWnd ( HWND  hWnd,
bool  bShow 
)
protectedvirtual

◆ WindowProc()

virtual LRESULT CRhinoUiComboBox::WindowProc ( UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
protectedvirtual

Friends And Related Function Documentation

◆ CRhinoUiPopDownLayerWnd::HidePopUpWindow

◆ RhinoUiComboBoxEnumFontProc

int CALLBACK RhinoUiComboBoxEnumFontProc ( const LOGFONT *  ,
const TEXTMETRIC *  ,
DWORD  ,
LPARAM   
)
friend

end - Font combo UI

Member Data Documentation

◆ m_bIncludeNonTrueType

bool CRhinoUiComboBox::m_bIncludeNonTrueType
protected

◆ m_bIncludeTrueType

bool CRhinoUiComboBox::m_bIncludeTrueType
protected

◆ m_bInOnPrintWidthEditKillFocus

bool CRhinoUiComboBox::m_bInOnPrintWidthEditKillFocus
protected

◆ m_bShowReferenceLayers

bool CRhinoUiComboBox::m_bShowReferenceLayers
protected

◆ m_change_mode

change_mode CRhinoUiComboBox::m_change_mode
protected

◆ m_crCustom

COLORREF CRhinoUiComboBox::m_crCustom
protected

◆ m_current_color

RhinoUiColorComboBoxItemData CRhinoUiComboBox::m_current_color
protected

◆ m_current_font

RhinoUiFontComboBoxItemData CRhinoUiComboBox::m_current_font
protected

◆ m_current_layer

RhinoUiLayerComboBoxItemData CRhinoUiComboBox::m_current_layer
protected

◆ m_current_linetype

RhinoUiLinetypeComboBoxItemData CRhinoUiComboBox::m_current_linetype
protected

◆ m_current_print_width

RhinoUiPrintWidthComboBoxItemData CRhinoUiComboBox::m_current_print_width
protected

◆ m_fill_class_type

CRhinoUiComboBoxItemData::class_type CRhinoUiComboBox::m_fill_class_type
protected

◆ m_from_file_linetypes

ON_ObjectArray<ON_Linetype> CRhinoUiComboBox::m_from_file_linetypes
protected

◆ m_pWndLayerPopDown

class CRhinoUiPopDownLayerWnd* CRhinoUiComboBox::m_pWndLayerPopDown
protected

◆ m_swatch_style

color_swatch_draw_style CRhinoUiComboBox::m_swatch_style
protected