Rhino C++ API  8.5
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CRhinoUiLayerListCtrl Class Reference

CRhinoUiLayerListCtrl. More...

#include <rhinoSdkUiLayerListCtrl.h>

Inheritance diagram for CRhinoUiLayerListCtrl:
CRhinoUiPopDownLayerListCtrl

Public Types

enum  columns {
  name_column = 0, color_column, current_column, visible_column,
  locked_column, column_count
}
 
enum  layer_images {
  no_layer_image = 0, current_image, visible_image, invisible_image,
  locked_image, unlocked_image, cached_visible_image, cached_locked_image,
  image_count
}
 
enum  state_images { no_state_image = 0, collapsed_image, expanded_image }
 

Public Member Functions

 CRhinoUiLayerListCtrl ()
 
virtual ~CRhinoUiLayerListCtrl ()
 
BOOL32 DeleteAllItems ()
 
virtual void DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
 
bool EnableMultipleSelect () const
 
int GetMaxIndentPixels ()
 
int GetMaxStringPixels ()
 
void Initialize ()
 
bool LayerEditingEnabled () const
 
int LoadLayers (CRhinoDoc *doc, bool bShowReference=true, int set_current=-1)
 
afx_msg void OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
 
afx_msg void OnContextMenu (CWnd *pWnd, CPoint point)
 
afx_msg BOOL32 OnEraseBkgnd (CDC *pDC)
 
virtual void OnItemCollapsed (int nItem)
 
virtual void OnItemExpanded (int nItem)
 
afx_msg void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 
afx_msg void OnLButtonDblClk (UINT nFlags, CPoint point)
 
afx_msg void OnLButtonDown (UINT nFlags, CPoint point)
 
afx_msg void OnPaint ()
 
int SelectedLayer () const
 
int SelectedLayers (ON_SimpleArray< int > &layer_list) const
 
void SetEnableMultipleSelect (bool bEnable)
 
void SetLayerEditingEnabled (bool bEnable=true)
 
void SetSelectedLayer (int layer_index)
 
void SetSelectedLayers (const ON_SimpleArray< int > &layer_list)
 
void SizeColumns ()
 

Protected Member Functions

void AppendItem (CRhinoDoc *doc, const CRhinoLayer *layer, bool bExpanded)
 
void AppendLayer (CRhinoDoc *doc, const CRhinoLayer *layer, bool bExpanded)
 
void Collapse (int nPos, int nItem)
 
int DoExpand (int nItem, bool bRecursive, int &nCounterInsert)
 
int Expand (int nPos, int nItem, bool bRecurse=false)
 
int GetItemIndent (int nItem) const
 
int InsertItem (int nItem, int nPos, const CRhinoUiLayerListCtrlItem &item)
 
const CRhinoUiLayerListCtrlItemLayerFromItem (int nItem) const
 
int LayerIndexFromItem (int nItem) const
 
void OnClickColorColumn (int nItem)
 
void OnClickCurrentColumn (int nItem)
 
void OnClickLockedColumn (int nItem)
 
void OnClickNameColumn (int nItem)
 
void OnClickVisibleColumn (int nItem)
 
virtual void PreSubclassWindow ()
 

Protected Attributes

bool m_bDrawHorzizontalGridLines
 
bool m_bKeepFocus
 
bool m_bLayerEditingEnabled
 
bool m_bShowReference
 
CRhinoUiImageList m_ilEmpty
 
CRhinoUiImageList m_ilImage
 
CRhinoUiImageList m_ilTree
 
ON_ClassArray< CRhinoUiLayerListCtrlItemm_layers
 
unsigned int m_rhino_doc_sn
 

Detailed Description

CRhinoUiLayerListCtrl.

Member Enumeration Documentation

◆ columns

Enumerator
name_column 
color_column 
current_column 
visible_column 
locked_column 
column_count 

◆ layer_images

Enumerator
no_layer_image 
current_image 
visible_image 
invisible_image 
locked_image 
unlocked_image 
cached_visible_image 
cached_locked_image 
image_count 

◆ state_images

Enumerator
no_state_image 
collapsed_image 
expanded_image 

Constructor & Destructor Documentation

◆ CRhinoUiLayerListCtrl()

CRhinoUiLayerListCtrl::CRhinoUiLayerListCtrl ( )

◆ ~CRhinoUiLayerListCtrl()

virtual CRhinoUiLayerListCtrl::~CRhinoUiLayerListCtrl ( )
virtual

Member Function Documentation

◆ AppendItem()

void CRhinoUiLayerListCtrl::AppendItem ( CRhinoDoc doc,
const CRhinoLayer layer,
bool  bExpanded 
)
protected

◆ AppendLayer()

void CRhinoUiLayerListCtrl::AppendLayer ( CRhinoDoc doc,
const CRhinoLayer layer,
bool  bExpanded 
)
protected

◆ Collapse()

void CRhinoUiLayerListCtrl::Collapse ( int  nPos,
int  nItem 
)
protected

◆ DeleteAllItems()

BOOL32 CRhinoUiLayerListCtrl::DeleteAllItems ( )

Description: Deletes all items in the list control, and purges local item data.

◆ DoExpand()

int CRhinoUiLayerListCtrl::DoExpand ( int  nItem,
bool  bRecursive,
int &  nCounterInsert 
)
protected

◆ DrawItem()

virtual void CRhinoUiLayerListCtrl::DrawItem ( LPDRAWITEMSTRUCT  lpDrawItemStruct)
virtual

◆ EnableMultipleSelect()

bool CRhinoUiLayerListCtrl::EnableMultipleSelect ( ) const

Description: Verifies that multiple selection is enabled. Returns: TRUE - if multiple selection is enabled. FALSE - if multiple selection is disabled. See Also: SetEnableMultipleSelect

◆ Expand()

int CRhinoUiLayerListCtrl::Expand ( int  nPos,
int  nItem,
bool  bRecurse = false 
)
protected

◆ GetItemIndent()

int CRhinoUiLayerListCtrl::GetItemIndent ( int  nItem) const
protected

◆ GetMaxIndentPixels()

int CRhinoUiLayerListCtrl::GetMaxIndentPixels ( )

Description Returns the size, in pixels, of the deepest layer indent in the control.

◆ GetMaxStringPixels()

int CRhinoUiLayerListCtrl::GetMaxStringPixels ( )

Description Returns the size, in pixels, of the long layer name in the control.

◆ Initialize()

void CRhinoUiLayerListCtrl::Initialize ( )

Description: Initializes the control. Remarks: Call this member from CDialog::OnInitDialog() after any call to SetLayerEditingEnabled and before calling LoadLayers(). See Also: LoadLayers

◆ InsertItem()

int CRhinoUiLayerListCtrl::InsertItem ( int  nItem,
int  nPos,
const CRhinoUiLayerListCtrlItem item 
)
protected

◆ LayerEditingEnabled()

bool CRhinoUiLayerListCtrl::LayerEditingEnabled ( ) const

Description: Verifies that layer editing is enabled. See Also: SetLayerEditingEnabled

◆ LayerFromItem()

const CRhinoUiLayerListCtrlItem* CRhinoUiLayerListCtrl::LayerFromItem ( int  nItem) const
protected

◆ LayerIndexFromItem()

int CRhinoUiLayerListCtrl::LayerIndexFromItem ( int  nItem) const
protected

◆ LoadLayers()

int CRhinoUiLayerListCtrl::LoadLayers ( CRhinoDoc doc,
bool  bShowReference = true,
int  set_current = -1 
)

Description: Load the layer table of the document into the list control Parameters: doc [in] - document containing the layer table show_referenced [in] - show reference layers set_current [in] - layer index of item to set as current Returns: Number of layers added to list See Also: Initialize

◆ OnChar()

afx_msg void CRhinoUiLayerListCtrl::OnChar ( UINT  nChar,
UINT  nRepCnt,
UINT  nFlags 
)

◆ OnClickColorColumn()

void CRhinoUiLayerListCtrl::OnClickColorColumn ( int  nItem)
protected

◆ OnClickCurrentColumn()

void CRhinoUiLayerListCtrl::OnClickCurrentColumn ( int  nItem)
protected

◆ OnClickLockedColumn()

void CRhinoUiLayerListCtrl::OnClickLockedColumn ( int  nItem)
protected

◆ OnClickNameColumn()

void CRhinoUiLayerListCtrl::OnClickNameColumn ( int  nItem)
protected

◆ OnClickVisibleColumn()

void CRhinoUiLayerListCtrl::OnClickVisibleColumn ( int  nItem)
protected

◆ OnContextMenu()

afx_msg void CRhinoUiLayerListCtrl::OnContextMenu ( CWnd *  pWnd,
CPoint  point 
)

◆ OnEraseBkgnd()

afx_msg BOOL32 CRhinoUiLayerListCtrl::OnEraseBkgnd ( CDC *  pDC)

◆ OnItemCollapsed()

virtual void CRhinoUiLayerListCtrl::OnItemCollapsed ( int  nItem)
virtual

Description Override this virtual function if you want to be notified when an item was collapsed.

Reimplemented in CRhinoUiPopDownLayerListCtrl.

◆ OnItemExpanded()

virtual void CRhinoUiLayerListCtrl::OnItemExpanded ( int  nItem)
virtual

Description Override this virtual function if you want to be notified when an item was expanded.

Reimplemented in CRhinoUiPopDownLayerListCtrl.

◆ OnKeyDown()

afx_msg void CRhinoUiLayerListCtrl::OnKeyDown ( UINT  nChar,
UINT  nRepCnt,
UINT  nFlags 
)

◆ OnLButtonDblClk()

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

◆ OnLButtonDown()

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

◆ OnPaint()

afx_msg void CRhinoUiLayerListCtrl::OnPaint ( )

◆ PreSubclassWindow()

virtual void CRhinoUiLayerListCtrl::PreSubclassWindow ( )
protectedvirtual

◆ SelectedLayer()

int CRhinoUiLayerListCtrl::SelectedLayer ( ) const

Description: Returns the selected layer. Returns: >= 0 The layer index, as found in CRhinoDoc::m_layer_table, of the selected layer. -1 If no item is selected See Also: SetSelectedLayer

◆ SelectedLayers()

int CRhinoUiLayerListCtrl::SelectedLayers ( ON_SimpleArray< int > &  layer_list) const

Description: Returns a list of selected layers. Parameters: layer_list [out] The array to hold the list of selected layers, as as found in CRhinoDoc::m_layer_table. Returns:

0 The number of items added to layer_list.

0 If no items were selected See Also: SetSelectedLayers

◆ SetEnableMultipleSelect()

void CRhinoUiLayerListCtrl::SetEnableMultipleSelect ( bool  bEnable)

Description: Enables or disables multiple selection. Parameters: bEnable - [in] TRUE to enable multiple select, otherwise FALSE. See Also: EnableMultipleSelect

◆ SetLayerEditingEnabled()

void CRhinoUiLayerListCtrl::SetLayerEditingEnabled ( bool  bEnable = true)

Description: Enables or disables layer editing. Parameters: bEnable [in] - enable layer editing. The default behavior of the control is not to allow layer editing. Remarks: If this member is not called or is called with a value of false, then the control will display a color and name column only. This mode is useful if only want the user to select a layer. If this member is called with a value of true, then this control will display visible, locked, color, current, and name columns. When items in these columns are clicked, the layer in which they represent will be manipulate accordingly. See Also: Initialize LoadLayers LayerEditingEnabled

◆ SetSelectedLayer()

void CRhinoUiLayerListCtrl::SetSelectedLayer ( int  layer_index)

Description: Sets the selected layer. Note, if the specified layer index is a child of a layer who is not expanded, the layer will not be selected. Parameters: layer_index - [in] The layer index, as found in CRhinoDoc::m_layer_table, of the layer to select. See Also: SelectedLayer

◆ SetSelectedLayers()

void CRhinoUiLayerListCtrl::SetSelectedLayers ( const ON_SimpleArray< int > &  layer_list)

Description: Sets the selected layers. Note, if any of the specified layer indices is a child of a layer who is not expanded, the layer will not be selected. Parameters: layer_list [in] The array layer indices, as as found in CRhinoDoc::m_layer_table. to select. See Also: SelectedLayers

◆ SizeColumns()

void CRhinoUiLayerListCtrl::SizeColumns ( )

Description: Ensures that column headers are sized appropriately. Call from CDialog::OnSize().

Member Data Documentation

◆ m_bDrawHorzizontalGridLines

bool CRhinoUiLayerListCtrl::m_bDrawHorzizontalGridLines
protected

◆ m_bKeepFocus

bool CRhinoUiLayerListCtrl::m_bKeepFocus
protected

◆ m_bLayerEditingEnabled

bool CRhinoUiLayerListCtrl::m_bLayerEditingEnabled
protected

◆ m_bShowReference

bool CRhinoUiLayerListCtrl::m_bShowReference
protected

◆ m_ilEmpty

CRhinoUiImageList CRhinoUiLayerListCtrl::m_ilEmpty
protected

◆ m_ilImage

CRhinoUiImageList CRhinoUiLayerListCtrl::m_ilImage
protected

◆ m_ilTree

CRhinoUiImageList CRhinoUiLayerListCtrl::m_ilTree
protected

◆ m_layers

ON_ClassArray<CRhinoUiLayerListCtrlItem> CRhinoUiLayerListCtrl::m_layers
protected

◆ m_rhino_doc_sn

unsigned int CRhinoUiLayerListCtrl::m_rhino_doc_sn
protected