From 3c679789bdbc8b42b7b71828b0f02f97614ee574 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 25 May 1999 13:36:09 +0000 Subject: [PATCH] windows emit wxCreateWindowEvent generic controls use wxINVERT for rubberbands etc wxXOR maps to GdkXOR etc git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 1 + src/common/event.cpp | 10 ++++++++++ src/generic/listctrl.cpp | 2 +- src/generic/sashwin.cpp | 2 +- src/generic/splitter.cpp | 6 +++++- src/gtk/dcclient.cpp | 24 ++++++++++++------------ src/gtk/textctrl.cpp | 14 +++++++------- src/gtk/window.cpp | 4 ++++ src/gtk1/dcclient.cpp | 24 ++++++++++++------------ src/gtk1/textctrl.cpp | 14 +++++++------- src/gtk1/window.cpp | 4 ++++ 11 files changed, 64 insertions(+), 41 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index e9f8825d9f..0453f4fc9a 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -478,6 +478,7 @@ public: void SetOrientation(int orient) { m_extraLong = (long) orient; } void SetPosition(int pos) { m_commandInt = pos; } + void CopyObject(wxObject& object_dest) const; public: int m_commandInt; // Additional information long m_extraLong; diff --git a/src/common/event.cpp b/src/common/event.cpp index 1813d7b4cf..0849fdb6a0 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -170,6 +170,16 @@ wxScrollWinEvent::wxScrollWinEvent(wxEventType commandType, m_commandInt = pos; } +void wxScrollWinEvent::CopyObject(wxObject& obj_d) const +{ + wxScrollWinEvent *obj = (wxScrollWinEvent*)&obj_d; + + wxEvent::CopyObject(obj_d); + + obj->m_extraLong = m_extraLong; + obj->m_commandInt = m_commandInt; +} + /* * Mouse events * diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 54e7506831..d0a1bd2fcd 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -781,7 +781,7 @@ void wxListHeaderWindow::DrawCurrent() m_owner->ClientToScreen( &x2, &y2 ); wxScreenDC dc; - dc.SetLogicalFunction( wxXOR ); + dc.SetLogicalFunction( wxINVERT ); dc.SetPen( wxPen( *wxBLACK, 2, wxSOLID ) ); dc.SetBrush( *wxTRANSPARENT_BRUSH ); diff --git a/src/generic/sashwin.cpp b/src/generic/sashwin.cpp index 32a708730e..bb03e90044 100644 --- a/src/generic/sashwin.cpp +++ b/src/generic/sashwin.cpp @@ -516,7 +516,7 @@ void wxSashWindow::DrawSashTracker(wxSashEdgePosition edge, int x, int y) wxPen sashTrackerPen(*wxBLACK, 2, wxSOLID); - screenDC.SetLogicalFunction(wxXOR); + screenDC.SetLogicalFunction(wxINVERT); screenDC.SetPen(sashTrackerPen); screenDC.SetBrush(*wxTRANSPARENT_BRUSH); diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index e2a50b5022..dd3ea592ab 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -537,7 +537,7 @@ void wxSplitterWindow::DrawSashTracker(int x, int y) ClientToScreen(&x1, &y1); ClientToScreen(&x2, &y2); - screenDC.SetLogicalFunction(wxXOR); + screenDC.SetLogicalFunction(wxINVERT); screenDC.SetPen(*m_sashTrackerPen); screenDC.SetBrush(*wxTRANSPARENT_BRUSH); @@ -599,9 +599,13 @@ void wxSplitterWindow::SizeWindows() m_windowTwo->Layout(); } } +#ifdef __WXGTK__ + Refresh(); +#else wxClientDC dc(this); DrawBorders(dc); DrawSash(dc); +#endif } // Set pane for unsplit window diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index c945bcd140..04fa10b530 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -973,19 +973,19 @@ void wxWindowDC::SetLogicalFunction( int function ) GdkFunction mode = GDK_COPY; switch (function) { - case wxXOR: mode = GDK_INVERT; break; - case wxINVERT: mode = GDK_XOR; break; + case wxXOR: mode = GDK_XOR; break; + case wxINVERT: mode = GDK_INVERT; break; #if (GDK_MINOR_VERSION > 0) - case wxOR_REVERSE: mode = GDK_OR_REVERSE; break; - case wxAND_REVERSE: mode = GDK_AND_REVERSE; break; - case wxCLEAR: mode = GDK_CLEAR; break; - case wxSET: mode = GDK_SET; break; - case wxOR_INVERT: mode = GDK_OR_INVERT; break; - case wxAND: mode = GDK_AND; break; - case wxOR: mode = GDK_OR; break; - case wxEQUIV: mode = GDK_EQUIV; break; - case wxNAND: mode = GDK_NAND; break; - case wxAND_INVERT: mode = GDK_AND_INVERT; break; + case wxOR_REVERSE: mode = GDK_OR_REVERSE; break; + case wxAND_REVERSE: mode = GDK_AND_REVERSE; break; + case wxCLEAR: mode = GDK_CLEAR; break; + case wxSET: mode = GDK_SET; break; + case wxOR_INVERT: mode = GDK_OR_INVERT; break; + case wxAND: mode = GDK_AND; break; + case wxOR: mode = GDK_OR; break; + case wxEQUIV: mode = GDK_EQUIV; break; + case wxNAND: mode = GDK_NAND; break; + case wxAND_INVERT: mode = GDK_AND_INVERT; break; /* ? wxSRC_INVERT GDK_AND_REVERSE, GDK_OR_REVERSE, GDK_OR_INVERT */ #endif default: break; diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 3640c7dfcc..de650285b7 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -44,10 +44,11 @@ extern bool g_blockEventsOnDrag; static void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) { - if (g_isIdle) wxapp_install_idle_handler(); - if (!win->m_hasVMT) return; + if (g_isIdle) + wxapp_install_idle_handler(); + win->SetModified(); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() ); @@ -63,11 +64,12 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) static void gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) { - if (g_isIdle) wxapp_install_idle_handler(); + if (!win->m_hasVMT) return; + + if (g_isIdle) + wxapp_install_idle_handler(); win->CalculateScrollbar(); - - if (!win->m_hasVMT) return; } //----------------------------------------------------------------------------- @@ -273,7 +275,6 @@ void wxTextCtrl::CalculateScrollbar() if (m_vScrollbarVisible) { gtk_widget_hide( m_vScrollbar ); - m_vScrollbarVisible = FALSE; } } @@ -282,7 +283,6 @@ void wxTextCtrl::CalculateScrollbar() if (!m_vScrollbarVisible) { gtk_widget_show( m_vScrollbar ); - m_vScrollbarVisible = TRUE; } } diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index d43e0946b1..cc9855afae 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1541,6 +1541,10 @@ gtk_window_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) win->SetForegroundColour( win->GetForegroundColour() ); win->SetCursor( win->GetCursor() ); + + wxWindowCreateEvent event( win ); + event.SetEventObject( win ); + win->GetEventHandler()->ProcessEvent( event ); return FALSE; } diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index c945bcd140..04fa10b530 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -973,19 +973,19 @@ void wxWindowDC::SetLogicalFunction( int function ) GdkFunction mode = GDK_COPY; switch (function) { - case wxXOR: mode = GDK_INVERT; break; - case wxINVERT: mode = GDK_XOR; break; + case wxXOR: mode = GDK_XOR; break; + case wxINVERT: mode = GDK_INVERT; break; #if (GDK_MINOR_VERSION > 0) - case wxOR_REVERSE: mode = GDK_OR_REVERSE; break; - case wxAND_REVERSE: mode = GDK_AND_REVERSE; break; - case wxCLEAR: mode = GDK_CLEAR; break; - case wxSET: mode = GDK_SET; break; - case wxOR_INVERT: mode = GDK_OR_INVERT; break; - case wxAND: mode = GDK_AND; break; - case wxOR: mode = GDK_OR; break; - case wxEQUIV: mode = GDK_EQUIV; break; - case wxNAND: mode = GDK_NAND; break; - case wxAND_INVERT: mode = GDK_AND_INVERT; break; + case wxOR_REVERSE: mode = GDK_OR_REVERSE; break; + case wxAND_REVERSE: mode = GDK_AND_REVERSE; break; + case wxCLEAR: mode = GDK_CLEAR; break; + case wxSET: mode = GDK_SET; break; + case wxOR_INVERT: mode = GDK_OR_INVERT; break; + case wxAND: mode = GDK_AND; break; + case wxOR: mode = GDK_OR; break; + case wxEQUIV: mode = GDK_EQUIV; break; + case wxNAND: mode = GDK_NAND; break; + case wxAND_INVERT: mode = GDK_AND_INVERT; break; /* ? wxSRC_INVERT GDK_AND_REVERSE, GDK_OR_REVERSE, GDK_OR_INVERT */ #endif default: break; diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 3640c7dfcc..de650285b7 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -44,10 +44,11 @@ extern bool g_blockEventsOnDrag; static void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) { - if (g_isIdle) wxapp_install_idle_handler(); - if (!win->m_hasVMT) return; + if (g_isIdle) + wxapp_install_idle_handler(); + win->SetModified(); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() ); @@ -63,11 +64,12 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) static void gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) { - if (g_isIdle) wxapp_install_idle_handler(); + if (!win->m_hasVMT) return; + + if (g_isIdle) + wxapp_install_idle_handler(); win->CalculateScrollbar(); - - if (!win->m_hasVMT) return; } //----------------------------------------------------------------------------- @@ -273,7 +275,6 @@ void wxTextCtrl::CalculateScrollbar() if (m_vScrollbarVisible) { gtk_widget_hide( m_vScrollbar ); - m_vScrollbarVisible = FALSE; } } @@ -282,7 +283,6 @@ void wxTextCtrl::CalculateScrollbar() if (!m_vScrollbarVisible) { gtk_widget_show( m_vScrollbar ); - m_vScrollbarVisible = TRUE; } } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index d43e0946b1..cc9855afae 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1541,6 +1541,10 @@ gtk_window_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) win->SetForegroundColour( win->GetForegroundColour() ); win->SetCursor( win->GetCursor() ); + + wxWindowCreateEvent event( win ); + event.SetEventObject( win ); + win->GetEventHandler()->ProcessEvent( event ); return FALSE; }