1. changed spelling error in wxTR_HAS_VARIABLE_HEIGHT (missing 'E')

2. compile fix for dcscreen.cpp
3. editing labels in place works in the tree ctrl and shown in the sample
4. sped up items deletion in the listview


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-07-23 23:41:45 +00:00
parent 9be9b97445
commit 5ea4780630
10 changed files with 365 additions and 263 deletions

View File

@@ -768,7 +768,7 @@ enum
#define wxTR_SINGLE 0x0000 #define wxTR_SINGLE 0x0000
#define wxTR_MULTIPLE 0x0020 #define wxTR_MULTIPLE 0x0020
#define wxTR_EXTENDED 0x0040 #define wxTR_EXTENDED 0x0040
#define wxTR_HAS_VARIABLE_ROW_HIGHT 0x0080 #define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080
/* /*
* wxListCtrl flags * wxListCtrl flags

View File

@@ -30,7 +30,7 @@ public:
/* /*
* Public interface * Public interface
*/ */
wxSpinButton(); wxSpinButton() { }
wxSpinButton(wxWindow *parent, wxSpinButton(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = -1,

View File

@@ -504,12 +504,16 @@ public:
// keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only) // keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
int GetCode() const { return m_code; } int GetCode() const { return m_code; }
// label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
const wxString& GetLabel() const { return m_label; }
private: private:
// @@ we could save some space by using union here // TODO we could save some space by using union here
int m_code; int m_code;
wxTreeItemId m_item, wxTreeItemId m_item,
m_itemOld; m_itemOld;
wxPoint m_pointDrag; wxPoint m_pointDrag;
wxString m_label;
DECLARE_DYNAMIC_CLASS(wxTreeEvent) DECLARE_DYNAMIC_CLASS(wxTreeEvent)
}; };
@@ -524,7 +528,11 @@ typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, #define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, #define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
// GetItem() returns the itme whose label is being edited // GetItem() returns the itme whose label is being edited, GetLabel() returns
// the current item label for BEGIN and the would be new one for END.
//
// Vetoing BEGIN event means that label editing won't happen at all,
// vetoing END means that the new value is discarded and the old one kept
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, #define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, #define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },

View File

@@ -45,6 +45,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(LIST_SMALL_ICON_TEXT_VIEW, MyFrame::OnSmallIconTextView) EVT_MENU(LIST_SMALL_ICON_TEXT_VIEW, MyFrame::OnSmallIconTextView)
EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnDeselectAll) EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnDeselectAll)
EVT_MENU(LIST_SELECT_ALL, MyFrame::OnSelectAll) EVT_MENU(LIST_SELECT_ALL, MyFrame::OnSelectAll)
EVT_MENU(LIST_DELETE_ALL, MyFrame::OnDeleteAll)
END_EVENT_TABLE() END_EVENT_TABLE()
BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl) BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
@@ -131,6 +132,9 @@ bool MyApp::OnInit(void)
file_menu->Append(LIST_SMALL_ICON_TEXT_VIEW, "Small icon &view with text"); file_menu->Append(LIST_SMALL_ICON_TEXT_VIEW, "Small icon &view with text");
file_menu->Append(LIST_DESELECT_ALL, "&Deselect All"); file_menu->Append(LIST_DESELECT_ALL, "&Deselect All");
file_menu->Append(LIST_SELECT_ALL, "S&elect All"); file_menu->Append(LIST_SELECT_ALL, "S&elect All");
file_menu->AppendSeparator();
file_menu->Append(LIST_DELETE_ALL, "Delete &all items");
file_menu->AppendSeparator();
file_menu->Append(BUSY_ON, "&Busy cursor on"); file_menu->Append(BUSY_ON, "&Busy cursor on");
file_menu->Append(BUSY_OFF, "&Busy cursor off"); file_menu->Append(BUSY_OFF, "&Busy cursor off");
file_menu->AppendSeparator(); file_menu->AppendSeparator();
@@ -260,7 +264,7 @@ void MyFrame::OnReportView(wxCommandEvent& WXUNUSED(event))
m_listCtrl->InsertColumn(1, "Column 2"); // , wxLIST_FORMAT_LEFT, 140); m_listCtrl->InsertColumn(1, "Column 2"); // , wxLIST_FORMAT_LEFT, 140);
m_listCtrl->InsertColumn(2, "One More Column (2)"); // , wxLIST_FORMAT_LEFT, 140); m_listCtrl->InsertColumn(2, "One More Column (2)"); // , wxLIST_FORMAT_LEFT, 140);
for ( int i=0; i < 30; i++) for ( int i = 0; i < 3000; i++ )
{ {
wxChar buf[50]; wxChar buf[50];
wxSprintf(buf, _T("This is item %d"), i); wxSprintf(buf, _T("This is item %d"), i);
@@ -336,6 +340,17 @@ void MyFrame::OnSmallIconTextView(wxCommandEvent& WXUNUSED(event))
} }
} }
void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event))
{
(void)wxGetElapsedTime(TRUE);
int nItems = m_listCtrl->GetItemCount();
m_listCtrl->DeleteAllItems();
wxLogMessage("Deleting %d items took %ld ms",
nItems, wxGetElapsedTime());
}
// MyListCtrl // MyListCtrl
void MyListCtrl::OnBeginDrag(wxListEvent& WXUNUSED(event)) void MyListCtrl::OnBeginDrag(wxListEvent& WXUNUSED(event))

View File

@@ -12,7 +12,7 @@
// Define a new application type // Define a new application type
class MyApp: public wxApp class MyApp: public wxApp
{ public: { public:
bool OnInit(void); bool OnInit();
wxImageList *m_imageListNormal; wxImageList *m_imageListNormal;
wxImageList *m_imageListSmall; wxImageList *m_imageListSmall;
@@ -46,14 +46,15 @@ public:
// Define a new frame type // Define a new frame type
class MyFrame: public wxFrame class MyFrame: public wxFrame
{ public: {
public:
MyListCtrl *m_listCtrl; MyListCtrl *m_listCtrl;
wxTextCtrl *m_logWindow; wxTextCtrl *m_logWindow;
MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h); MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h);
~MyFrame(void); ~MyFrame();
public: public:
void OnQuit(wxCommandEvent& event); void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event); void OnAbout(wxCommandEvent& event);
void OnListView(wxCommandEvent& event); void OnListView(wxCommandEvent& event);
@@ -64,8 +65,11 @@ class MyFrame: public wxFrame
void OnSmallIconTextView(wxCommandEvent& event); void OnSmallIconTextView(wxCommandEvent& event);
void OnDeselectAll(wxCommandEvent& event); void OnDeselectAll(wxCommandEvent& event);
void OnSelectAll(wxCommandEvent& event); void OnSelectAll(wxCommandEvent& event);
void OnDeleteAll(wxCommandEvent& event);
void BusyOn(wxCommandEvent& event); void BusyOn(wxCommandEvent& event);
void BusyOff(wxCommandEvent& event); void BusyOff(wxCommandEvent& event);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
@@ -83,6 +87,7 @@ class MyFrame: public wxFrame
#define LIST_ABOUT 102 #define LIST_ABOUT 102
#define BUSY_ON 10 #define BUSY_ON 10
#define BUSY_OFF 11 #define BUSY_OFF 11
#define LIST_DELETE_ALL 12
#define LIST_CTRL 1000 #define LIST_CTRL 1000

View File

@@ -35,22 +35,17 @@
#include "treetest.h" #include "treetest.h"
#ifdef wxTR_HAS_VARIABLE_ROW_HIGHT #ifdef __WXMSW__
#define USE_TR_HAS_VARIABLE_ROW_HIGHT 1 #define NO_ADVANCED_FEATURES
#else
#define USE_TR_HAS_VARIABLE_ROW_HIGHT 0
#endif #endif
// under Windows the icons are in the .rc file // under Windows the icons are in the .rc file
#ifndef __WXMSW__ #ifndef __WXMSW__
#if !USE_TR_HAS_VARIABLE_ROW_HIGHT
#include "icon1.xpm" #include "icon1.xpm"
#endif
#include "icon2.xpm" #include "icon2.xpm"
#include "mondrian.xpm" #include "mondrian.xpm"
#endif #endif
// verify that the item is ok and insult the user if it is not // verify that the item is ok and insult the user if it is not
#define CHECK_ITEM( item ) if ( !item.IsOk() ) { \ #define CHECK_ITEM( item ) if ( !item.IsOk() ) { \
wxMessageBox("Please select some item first!", \ wxMessageBox("Please select some item first!", \
@@ -157,9 +152,8 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
tree_menu->Append(TreeTest_IncSpacing, "Add 5 points to spacing\tCtrl-I"); tree_menu->Append(TreeTest_IncSpacing, "Add 5 points to spacing\tCtrl-I");
tree_menu->Append(TreeTest_DecSpacing, "Reduce spacing by 5 points\tCtrl-R"); tree_menu->Append(TreeTest_DecSpacing, "Reduce spacing by 5 points\tCtrl-R");
item_menu->AppendSeparator();
item_menu->Append(TreeTest_Dump, "&Dump item children"); item_menu->Append(TreeTest_Dump, "&Dump item children");
#ifdef wxTR_MULTIPLE #ifndef NO_ADVANCED_FEATURES
item_menu->Append(TreeTest_Dump_Selected, "Dump selected items\tAlt-S"); item_menu->Append(TreeTest_Dump_Selected, "Dump selected items\tAlt-S");
#endif #endif
item_menu->Append(TreeTest_Rename, "&Rename item..."); item_menu->Append(TreeTest_Rename, "&Rename item...");
@@ -177,11 +171,10 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
m_treeCtrl = new MyTreeCtrl(this, TreeTest_Ctrl, m_treeCtrl = new MyTreeCtrl(this, TreeTest_Ctrl,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxTR_HAS_BUTTONS | wxTR_HAS_BUTTONS |
#ifdef wxTR_MULTIPLE wxTR_EDIT_LABELS |
#ifndef NO_ADVANCED_FEATURES
wxTR_MULTIPLE | wxTR_MULTIPLE |
#endif wxTR_HAS_VARIABLE_ROW_HEIGHT |
#if USE_TR_HAS_VARIABLE_ROW_HIGHT
wxTR_HAS_VARIABLE_ROW_HIGHT |
#endif #endif
wxSUNKEN_BORDER); wxSUNKEN_BORDER);
wxTextCtrl *textCtrl = new wxTextCtrl(this, -1, "", wxTextCtrl *textCtrl = new wxTextCtrl(this, -1, "",
@@ -231,8 +224,7 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{ {
wxMessageBox("Tree test sample\n" wxMessageBox("Tree test sample\n"
"Julian Smart (c) 1997,\n" "(c) Julian Smart 1997, Vadim Zeitlin 1998",
"Vadim Zeitlin (c) 1998",
"About tree test", "About tree test",
wxOK | wxICON_INFORMATION, this); wxOK | wxICON_INFORMATION, this);
} }
@@ -243,6 +235,8 @@ void MyFrame::OnRename(wxCommandEvent& WXUNUSED(event))
CHECK_ITEM( item ); CHECK_ITEM( item );
// old code - now we edit in place
#if 0
static wxString s_text; static wxString s_text;
s_text = wxGetTextFromUser("New name: ", "Tree sample question", s_text = wxGetTextFromUser("New name: ", "Tree sample question",
s_text, this); s_text, this);
@@ -250,6 +244,10 @@ void MyFrame::OnRename(wxCommandEvent& WXUNUSED(event))
{ {
m_treeCtrl->SetItemText(item, s_text); m_treeCtrl->SetItemText(item, s_text);
} }
#endif // 0
// TODO demonstrate creating a custom edit control...
(void)m_treeCtrl->EditLabel(item);
} }
void MyFrame::DoSort(bool reverse) void MyFrame::DoSort(bool reverse)
@@ -272,7 +270,7 @@ void MyFrame::OnDump(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event))
{ {
#ifdef wxTR_MULTIPLE #ifndef NO_ADVANCED_FEATURES
wxArrayTreeItemIds array; wxArrayTreeItemIds array;
m_treeCtrl->GetSelections(array); m_treeCtrl->GetSelections(array);
@@ -510,8 +508,6 @@ void MyTreeCtrl::name(wxTreeEvent& WXUNUSED(event)) \
TREE_EVENT_HANDLER(OnBeginDrag) TREE_EVENT_HANDLER(OnBeginDrag)
TREE_EVENT_HANDLER(OnBeginRDrag) TREE_EVENT_HANDLER(OnBeginRDrag)
TREE_EVENT_HANDLER(OnBeginLabelEdit)
TREE_EVENT_HANDLER(OnEndLabelEdit)
TREE_EVENT_HANDLER(OnDeleteItem) TREE_EVENT_HANDLER(OnDeleteItem)
TREE_EVENT_HANDLER(OnGetInfo) TREE_EVENT_HANDLER(OnGetInfo)
TREE_EVENT_HANDLER(OnSetInfo) TREE_EVENT_HANDLER(OnSetInfo)
@@ -523,13 +519,40 @@ TREE_EVENT_HANDLER(OnSelChanging)
#undef TREE_EVENT_HANDLER #undef TREE_EVENT_HANDLER
void MyTreeCtrl::OnBeginLabelEdit(wxTreeEvent& event)
{
wxLogMessage("OnBeginLabelEdit");
// for testing, prevent this items label editing
wxTreeItemId itemId = event.GetItem();
if ( IsTestItem(itemId) )
{
wxMessageBox("You can't edit this item.");
event.Veto();
}
}
void MyTreeCtrl::OnEndLabelEdit(wxTreeEvent& event)
{
wxLogMessage("OnEndLabelEdit");
// don't allow anything except letters in the labels
if ( !event.GetLabel().IsWord() )
{
wxMessageBox("The label should contain only letters.");
event.Veto();
}
}
void MyTreeCtrl::OnItemCollapsing(wxTreeEvent& event) void MyTreeCtrl::OnItemCollapsing(wxTreeEvent& event)
{ {
wxLogMessage("OnItemCollapsing"); wxLogMessage("OnItemCollapsing");
// for testing, prevent the user from collapsing the first child folder // for testing, prevent the user from collapsing the first child folder
wxTreeItemId itemId = event.GetItem(); wxTreeItemId itemId = event.GetItem();
if ( GetParent(itemId) == GetRootItem() && !GetPrevSibling(itemId) ) if ( IsTestItem(itemId) )
{ {
wxMessageBox("You can't collapse this item."); wxMessageBox("You can't collapse this item.");

View File

@@ -71,6 +71,13 @@ public:
protected: protected:
virtual int OnCompareItems(const wxTreeItemId& i1, const wxTreeItemId& i2); virtual int OnCompareItems(const wxTreeItemId& i1, const wxTreeItemId& i2);
// 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
return GetParent(item) == GetRootItem() && !GetPrevSibling(item);
}
private: private:
void AddItemsRecursively(const wxTreeItemId& idParent, void AddItemsRecursively(const wxTreeItemId& idParent,
size_t nChildren, size_t nChildren,

View File

@@ -23,9 +23,10 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/string.h" #include "wx/string.h"
#include "wx/window.h" #include "wx/window.h"
#include "wx/msw/private.h"
#endif #endif
#include "wx/msw/private.h"
#include "wx/dcscreen.h" #include "wx/dcscreen.h"

View File

@@ -1231,13 +1231,21 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
event.m_col = hdr->iSubItem; event.m_col = hdr->iSubItem;
break; break;
} }
case LVN_DELETEALLITEMS: case LVN_DELETEALLITEMS:
{ // what's the sense of generating a wxWin event for this when
// it's absolutely not portable?
#if 0
eventType = wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS; eventType = wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
// NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
event.m_itemIndex = -1; event.m_itemIndex = -1;
break; #endif // 0
}
// return TRUE to suppress all additional LVN_DELETEITEM
// notifications - this makes deleting all items from a list ctrl
// much faster
*result = TRUE;
return TRUE;
case LVN_DELETEITEM: case LVN_DELETEITEM:
{ {
eventType = wxEVT_COMMAND_LIST_DELETE_ITEM; eventType = wxEVT_COMMAND_LIST_DELETE_ITEM;

View File

@@ -131,8 +131,8 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id,
m_windowId = (id == -1) ? NewControlId() : id; m_windowId = (id == -1) ? NewControlId() : id;
DWORD wstyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_SHOWSELALWAYS ; DWORD wstyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP |
TVS_HASLINES | TVS_SHOWSELALWAYS;
bool want3D; bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ; WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
@@ -792,7 +792,12 @@ wxTextCtrl* wxTreeCtrl::EditLabel(const wxTreeItemId& item,
HWND hWnd = (HWND) TreeView_EditLabel(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item); HWND hWnd = (HWND) TreeView_EditLabel(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item);
wxCHECK_MSG( hWnd, NULL, _T("Can't edit tree ctrl label") ); // this is not an error - the TVN_BEGINLABELEDIT handler might have
// returned FALSE
if ( !hWnd )
{
return NULL;
}
DeleteTextCtrl(); DeleteTextCtrl();
@@ -960,6 +965,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
TV_DISPINFO *info = (TV_DISPINFO *)lParam; TV_DISPINFO *info = (TV_DISPINFO *)lParam;
event.m_item = (WXHTREEITEM) info->item.hItem; event.m_item = (WXHTREEITEM) info->item.hItem;
event.m_label = info->item.pszText;
break; break;
} }
@@ -977,7 +983,8 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
eventType = wxEVT_COMMAND_TREE_END_LABEL_EDIT; eventType = wxEVT_COMMAND_TREE_END_LABEL_EDIT;
TV_DISPINFO *info = (TV_DISPINFO *)lParam; TV_DISPINFO *info = (TV_DISPINFO *)lParam;
event.m_item = (WXHTREEITEM) info->item.hItem; event.m_item = (WXHTREEITEM)info->item.hItem;
event.m_label = info->item.pszText;
break; break;
} }
@@ -1074,18 +1081,46 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
bool processed = GetEventHandler()->ProcessEvent(event); bool processed = GetEventHandler()->ProcessEvent(event);
// post processing // post processing
if ( hdr->code == TVN_DELETEITEM ) switch ( hdr->code )
{ {
// NB: we might process this message using wxWindows event tables, but case TVN_DELETEITEM:
// due to overhead of wxWin event system we prefer to do it here {
// (otherwise deleting a tree with many items is just too slow) // NB: we might process this message using wxWindows event
// tables, but due to overhead of wxWin event system we
// prefer to do it here ourself (otherwise deleting a tree
// with many items is just too slow)
NM_TREEVIEW* tv = (NM_TREEVIEW *)lParam; NM_TREEVIEW* tv = (NM_TREEVIEW *)lParam;
wxTreeItemData *data = (wxTreeItemData *)tv->itemOld.lParam; wxTreeItemData *data = (wxTreeItemData *)tv->itemOld.lParam;
delete data; // may be NULL, ok delete data; // may be NULL, ok
processed = TRUE; // Make sure we don't get called twice processed = TRUE; // Make sure we don't get called twice
} }
break;
case TVN_BEGINLABELEDIT:
// return TRUE to cancel label editing
*result = !event.IsAllowed(); *result = !event.IsAllowed();
break;
case TVN_ENDLABELEDIT:
// return TRUE to set the label to the new string
*result = event.IsAllowed();
// ensure that we don't have the text ctrl which is going to be
// deleted any more
DeleteTextCtrl();
break;
case TVN_SELCHANGING:
case TVN_ITEMEXPANDING:
// return TRUE to prevent the action from happening
*result = !event.IsAllowed();
break;
//default:
// for the other messages the return value is ignored and there is
// nothing special to do
}
return processed; return processed;
} }