diff options
Diffstat (limited to 'lib/wx/examples/demo/ex_textCtrl.erl')
-rw-r--r-- | lib/wx/examples/demo/ex_textCtrl.erl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/wx/examples/demo/ex_textCtrl.erl b/lib/wx/examples/demo/ex_textCtrl.erl index d82884f30b..57088ad878 100644 --- a/lib/wx/examples/demo/ex_textCtrl.erl +++ b/lib/wx/examples/demo/ex_textCtrl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2011. All Rights Reserved. +%% Copyright Ericsson AB 2009-2012. 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 @@ -51,27 +51,23 @@ do_init(Config) -> Sizer3 = wxStaticBoxSizer:new(?wxVERTICAL, Panel, [{label, "wxTextCtrl multiline"}]), - TextCtrl = wxTextCtrl:new(Panel, 1, [{value, "This is a single line wxTextCtrl"}, + TextCtrl = wxTextCtrl:new(Panel, 1, [{value, "This is a single line wxTextCtrl"}, {style, ?wxDEFAULT}]), TextCtrl2 = wxTextCtrl:new(Panel, 2, [{value, "password"}, - {style, ?wxDEFAULT bor - ?wxTE_PASSWORD}]), - TextCtrl3 = wxTextCtrl:new(Panel, 3, [{value, "This is a\n" - "multiline\n" - "wxTextCtrl"}, - {style, ?wxDEFAULT bor - ?wxTE_MULTILINE}]), + {style, ?wxDEFAULT bor ?wxTE_PASSWORD}]), + TextCtrl3 = wxTextCtrl:new(Panel, 3, [{value, "This is a\nmultiline\nwxTextCtrl"}, + {style, ?wxDEFAULT bor ?wxTE_MULTILINE}]), %% Add to sizers - wxSizer:add(Sizer, TextCtrl, [{flag, ?wxEXPAND}]), + wxSizer:add(Sizer, TextCtrl, [{flag, ?wxEXPAND}]), wxSizer:add(Sizer2, TextCtrl2, []), - wxSizer:add(Sizer3, TextCtrl3, [{flag, ?wxEXPAND}]), + wxSizer:add(Sizer3, TextCtrl3, [{flag, ?wxEXPAND}, {proportion, 1}]), wxSizer:add(MainSizer, Sizer, [{flag, ?wxEXPAND}]), wxSizer:addSpacer(MainSizer, 10), wxSizer:add(MainSizer, Sizer2, [{flag, ?wxEXPAND}]), wxSizer:addSpacer(MainSizer, 10), - wxSizer:add(MainSizer, Sizer3, [{flag, ?wxEXPAND}]), + wxSizer:add(MainSizer, Sizer3, [{flag, ?wxEXPAND}, {proportion, 1}]), wxPanel:setSizer(Panel, MainSizer), {Panel, #state{parent=Panel, config=Config}}. @@ -88,6 +84,10 @@ handle_info(Msg, State) -> demo:format(State#state.config, "Got Info ~p\n",[Msg]), {noreply, State}. +handle_call(shutdown, _From, State=#state{parent=Panel}) -> + wxPanel:destroy(Panel), + {stop, normal, ok, State}; + handle_call(Msg, _From, State) -> demo:format(State#state.config,"Got Call ~p\n",[Msg]), {reply, {error,nyi}, State}. |