m_logicalFunction = function;
gdk_gc_set_function( m_penGC, mode );
gdk_gc_set_function( m_brushGC, mode );
+ gdk_gc_set_function( m_textGC, mode );
}
void wxPaintDC::SetTextForeground( const wxColour &col )
float line_step = win->m_adjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
float line_step = win->m_adjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
#include "wx/menu.h"
#include "wx/statusbr.h"
#include "wx/intl.h"
+#include "wx/settings.h"
#include "gdk/gdkprivate.h"
#include "gdk/gdkkeysyms.h"
float line_step = win->m_vAdjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
float line_step = win->m_hAdjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
void wxWindow::Clear()
{
- wxCHECK_RET( m_widget != NULL, "invalid window" );
+ wxCHECK_RET( m_widget != NULL, "invalid window" );
- if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
+ if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
}
wxColour wxWindow::GetBackgroundColour() const
{
- return m_backgroundColour;
+ return m_backgroundColour;
}
void wxWindow::SetBackgroundColour( const wxColour &colour )
{
- wxCHECK_RET( m_widget != NULL, "invalid window" );
+ wxCHECK_RET( m_widget != NULL, "invalid window" );
- m_backgroundColour = colour;
- if (!m_backgroundColour.Ok()) return;
+ if (m_backgroundColour == colour) return;
+
+ if (!m_backgroundColour.Ok())
+ if (wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ) == colour) return;
- if (m_wxwindow)
- {
- GdkWindow *window = m_wxwindow->window;
- m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
- gdk_window_set_background( window, m_backgroundColour.GetColor() );
- gdk_window_clear( window );
- }
+ m_backgroundColour = colour;
+ if (!m_backgroundColour.Ok()) return;
- ApplyWidgetStyle();
+ if (m_wxwindow)
+ {
+ GdkWindow *window = m_wxwindow->window;
+ m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
+ gdk_window_set_background( window, m_backgroundColour.GetColor() );
+ gdk_window_clear( window );
+ }
+
+ ApplyWidgetStyle();
}
wxColour wxWindow::GetForegroundColour() const
{
- return m_foregroundColour;
+ return m_foregroundColour;
}
void wxWindow::SetForegroundColour( const wxColour &colour )
{
- wxCHECK_RET( m_widget != NULL, "invalid window" );
+ wxCHECK_RET( m_widget != NULL, "invalid window" );
- m_foregroundColour = colour;
- if (!m_foregroundColour.Ok()) return;
+ if (m_foregroundColour == colour) return;
- ApplyWidgetStyle();
+ m_foregroundColour = colour;
+ if (!m_foregroundColour.Ok()) return;
+
+ ApplyWidgetStyle();
}
GtkStyle *wxWindow::GetWidgetStyle()
m_logicalFunction = function;
gdk_gc_set_function( m_penGC, mode );
gdk_gc_set_function( m_brushGC, mode );
+ gdk_gc_set_function( m_textGC, mode );
}
void wxPaintDC::SetTextForeground( const wxColour &col )
float line_step = win->m_adjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
float line_step = win->m_adjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
#include "wx/menu.h"
#include "wx/statusbr.h"
#include "wx/intl.h"
+#include "wx/settings.h"
#include "gdk/gdkprivate.h"
#include "gdk/gdkkeysyms.h"
float line_step = win->m_vAdjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
float line_step = win->m_hAdjust->step_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-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
void wxWindow::Clear()
{
- wxCHECK_RET( m_widget != NULL, "invalid window" );
+ wxCHECK_RET( m_widget != NULL, "invalid window" );
- if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
+ if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
}
wxColour wxWindow::GetBackgroundColour() const
{
- return m_backgroundColour;
+ return m_backgroundColour;
}
void wxWindow::SetBackgroundColour( const wxColour &colour )
{
- wxCHECK_RET( m_widget != NULL, "invalid window" );
+ wxCHECK_RET( m_widget != NULL, "invalid window" );
- m_backgroundColour = colour;
- if (!m_backgroundColour.Ok()) return;
+ if (m_backgroundColour == colour) return;
+
+ if (!m_backgroundColour.Ok())
+ if (wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ) == colour) return;
- if (m_wxwindow)
- {
- GdkWindow *window = m_wxwindow->window;
- m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
- gdk_window_set_background( window, m_backgroundColour.GetColor() );
- gdk_window_clear( window );
- }
+ m_backgroundColour = colour;
+ if (!m_backgroundColour.Ok()) return;
- ApplyWidgetStyle();
+ if (m_wxwindow)
+ {
+ GdkWindow *window = m_wxwindow->window;
+ m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
+ gdk_window_set_background( window, m_backgroundColour.GetColor() );
+ gdk_window_clear( window );
+ }
+
+ ApplyWidgetStyle();
}
wxColour wxWindow::GetForegroundColour() const
{
- return m_foregroundColour;
+ return m_foregroundColour;
}
void wxWindow::SetForegroundColour( const wxColour &colour )
{
- wxCHECK_RET( m_widget != NULL, "invalid window" );
+ wxCHECK_RET( m_widget != NULL, "invalid window" );
- m_foregroundColour = colour;
- if (!m_foregroundColour.Ok()) return;
+ if (m_foregroundColour == colour) return;
- ApplyWidgetStyle();
+ m_foregroundColour = colour;
+ if (!m_foregroundColour.Ok()) return;
+
+ ApplyWidgetStyle();
}
GtkStyle *wxWindow::GetWidgetStyle()