Removed minor differences between wxMSW and wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2596,10 +2596,17 @@ bool wxListCtrl::DeleteAllItems(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxListCtrl::DeleteAllColumns()
|
||||
bool wxListCtrl::DeleteAllColumns()
|
||||
{
|
||||
for ( size_t n = 0; n < m_mainWin->m_columns.GetCount(); n++ )
|
||||
DeleteColumn(n);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxListCtrl::ClearAll()
|
||||
{
|
||||
m_mainWin->DeleteEverything();
|
||||
}
|
||||
|
||||
bool wxListCtrl::DeleteColumn( int col )
|
||||
|
@@ -329,11 +329,15 @@ void wxTreeCtrl::Init()
|
||||
|
||||
bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name )
|
||||
long style,
|
||||
const wxValidator &validator,
|
||||
const wxString& name )
|
||||
{
|
||||
Init();
|
||||
|
||||
wxScrolledWindow::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name );
|
||||
|
||||
SetValidator( validator );
|
||||
|
||||
SetBackgroundColour( *wxWHITE );
|
||||
m_dottedPen = wxPen( *wxBLACK, 0, 0 );
|
||||
@@ -1219,6 +1223,12 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event )
|
||||
}
|
||||
}
|
||||
|
||||
wxTreeItemId wxTreeCtrl::HitTest(const wxPoint& point, int& WXUNUSED(flags))
|
||||
{
|
||||
bool onButton = FALSE;
|
||||
return m_anchor->HitTest( point, onButton );
|
||||
}
|
||||
|
||||
void wxTreeCtrl::OnMouse( wxMouseEvent &event )
|
||||
{
|
||||
if ( !(event.LeftDown() || event.LeftDClick()) )
|
||||
|
@@ -77,14 +77,13 @@ void wxCheckListBox::Check( int index, bool check )
|
||||
|
||||
gtk_label_set( label, str );
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
|
||||
event.SetEventObject( this );
|
||||
event.SetInt( index );
|
||||
GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
wxFAIL_MSG("wrong checklistbox index");
|
||||
}
|
||||
|
||||
int wxCheckListBox::GetItemHeight()
|
||||
{
|
||||
return 22;
|
||||
}
|
||||
|
@@ -47,14 +47,28 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
|
||||
|
||||
if (!listbox->HasVMT()) return FALSE;
|
||||
|
||||
if (gdk_event->x > 15) return FALSE;
|
||||
|
||||
int sel = listbox->GetIndex( widget );
|
||||
|
||||
wxCheckListBox *clb = (wxCheckListBox *)listbox;
|
||||
if ((listbox->m_hasCheckBoxes) && (gdk_event->x < 15) && (gdk_event->type != GDK_2BUTTON_PRESS))
|
||||
{
|
||||
wxCheckListBox *clb = (wxCheckListBox *)listbox;
|
||||
|
||||
clb->Check( sel, !clb->IsChecked(sel) );
|
||||
clb->Check( sel, !clb->IsChecked(sel) );
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
|
||||
event.SetEventObject( listbox );
|
||||
event.SetInt( sel );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
if (gdk_event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() );
|
||||
event.SetEventObject( listbox );
|
||||
event.SetInt( sel );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -77,6 +91,11 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
|
||||
|
||||
clb->Check( sel, !clb->IsChecked(sel) );
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
|
||||
event.SetEventObject( listbox );
|
||||
event.SetInt( sel );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -219,13 +238,13 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
||||
"button_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_button_press_callback,
|
||||
(gpointer) this );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
}
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
|
||||
ConnectWidget( list_item );
|
||||
|
||||
gtk_widget_show( list_item );
|
||||
@@ -286,12 +305,12 @@ void wxListBox::AppendCommon( const wxString &item )
|
||||
"button_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_button_press_callback,
|
||||
(gpointer) this );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
}
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
|
||||
gtk_widget_show( list_item );
|
||||
|
||||
|
@@ -2190,6 +2190,11 @@ void wxWindow::SetCursor( const wxCursor &cursor )
|
||||
gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
|
||||
}
|
||||
|
||||
void wxWindow::WarpPointer( int WXUNUSED(x), int WXUNUSED(y) )
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
|
||||
{
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid window" );
|
||||
|
@@ -77,14 +77,13 @@ void wxCheckListBox::Check( int index, bool check )
|
||||
|
||||
gtk_label_set( label, str );
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
|
||||
event.SetEventObject( this );
|
||||
event.SetInt( index );
|
||||
GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
wxFAIL_MSG("wrong checklistbox index");
|
||||
}
|
||||
|
||||
int wxCheckListBox::GetItemHeight()
|
||||
{
|
||||
return 22;
|
||||
}
|
||||
|
@@ -47,14 +47,28 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
|
||||
|
||||
if (!listbox->HasVMT()) return FALSE;
|
||||
|
||||
if (gdk_event->x > 15) return FALSE;
|
||||
|
||||
int sel = listbox->GetIndex( widget );
|
||||
|
||||
wxCheckListBox *clb = (wxCheckListBox *)listbox;
|
||||
if ((listbox->m_hasCheckBoxes) && (gdk_event->x < 15) && (gdk_event->type != GDK_2BUTTON_PRESS))
|
||||
{
|
||||
wxCheckListBox *clb = (wxCheckListBox *)listbox;
|
||||
|
||||
clb->Check( sel, !clb->IsChecked(sel) );
|
||||
clb->Check( sel, !clb->IsChecked(sel) );
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
|
||||
event.SetEventObject( listbox );
|
||||
event.SetInt( sel );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
if (gdk_event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() );
|
||||
event.SetEventObject( listbox );
|
||||
event.SetInt( sel );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -77,6 +91,11 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
|
||||
|
||||
clb->Check( sel, !clb->IsChecked(sel) );
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
|
||||
event.SetEventObject( listbox );
|
||||
event.SetInt( sel );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -219,13 +238,13 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
||||
"button_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_button_press_callback,
|
||||
(gpointer) this );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
}
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
|
||||
ConnectWidget( list_item );
|
||||
|
||||
gtk_widget_show( list_item );
|
||||
@@ -286,12 +305,12 @@ void wxListBox::AppendCommon( const wxString &item )
|
||||
"button_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_button_press_callback,
|
||||
(gpointer) this );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
}
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
"key_press_event",
|
||||
(GtkSignalFunc)gtk_listbox_key_press_callback,
|
||||
(gpointer)this );
|
||||
|
||||
gtk_widget_show( list_item );
|
||||
|
||||
|
@@ -2190,6 +2190,11 @@ void wxWindow::SetCursor( const wxCursor &cursor )
|
||||
gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
|
||||
}
|
||||
|
||||
void wxWindow::WarpPointer( int WXUNUSED(x), int WXUNUSED(y) )
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
|
||||
{
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid window" );
|
||||
|
Reference in New Issue
Block a user