+ ::WinQueryWindowRect(HWND_DESKTOP, &vRect);
+ nYy = vRect.yTop - (nYy + nHeight);
+ }
+ ::WinSetWindowPos( GetHwnd()
+ ,HWND_TOP
+ ,(LONG)nXx
+ ,(LONG)nYy
+ ,(LONG)nWidth
+ ,(LONG)nHeight
+ ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+ );
+
+ //
+ // Now position all the buttons: the current button will be put at
+ // wxPoint(x_offset, y_offset) and the new row/column will start at
+ // startX/startY. The size of all buttons will be the same wxSize(maxWidth,
+ // maxHeight) except for the buttons in the last column which should extend
+ // to the right border of radiobox and thus can be wider than this.
+ //
+ // Also, remember that wxRA_SPECIFY_COLS means that we arrange buttons in
+ // left to right order and m_majorDim is the number of columns while
+ // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and
+ // m_majorDim is the number of rows.
+ //
+ nXOffset += nCx1;
+ nYOffset -= (nMaxHeight + ((3*nCy1)/2));
+
+ nStartX = nXOffset;
+ nStartY = nYOffset;
+
+ for (int i = 0; i < m_nNoItems; i++)
+ {
+ //
+ // The last button in the row may be wider than the other ones as the
+ // radiobox may be wider than the sum of the button widths (as it
+ // happens, for example, when the radiobox label is very long)
+ //
+ bool bIsLastInTheRow;
+
+ if (m_windowStyle & wxRA_SPECIFY_COLS)
+ {
+ //
+ // Item is the last in its row if it is a multiple of the number of
+ // columns or if it is just the last item
+ //
+ int n = i + 1;