mainform.cpp
来自「Windows mobile下的透明控件(皮肤控件) 当前Windows 」· C++ 代码 · 共 172 行
CPP
172 行
#include "MainForm.h"
#define IDC_BTT_LEFT 100
#define IDC_BTT_RIGHT 101
#define IDC_RADIO_1 102
#define IDC_RADIO_2 103
#define IDC_RADIO_3 104
LPCWSTR GetMainFormClassName( void )
{
return L"YCtrlMainForm";
}
LPCWSTR GetMainFormCaption( void )
{
return L"Y控件演示";
}
/*********************************************************************************************
* CMainForm *
* *
* YCode Y代码 YCtrl Y控件 Windows Mobile 透明控件 2008 YCtrl 1.0 *
* 作者:卢益贵 QQ:48092788 luyigui.blog.nnsky.com *
* *
**********************************************************************************************/
CMainForm::CMainForm()
{
Create( NULL, 0, 0, 0, 0, GetMainFormClassName(), GetMainFormCaption() );
SetFormStyle( FS_SCREENCLIENT_NOMENU, TRUE );
CPanel *pPanel;
CLabel *pLabel;
CCheckBox *pCheck;
CRadioBox *pRadio;
m_pLabel = new CLabel;
m_pLabel->Create( this, this, 0, 90, 3, 48, 19, L"个人简历" );
m_pLabel->SetTextColor(0xFF);
CBtt *pBtt;
pBtt = new CBtt;
pBtt->Create( this, this, IDC_BTT_LEFT, 3, 3, 25, 15, L"<--" );
pBtt = new CBtt;
pBtt->Create( this, this, IDC_BTT_RIGHT, 212, 3, 25, 15, L"-->" );
pPanel = new CPanel;
pPanel->Create( this, this, 0, 10, 22, 220, 100, L"基本信息" );
pPanel->SetStyle( TRUE );
pPanel->SetTextColor(0xFF00);
pLabel = new CLabel;
pLabel->Create( this, pPanel, 0, 4, 18, 200, 19, L"姓名:卢益贵 籍贯:广西武鸣" );
pLabel = new CLabel;
pLabel->Create( this, pPanel, 0, 4, 38, 30, 19, L"婚否:" );
pRadio = new CRadioBox;
pRadio->Create( this, pPanel, 0, 34, 38, 30, 19, L"是" );
pRadio = new CRadioBox;
pRadio->Create( this, pPanel, 0, 70, 38, 30, 19, L"否" );
pRadio->SetChecked( TRUE );
pLabel = new CLabel;
pLabel->Create( this, pPanel, 0, 4, 58, 60, 19, L"个人爱好:" );
pCheck = new CCheckBox;
pCheck->Create( this, pPanel, 0, 63, 58, 45, 19, L"编程" );
pCheck->SetChecked( TRUE );
pCheck = new CCheckBox;
pCheck->Create( this, pPanel, 0, 108, 58, 45, 19, L"足球" );
pCheck = new CCheckBox;
pCheck->Create( this, pPanel, 0, 153, 58, 45, 19, L"徒步" );
pCheck->SetChecked( TRUE );
pCheck = new CCheckBox;
pCheck->Create( this, pPanel, 0, 63, 78, 45, 19, L"阅读" );
pCheck = new CCheckBox;
pCheck->Create( this, pPanel, 0, 108, 78, 45, 19, L"音乐" );
pCheck->SetChecked( TRUE );
pCheck = new CCheckBox;
pCheck->Create( this, pPanel, 0, 153, 78, 45, 19, L"游泳" );
pCheck->SetChecked( TRUE );
pCheck = (CCheckBox *)pPanel;
pPanel = new CPanel;
pPanel->Create( this, pCheck, 0, 108, 38, 100, 22, L"基本信息" );
pLabel = new CLabel;
pLabel->Create( this, pPanel, 0, 0, 0, 30, 19, L"党员:" );
pRadio = new CRadioBox;
pRadio->Create( this, pPanel, 0, 30, 0, 30, 19, L"是" );
pRadio = new CRadioBox;
pRadio->Create( this, pPanel, 0, 64, 0, 30, 19, L"否" );
pRadio->SetChecked( TRUE );
pPanel = new CPanel;
pPanel->Create( this, this, 0, 10, 126, 220, 95, L"个人作品" );
pPanel->SetStyle( TRUE );
pPanel->SetTextColor(0xFF00);
pLabel = new CLabel;
pLabel->Create( this, pPanel, 0, 4, 18, 212, 78, L"Gogoto嵌入式操作系统、掌运八字预测等玄学系列、万能通讯精灵、Windows Mobile 透明控件(YCtrls)、Delphi透明控件(XCtrls)等,基于单片机(430、ARM)、SQL、WinXP(Server)、WM等应用" );
pLabel->SetWordWrap( TRUE );
pPanel = new CPanel;
pPanel->Create( this, this, 0, 10, 230, 220, 60, L"皮肤操作" );
pPanel->SetStyle( TRUE );
pPanel->SetTextColor(0xFF00);
pRadio = new CRadioBox;
pRadio->Create( this, pPanel, IDC_RADIO_1, 20, 18, 70, 19, L"蓝色经典" );
pRadio->SetChecked( TRUE );
pRadio = new CRadioBox;
pRadio->Create( this, pPanel, IDC_RADIO_2, 100, 18, 70, 19, L"绿色经典" );
//pRadio = new CRadioBox;
//pRadio->Create( this, pPanel, IDC_RADIO_3, 146, 18, 70, 19, L"水果动物" );
pLabel = new CLabel;
pLabel->Create( this, pPanel, 0, 4, 38, 212, 19, L"下载更新:luyigui.blog.nnsky.com" );
pLabel->SetTextAlign( DT_VCENTER | DT_CENTER );
}
CMainForm::~CMainForm()
{
}
LRESULT CMainForm::WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch( uMsg )
{
case WM_COMMAND:
switch( wParam )
{
case IDC_BTT_LEFT:
m_pLabel->SetPos(m_pLabel->GetLeft() - 5, m_pLabel->GetTop(),
m_pLabel->GetWidth(), m_pLabel->GetHeigth());
return 0;
break;
case IDC_BTT_RIGHT:
m_pLabel->SetPos(m_pLabel->GetLeft() + 5, m_pLabel->GetTop(),
m_pLabel->GetWidth(), m_pLabel->GetHeigth());
return 0;
case IDC_RADIO_1:
g_pApp->ChangeSkin(L"\\Storage Card\\蓝色经典");
break;
case IDC_RADIO_2:
g_pApp->ChangeSkin(L"\\Storage Card\\绿色经典");
break;
default:
return CForm::WindowProc( hWnd, uMsg, wParam, lParam );
}
default:
return CForm::WindowProc( hWnd, uMsg, wParam, lParam );
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?