From 41380c0ff6c4fb56aad5702b9d9554ae36580063 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 16 Oct 2013 16:53:53 +0200 Subject: observer: improve wx version of crashdump_viewer * bugfixes * better progress dialogs * show expanded binaries in different formats * speed up reading of big crashdumps --- lib/observer/src/cdv_info_page.erl | 39 +++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'lib/observer/src/cdv_info_page.erl') diff --git a/lib/observer/src/cdv_info_page.erl b/lib/observer/src/cdv_info_page.erl index b2f94fbc7f..27eb71225d 100644 --- a/lib/observer/src/cdv_info_page.erl +++ b/lib/observer/src/cdv_info_page.erl @@ -63,11 +63,18 @@ handle_info(active, State) -> crashdump_viewer_wx:set_status(State#state.trunc_warn), {noreply, State}; -handle_info(not_active, #state{} = State) -> - {noreply, State}; +handle_info(Info, State) -> + io:format("~p:~p: Unhandled info: ~p~n", [?MODULE, ?LINE, Info]), + {noreply, State}. + +terminate(_Reason, _State) -> + ok. -handle_info(new_dump, #state{callback=Callback,panel=Panel, - sizer=Sizer,fpanel=FPanel} = State) -> +code_change(_, _, State) -> + {ok, State}. + +handle_call(new_dump, _From, #state{callback=Callback,panel=Panel, + sizer=Sizer,fpanel=FPanel} = State) -> {InfoFields,Info,TW} = Callback:get_info(), NewFPanel = wx:batch( @@ -77,17 +84,7 @@ handle_info(new_dump, #state{callback=Callback,panel=Panel, wxSizer:layout(Sizer), FP end), - {noreply, State#state{fpanel=NewFPanel,trunc_warn=TW}}; - -handle_info(Info, State) -> - io:format("~p:~p: Unhandled info: ~p~n", [?MODULE, ?LINE, Info]), - {noreply, State}. - -terminate(_Reason, _State) -> - ok. - -code_change(_, _, State) -> - {ok, State}. + {reply, ok, State#state{fpanel=NewFPanel,trunc_warn=TW}}; handle_call(Msg, _From, State) -> io:format("~p~p: Unhandled Call ~p~n",[?MODULE, ?LINE, Msg]), @@ -97,6 +94,18 @@ handle_cast(Msg, State) -> io:format("~p~p: Unhandled cast ~p~n",[?MODULE, ?LINE, Msg]), {noreply, State}. +handle_event(#wx{event=#wxMouse{type=left_down},userData=Target}, State) -> + cdv_virtual_list:start_detail_win(Target), + {noreply, State}; + +handle_event(#wx{obj=Obj,event=#wxMouse{type=enter_window}},State) -> + wxTextCtrl:setForegroundColour(Obj,{0,0,100,255}), + {noreply, State}; + +handle_event(#wx{obj=Obj,event=#wxMouse{type=leave_window}},State) -> + wxTextCtrl:setForegroundColour(Obj,?wxBLUE), + {noreply, State}; + handle_event(Event, State) -> io:format("~p:~p: Unhandled event ~p\n", [?MODULE,?LINE,Event]), {noreply, State}. -- cgit v1.2.3