Stacking Tabs Menu?
-
Hi,
Is there a way to have stacking tabs the same way the attribute manager? (Not sure what's it really called)
Currently, with my code, it doesn't stack when I hold theShift
key. It just goes to the next tab.You can see the illustration of the problem here:
https://www.dropbox.com/s/fx185im9r5i4b6g/c4d199_stacking_tabs_gui.mp4?dl=0You can check the working code (in a .pyp file) here:
import c4d from c4d import gui, plugins, bitmaps, utils, documents PLUGIN_ID = 9201239 class TabDialog(gui.GeDialog): def CreateLayout(self): self.TabGroupBegin(id=5555, flags=c4d.BFH_LEFT, tabtype=c4d.TAB_TABS) self.GroupBegin(id=1031, flags=c4d.BFH_SCALEFIT, cols=1, rows=4, title="Tab1") self.AddStaticText(id=1041, flags=c4d.BFH_LEFT, initw=275, name="Stack Tab1", borderstyle=c4d.BORDER_NONE) self.GroupEnd() self.GroupBegin(id=1035, flags=c4d.BFH_SCALEFIT, cols=1, rows=4, title="Tab2") self.AddStaticText(id=1045, flags=c4d.BFH_LEFT, initw=275, name="Stack Tab2", borderstyle=c4d.BORDER_NONE) self.GroupEnd() return True def Command(self, id, msg): if id == 12345: pass return True class TabMenu(plugins.CommandData): dialog = None def Execute(self, doc): if self.dialog is None: self.dialog = TabDialog() return self.dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, pluginid=PLUGIN_ID, defaultw=200, defaulth=150, xpos=-1, ypos=-1) def RestoreLayout(self, sec_ref): # manage the dialog if self.dialog is None: self.dialog = MyDialog() return self.dialog.Restore(pluginid=PLUGIN_ID, secret=sec_ref) if __name__ == "__main__": okyn = plugins.RegisterCommandPlugin(PLUGIN_ID, "Stack Tab Menu",0, None, "Stack Tab Menu", TabMenu()) if (okyn): print "Stack Tab Menu Test"
Is such a feature available for the GeDialog?
-
Hi bentraje, thanks for reaching out us.
With regard to your issue, I recommend to have a look at the QuicktabCustomGui which actually delivers the desired behavior.
You can also find on our GitHub repo the customgui_quicktab_r19.py example showing how to make good use of it.
Best, Riccardp
-
Hi @r_gigante
Thanks for the response. I tried the sample script you referred but unfortunately it doesn not stack.
When hold shift, it just goes to another tab and so on.Is there a way around this?
-
Hi bentraje, you have to set to
False
the value for theQUICKTAB_NOMULTISELECT
in the BaseContainer used to store the QuickTabGui parameters.
This will allow you to have multiple tabs being selectable and then display the corresponding groups based on the list of items being selected.Best, R
-
Thanks for the response. I changed it and it does select both tabs but it does not stack them. You can see an illustration here:
https://www.dropbox.com/s/gzuoy0c2fal1xg1/c4d199_stacking_tabs_gui02.mp4?dl=0In addition, as in the code above, I'm using
TabGroupBegin
to set tabs. Is it possible with stacking tabs? Or does it have to beQuickTabCustomGui
for it to work?There's no
QUICKTAB_NOMULTISELECT
parameter for theTabGroupBegin
section. -
Hi bentraje, the logic of displaying the content of both should be adapted in the
DisplayCorrectGroup
function which, standing on the current implementation on GitHub, only consider one Group. Extending to get it working for more than one should be trivial.With regard to the "stacked" tabs functionality, as said above, you can get it working with QuickTabCustomGui in GeDialogs.
Cheers, R
-
Thanks for the response.
RE: Extending to get it working for more than one should be trivial.
Unfortunately, the whole code is trivial to me being novice.
Anyhow, I guess I'll just learn on QuickTabCustomGui on a separate thread.RE: With regard to the "stacked" tabs functionality, as said above
Yes, you did. I was wondering if there is an option for theTabGroupBegin
as that is somewhat straight forward to me rather than theQuickTabCustomGui
.So I guess, this confirms that it is not possible for the
TabGroupBegin
.Again, no further action required. Will just open another thread for the
QuickTabCustomGui
.