aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_trace_wx.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-11-24 13:33:24 +0100
committerDan Gudmundsson <[email protected]>2011-11-25 10:40:20 +0100
commite7a2f0d7228d8933ee55bdb18fb01a1b19c078a7 (patch)
tree033e64da4a0b42e7665b1bb55f9e711ce5b56d0b /lib/observer/src/observer_trace_wx.erl
parentd7eaea0d44fac1f0c67d67c188d6a635b0a4da4c (diff)
downloadotp-e7a2f0d7228d8933ee55bdb18fb01a1b19c078a7.tar.gz
otp-e7a2f0d7228d8933ee55bdb18fb01a1b19c078a7.tar.bz2
otp-e7a2f0d7228d8933ee55bdb18fb01a1b19c078a7.zip
[observer] Fix listctrl colum size calculation
Diffstat (limited to 'lib/observer/src/observer_trace_wx.erl')
-rw-r--r--lib/observer/src/observer_trace_wx.erl21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl
index 31c57bd9d3..ef46030cc7 100644
--- a/lib/observer/src/observer_trace_wx.erl
+++ b/lib/observer/src/observer_trace_wx.erl
@@ -94,7 +94,7 @@ create_window(Notebook, ParentPid) ->
%% Buttons
Buttons = wxBoxSizer:new(?wxHORIZONTAL),
ToggleButton = wxToggleButton:new(Panel, ?TOGGLE_TRACE, "Start Trace", []),
- wxSizer:add(Buttons, ToggleButton),
+ wxSizer:add(Buttons, ToggleButton, [{flag, ?wxALIGN_CENTER_VERTICAL}]),
wxSizer:addSpacer(Buttons, 15),
wxSizer:add(Buttons, wxButton:new(Panel, ?ADD_NODES, [{label, "Add Nodes"}])),
wxSizer:add(Buttons, wxButton:new(Panel, ?ADD_NEW, [{label, "Add 'new' Process"}])),
@@ -141,7 +141,7 @@ create_process_view(Parent) ->
wxSplitterWindow:setSashGravity(Splitter, 0.0),
wxSplitterWindow:setMinimumPaneSize(Splitter,50),
- wxSplitterWindow:splitVertically(Splitter, Nodes, Procs, [{sashPosition, 150}]),
+ wxSplitterWindow:splitVertically(Splitter, Nodes, Procs, [{sashPosition, 155}]),
wxSizer:add(MainSz, Splitter, [{flag, ?wxEXPAND}, {proportion, 1}]),
wxListCtrl:connect(Procs, command_list_item_right_click),
@@ -174,7 +174,7 @@ create_matchspec_view(Parent) ->
wxSplitterWindow:setSashGravity(Splitter, 0.0),
wxSplitterWindow:setMinimumPaneSize(Splitter,50),
- wxSplitterWindow:splitVertically(Splitter, Modules, Funcs, [{sashPosition, 150}]),
+ wxSplitterWindow:splitVertically(Splitter, Modules, Funcs, [{sashPosition, 155}]),
wxSizer:add(MainSz, Splitter, [{flag, ?wxEXPAND}, {proportion, 1}]),
wxListCtrl:connect(Modules, size, [{skip, true}]),
@@ -199,17 +199,8 @@ create_menues(Parent) ->
%%Main window
handle_event(#wx{obj=Obj, event=#wxSize{size={W,_}}}, State) ->
case wx:getObjectType(Obj) =:= wxListCtrl of
- true ->
- wx:batch(fun() ->
- Cols = wxListCtrl:getColumnCount(Obj),
- Last = lists:foldl(fun(I, Last) ->
- Last - wxListCtrl:getColumnWidth(Obj, I)
- end, W-?LCTRL_WDECR, lists:seq(0, Cols - 2)),
- Size = max(150, Last),
- wxListCtrl:setColumnWidth(Obj, Cols-1, Size)
- end);
- false ->
- ok
+ true -> observer_lib:set_listctrl_col_size(Obj, W);
+ false -> ok
end,
{noreply, State};
@@ -290,7 +281,7 @@ handle_event(#wx{id=Id, obj=LogWin, event=Ev},
{noreply, State}
end;
-handle_event(Ev = #wx{id=?LOG_CLEAR, userData=TCtrl}, State) ->
+handle_event(#wx{id=?LOG_CLEAR, userData=TCtrl}, State) ->
wxTextCtrl:clear(TCtrl),
{noreply, State};