• 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.

Pages (2): « Previous 1 2
micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,680
Threads: 184
Joined: Jun 2012
#11
04-11-2016, 10:13 PM
If you already have a trail, keep trying because I can work on this in two days. I just needed to be able to reproduce it before there.
[Image: tw.png] @MicheusVieira [Image: yt.png] @MicheusVieira [Image: da.png] Micheuss [Image: ig.png] micheus4wings3d
* Wings3D Team stands for: Björn and Dan
ggaliens
Offline

Erlang Hacker
Posts: 954
Threads: 143
Joined: Nov 2012
#12
04-11-2016, 10:16 PM (This post was last modified: 04-11-2016, 10:49 PM by ggaliens.)
"Nevermind. I found it. "

I'm sorry. I mis took this to mean "I fixed it" . My bad. I do have some time ... and yes ... there is a trail. Hard day for me (other works). Tired. Sorry. I will keep looking.

This code .... added to wings_dialog ... might have made things BETTER ... more debuggable.
MAYBE. Near line eight hundred sixy something. It make sure ... that what goes to wxStaticText is indeed text. That will mean we can SEE MORE and continue to get to root of problem.


Lines = lists:flatten(io_lib:format("~p", [Lines0])),
Text = wxStaticText:new(Parent, ?wxID_ANY, Lines),
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)

Pages (2): « Previous 1 2


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

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode