- long hButton = wButton*23/75;
- long wTotalButtons = wButton;
- if ( hasCancel )
- {
- wTotalButtons *= 2; // second button
- wTotalButtons += MARGIN_BETWEEN_BUTTONS; // margin between the 2
- }
-
- // listbox and stat line
- // ---------------------
-
- // make the listbox at least as tall as the message - otherwise it looks
- // ugly (the lower limit of 300 for the width is arbitrary OTOH)
- //
- // NB: we write "n + 2" because the horiz. scrollbar also takes some place
- long hListbox = wxMax((n + 2) * heightTextMax, hTotalMsg),
- wListbox = wxMax(300, wxMax(wTotalButtons, widthTextMax));
-
-#if wxUSE_STATLINE
- // arbitrary...
- long hStatLine = 5;
-#endif
-
- // now the complete dialog size
- // ----------------------------
-
- long hDialog = 2*LAYOUT_Y_MARGIN + // top margin
- hTotalMsg + // message
- 2*LAYOUT_Y_MARGIN + // margin between text and listbox
- hListbox + // listbox
-#if wxUSE_STATLINE
- LAYOUT_Y_MARGIN + // margin
- hStatLine + // separator line
-#endif
- 2*LAYOUT_Y_MARGIN + // margin between listbox and buttons
- hButton + // button(s)
- LAYOUT_Y_MARGIN; // bottom margin
-
- long wDialog = wxMax(wListbox, wxMax(wTotalButtons, widthTextMax)) +
- 4*LAYOUT_X_MARGIN; // 2 from each side
-
- // create the controls
- // -------------------
-
- // message
- wxStaticText *text;
- int y = 2*LAYOUT_Y_MARGIN;
- for ( size_t nLine = 0; nLine < nLineCount; nLine++ )
- {
- text = new wxStaticText(this, -1, lines[nLine],
- wxPoint(2*LAYOUT_X_MARGIN, y),
- wxSize(widthTextMax, heightTextMax));
- y += heightTextMax;
- }
-
- y += 2*LAYOUT_X_MARGIN;
-
- // listbox
- m_listbox = new wxListBox( this, wxID_LISTBOX,
- wxPoint(2*LAYOUT_X_MARGIN, y),
- wxSize(wListbox, hListbox),
- n, choices,
- wxLB_HSCROLL);
- y += hListbox;
-
- if ( clientData )