From 438d778eb1ccf432ddc8e275e5ee3e91f590cf8c Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 16 Dec 2009 13:53:01 +0100 Subject: Dbg Fixed mac gui issues --- lib/debugger/src/dbg_wx_filedialog_win.erl | 5 +++-- lib/debugger/src/dbg_wx_mon.erl | 2 +- lib/debugger/src/dbg_wx_win.erl | 13 ++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'lib/debugger/src') diff --git a/lib/debugger/src/dbg_wx_filedialog_win.erl b/lib/debugger/src/dbg_wx_filedialog_win.erl index d883438639..946e23e797 100644 --- a/lib/debugger/src/dbg_wx_filedialog_win.erl +++ b/lib/debugger/src/dbg_wx_filedialog_win.erl @@ -375,7 +375,8 @@ show_completion(Wanted, State = #state{text=TC, win=Win, list=LC, completion=Com Start = length(Wanted), wxTextCtrl:setValue(TC, Path++"/"), wxTextCtrl:setInsertionPoint(TC, Start), - wxTextCtrl:setSelection(TC, Start, -1), + Last = wxTextCtrl:getLastPosition(TC), + wxTextCtrl:setSelection(TC, Start, Last), destroy_completion(Comp), wxWindow:setFocus(TC), State#state{ptext=Path, completion=undefined}; @@ -399,7 +400,7 @@ show_completion(Wanted, State = #state{text=TC, win=Win, list=LC, completion=Com LB = wxListBox:new(Temp, ?COMPLETION_WIN, [{style, ?wxLB_SINGLE}, {choices, Files}, {size, Size}]), - wxListBox:connect(LB, command_listbox_doubleclicked), + %% wxListBox:connect(LB, command_listbox_doubleclicked), wxListBox:connect(LB, command_listbox_selected), wxWindow:show(Temp), wxWindow:setFocus(TC), diff --git a/lib/debugger/src/dbg_wx_mon.erl b/lib/debugger/src/dbg_wx_mon.erl index d81069ec90..3ffdeeaea2 100644 --- a/lib/debugger/src/dbg_wx_mon.erl +++ b/lib/debugger/src/dbg_wx_mon.erl @@ -144,7 +144,7 @@ init2(CallingPid, Mode, SFile, GS) -> win = Win, focus = undefined, - coords = {0,0}, + coords = {20,20}, intdir = element(2, file:get_cwd()), pinfos = [], diff --git a/lib/debugger/src/dbg_wx_win.erl b/lib/debugger/src/dbg_wx_win.erl index f029990aa4..a93b562a81 100644 --- a/lib/debugger/src/dbg_wx_win.erl +++ b/lib/debugger/src/dbg_wx_win.erl @@ -75,7 +75,8 @@ create_menus(MB, [{Title,Items}|Ms], Win, Id0) -> Id = create_menu_item(Menu, Items, Win, Id0, true), wxMenuBar:append(MB,Menu,menu_name(Title,ignore)), create_menus(MB,Ms,Win,Id); -create_menus(_MB,[], _Win,Id) -> Id. +create_menus(_MB,[], _Win,Id) -> + Id. create_menu_item(Menu, [separator|Is], Win, Id,Connect) -> wxMenu:appendSeparator(Menu), @@ -102,10 +103,14 @@ create_menu_item(Menu, [{Name, _N, cascade, Items}|Is], Win, Id0,Connect) -> [{id,Id0},{lastId, Id-1},{callback,Filter}]), create_menu_item(Menu, Is, Win, Id, Connect); create_menu_item(Menu, [{Name,Pos}|Is], Win, Id, Connect) -> - Item = wxMenu:append(Menu, Id, menu_name(Name,Pos)), + MenuId = case lists:member(Name, ['Debugger']) of + true -> ?wxID_HELP; + _ -> Id + end, + Item = wxMenu:append(Menu, MenuId, menu_name(Name,Pos)), put(Name,Item), if Connect -> - wxMenu:connect(Win, command_menu_selected, [{id,Id},{userData, Name}]); + wxMenu:connect(Win, command_menu_selected, [{id,MenuId},{userData, Name}]); true -> ignore end, create_menu_item(Menu,Is,Win,Id+1, Connect); @@ -308,6 +313,8 @@ to_string(Format,Args) -> menu_name(Atom, N) when is_atom(Atom) -> menu_name(atom_to_list(Atom),N); +menu_name("Help", _) -> %% Mac needs this to be exactly this + "&Help"; menu_name(Str, Pos) when is_integer(Pos) -> {S1,S2} = lists:split(Pos,Str), S1 ++ [$&|S2]; -- cgit v1.2.3 From e27e41b63225b1be5ce2f338d219a39429079fec Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 16 Dec 2009 14:04:43 +0100 Subject: Dbg: Fixed documentation links to the new index.html --- lib/debugger/src/dbg_ui_mon.erl | 3 +-- lib/debugger/src/dbg_wx_mon.erl | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/debugger/src') diff --git a/lib/debugger/src/dbg_ui_mon.erl b/lib/debugger/src/dbg_ui_mon.erl index 63cc9b66d1..733310fdeb 100644 --- a/lib/debugger/src/dbg_ui_mon.erl +++ b/lib/debugger/src/dbg_ui_mon.erl @@ -429,8 +429,7 @@ gui_cmd('Back Trace Size...', State) -> %% Help Menu gui_cmd('Debugger', State) -> - HelpFile = filename:join([code:lib_dir(debugger), - "doc", "html", "part_frame.html"]), + HelpFile = filename:join([code:lib_dir(debugger), "doc", "html", "index.html"]), Window = dbg_ui_mon_win:get_window(State#state.win), tool_utils:open_help(Window, HelpFile), State; diff --git a/lib/debugger/src/dbg_wx_mon.erl b/lib/debugger/src/dbg_wx_mon.erl index 3ffdeeaea2..10fa090413 100644 --- a/lib/debugger/src/dbg_wx_mon.erl +++ b/lib/debugger/src/dbg_wx_mon.erl @@ -442,8 +442,7 @@ gui_cmd('Back Trace Size...', State) -> %% Help Menu gui_cmd('Debugger', State) -> - HelpFile = filename:join([code:lib_dir(debugger), - "doc", "html", "part_frame.html"]), + HelpFile = filename:join([code:lib_dir(debugger), "doc", "html", "index.html"]), Window = dbg_wx_mon_win:get_window(State#state.win), dbg_wx_win:open_help(Window, HelpFile), State; -- cgit v1.2.3 From 87f6e4c3bcddc166d2109e72ae8add6adfca26cc Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 16 Dec 2009 14:34:03 +0100 Subject: Dbg: Cut variable bindings after 80 chars. This is an optimization to avoid sending huge terms to the gui just to step by them and update variables again. Even better would be to only update if necessary. --- lib/debugger/src/dbg_wx_trace_win.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/debugger/src') diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl index 6e7a291493..4f7f9baf80 100755 --- a/lib/debugger/src/dbg_wx_trace_win.erl +++ b/lib/debugger/src/dbg_wx_trace_win.erl @@ -571,7 +571,7 @@ update_bindings(#winInfo{bind=#sub{out=BA}}, Bs) -> wx:foldl(fun({Var,Val},Row) -> wxListCtrl:insertItem(BA, Row, ""), wxListCtrl:setItem(BA, Row, 0, dbg_wx_win:to_string(Var)), - wxListCtrl:setItem(BA, Row, 1, dbg_wx_win:to_string("~200p",[Val])), + wxListCtrl:setItem(BA, Row, 1, dbg_wx_win:to_string("~500P",[Val, 80])), Row+1 end, 0, Bs), put(bindings,Bs), -- cgit v1.2.3 From 85f849c570bc99fe33d3001d8b4f9705ca3a833a Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 16 Dec 2009 14:43:51 +0100 Subject: Dbg: Expand the module listbox when window grows. --- lib/debugger/src/dbg_wx_mon_win.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/debugger/src') diff --git a/lib/debugger/src/dbg_wx_mon_win.erl b/lib/debugger/src/dbg_wx_mon_win.erl index dfb327fa6a..95fc9a89b2 100644 --- a/lib/debugger/src/dbg_wx_mon_win.erl +++ b/lib/debugger/src/dbg_wx_mon_win.erl @@ -104,7 +104,7 @@ create_win_batch(Title, Menus) -> Hlb = 200, Listbox = wxListBox:new(Panel, ?wxID_ANY, [{size,{?Wf,Hlb}}, {style,?wxLB_SINGLE}]), - wxSizer:add(LeftSz,Listbox,[{border, 3}]), + wxSizer:add(LeftSz,Listbox,[{proportion,1}, {border,3}]), wxListBox:connect(Listbox, command_listbox_doubleclicked), wxListBox:connect(Listbox, right_down), -- cgit v1.2.3