Split this out from other changes to keep things sane..
wxDeprecated KeyCode. wxDeprecated old wxList compat methods. Replaced a large number of them in the gtk build already, but there are still plenty more so feel free to help nuke them as you find them. s/^I/ / and s/TRUE/true/ etc. a couple of these too. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -237,7 +237,7 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
||||
// But repaint the assertion message if necessary
|
||||
if (wxTopLevelWindows.GetCount() > 0)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) wxTopLevelWindows.Last()->Data();
|
||||
wxWindow* win = (wxWindow*) wxTopLevelWindows.GetLast()->GetData();
|
||||
if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog)))
|
||||
win->OnInternalIdle();
|
||||
}
|
||||
@@ -607,13 +607,13 @@ bool wxApp::CallInternalIdle( wxWindow* win )
|
||||
{
|
||||
win->OnInternalIdle();
|
||||
|
||||
wxNode* node = win->GetChildren().First();
|
||||
wxWindowList::Node *node = win->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
CallInternalIdle( win );
|
||||
wxWindow *win = node->GetData();
|
||||
|
||||
node = node->Next();
|
||||
CallInternalIdle( win );
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -631,14 +631,14 @@ bool wxApp::SendIdleEvents( wxWindow* win )
|
||||
if (event.MoreRequested())
|
||||
needMore = TRUE;
|
||||
|
||||
wxNode* node = win->GetChildren().First();
|
||||
wxWindowList::Node *node = win->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
wxWindow *win = node->GetData();
|
||||
|
||||
if (SendIdleEvents(win))
|
||||
needMore = TRUE;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return needMore;
|
||||
@@ -673,17 +673,17 @@ void wxApp::Dispatch()
|
||||
|
||||
void wxApp::DeletePendingObjects()
|
||||
{
|
||||
wxNode *node = wxPendingDelete.First();
|
||||
wxNode *node = wxPendingDelete.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxObject *obj = (wxObject *)node->Data();
|
||||
wxObject *obj = (wxObject *)node->GetData();
|
||||
|
||||
delete obj;
|
||||
|
||||
if (wxPendingDelete.Find(obj))
|
||||
delete node;
|
||||
|
||||
node = wxPendingDelete.First();
|
||||
node = wxPendingDelete.GetFirst();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -143,7 +143,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientData") );
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -153,17 +153,17 @@ void* wxChoice::DoGetItemClientData( int n ) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid choice control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetItemClientData") );
|
||||
|
||||
return node->Data();
|
||||
return node->GetData();
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") );
|
||||
|
||||
// wxItemContainer already deletes data for us
|
||||
@@ -175,11 +175,11 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid choice control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_MSG( node, (wxClientData *)NULL,
|
||||
wxT("invalid index in wxChoice::DoGetItemClientObject") );
|
||||
|
||||
return (wxClientData*) node->Data();
|
||||
return (wxClientData*) node->GetData();
|
||||
}
|
||||
|
||||
void wxChoice::Clear()
|
||||
@@ -195,11 +195,11 @@ void wxChoice::Clear()
|
||||
// destroy the data (due to Robert's idea of using wxList<wxObject>
|
||||
// and not wxList<wxClientData> we can't just say
|
||||
// m_clientList.DeleteContents(TRUE) - this would crash!
|
||||
wxNode *node = m_clientList.First();
|
||||
wxNode *node = m_clientList.GetFirst();
|
||||
while ( node )
|
||||
{
|
||||
delete (wxClientData *)node->Data();
|
||||
node = node->Next();
|
||||
delete (wxClientData *)node->GetData();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
m_clientList.Clear();
|
||||
|
@@ -160,7 +160,7 @@ void wxColour::InitFromName( const wxString &colourName )
|
||||
wxNode *node = (wxNode *) NULL;
|
||||
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
|
||||
{
|
||||
wxColour *col = (wxColour*)node->Data();
|
||||
wxColour *col = (wxColour*)node->GetData();
|
||||
UnRef();
|
||||
if (col) Ref( *col );
|
||||
}
|
||||
|
@@ -197,12 +197,12 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
|
||||
wxComboBox::~wxComboBox()
|
||||
{
|
||||
wxNode *node = m_clientObjectList.First();
|
||||
wxNode *node = m_clientObjectList.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxClientData *cd = (wxClientData*)node->Data();
|
||||
wxClientData *cd = (wxClientData*)node->GetData();
|
||||
if (cd) delete cd;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
m_clientObjectList.Clear();
|
||||
|
||||
@@ -272,7 +272,7 @@ void wxComboBox::SetClientData( int n, void* clientData )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
wxNode *node = m_clientDataList.Nth( n );
|
||||
wxNode *node = m_clientDataList.Item( n );
|
||||
if (!node) return;
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -282,20 +282,20 @@ void* wxComboBox::GetClientData( int n )
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
|
||||
|
||||
wxNode *node = m_clientDataList.Nth( n );
|
||||
wxNode *node = m_clientDataList.Item( n );
|
||||
if (!node) return NULL;
|
||||
|
||||
return node->Data();
|
||||
return node->GetData();
|
||||
}
|
||||
|
||||
void wxComboBox::SetClientObject( int n, wxClientData* clientData )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
wxNode *node = m_clientObjectList.Nth( n );
|
||||
wxNode *node = m_clientObjectList.Item( n );
|
||||
if (!node) return;
|
||||
|
||||
wxClientData *cd = (wxClientData*) node->Data();
|
||||
wxClientData *cd = (wxClientData*) node->GetData();
|
||||
if (cd) delete cd;
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -305,10 +305,10 @@ wxClientData* wxComboBox::GetClientObject( int n )
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
|
||||
|
||||
wxNode *node = m_clientObjectList.Nth( n );
|
||||
wxNode *node = m_clientObjectList.Item( n );
|
||||
if (!node) return (wxClientData*) NULL;
|
||||
|
||||
return (wxClientData*) node->Data();
|
||||
return (wxClientData*) node->GetData();
|
||||
}
|
||||
|
||||
void wxComboBox::Clear()
|
||||
@@ -318,12 +318,12 @@ void wxComboBox::Clear()
|
||||
GtkWidget *list = GTK_COMBO(m_widget)->list;
|
||||
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
|
||||
|
||||
wxNode *node = m_clientObjectList.First();
|
||||
wxNode *node = m_clientObjectList.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxClientData *cd = (wxClientData*)node->Data();
|
||||
wxClientData *cd = (wxClientData*)node->GetData();
|
||||
if (cd) delete cd;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
m_clientObjectList.Clear();
|
||||
|
||||
@@ -348,15 +348,15 @@ void wxComboBox::Delete( int n )
|
||||
gtk_list_remove_items( listbox, list );
|
||||
g_list_free( list );
|
||||
|
||||
wxNode *node = m_clientObjectList.Nth( n );
|
||||
wxNode *node = m_clientObjectList.Item( n );
|
||||
if (node)
|
||||
{
|
||||
wxClientData *cd = (wxClientData*)node->Data();
|
||||
wxClientData *cd = (wxClientData*)node->GetData();
|
||||
if (cd) delete cd;
|
||||
m_clientObjectList.DeleteNode( node );
|
||||
}
|
||||
|
||||
node = m_clientDataList.Nth( n );
|
||||
node = m_clientDataList.Item( n );
|
||||
if (node)
|
||||
{
|
||||
m_clientDataList.DeleteNode( node );
|
||||
|
@@ -447,7 +447,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
if (index != GetCount())
|
||||
{
|
||||
GtkAddItem( items[n], index );
|
||||
wxNode *node = m_clientList.Nth( index );
|
||||
wxNode *node = m_clientList.Item( index );
|
||||
m_clientList.Insert( node, (wxObject*) NULL );
|
||||
}
|
||||
else
|
||||
@@ -470,7 +470,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
}
|
||||
else
|
||||
{
|
||||
wxNode *node = m_clientList.Nth( pos );
|
||||
wxNode *node = m_clientList.Item( pos );
|
||||
for ( size_t n = 0; n < nItems; n++ )
|
||||
{
|
||||
GtkAddItem( items[n], pos+n );
|
||||
@@ -496,7 +496,7 @@ int wxListBox::DoAppend( const wxString& item )
|
||||
{
|
||||
GtkAddItem( item, index );
|
||||
|
||||
wxNode *node = m_clientList.Nth( index );
|
||||
wxNode *node = m_clientList.Item( index );
|
||||
m_clientList.Insert( node, (wxObject *)NULL );
|
||||
|
||||
return index;
|
||||
@@ -618,11 +618,11 @@ void wxListBox::Clear()
|
||||
// destroy the data (due to Robert's idea of using wxList<wxObject>
|
||||
// and not wxList<wxClientData> we can't just say
|
||||
// m_clientList.DeleteContents(TRUE) - this would crash!
|
||||
wxNode *node = m_clientList.First();
|
||||
wxNode *node = m_clientList.GetFirst();
|
||||
while ( node )
|
||||
{
|
||||
delete (wxClientData *)node->Data();
|
||||
node = node->Next();
|
||||
delete (wxClientData *)node->GetData();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
m_clientList.Clear();
|
||||
@@ -643,12 +643,12 @@ void wxListBox::Delete( int n )
|
||||
gtk_list_remove_items( m_list, list );
|
||||
g_list_free( list );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
if ( node )
|
||||
{
|
||||
if ( m_clientDataItemsType == wxClientData_Object )
|
||||
{
|
||||
wxClientData *cd = (wxClientData*)node->Data();
|
||||
wxClientData *cd = (wxClientData*)node->GetData();
|
||||
delete cd;
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ void wxListBox::DoSetItemClientData( int n, void* clientData )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientData") );
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -677,17 +677,17 @@ void* wxListBox::DoGetItemClientData( int n ) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid listbox control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_MSG( node, NULL, wxT("invalid index in wxListBox::DoGetItemClientData") );
|
||||
|
||||
return node->Data();
|
||||
return node->GetData();
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientObject") );
|
||||
|
||||
// wxItemContainer already deletes data for us
|
||||
@@ -699,11 +699,11 @@ wxClientData* wxListBox::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid listbox control") );
|
||||
|
||||
wxNode *node = m_clientList.Nth( n );
|
||||
wxNode *node = m_clientList.Item( n );
|
||||
wxCHECK_MSG( node, (wxClientData *)NULL,
|
||||
wxT("invalid index in wxListBox::DoGetItemClientObject") );
|
||||
|
||||
return (wxClientData*) node->Data();
|
||||
return (wxClientData*) node->GetData();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -62,7 +62,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
wxMDIChildFrame *child = parent->GetActiveChild();
|
||||
if (child)
|
||||
{
|
||||
wxActivateEvent event1( wxEVT_ACTIVATE, FALSE, child->GetId() );
|
||||
wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
|
||||
event1.SetEventObject( child);
|
||||
child->GetEventHandler()->ProcessEvent( event1 );
|
||||
}
|
||||
@@ -75,22 +75,25 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
|
||||
child = (wxMDIChildFrame*) NULL;
|
||||
|
||||
wxNode *node = client_window->GetChildren().First();
|
||||
wxWindowList::Node *node = client_window->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
|
||||
|
||||
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
|
||||
|
||||
if (child_frame->m_page == page)
|
||||
{
|
||||
child = child_frame;
|
||||
break;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
if (!child)
|
||||
return;
|
||||
|
||||
wxActivateEvent event2( wxEVT_ACTIVATE, TRUE, child->GetId() );
|
||||
wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
|
||||
event2.SetEventObject( child);
|
||||
child->GetEventHandler()->ProcessEvent( event2 );
|
||||
}
|
||||
@@ -103,7 +106,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame,wxFrame)
|
||||
|
||||
void wxMDIParentFrame::Init()
|
||||
{
|
||||
m_justInserted = FALSE;
|
||||
m_justInserted = false;
|
||||
m_clientWindow = (wxMDIClientWindow *) NULL;
|
||||
}
|
||||
|
||||
@@ -123,7 +126,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
||||
|
||||
OnCreateClient();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
|
||||
@@ -158,20 +161,20 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
|
||||
gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 );
|
||||
|
||||
m_justInserted = FALSE;
|
||||
m_justInserted = false;
|
||||
return;
|
||||
}
|
||||
|
||||
wxFrame::OnInternalIdle();
|
||||
|
||||
wxMDIChildFrame *active_child_frame = GetActiveChild();
|
||||
bool visible_child_menu = FALSE;
|
||||
bool visible_child_menu = false;
|
||||
|
||||
wxNode *node = m_clientWindow->GetChildren().First();
|
||||
wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxObject *child = node->Data();
|
||||
wxMDIChildFrame *child_frame = wxDynamicCast(child, wxMDIChildFrame);
|
||||
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
|
||||
|
||||
if ( child_frame )
|
||||
{
|
||||
wxMenuBar *menu_bar = child_frame->m_menuBar;
|
||||
@@ -179,7 +182,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
{
|
||||
if (child_frame == active_child_frame)
|
||||
{
|
||||
if (menu_bar->Show(TRUE))
|
||||
if (menu_bar->Show(true))
|
||||
{
|
||||
menu_bar->m_width = m_width;
|
||||
menu_bar->m_height = wxMENU_HEIGHT;
|
||||
@@ -188,11 +191,11 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
0, 0, m_width, wxMENU_HEIGHT );
|
||||
menu_bar->SetInvokingWindow( child_frame );
|
||||
}
|
||||
visible_child_menu = TRUE;
|
||||
visible_child_menu = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (menu_bar->Show(FALSE))
|
||||
if (menu_bar->Show(false))
|
||||
{
|
||||
menu_bar->UnsetInvokingWindow( child_frame );
|
||||
}
|
||||
@@ -200,7 +203,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
}
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
/* show/hide parent menu bar as required */
|
||||
@@ -209,12 +212,12 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
{
|
||||
if (visible_child_menu)
|
||||
{
|
||||
m_frameMenuBar->Show( FALSE );
|
||||
m_frameMenuBar->Show( false );
|
||||
m_frameMenuBar->UnsetInvokingWindow( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frameMenuBar->Show( TRUE );
|
||||
m_frameMenuBar->Show( true );
|
||||
m_frameMenuBar->SetInvokingWindow( this );
|
||||
|
||||
m_frameMenuBar->m_width = m_width;
|
||||
@@ -244,13 +247,16 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
||||
GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data);
|
||||
if (!page) return (wxMDIChildFrame*) NULL;
|
||||
|
||||
wxNode *node = m_clientWindow->GetChildren().First();
|
||||
wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
|
||||
|
||||
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
|
||||
|
||||
if (child_frame->m_page == page)
|
||||
return child_frame;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return (wxMDIChildFrame*) NULL;
|
||||
@@ -445,7 +451,7 @@ static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* chil
|
||||
child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
|
||||
|
||||
wxMDIParentFrame *parent_frame = (wxMDIParentFrame*) parent->GetParent();
|
||||
parent_frame->m_justInserted = TRUE;
|
||||
parent_frame->m_justInserted = true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -469,7 +475,7 @@ wxMDIClientWindow::~wxMDIClientWindow()
|
||||
|
||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_needParent = true;
|
||||
|
||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
|
||||
|
||||
@@ -477,7 +483,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
@@ -491,9 +497,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
Show( true );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1323,13 +1323,13 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
|
||||
|
||||
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
|
||||
{
|
||||
wxNode *node = m_items.First();
|
||||
wxMenuItemList::Node *node = m_items.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxMenuItem *item = (wxMenuItem*)node->Data();
|
||||
wxMenuItem *item = node->GetData();
|
||||
if (item->GetMenuItem() == menuItem)
|
||||
return item->GetId();
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return wxNOT_FOUND;
|
||||
|
@@ -91,20 +91,20 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
|
||||
if ((gdk_event->keyval == GDK_Up) ||
|
||||
(gdk_event->keyval == GDK_Left))
|
||||
{
|
||||
if (node == rb->m_boxes.First())
|
||||
node = rb->m_boxes.Last();
|
||||
if (node == rb->m_boxes.GetFirst())
|
||||
node = rb->m_boxes.GetLast();
|
||||
else
|
||||
node = node->Previous();
|
||||
node = node->GetPrevious();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node == rb->m_boxes.Last())
|
||||
node = rb->m_boxes.First();
|
||||
if (node == rb->m_boxes.GetLast())
|
||||
node = rb->m_boxes.GetFirst();
|
||||
else
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
GtkWidget *button = (GtkWidget*) node->Data();
|
||||
GtkWidget *button = (GtkWidget*) node->GetData();
|
||||
|
||||
gtk_widget_grab_focus( button );
|
||||
|
||||
@@ -260,12 +260,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
wxRadioBox::~wxRadioBox()
|
||||
{
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
gtk_widget_destroy( button );
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,10 +314,10 @@ wxSize wxRadioBox::LayoutItems()
|
||||
y = 15;
|
||||
|
||||
int max_len = 0;
|
||||
wxNode *node = m_boxes.Nth( j*num_of_rows );
|
||||
wxNode *node = m_boxes.Item( j*num_of_rows );
|
||||
for (int i1 = 0; i1< num_of_rows; i1++)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
|
||||
GtkRequisition req;
|
||||
req.width = 2;
|
||||
@@ -330,20 +330,20 @@ wxSize wxRadioBox::LayoutItems()
|
||||
gtk_pizza_move( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y );
|
||||
y += req.height;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
if (!node) break;
|
||||
}
|
||||
|
||||
// we don't know the max_len before
|
||||
|
||||
node = m_boxes.Nth( j*num_of_rows );
|
||||
node = m_boxes.Item( j*num_of_rows );
|
||||
for (int i2 = 0; i2< num_of_rows; i2++)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
|
||||
gtk_pizza_resize( GTK_PIZZA(m_parent->m_wxwindow), button, max_len, 20 );
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
if (!node) break;
|
||||
}
|
||||
|
||||
@@ -359,10 +359,10 @@ wxSize wxRadioBox::LayoutItems()
|
||||
{
|
||||
int max = 0;
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
|
||||
GtkRequisition req;
|
||||
req.width = 2;
|
||||
@@ -372,18 +372,18 @@ wxSize wxRadioBox::LayoutItems()
|
||||
|
||||
if (req.width > max) max = req.width;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
node = m_boxes.First();
|
||||
node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
|
||||
gtk_pizza_set_size( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y, max, 20 );
|
||||
x += max;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
res.x = x+4;
|
||||
res.y = 40;
|
||||
@@ -405,14 +405,14 @@ bool wxRadioBox::Show( bool show )
|
||||
if ((m_windowStyle & wxNO_BORDER) != 0)
|
||||
gtk_widget_hide( m_widget );
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
|
||||
if (show) gtk_widget_show( button ); else gtk_widget_hide( button );
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -424,10 +424,10 @@ int wxRadioBox::FindString( const wxString &find ) const
|
||||
|
||||
int count = 0;
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
|
||||
#ifdef __WXGTK20__
|
||||
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
|
||||
#else
|
||||
@@ -438,7 +438,7 @@ int wxRadioBox::FindString( const wxString &find ) const
|
||||
|
||||
count++;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -450,16 +450,16 @@ void wxRadioBox::SetFocus()
|
||||
|
||||
if (m_boxes.GetCount() == 0) return;
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
|
||||
if (button->active)
|
||||
{
|
||||
gtk_widget_grab_focus( GTK_WIDGET(button) );
|
||||
return;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,11 +467,11 @@ void wxRadioBox::SetSelection( int n )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
|
||||
|
||||
wxNode *node = m_boxes.Nth( n );
|
||||
wxNode *node = m_boxes.Item( n );
|
||||
|
||||
wxCHECK_RET( node, wxT("radiobox wrong index") );
|
||||
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
|
||||
|
||||
GtkDisableEvents();
|
||||
|
||||
@@ -486,13 +486,13 @@ int wxRadioBox::GetSelection(void) const
|
||||
|
||||
int count = 0;
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
|
||||
if (button->active) return count;
|
||||
count++;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
wxFAIL_MSG( wxT("wxRadioBox none selected") );
|
||||
@@ -504,11 +504,11 @@ wxString wxRadioBox::GetString( int n ) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
|
||||
|
||||
wxNode *node = m_boxes.Nth( n );
|
||||
wxNode *node = m_boxes.Item( n );
|
||||
|
||||
wxCHECK_MSG( node, wxT(""), wxT("radiobox wrong index") );
|
||||
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
|
||||
@@ -532,11 +532,11 @@ void wxRadioBox::SetString( int item, const wxString& label )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
|
||||
|
||||
wxNode *node = m_boxes.Nth( item );
|
||||
wxNode *node = m_boxes.Item( item );
|
||||
|
||||
wxCHECK_RET( node, wxT("radiobox wrong index") );
|
||||
|
||||
GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
|
||||
GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
|
||||
|
||||
gtk_label_set( g_label, wxGTK_CONV( label ) );
|
||||
}
|
||||
@@ -546,15 +546,15 @@ bool wxRadioBox::Enable( bool enable )
|
||||
if ( !wxControl::Enable( enable ) )
|
||||
return FALSE;
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON( node->Data() );
|
||||
GtkButton *button = GTK_BUTTON( node->GetData() );
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
|
||||
|
||||
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
|
||||
gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -564,11 +564,11 @@ void wxRadioBox::Enable( int item, bool enable )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
|
||||
|
||||
wxNode *node = m_boxes.Nth( item );
|
||||
wxNode *node = m_boxes.Item( item );
|
||||
|
||||
wxCHECK_RET( node, wxT("radiobox wrong index") );
|
||||
|
||||
GtkButton *button = GTK_BUTTON( node->Data() );
|
||||
GtkButton *button = GTK_BUTTON( node->GetData() );
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
|
||||
|
||||
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
|
||||
@@ -579,11 +579,11 @@ void wxRadioBox::Show( int item, bool show )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
|
||||
|
||||
wxNode *node = m_boxes.Nth( item );
|
||||
wxNode *node = m_boxes.Item( item );
|
||||
|
||||
wxCHECK_RET( node, wxT("radiobox wrong index") );
|
||||
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
|
||||
if (show)
|
||||
gtk_widget_show( button );
|
||||
@@ -595,13 +595,13 @@ wxString wxRadioBox::GetStringSelection() const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
|
||||
if (button->active)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
|
||||
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
|
||||
@@ -610,7 +610,7 @@ wxString wxRadioBox::GetStringSelection() const
|
||||
#endif
|
||||
return str;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
wxFAIL_MSG( wxT("wxRadioBox none selected") );
|
||||
@@ -630,7 +630,7 @@ bool wxRadioBox::SetStringSelection( const wxString &s )
|
||||
|
||||
int wxRadioBox::GetCount() const
|
||||
{
|
||||
return m_boxes.Number();
|
||||
return m_boxes.GetCount();
|
||||
}
|
||||
|
||||
int wxRadioBox::GetNumberOfRowsOrCols() const
|
||||
@@ -645,25 +645,25 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
|
||||
|
||||
void wxRadioBox::GtkDisableEvents()
|
||||
{
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
gtk_signal_disconnect_by_func( GTK_OBJECT(node->Data()),
|
||||
gtk_signal_disconnect_by_func( GTK_OBJECT(node->GetData()),
|
||||
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
void wxRadioBox::GtkEnableEvents()
|
||||
{
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
gtk_signal_connect( GTK_OBJECT(node->Data()), "clicked",
|
||||
gtk_signal_connect( GTK_OBJECT(node->GetData()), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,27 +673,27 @@ void wxRadioBox::ApplyWidgetStyle()
|
||||
|
||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *widget = GTK_WIDGET( node->GetData() );
|
||||
gtk_widget_set_style( widget, m_widgetStyle );
|
||||
|
||||
gtk_widget_set_style( BUTTON_CHILD(node->Data()), m_widgetStyle );
|
||||
gtk_widget_set_style( BUTTON_CHILD(node->GetData()), m_widgetStyle );
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
|
||||
{
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *widget = GTK_WIDGET( node->GetData() );
|
||||
gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL );
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
@@ -702,14 +702,14 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
if (window == m_widget->window) return TRUE;
|
||||
|
||||
wxNode *node = m_boxes.First();
|
||||
wxNode *node = m_boxes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( node->Data() );
|
||||
GtkWidget *button = GTK_WIDGET( node->GetData() );
|
||||
|
||||
if (window == button->window) return TRUE;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
@@ -1511,12 +1511,12 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
|
||||
yy += pizza->yoffset;
|
||||
}
|
||||
|
||||
wxNode *node = win->GetChildren().First();
|
||||
wxWindowList::Node *node = win->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxWindowGTK *child = (wxWindowGTK*)node->Data();
|
||||
wxWindowGTK *child = node->GetData();
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
if (!child->IsShown())
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user