X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c105dda0810d927d8531e4949ada0b407a1cbebd..3dea8ba7acb49948ccda20029655fd190a306298:/src/generic/hyperlinkg.cpp?ds=sidebyside diff --git a/src/generic/hyperlinkg.cpp b/src/generic/hyperlinkg.cpp index 573c18d178..791b15b357 100644 --- a/src/generic/hyperlinkg.cpp +++ b/src/generic/hyperlinkg.cpp @@ -62,6 +62,9 @@ bool wxGenericHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id, // do validation checks: CheckParams(label, url, style); + if ((style & wxHL_ALIGN_LEFT) == 0) + style |= wxFULL_REPAINT_ON_RESIZE; + if (!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name)) return false; @@ -76,6 +79,7 @@ bool wxGenericHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id, // colours m_normalColour = *wxBLUE; m_hoverColour = *wxRED; + m_visitedColour = wxColour("#551a8b"); SetForegroundColour(m_normalColour); // by default the font of an hyperlink control is underlined @@ -94,7 +98,6 @@ bool wxGenericHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id, // with GTK+'s native handling): Connect( wxEVT_PAINT, wxPaintEventHandler(wxGenericHyperlinkCtrl::OnPaint) ); - Connect( wxEVT_SIZE, wxSizeEventHandler(wxGenericHyperlinkCtrl::OnSize) ); Connect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler(wxGenericHyperlinkCtrl::OnLeaveWindow) ); Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler(wxGenericHyperlinkCtrl::OnLeftDown) ); @@ -145,7 +148,7 @@ void wxGenericHyperlinkCtrl::SetVisitedColour(const wxColour &colour) void wxGenericHyperlinkCtrl::DoContextMenu(const wxPoint &pos) { wxMenu *menuPopUp = new wxMenu(wxEmptyString, wxMENU_TEAROFF); - menuPopUp->Append(wxHYPERLINK_POPUP_COPY_ID, wxT("Copy URL")); + menuPopUp->Append(wxHYPERLINK_POPUP_COPY_ID, _("&Copy URL")); PopupMenu( menuPopUp, pos ); delete menuPopUp; } @@ -193,7 +196,7 @@ void wxGenericHyperlinkCtrl::OnLeftDown(wxMouseEvent& event) void wxGenericHyperlinkCtrl::OnLeftUp(wxMouseEvent& event) { // the click must be started and ended in the hyperlink rect - if (!m_clicking || !GetLabelRect().Contains(event.GetPosition())) + if (!m_clicking || !GetLabelRect().Contains(event.GetPosition())) return; SetForegroundColour(m_visitedColour); @@ -259,11 +262,4 @@ void wxGenericHyperlinkCtrl::OnPopUpCopy( wxCommandEvent& WXUNUSED(event) ) #endif // wxUSE_CLIPBOARD } -void wxGenericHyperlinkCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - // update the position of the label in the screen respecting - // the selected align flag - Refresh(); -} - #endif // wxUSE_HYPERLINKCTRL