4
%% Copyright Ericsson AB 2009. All Rights Reserved.
4
%% Copyright Ericsson AB 2009-2011. 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_basic_SUITE.erl
174
181
wxWindow:show(Frame),
175
182
wx_test_lib:wx_destroy(Frame, Config).
184
menu_item_debug(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo);
185
menu_item_debug(Config) ->
186
%% Debugging a menu entry problem
187
%% Run it with: lists:map(fun(_) -> [{0,{ok,_,_}}] = wxt:t() end, lists:seq(1,50)), ok.
190
Frame = wxFrame:new(Wx, -1, "Button Fix"),
191
wxFrame:connect(Frame, close_window),
195
wxWindow:show(Frame),
196
wx_test_lib:wx_destroy(Frame,Config).
199
create_menus(Frame) ->
200
MenuBar = ?mt(wxMenuBar, wxMenuBar:new()),
201
File = ?mt(wxMenu, wxMenu:new([])),
202
Help = ?mt(wxMenu, wxMenu:new([])),
204
?mt(wxMenuItem, wxMenu:append(Help, ?wxID_ABOUT, "&About", [])),
205
?mt(wxMenuItem, wxMenu:append(Help, ?wxID_HELP, "&Help", [])),
206
?mt(wxMenuItem, wxMenu:append(File, ?wxID_EXIT, "Exit", [])),
207
T1 = ?mt(wxMenu, wxMenu:new([])),
208
[wxMenuItem:getId(wxMenu:append(T1, Id, integer_to_list(Id), []))
209
|| Id <- lists:seq(100, 120)],
210
T2 = ?mt(wxMenu, wxMenu:new([])),
211
[wxMenuItem:getId(wxMenu:append(T2, Id, integer_to_list(Id), []))
212
|| Id <- lists:seq(200, 220)],
213
T3 = ?mt(wxMenu, wxMenu:new([])),
214
[wxMenuItem:getId(wxMenu:append(T3, Id, integer_to_list(Id), []))
215
|| Id <- lists:seq(300, 320)],
216
T4 = ?mt(wxMenu, wxMenu:new([])),
217
[wxMenuItem:getId(wxMenu:append(T4, Id, integer_to_list(Id), []))
218
|| Id <- lists:seq(400, 420)],
219
T5 = ?mt(wxMenu, wxMenu:new([])),
220
[wxMenuItem:getId(wxMenu:append(T5, Id, integer_to_list(Id), []))
221
|| Id <- lists:seq(500, 520)],
222
T6 = ?mt(wxMenu, wxMenu:new([])),
223
[wxMenuItem:getId(wxMenu:append(T6, Id, integer_to_list(Id), []))
224
|| Id <- lists:seq(600, 620)],
226
?m(ok,wxFrame:connect(Frame, command_menu_selected)),
227
?m(true, wxMenuBar:append(MenuBar, File, "&File")),
228
?m(true, wxMenuBar:append(MenuBar, Help, "&Help")),
229
?m(true, wxMenuBar:append(MenuBar, T1, "T1")),
230
?m(true, wxMenuBar:append(MenuBar, T2, "T2")),
231
?m(true, wxMenuBar:append(MenuBar, T3, "T3")),
232
?m(true, wxMenuBar:append(MenuBar, T4, "T4")),
233
?m(true, wxMenuBar:append(MenuBar, T5, "T5")),
234
?m(true, wxMenuBar:append(MenuBar, T6, "T6")),
237
?m(ok, wxFrame:setMenuBar(Frame,MenuBar)).