X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/096c9f9b986e3e614175efdbb880ef4f94283c42..edccf4281bc8fbb9d8151240ba5b208339c9ac11:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 89f4ad0dbb..d519c144c0 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -27,8 +27,19 @@ #pragma hdrstop #endif +#include "wx/window.h" +#include "wx/msw/private.h" + #ifndef WX_PRECOMP - #include "wx/wx.h" + #include "wx/settings.h" +#endif + +// Mingw32 is a bit mental even though this is done in winundef +#ifdef GetFirstChild +#undef GetFirstChild +#endif +#ifdef GetNextSibling +#undef GetNextSibling #endif #if defined(__WIN95__) @@ -38,8 +49,6 @@ #include "wx/imaglist.h" #include "wx/msw/treectrl.h" -#include "wx/msw/private.h" - #ifdef __GNUWIN32__ #include "wx/msw/gnuwin32/extra.h" #endif @@ -48,22 +57,6 @@ #include #endif -#ifdef GetFirstChild -#undef GetFirstChild -#endif - -#ifdef GetNextChild -#undef GetNextChild -#endif - -#ifdef GetNextSibling -#undef GetNextSibling -#endif - -#ifdef GetClassInfo -#undef GetClassInfo -#endif - // Bug in headers, sometimes #ifndef TVIS_FOCUSED #define TVIS_FOCUSED 0x0001 @@ -167,7 +160,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, ( exStyle, WC_TREEVIEW, - "", + _T(""), wstyle, pos.x, pos.y, size.x, size.y, (HWND)parent->GetHWND(), @@ -176,7 +169,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, NULL ); - wxCHECK_MSG( m_hWnd, FALSE, "Failed to create tree ctrl" ); + wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create tree ctrl") ); if ( parent ) parent->AddChild(this); @@ -294,7 +287,7 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively) wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const { - char buf[512]; // the size is arbitrary... + wxChar buf[512]; // the size is arbitrary... wxTreeViewItem tvItem(item, TVIF_TEXT); tvItem.pszText = buf; @@ -302,7 +295,7 @@ wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const if ( !DoGetItem(&tvItem) ) { // don't return some garbage which was on stack, but an empty string - buf[0] = '\0'; + buf[0] = _T('\0'); } return wxString(buf); @@ -311,7 +304,7 @@ wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) { wxTreeViewItem tvItem(item, TVIF_TEXT); - tvItem.pszText = (char *)text.c_str(); // conversion is ok + tvItem.pszText = (wxChar *)text.c_str(); // conversion is ok DoSetItem(&tvItem); } @@ -502,16 +495,16 @@ wxTreeItemId wxTreeCtrl::GetFirstVisibleItem() const wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const { - wxASSERT_MSG( IsVisible(item), "The item you call GetNextVisible() " - "for must be visible itself!"); + wxASSERT_MSG( IsVisible(item), _T("The item you call GetNextVisible() " + "for must be visible itself!")); return wxTreeItemId((WXHTREEITEM) TreeView_GetNextVisible(wxhWnd, (HTREEITEM) (WXHTREEITEM) item)); } wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const { - wxASSERT_MSG( IsVisible(item), "The item you call GetPrevVisible() " - "for must be visible itself!"); + wxASSERT_MSG( IsVisible(item), _T("The item you call GetPrevVisible() " + "for must be visible itself!")); return wxTreeItemId((WXHTREEITEM) TreeView_GetPrevVisible(wxhWnd, (HTREEITEM) (WXHTREEITEM) item)); } @@ -540,7 +533,7 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parent, if ( !text.IsEmpty() ) { mask |= TVIF_TEXT; - tvIns.item.pszText = (char *)text.c_str(); // cast is ok + tvIns.item.pszText = (wxChar *)text.c_str(); // cast is ok } if ( image != -1 ) @@ -675,7 +668,7 @@ void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag) flag == (TVE_COLLAPSE | TVE_COLLAPSERESET) || flag == TVE_EXPAND || flag == TVE_TOGGLE, - "Unknown flag in wxTreeCtrl::DoExpand" ); + _T("Unknown flag in wxTreeCtrl::DoExpand") ); // TreeView_Expand doesn't send TVN_ITEMEXPAND(ING) messages, so we must // emulate them @@ -698,7 +691,7 @@ void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag) else { // I wonder if it really ever happens... - wxLogDebug("TreeView_Expand: change didn't took place."); + wxLogDebug(_T("TreeView_Expand: change didn't took place.")); } } @@ -777,7 +770,7 @@ wxTextCtrl* wxTreeCtrl::EditLabel(const wxTreeItemId& item, HWND hWnd = (HWND) TreeView_EditLabel(wxhWnd, (HTREEITEM) (WXHTREEITEM) item); - wxCHECK_MSG( hWnd, NULL, "Can't edit tree ctrl label" ); + wxCHECK_MSG( hWnd, NULL, _T("Can't edit tree ctrl label") ); DeleteTextCtrl(); @@ -863,7 +856,7 @@ static int CALLBACK TreeView_CompareCallback(wxTreeItemData *pItem1, int wxTreeCtrl::OnCompareItems(const wxTreeItemId& item1, const wxTreeItemId& item2) { - return strcmp(GetItemText(item1), GetItemText(item2)); + return wxStrcmp(GetItemText(item1), GetItemText(item2)); } void wxTreeCtrl::SortChildren(const wxTreeItemId& item) @@ -914,7 +907,7 @@ bool wxTreeCtrl::MSWCommand(WXUINT cmd, WXWORD id) } // process WM_NOTIFY Windows message -bool wxTreeCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result) +bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { wxTreeEvent event(wxEVT_NULL, m_windowId); wxEventType eventType = wxEVT_NULL; @@ -1002,8 +995,8 @@ bool wxTreeCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result) break; default: - wxLogDebug("unexpected code %d in TVN_ITEMEXPAND " - "message", tv->action); + wxLogDebug(_T("unexpected code %d in TVN_ITEMEXPAND " + "message"), tv->action); } bool ing = (hdr->code == TVN_ITEMEXPANDING); @@ -1050,7 +1043,7 @@ bool wxTreeCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result) } default: - return wxControl::MSWNotify(wParam, lParam, result); + return wxControl::MSWOnNotify(idCtrl, lParam, result); } event.SetEventObject(this);