• 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 Programming v
« Previous 1 2 3 4
Add elements to UI

 
  • 0 Vote(s) - 0 Average
Add elements to UI

povmaniac
Offline

Member

Posts: 178
Threads: 7
Joined: May 2013
#1
06-15-2013, 06:45 PM
Because it is so complicated to add new elements to the interface, due to 'split_list'.
Is there no a better system of doing this (in Erlang)?
Code:
export_dialog_loop({Op,Fun}=Keep, Attr) ->
    {Prefs,Buttons} = split_list(Attr, 79), %% povman: add index?? old value 78
    case Buttons of
        [true,false,false] -> % Save
            set_user_prefs(Prefs),
            {dialog,
             export_dialog_qs(Op, Attr),
             export_dialog_fun(Keep)};
        [false,true,false] -> % Load
            {dialog,
             export_dialog_qs(Op,
                              get_user_prefs(export_prefs())
                              ++[save,load,reset]),
             export_dialog_fun(Keep)};
        [false,false,true] -> % Reset
            {dialog,
             export_dialog_qs(Op,
                              export_prefs()++[save,load,reset]),
             export_dialog_fun(Keep)};
        [false,false,false] -> % Ok
            Fun(Prefs)
    end.

Or there...

Code:
%%% Increase split_list # +1 per line if add Modulator to Dialog

modulator(Minimized, Enabled, Mode, Res0, M) ->
    {Res1,Res} = split_list(Res0, 39), % org : 37
    TypeTag = {?TAG,type,M},
    {value,{TypeTag,TexType}} = lists:keysearch(TypeTag, 1, Res1),
....

Smile
The Universe is an infinite equation
micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,675
Threads: 183
Joined: Jun 2012
#2
06-17-2013, 07:57 PM (This post was last modified: 06-17-2013, 07:57 PM by micheus.)
povmaniac, I'm not sure I can help you with this, but have you took a look in the Ask dialogs examples (wpc_test_ask.erl) at /wings/plugin_src?
There is an sample about add components dynamically: dynamic_dialog/1
Maybe it can help you.

You also can load the module by typing at the Erlang console (after you start your Wings3d):
Code:
1>  wpc_test_ask:enable().
-----
2>  wpc_test_ask:disable().
don't forget the [dot] at the end of line.
povmaniac
Offline

Member

Posts: 178
Threads: 7
Joined: May 2013
#3
06-17-2013, 08:51 PM
Ok. My Erlang is not good, atm Smile
Thanks
The Universe is an infinite equation
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



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

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode