aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_tv_table.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-10-07 15:35:16 +0200
committerDan Gudmundsson <[email protected]>2011-11-10 08:04:51 +0100
commit87487a2534d3e790f65ac5b90cfc497d7d05dd86 (patch)
tree1b2436625a57fbd41630a14d6565beec194d3c6a /lib/observer/src/observer_tv_table.erl
parentffcacd111c61019a502a895b1edcfbc1578ddfa7 (diff)
downloadotp-87487a2534d3e790f65ac5b90cfc497d7d05dd86.tar.gz
otp-87487a2534d3e790f65ac5b90cfc497d7d05dd86.tar.bz2
otp-87487a2534d3e790f65ac5b90cfc497d7d05dd86.zip
[observer] Misc cleanup and fixes
Make sure that the menus work on MacOsX. Fix asserts on debug build on linux. Make sure epmd is started before distribution. Rewrote multi-selection code observer_pro_wx.
Diffstat (limited to 'lib/observer/src/observer_tv_table.erl')
-rw-r--r--lib/observer/src/observer_tv_table.erl19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl
index a2797700d8..d4990ec0ff 100644
--- a/lib/observer/src/observer_tv_table.erl
+++ b/lib/observer/src/observer_tv_table.erl
@@ -26,6 +26,7 @@
-export([get_table/3]).
+-include("observer_defs.hrl").
-import(observer_lib, [to_str/1]).
-behaviour(wx_object).
@@ -68,8 +69,6 @@
sort_incr=true
}).
--record(attrs, {even, odd, deleted, changed, searched}).
-
-record(search,
{enable=true, % Subwindow is enabled
win, % Sash Sub window obj
@@ -116,7 +115,7 @@ init([Parent, Opts]) ->
ColumnNames = column_names(Node, Source, TabId),
KeyPos = key_pos(Node, Source, TabId),
- Attrs = create_attrs(),
+ Attrs = observer_lib:create_attrs(),
Self = self(),
Holder = spawn_link(fun() ->
@@ -587,7 +586,7 @@ parse_ets_data([], Cols, Tab) ->
sort(Col, S=#holder{n=N, parent=Parent, sort=Opt0, table=Table0}) ->
{Opt, Table} = sort(Col, Opt0, Table0),
- Parent ! {refresh, 0, N},
+ Parent ! {refresh, 0, N-1},
S#holder{sort=Opt, table=Table}.
sort(Col, Opt = #opt{sort_key=Col, sort_incr=Bool}, Table) ->
@@ -595,7 +594,7 @@ sort(Col, Opt = #opt{sort_key=Col, sort_incr=Bool}, Table) ->
sort(Col, S=#opt{sort_incr=true}, Table) ->
{S#opt{sort_key=Col}, keysort(Col, Table)};
sort(Col, S=#opt{sort_incr=false}, Table) ->
- {S=#opt{sort_key=Col}, lists:reverse(keysort(Col, Table))}.
+ {S#opt{sort_key=Col}, lists:reverse(keysort(Col, Table))}.
keysort(Col, Table) ->
Sort = fun([A0|_], [B0|_]) ->
@@ -800,13 +799,3 @@ key_pos(Node, ets, TabId) ->
KeyPos = rpc:call(Node, ets, info, [TabId, keypos]),
is_integer(KeyPos) orelse throw(node_or_table_down),
KeyPos.
-
-create_attrs() ->
- Font = wxSystemSettings:getFont(?wxSYS_DEFAULT_GUI_FONT),
- Text = wxSystemSettings:getColour(?wxSYS_COLOUR_LISTBOXTEXT),
- #attrs{even = wx:typeCast(wx:null(), wxListItemAttr),
- odd = wxListItemAttr:new(Text, {240,240,255}, Font),
- deleted = wxListItemAttr:new({240,30,30}, {100,100,100}, Font),
- changed = wxListItemAttr:new(Text, {255,215,0}, Font),
- searched = wxListItemAttr:new(Text, {235,215,90}, Font)
- }.