How to use RdkExpandingSection inside a TabbedDockBatDialog?

I modified the SampleOptionsListCtrlDlg::OnInitDialog() to create an RdkExpandingSectionHolder and then add the RhinoUI items, but the sections do not get resized. The Section remain the size of the original ExpandingSection placeholder dialog.

Is there some overall docs on the rdk UI helper classes?

Help!

Did you populate the ExpandingSectionHolder with CRhRdkExpandingSection dialogs? Or some other type of dialog?

Yes, derived from CrhRdkExpandingSection.

So in the SampleOptionListCtrl, rather than adding it to the SampleOpenListCtrlDlg, I add it to a Section. And it appears - but the Section themselves aren’t resized.

::OnInitDialog()
{

// Create the holder.
m_pHolder->Create(_T(“”), m_rectHolder, this);

// Create section 1 and attach it to the holder.
CLightUpOptionsSection1* pSection1 = new CLightUpOptionsSection1;
pSection1->m_caption = ON_wString(“Preferences”);
pSection1->CreateAndAttachToHolder(m_pHolder);

m_options_list.SetBorders( 0, 0, 0, 0 );
if( m_options_list.CreateOptionsList(pSection1, WS_VISIBLE | WS_CHILD, m_rectHolder) )

Its just not clear to me how you mix CRhinoUI elements and CRhRdk elements. Are they meant to work together?

I tried adding the Section to the m_Resize ItemResizer but it didn’t do anything - again is it because ItemResizer only works with CRhinoUI elements?

Adam

Could you post a zip file with your entire source converted from the sample and I’ll take a look.

Sure thing.

[ I just grabbed the MarmaladeOptionsSection class to get a concrete derivation of the abstract class CRhRdkExpandingSection ]

I’ve also tagged the part of the code of interest with “FIXME”

SampleOptionsListCtrlSections.zip (31.9 KB)

Attached is the fixed project. There’s no problem using these controls together.

Here’s what you need to know:

  1. The width of an expanding section is determined by the holder. They must all be the same width.
  2. The height is determined either by the resource, or by GetDialogSize. If you want to resize the dialog during runtime, you need to call ReExpandSection on that section.
  3. The panel calls OnSize on the Tabbed Dialog. The tabbed dialog therefore must handle WM_SIZE to size its children - which includes the options list. This is going to get a little odd, because you first must figure out how high the options list is (which is a child) before you can set the dialog size - but this is possible. You will set the width of the options list to the width of the tabbed dialog.
  • Andy

Fixed.zip (33.8 KB)

Nice. Thanks Andy. I’ll see how I get on.

Just FYI, was there somewhere I could have found all this info without bothering you? ie did I miss something?

Adam