From 72a7edf007f57bc9dacea77c408adb86a57d41f7 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 26 Nov 1999 17:41:20 +0000 Subject: [PATCH] Minor changes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/radiobox.h | 13 ++++++++----- include/wx/gtk1/radiobox.h | 13 ++++++++----- samples/dnd/dnd.cpp | 5 +++-- src/generic/listctrl.cpp | 28 +++++++++++++++++++++++++++- src/gtk/bitmap.cpp | 6 +++++- src/gtk/clipbrd.cpp | 2 ++ src/gtk/radiobox.cpp | 21 +++++++++++++++++---- src/gtk1/bitmap.cpp | 6 +++++- src/gtk1/clipbrd.cpp | 2 ++ src/gtk1/radiobox.cpp | 21 +++++++++++++++++---- 10 files changed, 94 insertions(+), 23 deletions(-) diff --git a/include/wx/gtk/radiobox.h b/include/wx/gtk/radiobox.h index 06402b021a..eded3b86e9 100644 --- a/include/wx/gtk/radiobox.h +++ b/include/wx/gtk/radiobox.h @@ -88,14 +88,17 @@ public: int GetNumberOfRowsOrCols() const; void SetNumberOfRowsOrCols( int n ); - void SetFocus(); - - // implementation + // implementation + // -------------- - void DisableEvents(); - void EnableEvents(); + void SetFocus(); + void GtkDisableEvents(); + void GtkEnableEvents(); bool IsOwnGtkWindow( GdkWindow *window ); void ApplyWidgetStyle(); +#if wxUSE_TOOLTIPS + void ApplyToolTip( GtkTooltips *tips, const wxChar *tip ); +#endif // wxUSE_TOOLTIPS wxSize LayoutItems(); void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO ); diff --git a/include/wx/gtk1/radiobox.h b/include/wx/gtk1/radiobox.h index 06402b021a..eded3b86e9 100644 --- a/include/wx/gtk1/radiobox.h +++ b/include/wx/gtk1/radiobox.h @@ -88,14 +88,17 @@ public: int GetNumberOfRowsOrCols() const; void SetNumberOfRowsOrCols( int n ); - void SetFocus(); - - // implementation + // implementation + // -------------- - void DisableEvents(); - void EnableEvents(); + void SetFocus(); + void GtkDisableEvents(); + void GtkEnableEvents(); bool IsOwnGtkWindow( GdkWindow *window ); void ApplyWidgetStyle(); +#if wxUSE_TOOLTIPS + void ApplyToolTip( GtkTooltips *tips, const wxChar *tip ); +#endif // wxUSE_TOOLTIPS wxSize LayoutItems(); void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO ); diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 2ba7814f1f..0b26e485d8 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -542,8 +542,9 @@ public: } // override base class (pure) virtuals - virtual void OnEnter() - { m_frame->SetStatusText("Mouse entered the frame"); } + virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def) + { m_frame->SetStatusText("Mouse entered the frame"); + return OnDragOver(x, y, def); } virtual void OnLeave() { m_frame->SetStatusText("Mouse left the frame"); } virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 59bf7da65d..ec4f79d94a 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1207,7 +1207,8 @@ void wxListMainWindow::SendNotify( wxListLineData *line, wxEventType command ) le.SetEventObject( GetParent() ); le.m_itemIndex = GetIndexOfLine( line ); line->GetItem( 0, le.m_item ); - GetParent()->GetEventHandler()->ProcessEvent( le ); +// GetParent()->GetEventHandler()->ProcessEvent( le ); + GetParent()->GetEventHandler()->AddPendingEvent( le ); } void wxListMainWindow::FocusLine( wxListLineData *WXUNUSED(line) ) @@ -2545,6 +2546,31 @@ wxListEvent::wxListEvent( wxEventType commandType, int id ): m_pointDrag.y = 0; } +void wxListEvent::CopyObject(wxObject& object_dest) const +{ + wxListEvent *obj = (wxListEvent *)&object_dest; + + wxNotifyEvent::CopyObject(object_dest); + + obj->m_code = m_code; + obj->m_itemIndex = m_itemIndex; + obj->m_oldItemIndex = m_oldItemIndex; + obj->m_col = m_col; + obj->m_cancelled = m_cancelled; + obj->m_pointDrag = m_pointDrag; + obj->m_item.m_mask = m_item.m_mask; + obj->m_item.m_itemId = m_item.m_itemId; + obj->m_item.m_col = m_item.m_col; + obj->m_item.m_state = m_item.m_state; + obj->m_item.m_stateMask = m_item.m_stateMask; + obj->m_item.m_text = m_item.m_text; + obj->m_item.m_image = m_item.m_image; + obj->m_item.m_data = m_item.m_data; + obj->m_item.m_format = m_item.m_format; + obj->m_item.m_width = m_item.m_width; + obj->m_item.m_colour = m_item.m_colour; +} + // ------------------------------------------------------------------------------------- // wxListCtrl // ------------------------------------------------------------------------------------- diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 975f4ab6ed..8a6ca2ccc7 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -33,22 +33,26 @@ wxMask::wxMask() wxMask::wxMask( const wxBitmap& bitmap, const wxColour& colour ) { + m_bitmap = (GdkBitmap *) NULL; Create( bitmap, colour ); } wxMask::wxMask( const wxBitmap& bitmap, int paletteIndex ) { + m_bitmap = (GdkBitmap *) NULL; Create( bitmap, paletteIndex ); } wxMask::wxMask( const wxBitmap& bitmap ) { + m_bitmap = (GdkBitmap *) NULL; Create( bitmap ); } wxMask::~wxMask() { - if (m_bitmap) gdk_bitmap_unref( m_bitmap ); + if (m_bitmap) + gdk_bitmap_unref( m_bitmap ); } bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 89f0c01611..32d0991d3e 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -490,9 +490,11 @@ bool wxClipboard::IsSupported( const wxDataFormat& format ) /* store requested format to be asked for by callbacks */ m_targetRequested = format; +#if 0 wxLogTrace( TRACE_CLIPBOARD, wxT("wxClipboard:IsSupported: requested format: %s"), format.GetId().c_str() ); +#endif wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") ); diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index ec667046fe..0e61498721 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -405,11 +405,11 @@ void wxRadioBox::SetSelection( int n ) GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); - DisableEvents(); + GtkDisableEvents(); gtk_toggle_button_set_state( button, 1 ); - EnableEvents(); + GtkEnableEvents(); } int wxRadioBox::GetSelection(void) const @@ -575,7 +575,7 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) wxFAIL_MSG(wxT("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); } -void wxRadioBox::DisableEvents() +void wxRadioBox::GtkDisableEvents() { wxNode *node = m_boxes.First(); while (node) @@ -587,7 +587,7 @@ void wxRadioBox::DisableEvents() } } -void wxRadioBox::EnableEvents() +void wxRadioBox::GtkEnableEvents() { wxNode *node = m_boxes.First(); while (node) @@ -618,6 +618,19 @@ void wxRadioBox::ApplyWidgetStyle() } } +#if wxUSE_TOOLTIPS +void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) +{ + wxNode *node = m_boxes.First(); + while (node) + { + GtkWidget *widget = GTK_WIDGET( node->Data() ); + gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL ); + node = node->Next(); + } +} +#endif // wxUSE_TOOLTIPS + bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window ) { if (window == m_widget->window) return TRUE; diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 975f4ab6ed..8a6ca2ccc7 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -33,22 +33,26 @@ wxMask::wxMask() wxMask::wxMask( const wxBitmap& bitmap, const wxColour& colour ) { + m_bitmap = (GdkBitmap *) NULL; Create( bitmap, colour ); } wxMask::wxMask( const wxBitmap& bitmap, int paletteIndex ) { + m_bitmap = (GdkBitmap *) NULL; Create( bitmap, paletteIndex ); } wxMask::wxMask( const wxBitmap& bitmap ) { + m_bitmap = (GdkBitmap *) NULL; Create( bitmap ); } wxMask::~wxMask() { - if (m_bitmap) gdk_bitmap_unref( m_bitmap ); + if (m_bitmap) + gdk_bitmap_unref( m_bitmap ); } bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 89f0c01611..32d0991d3e 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -490,9 +490,11 @@ bool wxClipboard::IsSupported( const wxDataFormat& format ) /* store requested format to be asked for by callbacks */ m_targetRequested = format; +#if 0 wxLogTrace( TRACE_CLIPBOARD, wxT("wxClipboard:IsSupported: requested format: %s"), format.GetId().c_str() ); +#endif wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") ); diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index ec667046fe..0e61498721 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -405,11 +405,11 @@ void wxRadioBox::SetSelection( int n ) GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); - DisableEvents(); + GtkDisableEvents(); gtk_toggle_button_set_state( button, 1 ); - EnableEvents(); + GtkEnableEvents(); } int wxRadioBox::GetSelection(void) const @@ -575,7 +575,7 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) wxFAIL_MSG(wxT("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); } -void wxRadioBox::DisableEvents() +void wxRadioBox::GtkDisableEvents() { wxNode *node = m_boxes.First(); while (node) @@ -587,7 +587,7 @@ void wxRadioBox::DisableEvents() } } -void wxRadioBox::EnableEvents() +void wxRadioBox::GtkEnableEvents() { wxNode *node = m_boxes.First(); while (node) @@ -618,6 +618,19 @@ void wxRadioBox::ApplyWidgetStyle() } } +#if wxUSE_TOOLTIPS +void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) +{ + wxNode *node = m_boxes.First(); + while (node) + { + GtkWidget *widget = GTK_WIDGET( node->Data() ); + gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL ); + node = node->Next(); + } +} +#endif // wxUSE_TOOLTIPS + bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window ) { if (window == m_widget->window) return TRUE; -- 2.45.2