Files
Work/imagelst/TVINSERT.HPP
2024-08-07 09:16:27 -04:00

110 lines
2.5 KiB
C++

#ifndef _IMAGELIST_TREEVIEWINSERT_HPP_
#define _IMAGELIST_TREEVIEWINSERT_HPP_
#ifndef _COMMON_COMMCTRL_HPP_
#include <common/commctrl.hpp>
#endif
#ifndef _IMAGELIST_TREEVIEWITEM_HPP_
#include <imagelst/tvitem.hpp>
#endif
class TreeViewInsert : private TV_INSERTSTRUCT
{
public:
enum InsertFlags{InsertRoot=(int)TVI_ROOT,InsertFirst=(int)TVI_FIRST,
InsertLast=(int)TVI_LAST,InsertSort=(int)TVI_SORT};
enum GetFlags{GetRoot=TVGN_ROOT,GetNext=TVGN_NEXT,GetPrevious=TVGN_PREVIOUS,
GetParent=TVGN_PARENT,GetChild=TVGN_CHILD,GetFirstVisible=TVGN_FIRSTVISIBLE,
GetNextVisible=TVGN_NEXTVISIBLE,GetPreviousVisible=TVGN_PREVIOUSVISIBLE,
GetDropHilite=TVGN_DROPHILITE,GetCaret=TVGN_CARET};
TreeViewInsert(void);
TreeViewInsert(const TreeViewInsert &someTreeViewInsert);
virtual ~TreeViewInsert();
operator TV_INSERTSTRUCT&(void);
TreeViewInsert &operator=(const TreeViewInsert &someTreeViewInsert);
HTREEITEM parent(void)const;
void parent(HTREEITEM hParent);
HTREEITEM insertAfter(void)const;
void insertAfter(HTREEITEM hInsertAfter);
void insertAfter(InsertFlags insertFlags);
TreeViewItem viewItem(void)const;
void viewItem(const TreeViewItem &someTreeViewItem);
private:
};
inline
TreeViewInsert::TreeViewInsert(void)
{
parent(0);
insertAfter(0);
viewItem(TreeViewItem());
}
inline
TreeViewInsert::TreeViewInsert(const TreeViewInsert &someTreeViewInsert)
{
*this=someTreeViewInsert;
}
inline
TreeViewInsert::~TreeViewInsert()
{
}
inline
TreeViewInsert &TreeViewInsert::operator=(const TreeViewInsert &someTreeViewInsert)
{
parent(someTreeViewInsert.parent());
insertAfter(someTreeViewInsert.insertAfter());
viewItem(someTreeViewInsert.viewItem());
return *this;
}
inline
TreeViewInsert::operator TV_INSERTSTRUCT&(void)
{
return *this;
}
inline
HTREEITEM TreeViewInsert::parent(void)const
{
return TV_INSERTSTRUCT::hParent;
}
inline
void TreeViewInsert::parent(HTREEITEM hParent)
{
TV_INSERTSTRUCT::hParent=hParent;
}
inline
HTREEITEM TreeViewInsert::insertAfter(void)const
{
return TV_INSERTSTRUCT::hInsertAfter;
}
inline
void TreeViewInsert::insertAfter(HTREEITEM hInsertAfter)
{
TV_INSERTSTRUCT::hInsertAfter=hInsertAfter;
}
inline
void TreeViewInsert::insertAfter(InsertFlags insertFlags)
{
TV_INSERTSTRUCT::hInsertAfter=((HTREEITEM)insertFlags);
}
inline
TreeViewItem TreeViewInsert::viewItem(void)const
{
return TreeViewItem(TV_INSERTSTRUCT::item);
}
inline
void TreeViewInsert::viewItem(const TreeViewItem &someTreeViewItem)
{
::memcpy((char*)&item,(char*)&((TV_ITEM&)someTreeViewItem),sizeof(TV_ITEM));
}
#endif