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

📄 styledlg.cpp

📁 winsur 源码 winsur 源码
💻 CPP
字号:
// StyleDlg.cpp : implementation file
//

#include "stdafx.h"
#include "WinSurge.h"
#include "StyleDlg.h"
#include "WinSurgeDlg.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CStyleDlg dialog


CStyleDlg::CStyleDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CStyleDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CStyleDlg)
	m_dec = _T("");
	m_skin = _T("");
	//}}AFX_DATA_INIT
}


void CStyleDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStyleDlg)
	DDX_Control(pDX, IDC_LIST, m_list);
	DDX_Text(pDX, IDC_DEC, m_dec);
	DDX_Text(pDX, IDC_STYLE, m_skin);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CStyleDlg, CDialog)
	//{{AFX_MSG_MAP(CStyleDlg)
	ON_BN_CLICKED(IDC_EXPLORE, OnExplore)
	ON_LBN_SELCHANGE(IDC_LIST, OnSelchangeList)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CStyleDlg message handlers

void CStyleDlg::OnExplore() 
{
	// TODO: Add your control notification handler code here
	CString strDirPath=_T("");
	BROWSEINFO bi = {
		this->GetSafeHwnd(),
			NULL,
			strDirPath.GetBuffer(255),
			NULL,//_T("加入目录中的所有MP3文件"),
			0,
			NULL,
			NULL,
			0};
		
		ITEMIDLIST* piid = NULL;
		
		// call the shell function
		piid = :: SHBrowseForFolder(&bi);
		strDirPath.ReleaseBuffer();
		
		// process the result
		if (piid && ::SHGetPathFromIDList(piid, strDirPath.GetBuffer(255)))
		{
			strDirPath.ReleaseBuffer();
			m_dec=strDirPath;

			UpdateData(FALSE);
		}
		else
		{
			return;
		}
}

BOOL CStyleDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CWinSurgeDlg* wdlg=(CWinSurgeDlg*)GetParent();
	for(int i=0;i<16;i++)
	{
		if(wdlg->TypeList[i]!="")
		{
			m_list.InsertString(0,wdlg->TypeList[i]);
		}
	}
	m_skin=wdlg->m_type;
	UpdateData(FALSE);
	HICON m_hIcon = AfxGetApp()->LoadIcon(IDI_OPPTION);
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CStyleDlg::OnSelchangeList() 
{
	// TODO: Add your control notification handler code here
	m_list.GetText(m_list.GetCurSel(),m_skin);
	UpdateData(FALSE);
}

⌨️ 快捷键说明

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