An oldy but a goody
(from back in the day… RP7… Allowing a user to resize a dynamic panel with drag control)
Here is a basic demo, updated for RP9, which makes things simpler. i made three dynamic panels:
- DP1, with a rectangle widget in it named “Content 1”, and a Placeholder widget.
- DP2, with a rectangle widget in it named “Content 2”
- A “Resizer Bar” with a Dragged event that sets the width of Content 1 and Content 2.
Take note of a few things:
- DP1 and DP2 are set to “Fit to Content” so as the rectangle widget inside is resized, the dynamic panel size changes accordingly.
- Also take note of the anchor points in the Set Size action. Content 1 is anchored to left, Content 2 is anchored to right.
- Content 1 has a Resized event that changes the size of the Placeholder widget, giving it a responsive nature.
- The Resizer Bar has a “handle” shape which is highlighted when dragged. Just a little decoration for usability. Typically, an app would change the cursor, which is not impossible but not easy in Axure (search this forum for “custom cursor” if you’d like to pursue that.)
- If you get crazy (fast back & forth) with the dragging or have a relatively slow system, the panel resizing may get out of whack. You can add a “healing” action in the Drag Dropped event to ensure the panel sizes and positions get set properly.
If you have a lot of content in either pane you could place all that content on its own separate page (one page per pane) and use an Inline Frame widget in the dynamic panel (or even replace the dynamic panel with just an Inline Frame) and set the frame’s target to that page. You could then use similar dynamic responsive sizing and/or Adaptive Views on that content page to define how the page responds to the width of the window (e.g., the Window Resized and built in variable, [[Window.width]] is quite useful), such as showing more items as it gets wider.
drag to resize panels.rp (57.2 KB)