aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/observer/src/observer_app_wx.erl2
-rw-r--r--lib/observer/src/observer_defs.hrl2
-rw-r--r--lib/observer/src/observer_lib.erl11
-rw-r--r--lib/observer/src/observer_sys_wx.erl15
-rw-r--r--lib/observer/src/observer_trace_wx.erl7
5 files changed, 22 insertions, 15 deletions
diff --git a/lib/observer/src/observer_app_wx.erl b/lib/observer/src/observer_app_wx.erl
index a710bd0a69..a8ace10275 100644
--- a/lib/observer/src/observer_app_wx.erl
+++ b/lib/observer/src/observer_app_wx.erl
@@ -81,7 +81,7 @@ init([Notebook, Parent]) ->
]),
Main = wxBoxSizer:new(?wxHORIZONTAL),
Splitter = wxSplitterWindow:new(Panel, [{size, wxWindow:getClientSize(Panel)},
- {style, ?wxSP_LIVE_UPDATE},
+ {style, ?SASH_STYLE},
{id, 2}
]),
Apps = wxListBox:new(Splitter, 3, []),
diff --git a/lib/observer/src/observer_defs.hrl b/lib/observer/src/observer_defs.hrl
index a720e8c833..3adc358b95 100644
--- a/lib/observer/src/observer_defs.hrl
+++ b/lib/observer/src/observer_defs.hrl
@@ -46,3 +46,5 @@
-define(BG_NEW, {123,168,123}).
-define(LCTRL_WDECR, 4). %% Remove some pixels in column width to avoid creating unnecessary scrollbar
+
+-define(SASH_STYLE, ?wxSP_LIVE_UPDATE bor ?wxSP_NOBORDER bor ?wxSP_3DSASH).
diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl
index 863ef8c2dc..e0f7bf482b 100644
--- a/lib/observer/src/observer_lib.erl
+++ b/lib/observer/src/observer_lib.erl
@@ -460,7 +460,7 @@ create_box(Panel, Data) ->
wxSizer:add(Line, 10, 0), % space of size 10 horisontally
wxSizer:add(Line, Field, RightProportion),
- {_,H,_,_} = wxTextCtrl:getTextExtent(Field,"W"),
+ {_,H,_,_} = wxTextCtrl:getTextExtent(Field,"Wj"),
wxTextCtrl:setMinSize(Field,{0,H}),
wxSizer:add(Box, Line, [{proportion,0},{flag,?wxEXPAND}]),
@@ -523,8 +523,8 @@ get_max_size(Txt,[{Desc,_}|Info],MaxX,MaxY) ->
end;
get_max_size(Txt,[undefined|Info],MaxX,MaxY) ->
get_max_size(Txt,Info,MaxX,MaxY);
-get_max_size(_,[],X,Y) ->
- {X+2,Y}.
+get_max_size(_,[],X,_Y) ->
+ {X+2,-1}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set_listctrl_col_size(LCtrl, Total) ->
@@ -543,10 +543,7 @@ calc_last(LCtrl, _Total) ->
scroll_size(LCtrl) ->
case os:type() of
{win32, nt} -> 0;
- {unix, darwin} ->
- %% I can't figure out is there is a visible scrollbar
- %% Always make room for it
- wxSystemSettings:getMetric(?wxSYS_VSCROLL_X);
+ {unix, darwin} -> 0; %% Always 0 in wxWidgets-3.0
_ ->
case wxWindow:hasScrollbar(LCtrl, ?wxVERTICAL) of
true -> wxSystemSettings:getMetric(?wxSYS_VSCROLL_X);
diff --git a/lib/observer/src/observer_sys_wx.erl b/lib/observer/src/observer_sys_wx.erl
index 8321d6eefe..f989f9cf97 100644
--- a/lib/observer/src/observer_sys_wx.erl
+++ b/lib/observer/src/observer_sys_wx.erl
@@ -60,10 +60,10 @@ init([Notebook, Parent]) ->
wxSizer:add(TopSizer, FPanel0, [{flag, ?wxEXPAND}, {proportion, 1}]),
wxSizer:add(TopSizer, FPanel1, [{flag, ?wxEXPAND}, {proportion, 1}]),
BorderFlags = ?wxLEFT bor ?wxRIGHT,
- MemoryInfo = create_mem_info(Panel, AllocInfo),
+ {MemPanel, MemoryInfo} = create_mem_info(Panel, AllocInfo),
wxSizer:add(Sizer, TopSizer, [{flag, ?wxEXPAND bor BorderFlags bor ?wxTOP},
{proportion, 0}, {border, 5}]),
- wxSizer:add(Sizer, MemoryInfo, [{flag, ?wxEXPAND bor BorderFlags bor ?wxBOTTOM},
+ wxSizer:add(Sizer, MemPanel, [{flag, ?wxEXPAND bor BorderFlags bor ?wxBOTTOM},
{proportion, 1}, {border, 5}]),
wxPanel:setSizer(Panel, Sizer),
Timer = observer_lib:start_timer(10),
@@ -86,7 +86,9 @@ update_syspage(#sys_wx_state{node = Node, fields=Fields, sizer=Sizer, alloc=Allo
update_alloc(AllocCtrl, AllocInfo),
wxSizer:layout(Sizer).
-create_mem_info(Panel, Fields) ->
+create_mem_info(Parent, Fields) ->
+ Panel = wxPanel:new(Parent),
+ wxWindow:setBackgroundColour(Panel, {255,255,255}),
Style = ?wxLC_REPORT bor ?wxLC_SINGLE_SEL bor ?wxLC_HRULES bor ?wxLC_VRULES,
Grid = wxListCtrl:new(Panel, [{style, Style}]),
Li = wxListItem:new(),
@@ -103,7 +105,12 @@ create_mem_info(Panel, Fields) ->
lists:foldl(AddListEntry, 0, ListItems),
wxListItem:destroy(Li),
update_alloc(Grid, Fields),
- Grid.
+
+ Sizer = wxBoxSizer:new(?wxVERTICAL),
+ wxSizer:add(Sizer, Grid, [{flag, ?wxEXPAND bor ?wxLEFT bor ?wxRIGHT},
+ {border, 5}, {proportion, 1}]),
+ wxWindow:setSizerAndFit(Panel, Sizer),
+ {Panel, Grid}.
update_alloc(Grid, AllocInfo) ->
Fields = alloc_info(AllocInfo, [], 0, 0, true),
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl
index f2a1084f85..2878842c23 100644
--- a/lib/observer/src/observer_trace_wx.erl
+++ b/lib/observer/src/observer_trace_wx.erl
@@ -84,7 +84,8 @@ create_window(Notebook, ParentPid) ->
%% Create the window
Panel = wxPanel:new(Notebook, [{size, wxWindow:getClientSize(Notebook)}]),
Sizer = wxBoxSizer:new(?wxVERTICAL),
- Splitter = wxSplitterWindow:new(Panel, [{size, wxWindow:getClientSize(Panel)}]),
+ Splitter = wxSplitterWindow:new(Panel, [{size, wxWindow:getClientSize(Panel)},
+ {style, ?SASH_STYLE}]),
{NodeProcView, NodeView, ProcessView} = create_process_view(Splitter),
{MatchSpecView,ModView,FuncView} = create_matchspec_view(Splitter),
wxSplitterWindow:setSashGravity(Splitter, 0.5),
@@ -120,7 +121,7 @@ create_process_view(Parent) ->
Panel = wxPanel:new(Parent),
MainSz = wxBoxSizer:new(?wxHORIZONTAL),
Style = ?wxLC_REPORT bor ?wxLC_HRULES,
- Splitter = wxSplitterWindow:new(Panel, []),
+ Splitter = wxSplitterWindow:new(Panel, [{style, ?SASH_STYLE}]),
Nodes = wxListCtrl:new(Splitter, [{winid, ?NODES_WIN}, {style, Style}]),
Procs = wxListCtrl:new(Splitter, [{winid, ?PROC_WIN}, {style, Style}]),
Li = wxListItem:new(),
@@ -157,7 +158,7 @@ create_matchspec_view(Parent) ->
Panel = wxPanel:new(Parent),
MainSz = wxBoxSizer:new(?wxHORIZONTAL),
Style = ?wxLC_REPORT bor ?wxLC_HRULES,
- Splitter = wxSplitterWindow:new(Panel, []),
+ Splitter = wxSplitterWindow:new(Panel, [{style, ?SASH_STYLE}]),
Modules = wxListCtrl:new(Splitter, [{winid, ?MODULES_WIN}, {style, Style}]),
Funcs = wxListCtrl:new(Splitter, [{winid, ?FUNCS_WIN}, {style, Style}]),
Li = wxListItem:new(),