- /** Version that works with wxArrayString and wxArrayInt. */
- void Set( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() )
- {
- Free();
- if ( &values )
- Add(labels,values);
- else
- Add(labels);
- }
-
- // Creates exclusive copy of current choices
- void SetExclusive()
- {
- if ( m_data->m_refCount != 1 )
- {
- wxPGChoicesData* data = new wxPGChoicesData();
- data->CopyDataFrom(m_data);
- Free();
- m_data = data;
- }
- }
-
- // Returns data, increases refcount.
- wxPGChoicesData* GetData()
- {
- wxASSERT( m_data->m_refCount != 0xFFFFFFF );
- m_data->m_refCount++;
- return m_data;
- }
-
- // Returns plain data ptr - no refcounting stuff is done.
- wxPGChoicesData* GetDataPtr() const { return m_data; }
-
- // Changes ownership of data to you.
- wxPGChoicesData* ExtractData()
- {
- wxPGChoicesData* data = m_data;
- m_data = wxPGChoicesEmptyData;
- return data;
- }