Added support for SCROLL_TOP and _BOTTOM events
Corrected behaviour for Blit with LogicalFunctions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -868,6 +868,7 @@ void wxPaintDC::SetLogicalFunction( int function )
|
|||||||
m_logicalFunction = function;
|
m_logicalFunction = function;
|
||||||
gdk_gc_set_function( m_penGC, mode );
|
gdk_gc_set_function( m_penGC, mode );
|
||||||
gdk_gc_set_function( m_brushGC, mode );
|
gdk_gc_set_function( m_brushGC, mode );
|
||||||
|
gdk_gc_set_function( m_textGC, mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPaintDC::SetTextForeground( const wxColour &col )
|
void wxPaintDC::SetTextForeground( const wxColour &col )
|
||||||
|
@@ -39,7 +39,9 @@ static void gtk_scrollbar_callback( GtkWidget *WXUNUSED(widget), wxScrollBar *wi
|
|||||||
float line_step = win->m_adjust->step_increment;
|
float line_step = win->m_adjust->step_increment;
|
||||||
float page_step = win->m_adjust->page_increment;
|
float page_step = win->m_adjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_adjust->value-win->m_adjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_adjust->value-win->m_adjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
|
@@ -38,7 +38,9 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
|
|||||||
float line_step = win->m_adjust->step_increment;
|
float line_step = win->m_adjust->step_increment;
|
||||||
float page_step = win->m_adjust->page_increment;
|
float page_step = win->m_adjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_adjust->value-win->m_adjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_adjust->value-win->m_adjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "wx/menu.h"
|
#include "wx/menu.h"
|
||||||
#include "wx/statusbr.h"
|
#include "wx/statusbr.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
#include "gdk/gdkprivate.h"
|
#include "gdk/gdkprivate.h"
|
||||||
#include "gdk/gdkkeysyms.h"
|
#include "gdk/gdkkeysyms.h"
|
||||||
|
|
||||||
@@ -713,7 +714,9 @@ static void gtk_window_vscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
|
|||||||
float line_step = win->m_vAdjust->step_increment;
|
float line_step = win->m_vAdjust->step_increment;
|
||||||
float page_step = win->m_vAdjust->page_increment;
|
float page_step = win->m_vAdjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_vAdjust->value-win->m_vAdjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_vAdjust->value-win->m_vAdjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
@@ -751,7 +754,9 @@ static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
|
|||||||
float line_step = win->m_hAdjust->step_increment;
|
float line_step = win->m_hAdjust->step_increment;
|
||||||
float page_step = win->m_hAdjust->page_increment;
|
float page_step = win->m_hAdjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_hAdjust->value-win->m_hAdjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_hAdjust->value-win->m_hAdjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
@@ -2016,6 +2021,11 @@ void wxWindow::SetBackgroundColour( const wxColour &colour )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
||||||
|
|
||||||
|
if (m_backgroundColour == colour) return;
|
||||||
|
|
||||||
|
if (!m_backgroundColour.Ok())
|
||||||
|
if (wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ) == colour) return;
|
||||||
|
|
||||||
m_backgroundColour = colour;
|
m_backgroundColour = colour;
|
||||||
if (!m_backgroundColour.Ok()) return;
|
if (!m_backgroundColour.Ok()) return;
|
||||||
|
|
||||||
@@ -2039,6 +2049,8 @@ void wxWindow::SetForegroundColour( const wxColour &colour )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
||||||
|
|
||||||
|
if (m_foregroundColour == colour) return;
|
||||||
|
|
||||||
m_foregroundColour = colour;
|
m_foregroundColour = colour;
|
||||||
if (!m_foregroundColour.Ok()) return;
|
if (!m_foregroundColour.Ok()) return;
|
||||||
|
|
||||||
|
@@ -868,6 +868,7 @@ void wxPaintDC::SetLogicalFunction( int function )
|
|||||||
m_logicalFunction = function;
|
m_logicalFunction = function;
|
||||||
gdk_gc_set_function( m_penGC, mode );
|
gdk_gc_set_function( m_penGC, mode );
|
||||||
gdk_gc_set_function( m_brushGC, mode );
|
gdk_gc_set_function( m_brushGC, mode );
|
||||||
|
gdk_gc_set_function( m_textGC, mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPaintDC::SetTextForeground( const wxColour &col )
|
void wxPaintDC::SetTextForeground( const wxColour &col )
|
||||||
|
@@ -39,7 +39,9 @@ static void gtk_scrollbar_callback( GtkWidget *WXUNUSED(widget), wxScrollBar *wi
|
|||||||
float line_step = win->m_adjust->step_increment;
|
float line_step = win->m_adjust->step_increment;
|
||||||
float page_step = win->m_adjust->page_increment;
|
float page_step = win->m_adjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_adjust->value-win->m_adjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_adjust->value-win->m_adjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
|
@@ -38,7 +38,9 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
|
|||||||
float line_step = win->m_adjust->step_increment;
|
float line_step = win->m_adjust->step_increment;
|
||||||
float page_step = win->m_adjust->page_increment;
|
float page_step = win->m_adjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_adjust->value-win->m_adjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_adjust->value-win->m_adjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "wx/menu.h"
|
#include "wx/menu.h"
|
||||||
#include "wx/statusbr.h"
|
#include "wx/statusbr.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
#include "gdk/gdkprivate.h"
|
#include "gdk/gdkprivate.h"
|
||||||
#include "gdk/gdkkeysyms.h"
|
#include "gdk/gdkkeysyms.h"
|
||||||
|
|
||||||
@@ -713,7 +714,9 @@ static void gtk_window_vscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
|
|||||||
float line_step = win->m_vAdjust->step_increment;
|
float line_step = win->m_vAdjust->step_increment;
|
||||||
float page_step = win->m_vAdjust->page_increment;
|
float page_step = win->m_vAdjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_vAdjust->value-win->m_vAdjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_vAdjust->value-win->m_vAdjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
@@ -751,7 +754,9 @@ static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
|
|||||||
float line_step = win->m_hAdjust->step_increment;
|
float line_step = win->m_hAdjust->step_increment;
|
||||||
float page_step = win->m_hAdjust->page_increment;
|
float page_step = win->m_hAdjust->page_increment;
|
||||||
|
|
||||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
if (fabs(win->m_hAdjust->value-win->m_hAdjust->lower) < 0.2) command = wxEVT_SCROLL_BOTTOM;
|
||||||
|
else if (fabs(win->m_hAdjust->value-win->m_hAdjust->upper) < 0.2) command = wxEVT_SCROLL_TOP;
|
||||||
|
else if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||||
@@ -2016,6 +2021,11 @@ void wxWindow::SetBackgroundColour( const wxColour &colour )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
||||||
|
|
||||||
|
if (m_backgroundColour == colour) return;
|
||||||
|
|
||||||
|
if (!m_backgroundColour.Ok())
|
||||||
|
if (wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ) == colour) return;
|
||||||
|
|
||||||
m_backgroundColour = colour;
|
m_backgroundColour = colour;
|
||||||
if (!m_backgroundColour.Ok()) return;
|
if (!m_backgroundColour.Ok()) return;
|
||||||
|
|
||||||
@@ -2039,6 +2049,8 @@ void wxWindow::SetForegroundColour( const wxColour &colour )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
wxCHECK_RET( m_widget != NULL, "invalid window" );
|
||||||
|
|
||||||
|
if (m_foregroundColour == colour) return;
|
||||||
|
|
||||||
m_foregroundColour = colour;
|
m_foregroundColour = colour;
|
||||||
if (!m_foregroundColour.Ok()) return;
|
if (!m_foregroundColour.Ok()) return;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user