Moving objects from one tab to another dynamically when resizing a window
I would accomplish this by dropping the tab pane.
Instead, use paged panes, scrollboxes, or any container object to represent the “tab” contents. You could use also use subwindows to break up the window if you’d like.
Add a tab strip, icon array, button-style radio buttons, or some other control to be the “tab” buttons. We rolled a fancy tab bar using HTML controls that handles scrolling, drag-and-drop re-ordering, and more.
Then add logic to hide/show the correct container object as the user clicks between the various buttons. Voila—you made a tab pane. 🙂 If you need a different layout (2-up, 3-up, etc.), position the container options and and hide/show multiple containers in the given layout.
> On Jul 28, 2021, at 17:40, email@example.com wrote:
> Hello $all,
> I was asked to create a POC window in studio 10 that shows how objects from one tab could appear in another tab dynamically when the window is resized.
> So say we have a window with a tabpane object that has 2 tabs.
> Say we have 3 fields on tab1, 3 fields on tab2.
> When we first construct the window, the window will open in certain size (minimum), and 2 tabs will be visible. Then we need to add a logic behind the evResized, if the window is in size A (with specific height and width), then show the 2 tabs, If the use changes the window to size b (make the window wider), we want to hide tab2 and show all the objects in tab1.
> I.e., make the Omnis desktop/client window responsive to its size or monitor size (same as JS client and bootstrap in web apps).
> I have not seen such thing done before in a desktop apps; the way I thought about it, is either by creating different sub-windows (one for each view) and then display the right one based on the window’s size or duplicate the fields that are in tab2 and place then as hidden fields on tab1 and show/ hide the fields in tab1 based on the window’s size.
> So something like this:
> On evResized
> If $cinst.$width<203 > Do $cinst.$width.$assign(203)
> End If
> If $cinst.$width>203&$cinst.$width<347 > Do bigView.$assign(0)
> Do bigView.$assign(1)
> End If
> Do $cinst.$objs.test_tabpane_1017.$currenttab(1)
> Do $cinst.$objs.test_tabpane_1017.$showpane(2,pick(bigView=1,1,0))
> Do $cinst.$objs.test_radio_1022.$visible.$assign(pick(bigView,0,1))
> Do $cinst.$objs.test_radio_1023.$visible.$assign(pick(bigView,0,1))
> Do $cinst.$redraw()
> I’m wondering if anyone has done this or knows of a better approach that I’m not aware of!
> All ideas are appreciated.
> Thank you,
> Manage your list subscriptions at lists.omnis-dev.com
> Start a new message -> mailto:firstname.lastname@example.org