// 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;
// colours
m_normalColour = *wxBLUE;
m_hoverColour = *wxRED;
+ m_visitedColour = wxColour("#551a8b");
SetForegroundColour(m_normalColour);
// by default the font of an hyperlink control is underlined
// 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) );
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;
}
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);
#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