Check multiple selection :-)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -235,13 +235,13 @@ private:
|
|||||||
static void EventFlagsToSelType(long style,
|
static void EventFlagsToSelType(long style,
|
||||||
bool shiftDown,
|
bool shiftDown,
|
||||||
bool ctrlDown,
|
bool ctrlDown,
|
||||||
bool *is_multiple,
|
bool &is_multiple,
|
||||||
bool *extended_select,
|
bool &extended_select,
|
||||||
bool *unselect_others)
|
bool &unselect_others)
|
||||||
{
|
{
|
||||||
*is_multiple = (style & wxTR_MULTIPLE) != 0;
|
is_multiple = (style & wxTR_MULTIPLE) != 0;
|
||||||
*extended_select = shiftDown && is_multiple;
|
extended_select = shiftDown && is_multiple;
|
||||||
*unselect_others = !(extended_select || (ctrlDown && is_multiple));
|
unselect_others = !(extended_select || (ctrlDown && is_multiple));
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -1826,8 +1826,18 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event )
|
|||||||
EventFlagsToSelType(GetWindowStyleFlag(),
|
EventFlagsToSelType(GetWindowStyleFlag(),
|
||||||
event.ShiftDown(),
|
event.ShiftDown(),
|
||||||
event.ControlDown(),
|
event.ControlDown(),
|
||||||
&is_multiple, &extended_select, &unselect_others);
|
is_multiple, extended_select, unselect_others);
|
||||||
|
|
||||||
|
// + : Expand
|
||||||
|
// - : Collaspe
|
||||||
|
// * : Toggle Expand/Collapse
|
||||||
|
// ' ' | return : activate
|
||||||
|
// up : go up (not last children!)
|
||||||
|
// down : go down
|
||||||
|
// left : go to parent
|
||||||
|
// right : open if parent and go next
|
||||||
|
// home : go to root
|
||||||
|
// end : go to last item without opening parents
|
||||||
switch (event.KeyCode())
|
switch (event.KeyCode())
|
||||||
{
|
{
|
||||||
case '+':
|
case '+':
|
||||||
@@ -2237,7 +2247,7 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
EventFlagsToSelType(GetWindowStyleFlag(),
|
EventFlagsToSelType(GetWindowStyleFlag(),
|
||||||
event.ShiftDown(),
|
event.ShiftDown(),
|
||||||
event.ControlDown(),
|
event.ControlDown(),
|
||||||
&is_multiple, &extended_select, &unselect_others);
|
is_multiple, extended_select, unselect_others);
|
||||||
|
|
||||||
if ( onButton )
|
if ( onButton )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user