1998-05-22 19:57:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-03-14 18:37:46 +00:00
|
|
|
// Name: treectrl.h
|
1998-05-22 19:57:05 +00:00
|
|
|
// Purpose: wxTreeCtrl sample
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04/01/98
|
2003-03-17 11:55:54 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-22 19:57:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-08-04 13:59:45 +00:00
|
|
|
#define USE_GENERIC_TREECTRL 0
|
|
|
|
|
|
|
|
#if USE_GENERIC_TREECTRL
|
|
|
|
#include "wx/generic/treectlg.h"
|
|
|
|
#ifndef wxTreeCtrl
|
|
|
|
#define wxTreeCtrl wxGenericTreeCtrl
|
|
|
|
#define sm_classwxTreeCtrl sm_classwxGenericTreeCtrl
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
1998-05-22 19:57:05 +00:00
|
|
|
// Define a new application type
|
1998-10-28 21:32:29 +00:00
|
|
|
class MyApp : public wxApp
|
|
|
|
{
|
|
|
|
public:
|
2008-06-24 12:48:01 +00:00
|
|
|
MyApp() { m_showImages = true; m_showStates = true; m_showButtons = false; }
|
2000-03-03 10:31:34 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
bool OnInit() wxOVERRIDE;
|
2000-03-03 10:31:34 +00:00
|
|
|
|
|
|
|
void SetShowImages(bool show) { m_showImages = show; }
|
|
|
|
bool ShowImages() const { return m_showImages; }
|
|
|
|
|
2008-06-24 12:48:01 +00:00
|
|
|
void SetShowStates(bool show) { m_showStates = show; }
|
|
|
|
bool ShowStates() const { return m_showStates; }
|
|
|
|
|
2001-08-18 13:09:26 +00:00
|
|
|
void SetShowButtons(bool show) { m_showButtons = show; }
|
|
|
|
bool ShowButtons() const { return m_showButtons; }
|
|
|
|
|
2000-03-03 10:31:34 +00:00
|
|
|
private:
|
2008-06-24 12:48:01 +00:00
|
|
|
bool m_showImages, m_showStates, m_showButtons;
|
1998-10-28 21:32:29 +00:00
|
|
|
};
|
1998-05-22 19:57:05 +00:00
|
|
|
|
1998-10-28 21:32:29 +00:00
|
|
|
class MyTreeItemData : public wxTreeItemData
|
|
|
|
{
|
|
|
|
public:
|
1999-04-12 11:48:06 +00:00
|
|
|
MyTreeItemData(const wxString& desc) : m_desc(desc) { }
|
1998-10-28 21:32:29 +00:00
|
|
|
|
1999-04-12 11:48:06 +00:00
|
|
|
void ShowInfo(wxTreeCtrl *tree);
|
2014-07-10 09:51:41 +00:00
|
|
|
wxString const& GetDesc() const { return m_desc; }
|
1998-10-28 21:32:29 +00:00
|
|
|
|
|
|
|
private:
|
1999-04-12 11:48:06 +00:00
|
|
|
wxString m_desc;
|
1998-05-22 19:57:05 +00:00
|
|
|
};
|
|
|
|
|
1998-10-28 21:32:29 +00:00
|
|
|
class MyTreeCtrl : public wxTreeCtrl
|
1998-05-22 19:57:05 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-04-12 11:48:06 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
TreeCtrlIcon_File,
|
1999-09-29 22:47:56 +00:00
|
|
|
TreeCtrlIcon_FileSelected,
|
|
|
|
TreeCtrlIcon_Folder,
|
|
|
|
TreeCtrlIcon_FolderSelected,
|
|
|
|
TreeCtrlIcon_FolderOpened
|
1999-04-12 11:48:06 +00:00
|
|
|
};
|
|
|
|
|
2008-06-24 12:48:01 +00:00
|
|
|
MyTreeCtrl() { m_alternateImages = false; m_alternateStates = false; }
|
1999-04-12 11:48:06 +00:00
|
|
|
MyTreeCtrl(wxWindow *parent, const wxWindowID id,
|
|
|
|
const wxPoint& pos, const wxSize& size,
|
|
|
|
long style);
|
2018-11-25 19:22:55 +00:00
|
|
|
virtual ~MyTreeCtrl(){}
|
1999-04-12 11:48:06 +00:00
|
|
|
|
|
|
|
void OnBeginDrag(wxTreeEvent& event);
|
|
|
|
void OnBeginRDrag(wxTreeEvent& event);
|
2000-02-15 23:57:33 +00:00
|
|
|
void OnEndDrag(wxTreeEvent& event);
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnBeginLabelEdit(wxTreeEvent& event);
|
|
|
|
void OnEndLabelEdit(wxTreeEvent& event);
|
|
|
|
void OnDeleteItem(wxTreeEvent& event);
|
2003-07-10 12:46:48 +00:00
|
|
|
void OnContextMenu(wxContextMenuEvent& event);
|
2005-03-18 15:13:41 +00:00
|
|
|
void OnItemMenu(wxTreeEvent& event);
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnGetInfo(wxTreeEvent& event);
|
|
|
|
void OnSetInfo(wxTreeEvent& event);
|
|
|
|
void OnItemExpanded(wxTreeEvent& event);
|
|
|
|
void OnItemExpanding(wxTreeEvent& event);
|
|
|
|
void OnItemCollapsed(wxTreeEvent& event);
|
|
|
|
void OnItemCollapsing(wxTreeEvent& event);
|
|
|
|
void OnSelChanged(wxTreeEvent& event);
|
|
|
|
void OnSelChanging(wxTreeEvent& event);
|
|
|
|
void OnTreeKeyDown(wxTreeEvent& event);
|
|
|
|
void OnItemActivated(wxTreeEvent& event);
|
2008-06-24 12:48:01 +00:00
|
|
|
void OnItemStateClick(wxTreeEvent& event);
|
2005-04-09 11:04:00 +00:00
|
|
|
void OnItemRClick(wxTreeEvent& event);
|
2005-04-05 23:03:32 +00:00
|
|
|
|
|
|
|
void OnRMouseDown(wxMouseEvent& event);
|
|
|
|
void OnRMouseUp(wxMouseEvent& event);
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnRMouseDClick(wxMouseEvent& event);
|
|
|
|
|
2014-02-25 17:26:54 +00:00
|
|
|
wxTreeItemId GetLastTreeITem() const;
|
2003-07-20 14:01:00 +00:00
|
|
|
void GetItemsRecursively(const wxTreeItemId& idParent,
|
|
|
|
wxTreeItemIdValue cookie = 0);
|
1999-04-12 11:48:06 +00:00
|
|
|
|
2000-03-10 01:17:08 +00:00
|
|
|
void CreateImageList(int size = 16);
|
2001-08-18 13:09:26 +00:00
|
|
|
void CreateButtonsImageList(int size = 11);
|
2008-06-24 12:48:01 +00:00
|
|
|
void CreateStateImageList(bool del = false);
|
2000-03-03 10:31:34 +00:00
|
|
|
|
1999-04-12 11:48:06 +00:00
|
|
|
void AddTestItemsToTree(size_t numChildren, size_t depth);
|
|
|
|
|
2004-05-20 17:23:15 +00:00
|
|
|
void DoSortChildren(const wxTreeItemId& item, bool reverse = false)
|
1999-07-30 22:45:55 +00:00
|
|
|
{ m_reverseSort = reverse; wxTreeCtrl::SortChildren(item); }
|
1998-12-18 15:37:19 +00:00
|
|
|
|
1999-07-30 22:45:55 +00:00
|
|
|
void DoToggleIcon(const wxTreeItemId& item);
|
2008-06-24 12:48:01 +00:00
|
|
|
void DoToggleState(const wxTreeItemId& item);
|
1999-07-30 22:45:55 +00:00
|
|
|
|
2001-05-27 02:16:09 +00:00
|
|
|
void ShowMenu(wxTreeItemId id, const wxPoint& pt);
|
|
|
|
|
2001-08-18 13:09:26 +00:00
|
|
|
int ImageSize(void) const { return m_imageSize; }
|
|
|
|
|
2007-04-07 19:59:51 +00:00
|
|
|
void SetAlternateImages(bool show) { m_alternateImages = show; }
|
|
|
|
bool AlternateImages() const { return m_alternateImages; }
|
|
|
|
|
2008-06-24 12:48:01 +00:00
|
|
|
void SetAlternateStates(bool show) { m_alternateStates = show; }
|
|
|
|
bool AlternateStates() const { return m_alternateStates; }
|
|
|
|
|
2009-01-25 18:34:45 +00:00
|
|
|
void ResetBrokenStateImages()
|
|
|
|
{
|
|
|
|
const size_t count = GetStateImageList()->GetImageCount();
|
|
|
|
int state = count > 0 ? count - 1 : wxTREE_ITEMSTATE_NONE;
|
|
|
|
DoResetBrokenStateImages(GetRootItem(), 0, state);
|
|
|
|
}
|
|
|
|
|
1998-12-18 15:37:19 +00:00
|
|
|
protected:
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual int OnCompareItems(const wxTreeItemId& i1, const wxTreeItemId& i2) wxOVERRIDE;
|
1998-12-18 15:37:19 +00:00
|
|
|
|
1999-07-23 23:41:45 +00:00
|
|
|
// is this the test item which we use in several event handlers?
|
|
|
|
bool IsTestItem(const wxTreeItemId& item)
|
|
|
|
{
|
|
|
|
// the test item is the first child folder
|
2002-12-29 07:48:21 +00:00
|
|
|
return GetItemParent(item) == GetRootItem() && !GetPrevSibling(item);
|
1999-07-23 23:41:45 +00:00
|
|
|
}
|
|
|
|
|
1998-10-28 21:32:29 +00:00
|
|
|
private:
|
2014-02-25 17:26:54 +00:00
|
|
|
// Find the very last item in the tree.
|
1999-04-12 11:48:06 +00:00
|
|
|
void AddItemsRecursively(const wxTreeItemId& idParent,
|
|
|
|
size_t nChildren,
|
|
|
|
size_t depth,
|
|
|
|
size_t folder);
|
|
|
|
|
2009-01-25 18:34:45 +00:00
|
|
|
void DoResetBrokenStateImages(const wxTreeItemId& idParent,
|
|
|
|
wxTreeItemIdValue cookie, int state);
|
|
|
|
|
2018-09-29 01:45:15 +00:00
|
|
|
void LogEvent(const wxString& name, const wxTreeEvent& event);
|
2006-09-24 15:24:19 +00:00
|
|
|
|
2001-08-18 13:09:26 +00:00
|
|
|
int m_imageSize; // current size of images
|
2000-02-15 23:57:33 +00:00
|
|
|
bool m_reverseSort; // flag for OnCompareItems
|
2014-02-22 22:39:53 +00:00
|
|
|
wxTreeItemId m_draggedItem; // item being dragged right now
|
2007-04-07 19:59:51 +00:00
|
|
|
bool m_alternateImages;
|
2008-06-24 12:48:01 +00:00
|
|
|
bool m_alternateStates;
|
1999-04-12 11:48:06 +00:00
|
|
|
|
2014-03-30 07:07:55 +00:00
|
|
|
// NB: due to an ugly wxMSW hack you _must_ use wxDECLARE_DYNAMIC_CLASS();
|
1999-04-12 11:48:06 +00:00
|
|
|
// if you want your overloaded OnCompareItems() to be called.
|
|
|
|
// OTOH, if you don't want it you may omit the next line - this will
|
|
|
|
// make default (alphabetical) sorting much faster under wxMSW.
|
2014-03-30 07:07:55 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(MyTreeCtrl);
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
1998-05-22 19:57:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Define a new frame type
|
|
|
|
class MyFrame: public wxFrame
|
1998-10-25 17:04:49 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-04-12 11:48:06 +00:00
|
|
|
// ctor and dtor
|
|
|
|
MyFrame(const wxString& title, int x, int y, int w, int h);
|
|
|
|
virtual ~MyFrame();
|
1998-10-26 17:11:33 +00:00
|
|
|
|
1999-04-12 11:48:06 +00:00
|
|
|
// menu callbacks
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
void OnAbout(wxCommandEvent& event);
|
2007-04-10 23:48:51 +00:00
|
|
|
void OnClearLog(wxCommandEvent& event);
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2002-03-16 15:10:43 +00:00
|
|
|
void OnTogButtons(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_HAS_BUTTONS); }
|
|
|
|
void OnTogTwist(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_TWIST_BUTTONS); }
|
|
|
|
void OnTogLines(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_NO_LINES); }
|
|
|
|
void OnTogEdit(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_EDIT_LABELS); }
|
|
|
|
void OnTogHideRoot(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_HIDE_ROOT); }
|
|
|
|
void OnTogRootLines(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_LINES_AT_ROOT); }
|
|
|
|
void OnTogBorder(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_ROW_LINES); }
|
|
|
|
void OnTogFullHighlight(wxCommandEvent& event)
|
|
|
|
{ TogStyle(event.GetId(), wxTR_FULL_ROW_HIGHLIGHT); }
|
|
|
|
|
|
|
|
void OnResetStyle(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{ CreateTreeWithDefStyle(); }
|
2001-08-18 13:09:26 +00:00
|
|
|
|
2002-02-20 17:41:39 +00:00
|
|
|
void OnSetFgColour(wxCommandEvent& event);
|
|
|
|
void OnSetBgColour(wxCommandEvent& event);
|
|
|
|
|
2006-11-04 11:26:51 +00:00
|
|
|
void OnHighlight(wxCommandEvent& event);
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnDump(wxCommandEvent& event);
|
1999-07-30 22:45:55 +00:00
|
|
|
#ifndef NO_MULTIPLE_SELECTION
|
1999-06-13 15:24:01 +00:00
|
|
|
void OnDumpSelected(wxCommandEvent& event);
|
1999-07-30 22:45:55 +00:00
|
|
|
void OnSelect(wxCommandEvent& event);
|
|
|
|
void OnUnselect(wxCommandEvent& event);
|
2000-02-23 00:30:59 +00:00
|
|
|
void OnToggleSel(wxCommandEvent& event);
|
2010-01-26 12:43:39 +00:00
|
|
|
void OnSelectChildren(wxCommandEvent& event);
|
1999-07-30 22:45:55 +00:00
|
|
|
#endif // NO_MULTIPLE_SELECTION
|
2004-02-12 16:35:36 +00:00
|
|
|
void OnSelectRoot(wxCommandEvent& event);
|
2010-05-02 12:01:30 +00:00
|
|
|
void OnSetFocusedRoot(wxCommandEvent& event);
|
|
|
|
void OnClearFocused(wxCommandEvent& event);
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnDelete(wxCommandEvent& event);
|
|
|
|
void OnDeleteChildren(wxCommandEvent& event);
|
|
|
|
void OnDeleteAll(wxCommandEvent& event);
|
2000-03-03 10:31:34 +00:00
|
|
|
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnRecreate(wxCommandEvent& event);
|
2001-08-18 13:09:26 +00:00
|
|
|
void OnToggleButtons(wxCommandEvent& event);
|
2000-03-03 10:31:34 +00:00
|
|
|
void OnToggleImages(wxCommandEvent& event);
|
2008-06-24 12:48:01 +00:00
|
|
|
void OnToggleStates(wxCommandEvent& event);
|
2012-10-07 22:42:02 +00:00
|
|
|
void OnToggleBell(wxCommandEvent& event);
|
2007-04-07 19:59:51 +00:00
|
|
|
void OnToggleAlternateImages(wxCommandEvent& event);
|
2008-06-24 12:48:01 +00:00
|
|
|
void OnToggleAlternateStates(wxCommandEvent& event);
|
2000-03-03 10:31:34 +00:00
|
|
|
void OnSetImageSize(wxCommandEvent& event);
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnCollapseAndReset(wxCommandEvent& event);
|
1998-11-30 00:08:57 +00:00
|
|
|
|
2004-05-20 17:23:15 +00:00
|
|
|
void OnSetBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(true); }
|
|
|
|
void OnClearBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(false); }
|
1999-03-23 13:50:29 +00:00
|
|
|
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnEnsureVisible(wxCommandEvent& event);
|
2009-03-16 11:49:04 +00:00
|
|
|
void OnSetFocus(wxCommandEvent& event);
|
1999-04-12 11:48:06 +00:00
|
|
|
|
1999-10-02 19:43:56 +00:00
|
|
|
void OnCount(wxCommandEvent& event);
|
|
|
|
void OnCountRec(wxCommandEvent& event);
|
1999-12-29 10:29:26 +00:00
|
|
|
|
1999-04-12 11:48:06 +00:00
|
|
|
void OnRename(wxCommandEvent& event);
|
2003-09-24 15:01:08 +00:00
|
|
|
void OnSort(wxCommandEvent& WXUNUSED(event)) { DoSort(); }
|
2004-05-20 17:23:15 +00:00
|
|
|
void OnSortRev(wxCommandEvent& WXUNUSED(event)) { DoSort(true); }
|
1999-04-12 11:48:06 +00:00
|
|
|
|
|
|
|
void OnAddItem(wxCommandEvent& event);
|
2013-05-31 23:21:36 +00:00
|
|
|
void OnAddManyItems(wxCommandEvent& event);
|
1999-12-29 10:29:26 +00:00
|
|
|
void OnInsertItem(wxCommandEvent& event);
|
1999-07-30 22:45:55 +00:00
|
|
|
|
1999-05-03 23:11:53 +00:00
|
|
|
void OnIncIndent(wxCommandEvent& event);
|
|
|
|
void OnDecIndent(wxCommandEvent& event);
|
|
|
|
|
|
|
|
void OnIncSpacing(wxCommandEvent& event);
|
|
|
|
void OnDecSpacing(wxCommandEvent& event);
|
1998-12-18 15:37:19 +00:00
|
|
|
|
1999-07-30 22:45:55 +00:00
|
|
|
void OnToggleIcon(wxCommandEvent& event);
|
2008-06-24 12:48:01 +00:00
|
|
|
void OnToggleState(wxCommandEvent& event);
|
1999-07-30 22:45:55 +00:00
|
|
|
|
2007-10-07 21:58:51 +00:00
|
|
|
void OnShowFirstVisible(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{ DoShowFirstOrLast(&wxTreeCtrl::GetFirstVisibleItem, "first visible"); }
|
|
|
|
#ifdef wxHAS_LAST_VISIBLE // we don't have it currently but may add later
|
|
|
|
void OnShowLastVisible(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{ DoShowFirstOrLast(&wxTreeCtrl::GetLastVisibleItem, "last visible"); }
|
|
|
|
#endif // wxHAS_LAST_VISIBLE
|
|
|
|
|
|
|
|
void OnShowNextVisible(wxCommandEvent& WXUNUSED(event))
|
2008-09-03 20:16:56 +00:00
|
|
|
{ DoShowRelativeItem(&wxTreeCtrl::GetNextVisible, "next visible"); }
|
2007-10-07 21:58:51 +00:00
|
|
|
void OnShowPrevVisible(wxCommandEvent& WXUNUSED(event))
|
2008-09-03 20:16:56 +00:00
|
|
|
{ DoShowRelativeItem(&wxTreeCtrl::GetPrevVisible, "previous visible"); }
|
|
|
|
|
|
|
|
void OnShowParent(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{ DoShowRelativeItem(&wxTreeCtrl::GetItemParent, "parent"); }
|
|
|
|
void OnShowPrevSibling(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{ DoShowRelativeItem(&wxTreeCtrl::GetPrevSibling, "previous sibling"); }
|
|
|
|
void OnShowNextSibling(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{ DoShowRelativeItem(&wxTreeCtrl::GetNextSibling, "next sibling"); }
|
2007-10-07 21:58:51 +00:00
|
|
|
|
2009-05-31 13:08:16 +00:00
|
|
|
void OnScrollTo(wxCommandEvent& event);
|
2010-06-20 17:43:11 +00:00
|
|
|
void OnSelectLast(wxCommandEvent& event);
|
2009-05-31 13:08:16 +00:00
|
|
|
|
2003-09-21 19:40:35 +00:00
|
|
|
void OnIdle(wxIdleEvent& event);
|
2000-02-23 00:30:59 +00:00
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
|
1998-10-26 17:11:33 +00:00
|
|
|
private:
|
2002-03-16 15:10:43 +00:00
|
|
|
void TogStyle(int id, long flag);
|
2001-08-18 13:09:26 +00:00
|
|
|
|
2004-05-20 17:23:15 +00:00
|
|
|
void DoSort(bool reverse = false);
|
1998-12-18 15:37:19 +00:00
|
|
|
|
2002-03-16 15:10:43 +00:00
|
|
|
void Resize();
|
|
|
|
|
|
|
|
void CreateTreeWithDefStyle();
|
|
|
|
void CreateTree(long style);
|
2000-02-23 00:30:59 +00:00
|
|
|
|
2007-10-07 21:58:51 +00:00
|
|
|
// common parts of OnShowFirst/LastVisible() and OnShowNext/PrevVisible()
|
|
|
|
typedef wxTreeItemId (wxTreeCtrl::*TreeFunc0_t)() const;
|
|
|
|
void DoShowFirstOrLast(TreeFunc0_t pfn, const wxString& label);
|
|
|
|
|
|
|
|
typedef wxTreeItemId (wxTreeCtrl::*TreeFunc1_t)(const wxTreeItemId&) const;
|
2008-09-03 20:16:56 +00:00
|
|
|
void DoShowRelativeItem(TreeFunc1_t pfn, const wxString& label);
|
2007-10-07 21:58:51 +00:00
|
|
|
|
|
|
|
|
2006-08-03 23:43:35 +00:00
|
|
|
wxPanel *m_panel;
|
1999-04-12 11:48:06 +00:00
|
|
|
MyTreeCtrl *m_treeCtrl;
|
2004-07-21 10:29:21 +00:00
|
|
|
#if wxUSE_LOG
|
2000-02-23 00:30:59 +00:00
|
|
|
wxTextCtrl *m_textCtrl;
|
2004-07-21 10:29:21 +00:00
|
|
|
#endif // wxUSE_LOG
|
1998-05-22 19:57:05 +00:00
|
|
|
|
2004-05-20 17:23:15 +00:00
|
|
|
void DoSetBold(bool bold = true);
|
1998-11-30 00:08:57 +00:00
|
|
|
|
2014-03-30 07:07:55 +00:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
1998-10-28 21:32:29 +00:00
|
|
|
};
|
1998-05-22 19:57:05 +00:00
|
|
|
|
1998-10-28 21:32:29 +00:00
|
|
|
// menu and control ids
|
|
|
|
enum
|
|
|
|
{
|
2005-03-15 11:29:14 +00:00
|
|
|
TreeTest_Quit = wxID_EXIT,
|
|
|
|
TreeTest_About = wxID_ABOUT,
|
2007-04-10 23:48:51 +00:00
|
|
|
TreeTest_ClearLog = wxID_CLEAR,
|
2005-03-15 11:29:14 +00:00
|
|
|
TreeTest_TogButtons = wxID_HIGHEST,
|
2001-08-18 13:09:26 +00:00
|
|
|
TreeTest_TogTwist,
|
|
|
|
TreeTest_TogLines,
|
|
|
|
TreeTest_TogEdit,
|
|
|
|
TreeTest_TogHideRoot,
|
|
|
|
TreeTest_TogRootLines,
|
|
|
|
TreeTest_TogBorder,
|
2001-12-17 00:30:43 +00:00
|
|
|
TreeTest_TogFullHighlight,
|
2002-02-20 17:41:39 +00:00
|
|
|
TreeTest_SetFgColour,
|
|
|
|
TreeTest_SetBgColour,
|
2002-03-16 15:10:43 +00:00
|
|
|
TreeTest_ResetStyle,
|
2006-11-04 11:26:51 +00:00
|
|
|
TreeTest_Highlight,
|
1999-04-12 11:48:06 +00:00
|
|
|
TreeTest_Dump,
|
1999-07-30 22:45:55 +00:00
|
|
|
TreeTest_DumpSelected,
|
1999-10-02 19:43:56 +00:00
|
|
|
TreeTest_Count,
|
|
|
|
TreeTest_CountRec,
|
1999-04-12 11:48:06 +00:00
|
|
|
TreeTest_Sort,
|
|
|
|
TreeTest_SortRev,
|
2001-08-18 13:09:26 +00:00
|
|
|
TreeTest_SetBold,
|
|
|
|
TreeTest_ClearBold,
|
1999-04-12 11:48:06 +00:00
|
|
|
TreeTest_Rename,
|
|
|
|
TreeTest_Delete,
|
|
|
|
TreeTest_DeleteChildren,
|
|
|
|
TreeTest_DeleteAll,
|
|
|
|
TreeTest_Recreate,
|
2000-03-03 10:31:34 +00:00
|
|
|
TreeTest_ToggleImages,
|
2008-06-24 12:48:01 +00:00
|
|
|
TreeTest_ToggleStates,
|
2012-10-07 22:42:02 +00:00
|
|
|
TreeTest_ToggleBell,
|
2007-04-07 19:59:51 +00:00
|
|
|
TreeTest_ToggleAlternateImages,
|
2008-06-24 12:48:01 +00:00
|
|
|
TreeTest_ToggleAlternateStates,
|
2001-08-18 13:09:26 +00:00
|
|
|
TreeTest_ToggleButtons,
|
2000-03-03 10:31:34 +00:00
|
|
|
TreeTest_SetImageSize,
|
2000-02-23 00:30:59 +00:00
|
|
|
TreeTest_ToggleSel,
|
1999-04-12 11:48:06 +00:00
|
|
|
TreeTest_CollapseAndReset,
|
|
|
|
TreeTest_EnsureVisible,
|
2009-03-16 11:49:04 +00:00
|
|
|
TreeTest_SetFocus,
|
1999-04-12 11:48:06 +00:00
|
|
|
TreeTest_AddItem,
|
2013-05-31 23:21:36 +00:00
|
|
|
TreeTest_AddManyItems,
|
1999-12-29 10:29:26 +00:00
|
|
|
TreeTest_InsertItem,
|
1999-05-03 23:11:53 +00:00
|
|
|
TreeTest_IncIndent,
|
|
|
|
TreeTest_DecIndent,
|
|
|
|
TreeTest_IncSpacing,
|
|
|
|
TreeTest_DecSpacing,
|
1999-07-30 22:45:55 +00:00
|
|
|
TreeTest_ToggleIcon,
|
2008-06-24 12:48:01 +00:00
|
|
|
TreeTest_ToggleState,
|
1999-07-30 22:45:55 +00:00
|
|
|
TreeTest_Select,
|
|
|
|
TreeTest_Unselect,
|
2004-02-12 16:35:36 +00:00
|
|
|
TreeTest_SelectRoot,
|
2010-05-02 12:01:30 +00:00
|
|
|
TreeTest_ClearFocused,
|
|
|
|
TreeTest_SetFocusedRoot,
|
2010-01-26 12:43:39 +00:00
|
|
|
TreeTest_SelectChildren,
|
2007-10-07 21:58:51 +00:00
|
|
|
TreeTest_ShowFirstVisible,
|
|
|
|
TreeTest_ShowLastVisible,
|
|
|
|
TreeTest_ShowNextVisible,
|
|
|
|
TreeTest_ShowPrevVisible,
|
2008-09-03 20:16:56 +00:00
|
|
|
TreeTest_ShowParent,
|
|
|
|
TreeTest_ShowPrevSibling,
|
|
|
|
TreeTest_ShowNextSibling,
|
2009-05-31 13:08:16 +00:00
|
|
|
TreeTest_ScrollTo,
|
2010-06-20 17:43:11 +00:00
|
|
|
TreeTest_SelectLast,
|
1999-07-30 22:45:55 +00:00
|
|
|
TreeTest_Ctrl = 1000
|
1999-03-23 13:50:29 +00:00
|
|
|
};
|