⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urllockdlg.cpp

📁 一个多窗口的浏览器的程序benbrowse
💻 CPP
字号:
// URLLockDlg.cpp : implementation file
//

#include "stdafx.h"
#include "benbenbrowser.h"

#include "URLLockDlg.h"

#include "generaldata.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CURLLockDlg dialog

CURLLockDlg::CURLLockDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CURLLockDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CURLLockDlg)
	m_urlenter = _T("");
	//}}AFX_DATA_INIT

}


void CURLLockDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CURLLockDlg)
	DDX_Control(pDX, IDC_URLLIST_URLLOCK, m_listboxctrl);
	DDX_Text(pDX, IDC_URLEDIT_URLLOCK, m_urlenter);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CURLLockDlg, CDialog)
	//{{AFX_MSG_MAP(CURLLockDlg)
	ON_BN_CLICKED(IDC_BTNDEL_URLLOCK, OnBtndelUrllock)
	ON_BN_CLICKED(IDC_BTNINSERT_URLLOCK, OnBtninsertUrllock)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CURLLockDlg message handlers

BOOL CURLLockDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	for(int i=0;i<m_lockurls.GetCount();i++)
	{
		m_listboxctrl.AddString(m_lockurls.GetAt(m_lockurls.FindIndex(i)));
	}
	SetLanguage();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CURLLockDlg::SetListBoxData(CStringList *data)
{
	for(int i=0;i<data->GetCount();i++)
	{
		m_lockurls.AddTail(data->GetAt(data->FindIndex(i)));
	}
}

void CURLLockDlg::OnOK() 
{
	// TODO: Add extra validation here
	m_lockurls.RemoveAll();
	CString url;
	for(int i=0;i<m_listboxctrl.GetCount();i++)
	{
		m_listboxctrl.GetText(i,url);
	    m_lockurls.AddTail(url);
	}
	CDialog::OnOK();
}

void CURLLockDlg::OnBtndelUrllock() 
{
	// TODO: Add your control notification handler code here
	m_listboxctrl.DeleteString(m_listboxctrl.GetCurSel());
}

void CURLLockDlg::OnBtninsertUrllock() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	m_listboxctrl.AddString(m_urlenter);
}

void CURLLockDlg::SetLanguage()
{
	CString wintextsrc;
	CString wintextnew;
	
	if(this)
	{
		this->GetWindowText(wintextsrc);
		GetText(wintextsrc,wintextnew,global_item_text);
		this->SetWindowText(wintextnew);
	}
	
	CWnd *wnd=GetDlgItem(IDOK);;
	if(wnd)
	{
		wnd->GetWindowText(wintextsrc);
		GetText(wintextsrc,wintextnew,global_item_text);
		wnd->SetWindowText(wintextnew);
	}
	wnd=GetDlgItem(IDCANCEL);
	if(wnd)
	{
		wnd->GetWindowText(wintextsrc);
		GetText(wintextsrc,wintextnew,global_item_text);
		wnd->SetWindowText(wintextnew);
	}
	wnd=GetDlgItem(IDC_BTNINSERT_URLLOCK);
	if(wnd)
	{
		wnd->GetWindowText(wintextsrc);
		GetText(wintextsrc,wintextnew,global_item_text);
		wnd->SetWindowText(wintextnew);
	}
	wnd=GetDlgItem(IDC_BTNDEL_URLLOCK);
	if(wnd)
	{
		wnd->GetWindowText(wintextsrc);
		GetText(wintextsrc,wintextnew,global_item_text);
		wnd->SetWindowText(wintextnew);
	}
	wnd=GetDlgItem(IDC_STATIC1);
	if(wnd)
	{
		wnd->GetWindowText(wintextsrc);
		GetText(wintextsrc,wintextnew,global_item_text);
		wnd->SetWindowText(wintextnew);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -