Wings 3D Development Forum
Selecting in folders - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Interface & Usage (https://www.wings3d.com/forum/forumdisplay.php?fid=3)
+--- Thread: Selecting in folders (/showthread.php?tid=1132)



Selecting in folders - micheus - 04-01-2015

ggaliens, as you have deleted the that thread I create this one as a replacement.

As you ask in your video - Select All Object in Folder: "Am I crazy? Am I crazy? I don't know. You tell me"

Yeah, maybe you are. Smile
You are spending time with things that already exists - and works no only for selection.

You are a very active coder, but seems to not be so active Wings3d user. Otherwise - for all these years - you probably would to know about this feature I tried to "show" you how to use in that deleted thread.

As you say: "Enjoy the show"
Wings3D: Select/Hide/Lock/Wire operations in the Geometry window (best seen at YouTube)



RE: ggaliens: selecting in folders - ggaliens - 04-01-2015

Micheus ... how does it work if the folders are in closed state ?

Does it work in that case ?

"Toggle Selection for all other objects ? " That worthless command IMHO. At very least ... not ideal.

I think someone wrote the helptext to obey the current implementation ... rather than considering whether the action makes sense.

My command is not TOGGLING the same way ... and is available for closed folders and simpler to understand.




RE: ggaliens: selecting in folders - micheus - 04-01-2015

(04-01-2015, 06:54 PM)ggaliens Wrote: Micheus ... how does it work if the folders are in closed state ?

Does it work in that case ?
No it doesn't. But I can see that as a big "problem".

Why not work in something similar to that, but more relevant and new as the Layers management?


RE: ggaliens: selecting in folders - ggaliens - 04-01-2015

It is a big problem. As is having to click twice instead of once ... for a very simple action.

Sheesh.


RE: ggaliens: selecting in folders - micheus - 04-02-2015

A last comment. I swear.
Something really missing that you could add in the same pack: Collapse All and - maybe - the opposite Expand All.


RE: ggaliens: selecting in folders - ggaliens - 04-02-2015

OK. I'll add them.

Code:
close_all_folders(#st{pst=Pst0}=St,OpenOrClosed0) ->
    {Key0,Fld}  = gb_trees:get(?FOLDERS,Pst0),
    MyAcc = fun
        (no_folder, MORE, Acc) ->
            orddict:store(no_folder,MORE, Acc);
        (Key, {OpenOrClosed1,MORE}, Acc) when OpenOrClosed1 == open orelse OpenOrClosed1 == closed ->
            orddict:store(Key,{OpenOrClosed0,MORE},Acc)
    end,
    Fld2 = orddict:fold(MyAcc,Fld,Fld),
    Pst1 = gb_trees:enter(?FOLDERS, {Key0,Fld2}, Pst0),
    St#st{pst=Pst1}.



RE: ggaliens: selecting in folders - ggaliens - 04-02-2015

Released.


RE: ggaliens: selecting in folders - micheus - 04-02-2015

As you shared the code here...

Don't you think it's a good idea to have a "guard" option: _ ->
Just in case at some point in the future someone call the function with a wrong value into OpenOrClosed0?


RE: ggaliens: selecting in folders - ggaliens - 04-02-2015

Yes.
I moved the guard up to the main function entry point.

Code:
close_all_folders(#st{pst=Pst0}=St,OpenOrClosed0)
    when OpenOrClosed0 == open orelse OpenOrClosed0 == closed ->
    {Key0,Fld}  = gb_trees:get(?FOLDERS,Pst0),
    MyAcc = fun
        (?NO_FLD, MORE, Acc) ->
            orddict:store(?NO_FLD,MORE, Acc);
        (Key, {open,MORE}, Acc) ->
            orddict:store(Key,{OpenOrClosed0,MORE},Acc);
        (Key, {closed,MORE}, Acc) ->
            orddict:store(Key,{OpenOrClosed0,MORE},Acc)
    end,
    Fld2 = orddict:fold(MyAcc,Fld,Fld),
    Pst1 = gb_trees:enter(?FOLDERS, {Key0,Fld2}, Pst0),
    St#st{pst=Pst1}.