fix multiple problems with selection in controls with wxTR_MULTIPLE style (closes #626)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-03-05 14:13:19 +00:00
parent 6bec9d5013
commit c7d9c476ea
3 changed files with 1010 additions and 270 deletions

View File

@@ -526,6 +526,7 @@ wxMac:
wxMSW: wxMSW:
- Fix many problems with selection in multi-selection wxTreeCtrl (Jonathan Liu).
- Fixed infinite loop in wxThread::Wait() in console applications. - Fixed infinite loop in wxThread::Wait() in console applications.
- Return the restored window size from GetSize() when window is minimized. - Return the restored window size from GetSize() when window is minimized.
- wxCheckListBox now looks more native, especially under XP (Marcin Malich). - wxCheckListBox now looks more native, especially under XP (Marcin Malich).

View File

@@ -233,6 +233,22 @@ protected:
// obtain the user data for the lParam member of TV_ITEM // obtain the user data for the lParam member of TV_ITEM
class wxTreeItemParam *GetItemParam(const wxTreeItemId& item) const; class wxTreeItemParam *GetItemParam(const wxTreeItemId& item) const;
// update the event to include the items client data and pass it to
// HandleWindowEvent(), return true if it processed it
bool HandleTreeEvent(wxTreeEvent& event) const;
// pass the event to HandleTreeEvent() and return true if the event was
// either unprocessed or not vetoed
bool IsTreeEventAllowed(wxTreeEvent& event) const
{
return !HandleTreeEvent(event) || event.IsAllowed();
}
// handle a key event in a multi-selection control
//
// return true if the key was processed, false otherwise
bool MSWHandleSelectionKey(WPARAM vkey);
// data used only while editing the item label: // data used only while editing the item label:
wxTextCtrl *m_textCtrl; // text control in which it is edited wxTextCtrl *m_textCtrl; // text control in which it is edited
@@ -248,6 +264,8 @@ private:
void DoExpand(const wxTreeItemId& item, int flag); void DoExpand(const wxTreeItemId& item, int flag);
void DoUnselectAll();
void DeleteTextCtrl(); void DeleteTextCtrl();
// return true if the item is the hidden root one (i.e. it's the root item // return true if the item is the hidden root one (i.e. it's the root item
@@ -273,6 +291,15 @@ private:
wxTreeItemId m_htSelStart, m_htClickedItem; wxTreeItemId m_htSelStart, m_htClickedItem;
wxPoint m_ptClick; wxPoint m_ptClick;
// whether dragging has started
bool m_dragStarted;
// whether focus was lost between subsequent clicks of a single item
bool m_focusLost;
// whether we need to trigger a state image click event
bool m_triggerStateImageClick;
friend class wxTreeItemIndirectData; friend class wxTreeItemIndirectData;
friend class wxTreeSortHelper; friend class wxTreeSortHelper;

File diff suppressed because it is too large Load Diff