diff options
author | Dan Gudmundsson <dgud@erlang.org> | 2013-01-23 13:41:09 +0100 |
---|---|---|
committer | Dan Gudmundsson <dgud@erlang.org> | 2013-01-23 13:41:09 +0100 |
commit | 694513b8297e09e22fdf47d63772b5044ef50164 (patch) | |
tree | a00fa938a80e352dfe0731e3b3d628653d0d18d7 /lib/wx/test | |
parent | 47de15b52c46bce34c9e0a172e54411622eb08f1 (diff) | |
download | otp-694513b8297e09e22fdf47d63772b5044ef50164.tar.gz otp-694513b8297e09e22fdf47d63772b5044ef50164.tar.bz2 otp-694513b8297e09e22fdf47d63772b5044ef50164.zip |
wx: Fix wxTreeCtrl return values
Fixes wxTreeCtrl:getBoundingRect/2 and wxTreeCtrl:hitTest/1.
wxTreeCtrl:hitTest now returns a tuple, i.e. not bug compatible with previous
releases but needed to know if the returned wxTreeItemId is valid or not.
Diffstat (limited to 'lib/wx/test')
-rw-r--r-- | lib/wx/test/wx_class_SUITE.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index 22bfa53e0a..3e4d9cd528 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2012. All Rights Reserved. +%% Copyright Ericsson AB 2008-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -130,11 +130,17 @@ treeCtrl(Config) -> wxWindow:setSizerAndFit(Panel, Sizer), wxFrame:show(Frame), + ok = wxTreeCtrl:expand(Tree, Root), ?m([], wxTreeCtrl:getItemData(Tree, Root)), ?m({data,item1}, wxTreeCtrl:getItemData(Tree, Item1)), ?m({data,item2}, wxTreeCtrl:getItemData(Tree, Item2)), ?m({data,item3}, wxTreeCtrl:getItemData(Tree, Item3)), + {true, {X0,Y0,W0,H0}} = ?m({_,_},wxTreeCtrl:getBoundingRect(Tree, Item1, [{textOnly, true}])), + ?m({true, {_,Y1,_,_}} when Y1 > Y0, wxTreeCtrl:getBoundingRect(Tree, Item2)), + ?m({Item1, _}, wxTreeCtrl:hitTest(Tree, {X0+W0 div 2, Y0+H0 div 2})), + ?m({0, _}, wxTreeCtrl:hitTest(Tree, {X0+W0 div 2, Y0+H0+H0})), + wxFrame:connect(Tree, command_tree_item_expanded), wxFrame:connect(Tree, command_tree_item_collapsed), wxFrame:connect(Frame, close_window), |