So far so good. These now compiles in Unicode mode.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
105
src/gtk/menu.cpp
105
src/gtk/menu.cpp
@@ -73,10 +73,10 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
||||
{
|
||||
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)
|
||||
@@ -87,7 +87,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
||||
}
|
||||
|
||||
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 );
|
||||
|
||||
@@ -178,7 +178,7 @@ void wxMenuBar::Check( int id, bool check )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::Check: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") );
|
||||
|
||||
item->Check(check);
|
||||
}
|
||||
@@ -187,7 +187,7 @@ bool wxMenuBar::IsChecked( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void wxMenuBar::Enable( int id, bool enable )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::Enable: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") );
|
||||
|
||||
item->Enable(enable);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ bool wxMenuBar::IsEnabled( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -214,7 +214,7 @@ wxString wxMenuBar::GetLabel( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -223,7 +223,7 @@ void wxMenuBar::SetLabel( int id, const wxString &label )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::SetLabel: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") );
|
||||
|
||||
item->SetText( label );
|
||||
}
|
||||
@@ -232,7 +232,7 @@ void wxMenuBar::EnableTop( int pos, bool flag )
|
||||
{
|
||||
wxNode *node = m_menus.Nth( pos );
|
||||
|
||||
wxCHECK_RET( node, "menu not found" );
|
||||
wxCHECK_RET( node, _T("menu not found") );
|
||||
|
||||
wxMenu* menu = (wxMenu*)node->Data();
|
||||
|
||||
@@ -244,7 +244,7 @@ wxString wxMenuBar::GetLabelTop( int pos ) const
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -255,7 +255,7 @@ void wxMenuBar::SetLabelTop( int pos, const wxString& 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();
|
||||
|
||||
@@ -266,7 +266,7 @@ void wxMenuBar::SetHelpString( int id, const wxString& helpString )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::SetHelpString: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") );
|
||||
|
||||
item->SetHelp( helpString );
|
||||
}
|
||||
@@ -275,7 +275,7 @@ wxString wxMenuBar::GetHelpString( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -295,7 +295,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
|
||||
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())
|
||||
{
|
||||
@@ -404,14 +404,14 @@ wxMenuItem::wxMenuItem()
|
||||
// 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;
|
||||
@@ -420,15 +420,15 @@ void wxMenuItem::SetName( const wxString& str )
|
||||
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;
|
||||
|
||||
@@ -438,7 +438,7 @@ void wxMenuItem::Check( bool check )
|
||||
|
||||
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;
|
||||
@@ -446,7 +446,7 @@ void wxMenuItem::Enable( bool 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!
|
||||
|
||||
@@ -479,8 +479,8 @@ wxMenu::wxMenu( const wxString& title, const wxFunction func )
|
||||
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();
|
||||
@@ -525,15 +525,16 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
||||
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;
|
||||
@@ -545,14 +546,14 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
||||
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
|
||||
|
||||
@@ -588,7 +589,7 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri
|
||||
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);
|
||||
|
||||
@@ -615,10 +616,10 @@ void wxMenu::Append( wxMenuItem *item )
|
||||
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())
|
||||
{
|
||||
@@ -645,14 +646,14 @@ void wxMenu::Append( wxMenuItem *item )
|
||||
|
||||
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;
|
||||
@@ -676,7 +677,7 @@ void wxMenu::Enable( int id, bool enable )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::Enable: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::Enable: no such item") );
|
||||
|
||||
item->Enable(enable);
|
||||
}
|
||||
@@ -685,7 +686,7 @@ bool wxMenu::IsEnabled( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -694,7 +695,7 @@ void wxMenu::Check( int id, bool enable )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::Check: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::Check: no such item") );
|
||||
|
||||
item->Check(enable);
|
||||
}
|
||||
@@ -703,7 +704,7 @@ bool wxMenu::IsChecked( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -712,7 +713,7 @@ void wxMenu::SetLabel( int id, const wxString &label )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::SetLabel: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") );
|
||||
|
||||
item->SetText(label);
|
||||
}
|
||||
@@ -721,7 +722,7 @@ wxString wxMenu::GetLabel( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -730,7 +731,7 @@ void wxMenu::SetHelpString( int id, const wxString& helpString )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::SetHelpString: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") );
|
||||
|
||||
item->SetHelp( helpString );
|
||||
}
|
||||
@@ -739,7 +740,7 @@ wxString wxMenu::GetHelpString( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
@@ -177,7 +177,7 @@ static void wxInsertChildInNotebook( wxNotebook* parent, wxWindow* child )
|
||||
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 );
|
||||
}
|
||||
@@ -256,7 +256,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
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;
|
||||
|
||||
@@ -281,7 +281,7 @@ int wxNotebook::GetSelection() const
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
|
||||
wxCHECK_MSG( node != NULL, -1, _T("wxNotebook: no selection?") );
|
||||
|
||||
return page->m_id;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ int wxNotebook::GetRowCount() const
|
||||
|
||||
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)
|
||||
@@ -321,7 +321,7 @@ wxString wxNotebook::GetPageText( int page ) const
|
||||
|
||||
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)
|
||||
@@ -332,7 +332,7 @@ int wxNotebook::GetPageImage( int page ) const
|
||||
|
||||
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;
|
||||
|
||||
@@ -345,14 +345,14 @@ wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
|
||||
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);
|
||||
@@ -377,7 +377,7 @@ int wxNotebook::SetSelection( int 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();
|
||||
@@ -395,7 +395,7 @@ void wxNotebook::SetImageList( wxImageList* imageList )
|
||||
|
||||
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);
|
||||
|
||||
@@ -403,9 +403,9 @@ bool wxNotebook::SetPageText( int page, const wxString &text )
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -497,22 +497,22 @@ bool wxNotebook::SetPageImage( int page, int image )
|
||||
|
||||
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)
|
||||
@@ -541,7 +541,7 @@ bool wxNotebook::DeletePage( int page )
|
||||
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;
|
||||
|
||||
@@ -564,7 +564,7 @@ bool wxNotebook::RemovePage( int page )
|
||||
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 );
|
||||
|
||||
@@ -576,7 +576,7 @@ bool wxNotebook::RemovePage( int page )
|
||||
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. */
|
||||
@@ -592,10 +592,10 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -618,9 +618,9 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
|
||||
|
||||
/* 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?
|
||||
@@ -643,7 +643,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
|
||||
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)
|
||||
|
@@ -93,7 +93,7 @@ bool wxPalette::Create( int WXUNUSED(n),
|
||||
const unsigned char *WXUNUSED(green),
|
||||
const unsigned char *WXUNUSED(blue) )
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ int wxPalette::GetPixel( const unsigned char WXUNUSED(red),
|
||||
const unsigned char WXUNUSED(green),
|
||||
const unsigned char WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ bool wxPalette::GetRGB( int WXUNUSED(pixel),
|
||||
unsigned char *WXUNUSED(green),
|
||||
unsigned char *WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -138,35 +138,35 @@ void wxPen::SetWidth( int width )
|
||||
|
||||
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;
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
SetValidator( validator );
|
||||
|
||||
m_widget = gtk_frame_new( title );
|
||||
m_widget = gtk_frame_new( title.mbc_str() );
|
||||
|
||||
m_majorDim = majorDim;
|
||||
|
||||
@@ -88,7 +88,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
{
|
||||
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 );
|
||||
|
||||
@@ -236,7 +236,7 @@ wxSize wxRadioBox::LayoutItems()
|
||||
|
||||
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 );
|
||||
|
||||
@@ -255,7 +255,7 @@ bool wxRadioBox::Show( bool 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;
|
||||
|
||||
@@ -276,7 +276,7 @@ int wxRadioBox::FindString( const wxString &s ) const
|
||||
|
||||
void wxRadioBox::SetFocus()
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
|
||||
wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
|
||||
|
||||
if (m_boxes.GetCount() == 0) return;
|
||||
|
||||
@@ -297,11 +297,11 @@ void wxRadioBox::SetFocus()
|
||||
|
||||
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() );
|
||||
|
||||
@@ -310,7 +310,7 @@ void wxRadioBox::SetSelection( int n )
|
||||
|
||||
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;
|
||||
|
||||
@@ -323,18 +323,18 @@ int wxRadioBox::GetSelection(void) const
|
||||
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 );
|
||||
@@ -344,37 +344,37 @@ wxString wxRadioBox::GetString( int n ) const
|
||||
|
||||
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 )
|
||||
@@ -394,11 +394,11 @@ 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;
|
||||
@@ -408,11 +408,11 @@ void wxRadioBox::Enable( int item, bool enable )
|
||||
|
||||
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() );
|
||||
|
||||
@@ -424,7 +424,7 @@ void wxRadioBox::Show( int item, bool show )
|
||||
|
||||
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)
|
||||
@@ -438,13 +438,13 @@ wxString wxRadioBox::GetStringSelection(void) const
|
||||
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;
|
||||
@@ -465,7 +465,7 @@ int wxRadioBox::GetNumberOfRowsOrCols(void) const
|
||||
|
||||
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
|
||||
wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
|
||||
}
|
||||
|
||||
void wxRadioBox::ApplyWidgetStyle()
|
||||
|
@@ -64,7 +64,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
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(
|
||||
@@ -75,7 +75,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
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 );
|
||||
|
||||
@@ -99,17 +99,17 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
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;
|
||||
@@ -124,14 +124,14 @@ void wxRadioButton::SetValue( bool val )
|
||||
|
||||
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 );
|
||||
|
||||
@@ -144,5 +144,3 @@ void wxRadioButton::ApplyWidgetStyle()
|
||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -190,7 +190,7 @@ int wxSystemSettings::GetSystemMetric( int index )
|
||||
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;
|
||||
}
|
||||
|
@@ -73,10 +73,10 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
||||
{
|
||||
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)
|
||||
@@ -87,7 +87,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
||||
}
|
||||
|
||||
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 );
|
||||
|
||||
@@ -178,7 +178,7 @@ void wxMenuBar::Check( int id, bool check )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::Check: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") );
|
||||
|
||||
item->Check(check);
|
||||
}
|
||||
@@ -187,7 +187,7 @@ bool wxMenuBar::IsChecked( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void wxMenuBar::Enable( int id, bool enable )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::Enable: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") );
|
||||
|
||||
item->Enable(enable);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ bool wxMenuBar::IsEnabled( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -214,7 +214,7 @@ wxString wxMenuBar::GetLabel( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -223,7 +223,7 @@ void wxMenuBar::SetLabel( int id, const wxString &label )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::SetLabel: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") );
|
||||
|
||||
item->SetText( label );
|
||||
}
|
||||
@@ -232,7 +232,7 @@ void wxMenuBar::EnableTop( int pos, bool flag )
|
||||
{
|
||||
wxNode *node = m_menus.Nth( pos );
|
||||
|
||||
wxCHECK_RET( node, "menu not found" );
|
||||
wxCHECK_RET( node, _T("menu not found") );
|
||||
|
||||
wxMenu* menu = (wxMenu*)node->Data();
|
||||
|
||||
@@ -244,7 +244,7 @@ wxString wxMenuBar::GetLabelTop( int pos ) const
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -255,7 +255,7 @@ void wxMenuBar::SetLabelTop( int pos, const wxString& 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();
|
||||
|
||||
@@ -266,7 +266,7 @@ void wxMenuBar::SetHelpString( int id, const wxString& helpString )
|
||||
{
|
||||
wxMenuItem* item = FindMenuItemById( id );
|
||||
|
||||
wxCHECK_RET( item, "wxMenuBar::SetHelpString: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") );
|
||||
|
||||
item->SetHelp( helpString );
|
||||
}
|
||||
@@ -275,7 +275,7 @@ wxString wxMenuBar::GetHelpString( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -295,7 +295,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
|
||||
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())
|
||||
{
|
||||
@@ -404,14 +404,14 @@ wxMenuItem::wxMenuItem()
|
||||
// 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;
|
||||
@@ -420,15 +420,15 @@ void wxMenuItem::SetName( const wxString& str )
|
||||
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;
|
||||
|
||||
@@ -438,7 +438,7 @@ void wxMenuItem::Check( bool check )
|
||||
|
||||
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;
|
||||
@@ -446,7 +446,7 @@ void wxMenuItem::Enable( bool 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!
|
||||
|
||||
@@ -479,8 +479,8 @@ wxMenu::wxMenu( const wxString& title, const wxFunction func )
|
||||
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();
|
||||
@@ -525,15 +525,16 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
||||
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;
|
||||
@@ -545,14 +546,14 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
||||
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
|
||||
|
||||
@@ -588,7 +589,7 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri
|
||||
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);
|
||||
|
||||
@@ -615,10 +616,10 @@ void wxMenu::Append( wxMenuItem *item )
|
||||
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())
|
||||
{
|
||||
@@ -645,14 +646,14 @@ void wxMenu::Append( wxMenuItem *item )
|
||||
|
||||
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;
|
||||
@@ -676,7 +677,7 @@ void wxMenu::Enable( int id, bool enable )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::Enable: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::Enable: no such item") );
|
||||
|
||||
item->Enable(enable);
|
||||
}
|
||||
@@ -685,7 +686,7 @@ bool wxMenu::IsEnabled( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -694,7 +695,7 @@ void wxMenu::Check( int id, bool enable )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::Check: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::Check: no such item") );
|
||||
|
||||
item->Check(enable);
|
||||
}
|
||||
@@ -703,7 +704,7 @@ bool wxMenu::IsChecked( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -712,7 +713,7 @@ void wxMenu::SetLabel( int id, const wxString &label )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::SetLabel: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") );
|
||||
|
||||
item->SetText(label);
|
||||
}
|
||||
@@ -721,7 +722,7 @@ wxString wxMenu::GetLabel( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -730,7 +731,7 @@ void wxMenu::SetHelpString( int id, const wxString& helpString )
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_RET( item, "wxMenu::SetHelpString: no such item" );
|
||||
wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") );
|
||||
|
||||
item->SetHelp( helpString );
|
||||
}
|
||||
@@ -739,7 +740,7 @@ wxString wxMenu::GetHelpString( int id ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
@@ -177,7 +177,7 @@ static void wxInsertChildInNotebook( wxNotebook* parent, wxWindow* child )
|
||||
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 );
|
||||
}
|
||||
@@ -256,7 +256,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
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;
|
||||
|
||||
@@ -281,7 +281,7 @@ int wxNotebook::GetSelection() const
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
|
||||
wxCHECK_MSG( node != NULL, -1, _T("wxNotebook: no selection?") );
|
||||
|
||||
return page->m_id;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ int wxNotebook::GetRowCount() const
|
||||
|
||||
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)
|
||||
@@ -321,7 +321,7 @@ wxString wxNotebook::GetPageText( int page ) const
|
||||
|
||||
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)
|
||||
@@ -332,7 +332,7 @@ int wxNotebook::GetPageImage( int page ) const
|
||||
|
||||
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;
|
||||
|
||||
@@ -345,14 +345,14 @@ wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
|
||||
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);
|
||||
@@ -377,7 +377,7 @@ int wxNotebook::SetSelection( int 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();
|
||||
@@ -395,7 +395,7 @@ void wxNotebook::SetImageList( wxImageList* imageList )
|
||||
|
||||
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);
|
||||
|
||||
@@ -403,9 +403,9 @@ bool wxNotebook::SetPageText( int page, const wxString &text )
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -497,22 +497,22 @@ bool wxNotebook::SetPageImage( int page, int image )
|
||||
|
||||
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)
|
||||
@@ -541,7 +541,7 @@ bool wxNotebook::DeletePage( int page )
|
||||
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;
|
||||
|
||||
@@ -564,7 +564,7 @@ bool wxNotebook::RemovePage( int page )
|
||||
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 );
|
||||
|
||||
@@ -576,7 +576,7 @@ bool wxNotebook::RemovePage( int page )
|
||||
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. */
|
||||
@@ -592,10 +592,10 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -618,9 +618,9 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
|
||||
|
||||
/* 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?
|
||||
@@ -643,7 +643,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
|
||||
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)
|
||||
|
@@ -93,7 +93,7 @@ bool wxPalette::Create( int WXUNUSED(n),
|
||||
const unsigned char *WXUNUSED(green),
|
||||
const unsigned char *WXUNUSED(blue) )
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ int wxPalette::GetPixel( const unsigned char WXUNUSED(red),
|
||||
const unsigned char WXUNUSED(green),
|
||||
const unsigned char WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ bool wxPalette::GetRGB( int WXUNUSED(pixel),
|
||||
unsigned char *WXUNUSED(green),
|
||||
unsigned char *WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -138,35 +138,35 @@ void wxPen::SetWidth( int width )
|
||||
|
||||
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;
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
SetValidator( validator );
|
||||
|
||||
m_widget = gtk_frame_new( title );
|
||||
m_widget = gtk_frame_new( title.mbc_str() );
|
||||
|
||||
m_majorDim = majorDim;
|
||||
|
||||
@@ -88,7 +88,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
{
|
||||
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 );
|
||||
|
||||
@@ -236,7 +236,7 @@ wxSize wxRadioBox::LayoutItems()
|
||||
|
||||
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 );
|
||||
|
||||
@@ -255,7 +255,7 @@ bool wxRadioBox::Show( bool 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;
|
||||
|
||||
@@ -276,7 +276,7 @@ int wxRadioBox::FindString( const wxString &s ) const
|
||||
|
||||
void wxRadioBox::SetFocus()
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
|
||||
wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
|
||||
|
||||
if (m_boxes.GetCount() == 0) return;
|
||||
|
||||
@@ -297,11 +297,11 @@ void wxRadioBox::SetFocus()
|
||||
|
||||
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() );
|
||||
|
||||
@@ -310,7 +310,7 @@ void wxRadioBox::SetSelection( int n )
|
||||
|
||||
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;
|
||||
|
||||
@@ -323,18 +323,18 @@ int wxRadioBox::GetSelection(void) const
|
||||
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 );
|
||||
@@ -344,37 +344,37 @@ wxString wxRadioBox::GetString( int n ) const
|
||||
|
||||
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 )
|
||||
@@ -394,11 +394,11 @@ 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;
|
||||
@@ -408,11 +408,11 @@ void wxRadioBox::Enable( int item, bool enable )
|
||||
|
||||
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() );
|
||||
|
||||
@@ -424,7 +424,7 @@ void wxRadioBox::Show( int item, bool show )
|
||||
|
||||
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)
|
||||
@@ -438,13 +438,13 @@ wxString wxRadioBox::GetStringSelection(void) const
|
||||
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;
|
||||
@@ -465,7 +465,7 @@ int wxRadioBox::GetNumberOfRowsOrCols(void) const
|
||||
|
||||
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
|
||||
wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
|
||||
}
|
||||
|
||||
void wxRadioBox::ApplyWidgetStyle()
|
||||
|
@@ -64,7 +64,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
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(
|
||||
@@ -75,7 +75,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
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 );
|
||||
|
||||
@@ -99,17 +99,17 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
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;
|
||||
@@ -124,14 +124,14 @@ void wxRadioButton::SetValue( bool val )
|
||||
|
||||
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 );
|
||||
|
||||
@@ -144,5 +144,3 @@ void wxRadioButton::ApplyWidgetStyle()
|
||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -190,7 +190,7 @@ int wxSystemSettings::GetSystemMetric( int index )
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user