4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
18
18
%%%-------------------------------------------------------------------
19
19
%%% File : wx_class_SUITE.erl
113
113
Frame = wxFrame:new(Wx, ?wxID_ANY, "Frame"),
114
114
Panel = wxPanel:new(Frame, []),
115
115
Tree = ?mt(wxTreeCtrl,wxTreeCtrl:new(Panel, [{style , ?wxTR_HAS_BUTTONS}])),
116
Root = ?mt(wxTreeItemId, wxTreeCtrl:addRoot(Tree, "Root", [])),
117
Item1 = ?mt(wxTreeItemId, wxTreeCtrl:appendItem(Tree, Root, "Item1", [])),
118
?m(ok, wxTreeCtrl:setItemData(Tree, Item1, {data, item1})),
119
Item2 = ?mt(wxTreeItemId, wxTreeCtrl:appendItem(Tree, Root, "Item2", [])),
120
?m(ok, wxTreeCtrl:setItemData(Tree, Item2, {data, item2})),
121
Item3 = ?mt(wxTreeItemId, wxTreeCtrl:appendItem(Tree, Root, "Item3", [])),
116
Root = wxTreeCtrl:addRoot(Tree, "Root", []),
117
?m(true, is_integer(Root)),
118
Item1 = wxTreeCtrl:appendItem(Tree, Root, "Item1", []),
119
?m(true, is_integer(Item1)),
120
?m(ok, wxTreeCtrl:setItemData(Tree, Item1, {data, item1})),
121
Item2 = wxTreeCtrl:appendItem(Tree, Root, "Item2", []),
122
?m(ok, wxTreeCtrl:setItemData(Tree, Item2, {data, item2})),
123
Item3 = wxTreeCtrl:appendItem(Tree, Root, "Item3", []),
122
124
?m(ok, wxTreeCtrl:setItemData(Tree, Item3, {data, item3})),
124
126
Sizer = wxBoxSizer:new(?wxVERTICAL),
359
361
Time = timer:tc(erlang, apply, [Sort,[]]),
360
362
io:format("Sorted ~p ~n",[Time]),
364
Item = wxListItem:new(),
365
_List = wx:map(fun(Int) ->
366
wxListItem:setId(Item, Int),
367
?m(true, wxListCtrl:getItem(LC, Item)),
368
io:format("~s~n",[wxListItem:getText(Item)])
369
end, lists:seq(0,100)),
370
wxListItem:destroy(Item),
362
372
wx_test_lib:wx_destroy(Frame,Config).
373
383
io:format("TrSortRadioBox ~p ~n", [TrSortRadioBox]),
374
384
%% If I uncomment any of these lines, it will crash
376
?m(_, catch wxControlWithItems:setClientData(TrSortRadioBox, 0, timestamp)),
386
io:format("~p~n", [catch wxControlWithItems:setClientData(TrSortRadioBox, 0, timestamp)]),
377
387
%?m(_, wxListBox:append(TrSortRadioBox, "Session Id", session_id)),
378
388
%?m(_, wxListBox:insert(TrSortRadioBox, "Session Id", 0, session_id)),