{
m_menus.Append( menu );
- wxString s = "";
- for ( const char *pc = title; *pc != '\0'; pc++ )
+ wxString s = _T("");
+ for ( const wxChar *pc = title; *pc != _T('\0'); pc++ )
{
- if (*pc == '&')
+ if (*pc == _T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
}
menu->SetTitle(s);
- menu->m_owner = gtk_menu_item_new_with_label( WXSTRINGCAST(s) );
+ menu->m_owner = gtk_menu_item_new_with_label( MBSTRINGCAST s.mbc_str() );
gtk_widget_show( menu->m_owner );
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::Check: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") );
item->Check(check);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, "wxMenuBar::IsChecked: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::Enable: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, "wxMenuBar::IsEnabled: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, "", "wxMenuBar::GetLabel: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::SetLabel: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") );
item->SetText( label );
}
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, "menu not found" );
+ wxCHECK_RET( node, _T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_MSG( node, "invalid", "menu not found" );
+ wxCHECK_MSG( node, _T("invalid"), _T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, "menu not found" );
+ wxCHECK_RET( node, _T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::SetHelpString: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, "", "wxMenuBar::GetHelpString: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString: no such item") );
return item->GetHelp();
}
return;
wxMenuItem* item = menu->FindItem( id );
- wxCHECK_RET( item, "error in menu item callback" );
+ wxCHECK_RET( item, _T("error in menu item callback") );
if (item->IsCheckable())
{
// it's valid for this function to be called even if m_menuItem == NULL
void wxMenuItem::SetName( const wxString& str )
{
- m_text = "";
- for ( const char *pc = str; *pc != '\0'; pc++ )
+ m_text = _T("");
+ for ( const wxChar *pc = str; *pc != _T('\0'); pc++ )
{
- if (*pc == '&')
+ if (*pc == _T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
- m_text << '_';
+ m_text << _T('_');
#endif
}
m_text << *pc;
if (m_menuItem)
{
GtkLabel *label = GTK_LABEL( GTK_BIN(m_menuItem)->child );
- gtk_label_set( label, m_text.c_str());
+ gtk_label_set( label, m_text.mbc_str());
}
}
void wxMenuItem::Check( bool check )
{
- wxCHECK_RET( m_menuItem, "invalid menu item" );
+ wxCHECK_RET( m_menuItem, _T("invalid menu item") );
- wxCHECK_RET( IsCheckable(), "Can't check uncheckable item!" )
+ wxCHECK_RET( IsCheckable(), _T("Can't check uncheckable item!") )
if (check == m_isChecked) return;
void wxMenuItem::Enable( bool enable )
{
- wxCHECK_RET( m_menuItem, "invalid menu item" );
+ wxCHECK_RET( m_menuItem, _T("invalid menu item") );
gtk_widget_set_sensitive( m_menuItem, enable );
m_isEnabled = enable;
bool wxMenuItem::IsChecked() const
{
- wxCHECK_MSG( m_menuItem, FALSE, "invalid menu item" );
+ wxCHECK_MSG( m_menuItem, FALSE, _T("invalid menu item") );
wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item!
m_eventHandler = this;
m_clientData = (void*) NULL;
- if (m_title.IsNull()) m_title = "";
- if (m_title != "")
+ if (m_title.IsNull()) m_title = _T("");
+ if (m_title != _T(""))
{
Append(-2, m_title);
AppendSeparator();
mitem->SetText(item);
mitem->SetHelp(helpStr);
mitem->SetCheckable(checkable);
- const char *text = mitem->GetText();
+ const wxChar *text = mitem->GetText();
#if (GTK_MINOR_VERSION > 0)
- char buf[100];
- strcpy( buf, "/" );
- strcat( buf, text );
+ wxChar buf[100];
+ wxStrcpy( buf, _T("/") );
+ wxStrcat( buf, text );
+ wxWX2MBbuf pbuf = wxConv_current->cWX2MB(buf);
GtkItemFactoryEntry entry;
- entry.path = buf;
+ entry.path = MBSTRINGCAST pbuf;
entry.accelerator = (gchar*) NULL;
entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
entry.callback_action = 0;
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString s = "<main>/";
- for ( const char *pc = text; *pc != '\0'; pc++ )
+ wxString s = _T("<main>/");
+ for ( const wxChar *pc = text; *pc != _T('\0'); pc++ )
{
- if (*pc == '_') pc++; /* skip it */
+ if (*pc == _T('_')) pc++; /* skip it */
s << *pc;
}
- GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s );
+ GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s.mbc_str() );
#else
mitem->SetText(text);
mitem->SetHelp(helpStr);
- GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText());
+ GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText().mbc_str());
mitem->SetMenuItem(menuItem);
mitem->SetSubMenu(subMenu);
if (item->IsSeparator())
menuItem = gtk_menu_item_new();
else if (item->IsSubMenu())
- menuItem = gtk_menu_item_new_with_label(item->GetText());
+ menuItem = gtk_menu_item_new_with_label(item->GetText().mbc_str());
else
- menuItem = item->IsCheckable() ? gtk_check_menu_item_new_with_label(item->GetText())
- : gtk_menu_item_new_with_label(item->GetText());
+ menuItem = item->IsCheckable() ? gtk_check_menu_item_new_with_label(item->GetText().mbc_str())
+ : gtk_menu_item_new_with_label(item->GetText().mbc_str());
if (!item->IsSeparator())
{
int wxMenu::FindItem( const wxString itemString ) const
{
- wxString s = "";
- for ( const char *pc = itemString; *pc != '\0'; pc++ )
+ wxString s = _T("");
+ for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ )
{
- if (*pc == '&')
+ if (*pc == _T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
- s << '_';
+ s << _T('_');
#endif
}
s << *pc;
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::Enable: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, "wxMenu::IsEnabled: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenu::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::Check: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::Check: no such item") );
item->Check(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, "wxMenu::IsChecked: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenu::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::SetLabel: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") );
item->SetText(label);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, "", "wxMenu::GetLabel: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenu::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::SetHelpString: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, "", "wxMenu::GetHelpString: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenu::GetHelpString: no such item") );
return item->GetHelp();
}
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
- wxASSERT_MSG( page->m_page, "Notebook page creation error" );
+ wxASSERT_MSG( page->m_page, _T("Notebook page creation error") );
parent->m_pages.Append( page );
}
int wxNotebook::GetSelection() const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
if (m_pages.Number() == 0) return -1;
node = node->Next();
}
- wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
+ wxCHECK_MSG( node != NULL, -1, _T("wxNotebook: no selection?") );
return page->m_id;
}
wxString wxNotebook::GetPageText( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
int wxNotebook::GetPageImage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, 0, _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
{
- wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*)NULL, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*)NULL, _T("invalid notebook") );
wxNotebookPage *nb_page = (wxNotebookPage *) NULL;
node = node->Next();
}
- wxFAIL_MSG( "Notebook page not found!" );
+ wxFAIL_MSG( _T("Notebook page not found!") );
return (wxNotebookPage *) NULL;
}
int wxNotebook::SetSelection( int page )
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
int selOld = GetSelection();
wxNotebookPage* nb_page = GetNotebookPage(page);
void wxNotebook::AdvanceSelection( bool bForward )
{
- wxCHECK_RET( m_widget != NULL, "invalid notebook" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid notebook") );
int sel = GetSelection();
int max = GetPageCount();
bool wxNotebook::SetPageText( int page, const wxString &text )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
nb_page->m_text = text;
- if (nb_page->m_text.IsEmpty()) nb_page->m_text = "";
+ if (nb_page->m_text.IsEmpty()) nb_page->m_text = _T("");
- gtk_label_set(nb_page->m_label, nb_page->m_text);
+ gtk_label_set(nb_page->m_label, nb_page->m_text.mbc_str());
return TRUE;
}
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{
- wxFAIL_MSG( "wxNotebook::SetPageSize not implemented" );
+ wxFAIL_MSG( _T("wxNotebook::SetPageSize not implemented") );
}
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{
- wxFAIL_MSG( "wxNotebook::SetPadding not implemented" );
+ wxFAIL_MSG( _T("wxNotebook::SetPadding not implemented") );
}
void wxNotebook::SetTabSize(const wxSize& sz)
{
- wxFAIL_MSG( "wxNotebook::SetTabSize not implemented" );
+ wxFAIL_MSG( _T("wxNotebook::SetTabSize not implemented") );
}
bool wxNotebook::DeleteAllPages()
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
wxNode *page_node = m_pages.First();
while (page_node)
child = child->next;
}
- wxCHECK_MSG( child != NULL, FALSE, "illegal notebook index" );
+ wxCHECK_MSG( child != NULL, FALSE, _T("illegal notebook index") );
delete nb_page->m_client;
child = child->next;
}
- wxCHECK_MSG( child != NULL, FALSE, "illegal notebook index" );
+ wxCHECK_MSG( child != NULL, FALSE, _T("illegal notebook index") );
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page_num );
bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
bool select, int imageId)
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
/* we've created the notebook page in AddChild(). Now we just have to set
the caption for the page and set the others parameters. */
}
wxCHECK_MSG( page != NULL, FALSE,
- "Can't add a page whose parent is not the notebook!" );
+ _T("Can't add a page whose parent is not the notebook!") );
wxCHECK_MSG( page->Add(), FALSE,
- "Can't add the same page twice to a notebook." );
+ _T("Can't add the same page twice to a notebook.") );
if (imageId != -1)
{
/* then set the attributes */
page->m_text = text;
- if (page->m_text.IsEmpty()) page->m_text = "";
+ if (page->m_text.IsEmpty()) page->m_text = _T("");
page->m_image = imageId;
- page->m_label = (GtkLabel *)gtk_label_new(page->m_text);
+ page->m_label = (GtkLabel *)gtk_label_new(page->m_text.mbc_str());
gtk_box_pack_end( GTK_BOX(page->m_box), (GtkWidget *)page->m_label, FALSE, FALSE, 3);
/* @@@: what does this do? do we still need it?
wxWindow *wxNotebook::GetPage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (!nb_page)
const unsigned char *WXUNUSED(green),
const unsigned char *WXUNUSED(blue) )
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return FALSE;
}
const unsigned char WXUNUSED(green),
const unsigned char WXUNUSED(blue) ) const
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return 0;
}
unsigned char *WXUNUSED(green),
unsigned char *WXUNUSED(blue) ) const
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return 0;
}
int wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_capStyle;
}
int wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_joinStyle;
}
int wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, "invalid pen" );
+ wxCHECK_MSG( Ok(), wxNullColour, _T("invalid pen") );
return M_PENDATA->m_colour;
}
SetValidator( validator );
- m_widget = gtk_frame_new( title );
+ m_widget = gtk_frame_new( title.mbc_str() );
m_majorDim = majorDim;
{
if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) );
- m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) );
+ m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i].mbc_str() ) );
m_boxes.Append( (wxObject*) m_radio );
bool wxRadioBox::Show( bool show )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
wxWindow::Show( show );
int wxRadioBox::FindString( const wxString &s ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
int count = 0;
void wxRadioBox::SetFocus()
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
if (m_boxes.GetCount() == 0) return;
void wxRadioBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
int wxRadioBox::GetSelection(void) const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
int count = 0;
node = node->Next();
}
- wxFAIL_MSG( "wxRadioBox none selected" );
+ wxFAIL_MSG( _T("wxRadioBox none selected") );
return -1;
}
wxString wxRadioBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_MSG( node, "", "radiobox wrong index" );
+ wxCHECK_MSG( node, _T(""), _T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *label = GTK_LABEL( button->child );
wxString wxRadioBox::GetLabel( int item ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
return GetString( item );
}
void wxRadioBox::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxControl::SetLabel( label );
- gtk_frame_set_label( GTK_FRAME(m_widget), wxControl::GetLabel() );
+ gtk_frame_set_label( GTK_FRAME(m_widget), wxControl::GetLabel().mbc_str() );
}
void wxRadioBox::SetLabel( int item, const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *g_label = GTK_LABEL( button->child );
- gtk_label_set( g_label, label );
+ gtk_label_set( g_label, label.mbc_str() );
}
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
{
- wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
+ wxFAIL_MSG(_T("wxRadioBox::SetLabel not implemented."));
}
void wxRadioBox::Enable( bool enable )
void wxRadioBox::Enable( int item, bool enable )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkWidget *label = button->child;
void wxRadioBox::Show( int item, bool show )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkWidget *button = GTK_WIDGET( node->Data() );
wxString wxRadioBox::GetStringSelection(void) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
wxNode *node = m_boxes.First();
while (node)
node = node->Next();
}
- wxFAIL_MSG( "wxRadioBox none selected" );
- return "";
+ wxFAIL_MSG( _T("wxRadioBox none selected") );
+ return _T("");
}
bool wxRadioBox::SetStringSelection( const wxString &s )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
int res = FindString( s );
if (res == -1) return FALSE;
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
{
- wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
+ wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
}
void wxRadioBox::ApplyWidgetStyle()
SetValidator( validator );
- m_widget = gtk_radio_button_new_with_label( (GSList *) NULL, label );
+ m_widget = gtk_radio_button_new_with_label( (GSList *) NULL, label.mbc_str() );
m_theOtherRadioButtton =
gtk_radio_button_new_with_label(
m_blockFirstEvent = FALSE;
- if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label );
+ if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label.mbc_str() );
if (newSize.y == -1) newSize.y = 26;
SetSize( newSize.x, newSize.y );
void wxRadioButton::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
wxControl::SetLabel( label );
GtkButton *bin = GTK_BUTTON( m_widget );
GtkLabel *g_label = GTK_LABEL( bin->child );
- gtk_label_set( g_label, GetLabel() );
+ gtk_label_set( g_label, GetLabel().mbc_str() );
}
void wxRadioButton::SetValue( bool val )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
if ( val == GetValue() )
return;
bool wxRadioButton::GetValue(void) const
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid radiobutton" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") );
return GTK_TOGGLE_BUTTON(m_widget)->active;
}
void wxRadioButton::Enable( bool enable )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
wxControl::Enable( enable );
gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
-
-
case wxSYS_VSCROLL_X: return 15;
}
- wxCHECK_MSG( index, 0, "wxSystemSettings::GetSystemMetric not fully implemented" );
+ wxCHECK_MSG( index, 0, _T("wxSystemSettings::GetSystemMetric not fully implemented") );
return 0;
}
{
m_menus.Append( menu );
- wxString s = "";
- for ( const char *pc = title; *pc != '\0'; pc++ )
+ wxString s = _T("");
+ for ( const wxChar *pc = title; *pc != _T('\0'); pc++ )
{
- if (*pc == '&')
+ if (*pc == _T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
}
menu->SetTitle(s);
- menu->m_owner = gtk_menu_item_new_with_label( WXSTRINGCAST(s) );
+ menu->m_owner = gtk_menu_item_new_with_label( MBSTRINGCAST s.mbc_str() );
gtk_widget_show( menu->m_owner );
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::Check: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") );
item->Check(check);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, "wxMenuBar::IsChecked: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::Enable: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, "wxMenuBar::IsEnabled: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, "", "wxMenuBar::GetLabel: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::SetLabel: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") );
item->SetText( label );
}
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, "menu not found" );
+ wxCHECK_RET( node, _T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_MSG( node, "invalid", "menu not found" );
+ wxCHECK_MSG( node, _T("invalid"), _T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, "menu not found" );
+ wxCHECK_RET( node, _T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, "wxMenuBar::SetHelpString: no such item" );
+ wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, "", "wxMenuBar::GetHelpString: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString: no such item") );
return item->GetHelp();
}
return;
wxMenuItem* item = menu->FindItem( id );
- wxCHECK_RET( item, "error in menu item callback" );
+ wxCHECK_RET( item, _T("error in menu item callback") );
if (item->IsCheckable())
{
// it's valid for this function to be called even if m_menuItem == NULL
void wxMenuItem::SetName( const wxString& str )
{
- m_text = "";
- for ( const char *pc = str; *pc != '\0'; pc++ )
+ m_text = _T("");
+ for ( const wxChar *pc = str; *pc != _T('\0'); pc++ )
{
- if (*pc == '&')
+ if (*pc == _T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
- m_text << '_';
+ m_text << _T('_');
#endif
}
m_text << *pc;
if (m_menuItem)
{
GtkLabel *label = GTK_LABEL( GTK_BIN(m_menuItem)->child );
- gtk_label_set( label, m_text.c_str());
+ gtk_label_set( label, m_text.mbc_str());
}
}
void wxMenuItem::Check( bool check )
{
- wxCHECK_RET( m_menuItem, "invalid menu item" );
+ wxCHECK_RET( m_menuItem, _T("invalid menu item") );
- wxCHECK_RET( IsCheckable(), "Can't check uncheckable item!" )
+ wxCHECK_RET( IsCheckable(), _T("Can't check uncheckable item!") )
if (check == m_isChecked) return;
void wxMenuItem::Enable( bool enable )
{
- wxCHECK_RET( m_menuItem, "invalid menu item" );
+ wxCHECK_RET( m_menuItem, _T("invalid menu item") );
gtk_widget_set_sensitive( m_menuItem, enable );
m_isEnabled = enable;
bool wxMenuItem::IsChecked() const
{
- wxCHECK_MSG( m_menuItem, FALSE, "invalid menu item" );
+ wxCHECK_MSG( m_menuItem, FALSE, _T("invalid menu item") );
wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item!
m_eventHandler = this;
m_clientData = (void*) NULL;
- if (m_title.IsNull()) m_title = "";
- if (m_title != "")
+ if (m_title.IsNull()) m_title = _T("");
+ if (m_title != _T(""))
{
Append(-2, m_title);
AppendSeparator();
mitem->SetText(item);
mitem->SetHelp(helpStr);
mitem->SetCheckable(checkable);
- const char *text = mitem->GetText();
+ const wxChar *text = mitem->GetText();
#if (GTK_MINOR_VERSION > 0)
- char buf[100];
- strcpy( buf, "/" );
- strcat( buf, text );
+ wxChar buf[100];
+ wxStrcpy( buf, _T("/") );
+ wxStrcat( buf, text );
+ wxWX2MBbuf pbuf = wxConv_current->cWX2MB(buf);
GtkItemFactoryEntry entry;
- entry.path = buf;
+ entry.path = MBSTRINGCAST pbuf;
entry.accelerator = (gchar*) NULL;
entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
entry.callback_action = 0;
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString s = "<main>/";
- for ( const char *pc = text; *pc != '\0'; pc++ )
+ wxString s = _T("<main>/");
+ for ( const wxChar *pc = text; *pc != _T('\0'); pc++ )
{
- if (*pc == '_') pc++; /* skip it */
+ if (*pc == _T('_')) pc++; /* skip it */
s << *pc;
}
- GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s );
+ GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s.mbc_str() );
#else
mitem->SetText(text);
mitem->SetHelp(helpStr);
- GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText());
+ GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText().mbc_str());
mitem->SetMenuItem(menuItem);
mitem->SetSubMenu(subMenu);
if (item->IsSeparator())
menuItem = gtk_menu_item_new();
else if (item->IsSubMenu())
- menuItem = gtk_menu_item_new_with_label(item->GetText());
+ menuItem = gtk_menu_item_new_with_label(item->GetText().mbc_str());
else
- menuItem = item->IsCheckable() ? gtk_check_menu_item_new_with_label(item->GetText())
- : gtk_menu_item_new_with_label(item->GetText());
+ menuItem = item->IsCheckable() ? gtk_check_menu_item_new_with_label(item->GetText().mbc_str())
+ : gtk_menu_item_new_with_label(item->GetText().mbc_str());
if (!item->IsSeparator())
{
int wxMenu::FindItem( const wxString itemString ) const
{
- wxString s = "";
- for ( const char *pc = itemString; *pc != '\0'; pc++ )
+ wxString s = _T("");
+ for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ )
{
- if (*pc == '&')
+ if (*pc == _T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
- s << '_';
+ s << _T('_');
#endif
}
s << *pc;
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::Enable: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, "wxMenu::IsEnabled: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenu::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::Check: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::Check: no such item") );
item->Check(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, "wxMenu::IsChecked: no such item" );
+ wxCHECK_MSG( item, FALSE, _T("wxMenu::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::SetLabel: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") );
item->SetText(label);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, "", "wxMenu::GetLabel: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenu::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, "wxMenu::SetHelpString: no such item" );
+ wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, "", "wxMenu::GetHelpString: no such item" );
+ wxCHECK_MSG( item, _T(""), _T("wxMenu::GetHelpString: no such item") );
return item->GetHelp();
}
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
- wxASSERT_MSG( page->m_page, "Notebook page creation error" );
+ wxASSERT_MSG( page->m_page, _T("Notebook page creation error") );
parent->m_pages.Append( page );
}
int wxNotebook::GetSelection() const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
if (m_pages.Number() == 0) return -1;
node = node->Next();
}
- wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
+ wxCHECK_MSG( node != NULL, -1, _T("wxNotebook: no selection?") );
return page->m_id;
}
wxString wxNotebook::GetPageText( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
int wxNotebook::GetPageImage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, 0, _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
{
- wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*)NULL, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*)NULL, _T("invalid notebook") );
wxNotebookPage *nb_page = (wxNotebookPage *) NULL;
node = node->Next();
}
- wxFAIL_MSG( "Notebook page not found!" );
+ wxFAIL_MSG( _T("Notebook page not found!") );
return (wxNotebookPage *) NULL;
}
int wxNotebook::SetSelection( int page )
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
int selOld = GetSelection();
wxNotebookPage* nb_page = GetNotebookPage(page);
void wxNotebook::AdvanceSelection( bool bForward )
{
- wxCHECK_RET( m_widget != NULL, "invalid notebook" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid notebook") );
int sel = GetSelection();
int max = GetPageCount();
bool wxNotebook::SetPageText( int page, const wxString &text )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
nb_page->m_text = text;
- if (nb_page->m_text.IsEmpty()) nb_page->m_text = "";
+ if (nb_page->m_text.IsEmpty()) nb_page->m_text = _T("");
- gtk_label_set(nb_page->m_label, nb_page->m_text);
+ gtk_label_set(nb_page->m_label, nb_page->m_text.mbc_str());
return TRUE;
}
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{
- wxFAIL_MSG( "wxNotebook::SetPageSize not implemented" );
+ wxFAIL_MSG( _T("wxNotebook::SetPageSize not implemented") );
}
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{
- wxFAIL_MSG( "wxNotebook::SetPadding not implemented" );
+ wxFAIL_MSG( _T("wxNotebook::SetPadding not implemented") );
}
void wxNotebook::SetTabSize(const wxSize& sz)
{
- wxFAIL_MSG( "wxNotebook::SetTabSize not implemented" );
+ wxFAIL_MSG( _T("wxNotebook::SetTabSize not implemented") );
}
bool wxNotebook::DeleteAllPages()
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
wxNode *page_node = m_pages.First();
while (page_node)
child = child->next;
}
- wxCHECK_MSG( child != NULL, FALSE, "illegal notebook index" );
+ wxCHECK_MSG( child != NULL, FALSE, _T("illegal notebook index") );
delete nb_page->m_client;
child = child->next;
}
- wxCHECK_MSG( child != NULL, FALSE, "illegal notebook index" );
+ wxCHECK_MSG( child != NULL, FALSE, _T("illegal notebook index") );
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page_num );
bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
bool select, int imageId)
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
/* we've created the notebook page in AddChild(). Now we just have to set
the caption for the page and set the others parameters. */
}
wxCHECK_MSG( page != NULL, FALSE,
- "Can't add a page whose parent is not the notebook!" );
+ _T("Can't add a page whose parent is not the notebook!") );
wxCHECK_MSG( page->Add(), FALSE,
- "Can't add the same page twice to a notebook." );
+ _T("Can't add the same page twice to a notebook.") );
if (imageId != -1)
{
/* then set the attributes */
page->m_text = text;
- if (page->m_text.IsEmpty()) page->m_text = "";
+ if (page->m_text.IsEmpty()) page->m_text = _T("");
page->m_image = imageId;
- page->m_label = (GtkLabel *)gtk_label_new(page->m_text);
+ page->m_label = (GtkLabel *)gtk_label_new(page->m_text.mbc_str());
gtk_box_pack_end( GTK_BOX(page->m_box), (GtkWidget *)page->m_label, FALSE, FALSE, 3);
/* @@@: what does this do? do we still need it?
wxWindow *wxNotebook::GetPage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, "invalid notebook" );
+ wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, _T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (!nb_page)
const unsigned char *WXUNUSED(green),
const unsigned char *WXUNUSED(blue) )
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return FALSE;
}
const unsigned char WXUNUSED(green),
const unsigned char WXUNUSED(blue) ) const
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return 0;
}
unsigned char *WXUNUSED(green),
unsigned char *WXUNUSED(blue) ) const
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return 0;
}
int wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_capStyle;
}
int wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_joinStyle;
}
int wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, "invalid pen" );
+ wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, "invalid pen" );
+ wxCHECK_MSG( Ok(), wxNullColour, _T("invalid pen") );
return M_PENDATA->m_colour;
}
SetValidator( validator );
- m_widget = gtk_frame_new( title );
+ m_widget = gtk_frame_new( title.mbc_str() );
m_majorDim = majorDim;
{
if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) );
- m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) );
+ m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i].mbc_str() ) );
m_boxes.Append( (wxObject*) m_radio );
bool wxRadioBox::Show( bool show )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
wxWindow::Show( show );
int wxRadioBox::FindString( const wxString &s ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
int count = 0;
void wxRadioBox::SetFocus()
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
if (m_boxes.GetCount() == 0) return;
void wxRadioBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
int wxRadioBox::GetSelection(void) const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
int count = 0;
node = node->Next();
}
- wxFAIL_MSG( "wxRadioBox none selected" );
+ wxFAIL_MSG( _T("wxRadioBox none selected") );
return -1;
}
wxString wxRadioBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_MSG( node, "", "radiobox wrong index" );
+ wxCHECK_MSG( node, _T(""), _T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *label = GTK_LABEL( button->child );
wxString wxRadioBox::GetLabel( int item ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
return GetString( item );
}
void wxRadioBox::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxControl::SetLabel( label );
- gtk_frame_set_label( GTK_FRAME(m_widget), wxControl::GetLabel() );
+ gtk_frame_set_label( GTK_FRAME(m_widget), wxControl::GetLabel().mbc_str() );
}
void wxRadioBox::SetLabel( int item, const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *g_label = GTK_LABEL( button->child );
- gtk_label_set( g_label, label );
+ gtk_label_set( g_label, label.mbc_str() );
}
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
{
- wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
+ wxFAIL_MSG(_T("wxRadioBox::SetLabel not implemented."));
}
void wxRadioBox::Enable( bool enable )
void wxRadioBox::Enable( int item, bool enable )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkWidget *label = button->child;
void wxRadioBox::Show( int item, bool show )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, "radiobox wrong index" );
+ wxCHECK_RET( node, _T("radiobox wrong index") );
GtkWidget *button = GTK_WIDGET( node->Data() );
wxString wxRadioBox::GetStringSelection(void) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
wxNode *node = m_boxes.First();
while (node)
node = node->Next();
}
- wxFAIL_MSG( "wxRadioBox none selected" );
- return "";
+ wxFAIL_MSG( _T("wxRadioBox none selected") );
+ return _T("");
}
bool wxRadioBox::SetStringSelection( const wxString &s )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid radiobox" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
int res = FindString( s );
if (res == -1) return FALSE;
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
{
- wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
+ wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
}
void wxRadioBox::ApplyWidgetStyle()
SetValidator( validator );
- m_widget = gtk_radio_button_new_with_label( (GSList *) NULL, label );
+ m_widget = gtk_radio_button_new_with_label( (GSList *) NULL, label.mbc_str() );
m_theOtherRadioButtton =
gtk_radio_button_new_with_label(
m_blockFirstEvent = FALSE;
- if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label );
+ if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label.mbc_str() );
if (newSize.y == -1) newSize.y = 26;
SetSize( newSize.x, newSize.y );
void wxRadioButton::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
wxControl::SetLabel( label );
GtkButton *bin = GTK_BUTTON( m_widget );
GtkLabel *g_label = GTK_LABEL( bin->child );
- gtk_label_set( g_label, GetLabel() );
+ gtk_label_set( g_label, GetLabel().mbc_str() );
}
void wxRadioButton::SetValue( bool val )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
if ( val == GetValue() )
return;
bool wxRadioButton::GetValue(void) const
{
- wxCHECK_MSG( m_widget != NULL, FALSE, "invalid radiobutton" );
+ wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") );
return GTK_TOGGLE_BUTTON(m_widget)->active;
}
void wxRadioButton::Enable( bool enable )
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
wxControl::Enable( enable );
gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
-
-
case wxSYS_VSCROLL_X: return 15;
}
- wxCHECK_MSG( index, 0, "wxSystemSettings::GetSystemMetric not fully implemented" );
+ wxCHECK_MSG( index, 0, _T("wxSystemSettings::GetSystemMetric not fully implemented") );
return 0;
}