X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c0b55475a7eef00cfd65834a2456e3e8919ac38..7f35402d14ae82a86b120a64888388272f9927c5:/src/generic/tipwin.cpp diff --git a/src/generic/tipwin.cpp b/src/generic/tipwin.cpp index 570d632273..ed4939a286 100644 --- a/src/generic/tipwin.cpp +++ b/src/generic/tipwin.cpp @@ -34,6 +34,7 @@ #include "wx/tipwin.h" #include "wx/timer.h" +#include "wx/settings.h" // ---------------------------------------------------------------------------- // constants @@ -95,16 +96,18 @@ wxTipWindow::wxTipWindow(wxWindow *parent, wxCoord maxLength, wxTipWindow** windowPtr) : wxFrame(parent, -1, _T(""), wxDefaultPosition, wxDefaultSize, - wxNO_BORDER | wxFRAME_FLOAT_ON_PARENT) + wxNO_BORDER | wxFRAME_NO_TASKBAR ) { // set colours SetForegroundColour(*wxBLACK); -#if !defined(__WXPM__) - SetBackgroundColour(wxColour(0xc3ffff)); + +#ifdef __WXMSW__ + wxColour bkCol(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_INFOBK)); #else - // What is 0xc3ffff, try some legable documentation for those of us who don't memorize hex codes?? - SetBackgroundColour(wxColour(*wxWHITE)); + wxColour bkCol(wxColour(255, 255, 225)); #endif + SetBackgroundColour(bkCol); + // set position and size int x, y; wxGetMousePosition(&x, &y); @@ -127,7 +130,7 @@ wxTipWindow::~wxTipWindow() } } -void wxTipWindow::OnMouseClick(wxMouseEvent& event) +void wxTipWindow::OnMouseClick(wxMouseEvent& WXUNUSED(event)) { Close(); } @@ -138,7 +141,7 @@ void wxTipWindow::OnActivate(wxActivateEvent& event) Close(); } -void wxTipWindow::OnKillFocus(wxFocusEvent& event) +void wxTipWindow::OnKillFocus(wxFocusEvent& WXUNUSED(event)) { // Under Windows at least, we will get this immediately // because when the view window is focussed, the @@ -159,12 +162,12 @@ wxTipWindowView::wxTipWindowView(wxWindow *parent) { // set colours SetForegroundColour(*wxBLACK); -#if !defined(__WXPM__) - SetBackgroundColour(wxColour(0xc3ffff)); +#ifdef __WXMSW__ + wxColour bkCol(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_INFOBK)); #else - // What is 0xc3ffff, try some legable documentation for those of us who don't memorize hex codes?? - SetBackgroundColour(wxColour(*wxWHITE)); + wxColour bkCol(wxColour(255, 255, 225)); #endif + SetBackgroundColour(bkCol); m_creationTime = wxGetLocalTime(); } @@ -231,7 +234,7 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength) 2*(TEXT_MARGIN_Y + 1) + parent->m_textLines.GetCount()*parent->m_heightLine); } -void wxTipWindowView::OnPaint(wxPaintEvent& event) +void wxTipWindowView::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxTipWindow* parent = (wxTipWindow*) GetParent(); if (!parent) @@ -247,12 +250,7 @@ void wxTipWindowView::OnPaint(wxPaintEvent& event) // first filll the background dc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID)); - // Under Windows, you apparently get a thin black border whether you like it or not :-( -#ifdef __WXMSW__ - dc.SetPen( * wxTRANSPARENT_PEN ); -#else dc.SetPen( * wxBLACK_PEN ); -#endif dc.DrawRectangle(rect); // and then draw the text line by line @@ -270,14 +268,15 @@ void wxTipWindowView::OnPaint(wxPaintEvent& event) } } -void wxTipWindowView::OnMouseClick(wxMouseEvent& event) +void wxTipWindowView::OnMouseClick(wxMouseEvent& WXUNUSED(event)) { GetParent()->Close(); } -void wxTipWindowView::OnKillFocus(wxFocusEvent& event) +void wxTipWindowView::OnKillFocus(wxFocusEvent& WXUNUSED(event)) { // Workaround the kill focus event happening just after creation in wxGTK if (wxGetLocalTime() > m_creationTime + 1) GetParent()->Close(); } +