event/leave events
scrollbar fix listctrl fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
|
#include "wx/palette.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// classes
|
// classes
|
||||||
|
@@ -40,8 +40,9 @@ public:
|
|||||||
|
|
||||||
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
||||||
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
|
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
|
||||||
|
|
||||||
wxIcon( char **bits, int width=-1, int height=-1 ) :
|
// Don't change this. Robert.
|
||||||
|
wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
|
||||||
wxBitmap( bits ) {};
|
wxBitmap( bits ) {};
|
||||||
|
|
||||||
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
|
#include "wx/palette.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// classes
|
// classes
|
||||||
|
@@ -40,8 +40,9 @@ public:
|
|||||||
|
|
||||||
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
||||||
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
|
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
|
||||||
|
|
||||||
wxIcon( char **bits, int width=-1, int height=-1 ) :
|
// Don't change this. Robert.
|
||||||
|
wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
|
||||||
wxBitmap( bits ) {};
|
wxBitmap( bits ) {};
|
||||||
|
|
||||||
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
||||||
|
@@ -740,13 +740,13 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
|||||||
};
|
};
|
||||||
if (hit)
|
if (hit)
|
||||||
{
|
{
|
||||||
// if (m_currentCursor == wxSTANDARD_CURSOR) SetCursor( m_resizeCursor );
|
if (m_currentCursor == wxSTANDARD_CURSOR) SetCursor( m_resizeCursor );
|
||||||
// m_currentCursor = m_resizeCursor;
|
m_currentCursor = m_resizeCursor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if (m_currentCursor != wxSTANDARD_CURSOR) SetCursor( wxSTANDARD_CURSOR );
|
if (m_currentCursor != wxSTANDARD_CURSOR) SetCursor( wxSTANDARD_CURSOR );
|
||||||
// m_currentCursor = wxSTANDARD_CURSOR;
|
m_currentCursor = wxSTANDARD_CURSOR;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -2433,6 +2433,7 @@ void wxListCtrl::OnIdle( wxIdleEvent &event )
|
|||||||
|
|
||||||
m_mainWin->CalculatePositions();
|
m_mainWin->CalculatePositions();
|
||||||
m_mainWin->RealizeChanges();
|
m_mainWin->RealizeChanges();
|
||||||
|
m_mainWin->m_dirty = FALSE;
|
||||||
m_mainWin->Refresh();
|
m_mainWin->Refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -414,9 +414,9 @@ gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_e
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// focus_in
|
// focus_in
|
||||||
|
|
||||||
void gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
gint gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
||||||
{
|
{
|
||||||
if (g_blockEventsOnDrag) return;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
if (win->m_wxwindow)
|
if (win->m_wxwindow)
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
||||||
@@ -431,7 +431,7 @@ void gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUS
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!win->HasVMT()) return;
|
if (!win->HasVMT()) return FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf( "OnSetFocus from " );
|
printf( "OnSetFocus from " );
|
||||||
@@ -444,22 +444,22 @@ void gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUS
|
|||||||
|
|
||||||
wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
|
wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->ProcessEvent( event );
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// focus out
|
// focus out
|
||||||
|
|
||||||
void gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
gint gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
||||||
{
|
{
|
||||||
if (g_blockEventsOnDrag) return;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
if (win->m_wxwindow)
|
if (win->m_wxwindow)
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
||||||
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
|
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!win->HasVMT()) return;
|
if (!win->HasVMT()) return FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf( "OnKillFocus from " );
|
printf( "OnKillFocus from " );
|
||||||
@@ -470,7 +470,7 @@ void gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNU
|
|||||||
|
|
||||||
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
|
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->ProcessEvent( event );
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -648,27 +648,35 @@ bool gtk_window_destroy_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSE
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// enter
|
// enter
|
||||||
|
|
||||||
bool gtk_window_enter_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
|
bool gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
|
||||||
{
|
{
|
||||||
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return FALSE;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
|
|
||||||
if (widget->window)
|
if (widget->window)
|
||||||
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
|
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
|
||||||
|
|
||||||
return TRUE;
|
wxMouseEvent event( wxEVT_ENTER_WINDOW );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// leave
|
// leave
|
||||||
|
|
||||||
bool gtk_window_leave_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *WXUNUSED(win) )
|
bool gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
|
||||||
{
|
{
|
||||||
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return FALSE;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
|
|
||||||
if (widget->window)
|
if (widget->window)
|
||||||
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
|
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
|
||||||
|
|
||||||
return TRUE;
|
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1828,7 +1836,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
|
|||||||
else
|
else
|
||||||
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
|
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
|
||||||
|
|
||||||
// gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -414,9 +414,9 @@ gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_e
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// focus_in
|
// focus_in
|
||||||
|
|
||||||
void gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
gint gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
||||||
{
|
{
|
||||||
if (g_blockEventsOnDrag) return;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
if (win->m_wxwindow)
|
if (win->m_wxwindow)
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
||||||
@@ -431,7 +431,7 @@ void gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUS
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!win->HasVMT()) return;
|
if (!win->HasVMT()) return FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf( "OnSetFocus from " );
|
printf( "OnSetFocus from " );
|
||||||
@@ -444,22 +444,22 @@ void gtk_window_focus_in_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUS
|
|||||||
|
|
||||||
wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
|
wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->ProcessEvent( event );
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// focus out
|
// focus out
|
||||||
|
|
||||||
void gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
gint gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxWindow *win )
|
||||||
{
|
{
|
||||||
if (g_blockEventsOnDrag) return;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
if (win->m_wxwindow)
|
if (win->m_wxwindow)
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
|
||||||
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
|
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!win->HasVMT()) return;
|
if (!win->HasVMT()) return FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf( "OnKillFocus from " );
|
printf( "OnKillFocus from " );
|
||||||
@@ -470,7 +470,7 @@ void gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNU
|
|||||||
|
|
||||||
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
|
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->ProcessEvent( event );
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -648,27 +648,35 @@ bool gtk_window_destroy_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSE
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// enter
|
// enter
|
||||||
|
|
||||||
bool gtk_window_enter_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
|
bool gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
|
||||||
{
|
{
|
||||||
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return FALSE;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
|
|
||||||
if (widget->window)
|
if (widget->window)
|
||||||
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
|
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
|
||||||
|
|
||||||
return TRUE;
|
wxMouseEvent event( wxEVT_ENTER_WINDOW );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// leave
|
// leave
|
||||||
|
|
||||||
bool gtk_window_leave_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *WXUNUSED(win) )
|
bool gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
|
||||||
{
|
{
|
||||||
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return FALSE;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
|
|
||||||
if (widget->window)
|
if (widget->window)
|
||||||
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
|
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
|
||||||
|
|
||||||
return TRUE;
|
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
return win->ProcessEvent( event );
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1828,7 +1836,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
|
|||||||
else
|
else
|
||||||
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
|
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
|
||||||
|
|
||||||
// gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user