diff options
author | Dan Gudmundsson <[email protected]> | 2014-01-08 14:03:01 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-01-21 16:04:25 +0100 |
commit | cdd8d5daadc29a128e7c671e705a3e3ad32c7ecb (patch) | |
tree | 5b137b2e6d8b7ad4ae3f0b1e375aeb05ee5e95dd /lib/wx/test/wx_event_SUITE.erl | |
parent | e26d06d0e73972c51eb6601a5ff2725508eb7f09 (diff) | |
download | otp-cdd8d5daadc29a128e7c671e705a3e3ad32c7ecb.tar.gz otp-cdd8d5daadc29a128e7c671e705a3e3ad32c7ecb.tar.bz2 otp-cdd8d5daadc29a128e7c671e705a3e3ad32c7ecb.zip |
wx: Add init_dialog event
It was missing.
Diffstat (limited to 'lib/wx/test/wx_event_SUITE.erl')
-rw-r--r-- | lib/wx/test/wx_event_SUITE.erl | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index bbb5294d08..2711943e5d 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2013. All Rights Reserved. +%% Copyright Ericsson AB 2008-2014. 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 @@ -48,7 +48,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [connect, disconnect, connect_msg_20, connect_cb_20, mouse_on_grid, spin_event, connect_in_callback, recursive, - char_events, callback_clean + dialog, char_events, callback_clean ]. groups() -> @@ -402,6 +402,43 @@ recursive(Config) -> wx_test_lib:wx_destroy(Frame, Config). +dialog(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); +dialog(Config) -> + Wx = wx:new(), + Frame = wxFrame:new(Wx, ?wxID_ANY, "Testing"), + wxFrame:show(Frame), + Env = wx:get_env(), + Tester = self(), + spawn_link( + fun() -> + wx:set_env(Env), + PD = wxProgressDialog:new("Dialog","Testing", + [%%{parent, Frame}, + {maximum,10}, + {style, ?wxPD_SMOOTH bor ?wxPD_AUTO_HIDE}]), + wxDialog:connect(PD, init_dialog + , [{callback, fun(#wx{event=#wxInitDialog{}}, Ev) -> + ?mt(wxInitDialogEvent, Ev), + io:format("Heyhoo~n", []), + wxEvent:skip(Ev), + Tester ! {progress_dialog,PD} + end}] + ), + wxProgressDialog:showModal(PD), + wxDialog:destroy(PD) + end), + receive {progress_dialog,PD} -> + wxDialog:endModal(PD, ?wxID_OK) + after 5000 -> + exit(timeout) + end, + + wx_test_lib:flush(), + + wx_test_lib:wx_destroy(Frame, Config). + + + char_events(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); char_events(Config) -> Wx = wx:new(), |