rLink::StyleDownClick);
return TRUE; // return TRUE unless you set the focus to a control
}
void CHypLnkExDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CHypLnkExDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CHypLnkExDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CHypLnkExDlg::OnCheck1()
{
DWORD dwRemove=0L, dwAdd=0L;
UpdateData();
if (m_bUnderline)
dwAdd = CHyperLink::StyleUnderline;
else
dwRemove = CHyperLink::StyleUnderline;
m_hyperlink1.ModifyLinkStyle(dwRemove, dwAdd);
m_hyperlink2.ModifyLinkStyle(dwRemove, dwAdd);
m_hyperlink3.ModifyLinkStyle(dwRemove, dwAdd);
m_hyperlink4.ModifyLinkStyle(dwRemove, dwAdd);
}
void CHypLnkExDlg::OnCheck2()
{
DWORD dwRemove=0L, dwAdd=0L;
UpdateData();
if (m_bUseHover)
dwAdd = CHyperLink::StyleUseHover;
else
dwRemove = CHyperLink::StyleUseHover;
m_hyperlink1.ModifyLinkStyle(dwRemove, dwAdd);
m_hyperlink2.ModifyLinkStyle(dwRemove, dwAdd);
m_hyperlink3.ModifyLinkStyle(dwRemove, dwAdd);
m_hyperlink4.ModifyLinkStyle(dwRemove, dwAdd);
}
void CHypLnkExDlg::OnCheck3()
{
UpdateData();
if (m_bShowURL) {
m_hyperlink1.SetWindowText(_T("http://www.firstsite.net"));
m_hyperlink2.SetWindowText(_T("http://www.secondsite.net"));
m_hyperlink3.SetWindowText(_T("http://www.thirdsite.net"));
m_hyperlink4.SetWindowText(_T("http://www.fourthsite.net"));
}
else {
m_hyperlink1.SetWindowText(_T("First site"));
m_hyperlink2.SetWindowText(_T("Second site"));
m_hyperlink3.SetWindowText(_T("Third site"));
m_hyperlink4.SetWindowText(_T("Fourth site"));
}
}
void CHypLnkExDlg::OnCheck4()
{
UpdateData();
CFont* pFont = m_hyperlink1.GetFont();
LOGFONT lf;
if (pFont != NULL) {
pFont->GetLogFont(&lf);
lf.lfItalic = m_bItalic;
m_Font.DeleteObject();
m_Font.CreateFontIndirect(&lf);
}
m_hyperlink1.SetFont(&m_Font);
m_hyperlink2.SetFont(&m_Font);
m_hyperlink3.SetFont(&m_Font);
m_hyperlink4.SetFont(&m_Font);
}