aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool/src/reltool_utils.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-03-19 15:54:30 +0100
committerSiri Hansen <[email protected]>2012-03-19 15:54:30 +0100
commit844afaf366ad7a4f668a60e896d0ae3b9e5d850b (patch)
tree05838abebbb3c998abc41ff5f3430313fb23da7b /lib/reltool/src/reltool_utils.erl
parent20ef6a7d381b37d7c620f303a981a3a8b4e227a8 (diff)
downloadotp-844afaf366ad7a4f668a60e896d0ae3b9e5d850b.tar.gz
otp-844afaf366ad7a4f668a60e896d0ae3b9e5d850b.tar.bz2
otp-844afaf366ad7a4f668a60e896d0ae3b9e5d850b.zip
[reltool] Fix GUI problems on Windows
The new warning list did not work on Windows. It could not display tooltips for each warning and the popup window would always disappear behind the main system window. Also, column width did not occur well initially in list controls.
Diffstat (limited to 'lib/reltool/src/reltool_utils.erl')
-rw-r--r--lib/reltool/src/reltool_utils.erl21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/reltool/src/reltool_utils.erl b/lib/reltool/src/reltool_utils.erl
index 3e50324011..b0def45213 100644
--- a/lib/reltool/src/reltool_utils.erl
+++ b/lib/reltool/src/reltool_utils.erl
@@ -29,6 +29,7 @@
app_dir_test/2, split_app_dir/1,
get_item/1, get_items/1, get_selected_items/3,
select_items/3, select_item/2,
+ get_column_width/1,
safe_keysearch/5, print/4, add_warning/3,
@@ -383,6 +384,26 @@ select_item(ListCtrl, [{ItemNo, Text} | Items]) ->
select_item(_ListCtrl, []) ->
ok.
+get_column_width(ListCtrl) ->
+ wx:batch(fun() ->
+ {Total, _} = wxWindow:getClientSize(ListCtrl),
+ Total - scroll_size(ListCtrl)
+ end).
+
+scroll_size(ObjRef) ->
+ 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);
+ _ ->
+ case wxWindow:hasScrollbar(ObjRef, ?wxVERTICAL) of
+ true -> wxSystemSettings:getMetric(?wxSYS_VSCROLL_X);
+ false -> 0
+ end
+ end.
+
safe_keysearch(Key, Pos, List, Mod, Line) ->
case lists:keysearch(Key, Pos, List) of
false ->