+ // initialize members
+ SetMajorDim(majorDim == 0 ? n : majorDim, style);
+
+ if ( GetMajorDim() == 0 || n == 0 )
+ return false;
+
+ // subtype of the native palmOS radio: checkbox or push button?
+ const bool use_checkbox = style & wxRA_USE_CHECKBOX;
+ const bool use_cols = style & wxRA_SPECIFY_COLS;
+
+ // get default size and position for the initial placement
+ m_size = size;
+ m_pos = pos;
+ int minor = n / GetMajorDim();
+ if(n % GetMajorDim() > 0)
+ minor++;
+ if(m_size.x==wxDefaultCoord)
+ m_size.x=36*(use_cols?GetMajorDim():minor);
+ if(m_size.y==wxDefaultCoord)
+ m_size.y=12*(use_cols?minor:GetMajorDim());
+ if(m_pos.x==wxDefaultCoord)
+ m_pos.x=0;
+ if(m_pos.y==wxDefaultCoord)
+ m_pos.y=0;
+
+ m_label = title;
+
+ if(!wxControl::Create(parent, id, m_pos, m_size, style, val, name))
+ return false;
+
+ int i = 0;
+ for ( int j = 0; j < minor; j++ )
+ {
+ for ( int k = 0; k < GetMajorDim(); k++ )
+ {
+ if(i<n)
+ {
+ wxPoint start, end;
+ start.x = (use_cols ? (k*m_size.x)/GetMajorDim() : (j*m_size.x)/minor);
+ start.y = (use_cols ? (j*m_size.y)/minor : (k*m_size.y)/GetMajorDim());
+ end.x = (use_cols ? ((k+1)*m_size.x)/GetMajorDim() : ((j+1)*m_size.x)/minor);
+ end.y = (use_cols ? ((j+1)*m_size.y)/minor : ((k+1)*m_size.y)/GetMajorDim());
+ wxRadioButton* rb = new wxRadioButton();
+ rb->SetGroup( id );
+ rb->Create(
+ this,
+ wxID_ANY,
+ choices[i],
+ start,
+ wxSize(end.x-start.x-1,end.y-start.y-1),
+ ( n == 0 ? wxRB_GROUP : 0 ) |
+ use_checkbox ? wxRB_USE_CHECKBOX : 0
+ );
+ m_radios.Put(i,rb);
+ i++;
+ }
+ }
+ }