Notifications
Clear all

[Closed] SDK: Resizing IRollupPanels

A curious question…

Does anyone know how to resize a IRollupPanel??

Silly question I know, but I need to be able dynamically change the window size…

I’ve played around with the MoveWindow function but it didn’t quite work out…

Shane

4 Replies

You generally shouldn’t be playing with the width of individual panels, as the rollup window maintains a list of panels, that should hopefully be of the same width. Hacking one panel involves setting more than the size of the dialog, as a panel is built from a number of windows (the title bar, container, etc). Even if you did change all these windows, the rollup window manager would probably forget your change due to its internal state not being affected. Not to mention, it wouldn’t be a good idea to have one panel being too wide to fit into the RollupWindow that contains it – the RollupWindow doesn’t support horizontal scrolling.

You can however programmatically, and safely, change the height of individual panels, without breaking the system, by calling IRollupPanel::SetDlgHeight(). If you were to just directly manipulate the HWND of a panel and resize it, it would cause havoc on the panels below it – it’s the job of RollupWindow to handle the propagation of these changes to each window it owns.

1 Reply
(@rustyknight)
Joined: 10 months ago

Posts: 0

Thank you for that clarification, it helps.

I was hopping to be able to determine the width dynamically and runtime, but it is not a major issue, just annoying.

Once again, very useful and informative, very appriciated!

Shane

Sure, if all you want to is read the width at runtime, that’s safe and easy to do.

Use GetClientRect or GetWindowRect. In this case it shouldn’t matter which since they are child windows with no border.

If you want the width of your panel for example, use something like:


RECT rc;
IRollupPanel *irp = <something>; // pretend it's initialized
GetClientRect(irp->GetPanelWnd(), &rc);
int width = rc.right - rc.left; // here's your width.

1 Reply
(@rustyknight)
Joined: 10 months ago

Posts: 0

Opps, should said “set”…but that helps to

Shame