Applied patch [ 1113565 ] generic treectl multiselection
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2637,7 +2637,7 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
|
|||||||
bool is_multiple, extended_select, unselect_others;
|
bool is_multiple, extended_select, unselect_others;
|
||||||
EventFlagsToSelType(GetWindowStyleFlag(),
|
EventFlagsToSelType(GetWindowStyleFlag(),
|
||||||
event.ShiftDown(),
|
event.ShiftDown(),
|
||||||
event.ControlDown(),
|
event.CmdDown(),
|
||||||
is_multiple, extended_select, unselect_others);
|
is_multiple, extended_select, unselect_others);
|
||||||
|
|
||||||
// + : Expand
|
// + : Expand
|
||||||
@@ -3225,7 +3225,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
size_t count = GetSelections(selections);
|
size_t count = GetSelections(selections);
|
||||||
|
|
||||||
if (count > 1 &&
|
if (count > 1 &&
|
||||||
!event.ControlDown() &&
|
!event.CmdDown() &&
|
||||||
!event.ShiftDown())
|
!event.ShiftDown())
|
||||||
{
|
{
|
||||||
DoSelectItem(item, true, false);
|
DoSelectItem(item, true, false);
|
||||||
@@ -3279,14 +3279,14 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
// user clicked outside of the present selection.
|
// user clicked outside of the present selection.
|
||||||
// otherwise, perform the deselection on mouse-up.
|
// otherwise, perform the deselection on mouse-up.
|
||||||
// this allows multiple drag and drop to work.
|
// this allows multiple drag and drop to work.
|
||||||
|
// but if Cmd is down, toggle selection of the clicked item
|
||||||
if (!IsSelected(item))
|
if (!IsSelected(item) || event.CmdDown())
|
||||||
{
|
{
|
||||||
// how should the selection work for this event?
|
// how should the selection work for this event?
|
||||||
bool is_multiple, extended_select, unselect_others;
|
bool is_multiple, extended_select, unselect_others;
|
||||||
EventFlagsToSelType(GetWindowStyleFlag(),
|
EventFlagsToSelType(GetWindowStyleFlag(),
|
||||||
event.ShiftDown(),
|
event.ShiftDown(),
|
||||||
event.ControlDown(),
|
event.CmdDown(),
|
||||||
is_multiple, extended_select, unselect_others);
|
is_multiple, extended_select, unselect_others);
|
||||||
|
|
||||||
DoSelectItem(item, unselect_others, extended_select);
|
DoSelectItem(item, unselect_others, extended_select);
|
||||||
|
Reference in New Issue
Block a user