// reserved for internal use only
#define wxHYPERLINKCTRL_POPUP_COPY_ID 16384
+const wxChar wxHyperlinkCtrlNameStr[] = wxT("hyperlink");
+
// ----------------------------------------------------------------------------
// wxHyperlinkCtrl
// ----------------------------------------------------------------------------
f.SetUnderlined(true);
SetFont(f);
- CacheBestSize(DoGetBestSize());
- SetMinSize(GetBestSize());
- SetSize (DoGetBestSize());
-
+ SetBestFittingSize(size);
+
return true;
}
dc.SetFont(GetFont());
dc.GetTextExtent(GetLabel(), &w, &h);
- return wxSize(w, h);
+ wxSize best(w, h);
+ CacheBestSize(best);
+ return best;
}
-void wxHyperlinkCtrl::DoGetSize(int *width, int *height) const
-{
- if (width) *width = GetBestSize().GetWidth();
- if (height) *height = GetBestSize().GetHeight();
-}
void wxHyperlinkCtrl::SetNormalColour(const wxColour &colour)
{
void wxHyperlinkCtrl::OnLeftDown(wxMouseEvent& event)
{
// the left click must start from the hyperlink rect
- m_clicking = GetLabelRect().Inside(event.GetPosition());
+ m_clicking = GetLabelRect().Contains(event.GetPosition());
}
void wxHyperlinkCtrl::OnLeftUp(wxMouseEvent& event)
{
// the click must be started and ended in the hyperlink rect
- if (!m_clicking || !GetLabelRect().Inside(event.GetPosition()))
+ if (!m_clicking || !GetLabelRect().Contains(event.GetPosition()))
return;
SetForegroundColour(m_visitedColour);
void wxHyperlinkCtrl::OnRightUp(wxMouseEvent& event)
{
if( GetWindowStyle() & wxHL_CONTEXTMENU )
- if ( GetLabelRect().Inside(event.GetPosition()) )
+ if ( GetLabelRect().Contains(event.GetPosition()) )
DoContextMenu(wxPoint(event.m_x, event.m_y));
}
{
wxRect textrc = GetLabelRect();
- if (textrc.Inside(event.GetPosition()))
+ if (textrc.Contains(event.GetPosition()))
{
SetCursor(wxCursor(wxCURSOR_HAND));
SetForegroundColour(m_hoverColour);