• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Bug Reports v
« Previous 1 … 20 21 22 23 24 … 35 Next »
[fixed] This one is for Dan G ... it has his name in the dump.

 
  • 0 Vote(s) - 0 Average
[fixed] This one is for Dan G ... it has his name in the dump.

ggaliens
Offline

Erlang Hacker
Posts: 954
Threads: 143
Joined: Nov 2012
#13
04-11-2016, 11:20 PM (This post was last modified: 04-12-2016, 09:10 PM by ggaliens.)
OK ... a more broad picture of what I did to "see more" ...

Code:
build(Ask, {label, Label, Flags}, Parent, Sizer, In)
  when Ask =/= false ->
    Limit = proplists:get_value(break, Flags, infinite),
    {_,Lines} = wings_text:break_lines([Label], Limit),
    Text = wxStaticText:new(Parent, ?wxID_ANY, Lines),
    add_sizer(label, Sizer, Text, Flags),
    MinSize = case proplists:get_value(min_wsz, Flags, -1) of
          Sz when Sz > 0 -> Sz;
          Sz ->
              case proplists:get_value(width, Flags) of
              undefined -> Sz;
              Chars ->
                  {W, _, _, _} = wxWindow:getTextExtent(Parent, "W"),
                  Chars*W
              end
          end,
    wxSizer:setItemMinSize(Sizer, Text, MinSize, -1),
    In;

Now it looks ugly ... but is less of a fail.

And even after that ... I made these changes ... adding lots of lists:flatten(io_lib:format( ) )
To ensure a readable STRING. After this ... I have a very very long session of cutting triangles with not even a dialog popping up.

Code:
handle_error(Ev, Cmd) ->
    Key = bindkey(Ev, Cmd),
    KeyName =
    case Key of
      {bindkey,_MODE,KEY_OR_TUPLE} ->
            lists:flatten(io_lib:format("~p",[{bindkey,KEY_OR_TUPLE}]));
      _ ->  lists:flatten(io_lib:format("~p",[Key])) % Prob never happens but OK if does.
    end,
    CmdStr = cmd_to_string(Cmd),
    Msg1 = "Executing the command " ++ CmdStr ++ " bound to the hotkey " ++
        KeyName  ++ " caused an error.",
    Msg2 = "Possible causes:",
    Msg3 = "The hotkey was defined in a previous version of Wings,"
    " and the command that it refers to has been changed,"
    " removed, or renamed in this version of Wings.",
    Msg4 = "The hotkey refers to a command in a "
    " plug-in that is currently disabled,"
    " or to a previous version of a plug-in.",
    Msg5 = "A bug in the command itself. Try executing the command"
    " from the menu directly (i.e. not through a hotkey) -"
    "if it crashes it IS a bug. (Please report it.)",
    Msg6 = "Delete Hotkey: " ++ KeyName ++ " or press cancel to avoid any changes",
    Qs = {vframe_dialog,
      [{label,Msg1}, separator,
       {label,Msg2},
       {label,Msg3},
       {label,Msg4},
       {label,Msg5}, separator,
       {label,Msg6}],
      [{buttons, [ok, cancel], {key, result}}]},
    wings_dialog:dialog("Delete HotKey", Qs,
            fun([{result, ok}]) -> unbind(Key);
               (_) -> ignore
            end).

cmd_to_string(X) when is_atom(X) -> atom_to_list(X);
cmd_to_string({X,Tuple}) when is_atom(X), is_tuple(Tuple) ->
   "{" ++ atom_to_list(X)  ++ "," ++ cmd_to_string(Tuple) ++ "}";
cmd_to_string({X,Y}) when is_atom(X),is_atom(Y) ->
    "{" ++ atom_to_list(X) ++ "," ++ atom_to_list(Y) ++ "}".
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
[fixed] This one is for Dan G ... it has his name in the dump. - by ggaliens - 04-10-2016, 06:16 PM
RE: This one is for Dan G ... it has his name in the dump. - by micheus - 04-11-2016, 02:48 PM
RE: This one is for Dan G ... it has his name in the dump. - by ggaliens - 04-11-2016, 03:21 PM
RE: This one is for Dan G ... it has his name in the dump. - by micheus - 04-11-2016, 03:52 PM
RE: This one is for Dan G ... it has his name in the dump. - by ggaliens - 04-11-2016, 04:15 PM
RE: This one is for Dan G ... it has his name in the dump. - by micheus - 04-11-2016, 04:28 PM
RE: This one is for Dan G ... it has his name in the dump. - by ggaliens - 04-11-2016, 06:30 PM
RE: This one is for Dan G ... it has his name in the dump. - by micheus - 04-11-2016, 08:10 PM
RE: This one is for Dan G ... it has his name in the dump. - by micheus - 04-11-2016, 08:42 PM
RE: This one is for Dan G ... it has his name in the dump. - by ggaliens - 04-11-2016, 08:57 PM
RE: This one is for Dan G ... it has his name in the dump. - by micheus - 04-11-2016, 10:13 PM
RE: This one is for Dan G ... it has his name in the dump. - by ggaliens - 04-11-2016, 10:16 PM
RE: This one is for Dan G ... it has his name in the dump. - by ggaliens - 04-11-2016, 11:20 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode