void CSyncDirSet::OnInitButton() { HDC hParentDC = GetBackDC(); m_btDeleteDir.SetBackImage(_T("res\\bt_delete_nor.png"), _T("res\\bt_delete_hov.png"), _T("res\\bt_delete_hov.png"), _T("res\\bt_delete_nor.png"),CRect(2, 2, 2, 2)); m_btDeleteDir.SetButtonType(BT_PUSHBUTTON); m_btDeleteDir.SetParentBack(hParentDC); m_btDeleteDir.SetSize(130, 30); m_btOk.SetBackImage(_T("res\\bt_back.png"),_T("res\\bt_back.png"), _T("res\\bt_back.png"),_T("res\\bt_back.png")); m_btOk.SetButtonType(BT_PUSHBUTTON); m_btOk.SetParentBack(hParentDC); m_btOk.SetSize(74, 26); m_btCancle.SetBackImage(_T("res\\bt_back.png"),_T("res\\bt_back.png"), _T("res\\bt_back.png"),_T("res\\bt_back.png")); m_btCancle.SetButtonType(BT_PUSHBUTTON); m_btCancle.SetParentBack(hParentDC); m_btCancle.SetSize(74, 26); m_btCancleSync.SetBackImage(_T("res\\bt_back.png"),_T("res\\bt_back.png"), _T("res\\bt_back.png"),_T("res\\bt_back.png")); m_btCancleSync.SetButtonType(BT_PUSHBUTTON); m_btCancleSync.SetParentBack(hParentDC); m_btCancleSync.SetSize(74, 26); m_btSet.SetBackImage(_T("res\\bt_back.png"),_T("res\\bt_back.png"), _T("res\\bt_back.png"),_T("res\\bt_back.png")); m_btSet.SetButtonType(BT_PUSHBUTTON); m_btSet.SetParentBack(hParentDC); m_btSet.SetSize(74, 26); }
void CHallQueFrontView::ShowPage(int nPageID) { if(nPageID!=-1) { list<CTrackContrl*>::const_iterator itera = m_list_trackCtrl.begin(); for(itera;itera!=m_list_trackCtrl.end();itera++) { CTrackContrl* pTrackContrl = *itera; if(nPageID == pTrackContrl->GetSerialID())//找到界面 { if(m_pTrackCtrl!=NULL) m_pTrackCtrl->SetAllCtrlHide();//隐藏原来界面 m_pTrackCtrl = pTrackContrl;//新界面赋值 if(!MyLoadBackImage(pTrackContrl->GetBackPath())) { CDoFile doFile; CString path = doFile.GetExeFullFilePath(); path += _T("\\背景\\初始背景.jpg"); MyLoadBackImage(path); } GetBackDC();//重新加载背景DC /////////////////////////////////////////////////////////////////// theApp.m_Controller.InitShowInlineQueNum();//显示界面排队人数 pTrackContrl->SetAllCtrlShow();//显示 Invalidate(); break; } } // theApp.m_Controller.InitShowInlineQueNum();//显示界面排队人数 } }
void CCreateSyncDIr::OnInitButton() { CRect rcClient, rcCenter; GetClientRect(&rcClient); CalcCenterRect(rcClient, 360, 244, rcCenter); m_btCreate.SetBackImage(_T("res\\bt_create.png"),_T("res\\bt_create.png"), _T("res\\bt_create.png"),_T("res\\bt_create.png"), CRect(3,3,3,3)); m_btCreate.SetButtonType(BT_PUSHBUTTON); m_btCreate.SetParentBack(GetBackDC()); m_gbArea.SetItemSize(360, 244); m_gbArea.SetBackImage(_T("res\\bt_createdir.png")); m_gbArea.SetParentBack(GetBackDC()); m_gbArea.MoveWindow(&rcCenter); }
void CBackBuffer::Clear() { HBRUSH oldBrush = static_cast<HBRUSH>(SelectObject(GetBackDC(), GetStockObject(WHITE_BRUSH))); Rectangle(m_hDC, 0, 0, m_iWidth, m_iHeight); SelectObject(m_hDC, oldBrush); }
BOOL CBaseDialog::OnInitDialog() { CSkinDialog::OnInitDialog(); theApp.m_WindowArray.push_back(this); HDC hParentDC = GetBackDC(); SetExtrude(true); SetClipChild(true); m_pImageBack = RenderEngine->GetImage(theApp.m_szDefaultSkin); m_pShadow = RenderEngine->GetImage(TEXT("Res\\Shadow.png")); if ( m_pImageBack->IsNull() ) { AfxMessageBox(TEXT("资源加载失败!")); return FALSE; } CRect rcClient; GetClientRect(&rcClient); if ( m_enWndStyle != en_Wnd_None ) { m_btClose.Create(NULL,WS_VISIBLE|WS_CHILD,CRect(rcClient.Width()-25,25,0,0),this,IDCANCEL); m_btClose.SetBackImage(TEXT("Res\\Button\\btn_close_normal.png"),TEXT("Res\\Button\\btn_close_highlight.png"),TEXT("Res\\Button\\btn_close_down.png"),TEXT("Res\\Button\\btn_close_normal.png")); m_btClose.SetButtonType(en_PushButton); m_btClose.SetParentBack(hParentDC); m_btClose.SetSize(15,15); if ( m_enWndStyle != en_Wnd_CloseBox ) { if( m_enWndStyle != en_Wnd_MinimizeBox ) { m_btMax.Create(NULL,WS_VISIBLE|WS_CHILD,CRect(rcClient.Width()-50,25,0,0),this,IDC_WNDMAX); m_btMax.SetBackImage(TEXT("Res\\Button\\btn_max_normal.png"),TEXT("Res\\Button\\btn_max_highlight.png"),TEXT("Res\\Button\\btn_max_down.png"),TEXT("Res\\Button\\btn_max_normal.png")); m_btMax.SetButtonType(en_PushButton); m_btMax.SetParentBack(hParentDC); m_btMax.SetSize(16,15); } m_btMin.Create(NULL,WS_VISIBLE|WS_CHILD,CRect(rcClient.Width()-50-(m_enWndStyle==en_Wnd_Normal?25:0),25,0,0),this,IDC_WNDMIN); m_btMin.SetBackImage(TEXT("Res\\Button\\btn_mini_normal.png"),TEXT("Res\\Button\\btn_mini_highlight.png"),TEXT("Res\\Button\\btn_mini_down.png"),TEXT("Res\\Button\\btn_mini_normal.png")); m_btMin.SetButtonType(en_PushButton); m_btMin.SetParentBack(hParentDC); m_btMin.SetSize(15,15); } } return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
void CHallQueFrontView::OnErasebackpic() { // TODO: 在此添加命令处理程序代码 CFileDialog picdlg(TRUE, 0, 0, 4|2, m_picType); if(IDOK==picdlg.DoModal()) { CString backPath = picdlg.GetPathName(); m_pTrackCtrl->SetBackPath(backPath);//先设置背景图片路径 MyLoadBackImage(m_pTrackCtrl->GetSerialID());//然后加载图片 //////////////////保存背景DC GetBackDC();//保存全局DC ////////////////////// Invalidate(TRUE); } }
BOOL CPage1::OnInitDialog() { CMyDialog::OnInitDialog(); OnInitListCtrl(); HDC hParentDC = GetBackDC(); m_btAdd.SetBackImage(_T("res\\button_add_nor.png"), _T("res\\button_add_hov.png"), _T("res\\button_add_hov.png"), _T("res\\button_add_nor.png")); m_btAdd.SetButtonType(BT_PUSHBUTTON); m_btAdd.SetParentBack(hParentDC); m_btAdd.SetSize(500, 48); m_btAdd.MoveWindow(50, 370, 500, 48); return TRUE; }
BOOL CEasySkinManager::OnInitDialog() { CEasySkinDialog::OnInitDialog(); HDC hParentDC = GetBackDC(); m_pImageBack = UIRenderEngine->GetImage(GlobalUnits->m_szDefaultSkin); m_pImageLogo = UIRenderEngine->GetImage(TEXT("SkinUI\\图标\\Easy_32.png"));//Easy_32.png logo.png m_pImageTitle = UIRenderEngine->GetImage(TEXT("SkinUI\\图标\\logo.png"));//Easy_32.png GlobalUnits->m_WindowArray.push_back(this); CRect rcClient; GetClientRect(&rcClient); if ( m_enWndStyle != en_Wnd_None ) { m_btClose.Create(NULL,WS_VISIBLE|WS_CHILD,CRect(rcClient.Width()-41,0,0,0),this,IDCANCEL); m_btClose.SetBackImage(TEXT("\\SkinUI\\Button\\btn_close_normal.png"),TEXT("\\SkinUI\\Button\\btn_close_highlight.png"),TEXT("\\SkinUI\\Button\\btn_close_down.png"),TEXT("\\SkinUI\\Button\\btn_close_normal.png")); //m_btClose.SetBackImage(TEXT("\\SkinUI\\图标\\关闭常规.png"),TEXT("\\SkinUI\\图标\\关闭选中.png"),TEXT("\\SkinUI\\图标\\关闭选中.png"),TEXT("\\SkinUI\\图标\\关闭常规.png")); m_btClose.SetButtonType(en_PushButton); m_btClose.SetParentBack(hParentDC); m_btClose.SetSize(39,20); //m_btClose.SetSize(29,24); if ( m_enWndStyle != en_Wnd_CloseBox ) { if( m_enWndStyle != en_Wnd_MinimizeBox ) { m_btMax.Create(NULL,WS_VISIBLE|WS_CHILD,CRect(rcClient.Width()-69,0,0,0),this,IDC_WNDMAX); m_btMax.SetBackImage(TEXT("\\SkinUI\\Button\\btn_max_normal.png"),TEXT("\\SkinUI\\Button\\btn_max_highlight.png"),TEXT("\\SkinUI\\Button\\btn_max_down.png"),TEXT("\\SkinUI\\Button\\btn_max_normal.png")); m_btMax.SetButtonType(en_PushButton); m_btMax.SetParentBack(hParentDC); m_btMax.SetSize(28,20); } m_btMin.Create(NULL,WS_VISIBLE|WS_CHILD,CRect(rcClient.Width()-69-(m_enWndStyle==en_Wnd_Normal?28:0),0,0,0),this,IDC_WNDMIN); m_btMin.SetBackImage(TEXT("\\SkinUI\\Button\\btn_mini_normal.png"),TEXT("\\SkinUI\\Button\\btn_mini_highlight.png"),TEXT("\\SkinUI\\Button\\btn_mini_down.png"),TEXT("\\SkinUI\\Button\\btn_mini_normal.png")); m_btMin.SetButtonType(en_PushButton); m_btMin.SetParentBack(hParentDC); m_btMin.SetSize(28,20); } } return TRUE; }
void CHallQueFrontView::OnManage() { // TODO: 在此添加命令处理程序代码 CMainFrame *pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd; if(m_isManage) { return; } CPassWordDlg PassWordDlg(this); if(PassWordDlg.DoModal()==IDOK) { CRect rect; pFrame->m_wndToolBar.GetWindowRect(&rect); m_isManage=TRUE; list<CTrackContrl*>::const_iterator itera = m_list_trackCtrl.begin(); for(itera;itera!=m_list_trackCtrl.end();itera++) { CTrackContrl* pTrackCtrl = *itera; ASSERT(pTrackCtrl!=NULL); pTrackCtrl->AlterAllCtrTop(-rect.Height()); pTrackCtrl->SetAllCtrContralDisable(); } //退出全屏 pFrame->EndFullScreen(); //////////////////保存背景DC GetBackDC(); //////////////////////重画 for(int i=0;i<m_pTrackCtrl->m_selTrackerAll.GetSize();i++) { m_pTrackCtrl->m_selTrackerAll[i]->Invalidate(); } ///////////////////// CRect clientRect; GetClientRect(clientRect); CRect newRect; newRect.left=clientRect.left;newRect.right=m_rShowPageRect.right; newRect.top=m_rShowPageRect.top+clientRect.Height()/2-m_rShowPageRect.Height()/2; newRect.bottom = newRect.top+m_rShowPageRect.Height(); m_pShowPageDlg->MoveWindow(newRect,FALSE); m_pShowPageDlg->ShowWindow(SW_SHOWNORMAL); CButton* pButton = (CButton*)m_pShowPageDlg->GetDlgItem(IDC_BN_TIMEHIDE); if(pButton) pButton->SetWindowText(_T("<")); } // Invalidate(); }
void CDlgPanel::UpdataResource() { HDC hParentDC = GetBackDC(); CRect rcClient; GetClientRect(&rcClient); m_ftSaticDefault.CreateFont(19,0,0,0,FW_NORMAL,0,FALSE,0,0,0,0,0,0,TEXT("微软雅黑")); //贴图 m_btnStart.SetBackImage(TEXT("SkinUI\\图标\\按钮常规.png"), TEXT("SkinUI\\图标\\按钮选中.png"),TEXT("SkinUI\\图标\\按钮选中-2.png"),TEXT("SkinUI\\图标\\按钮常规.png"), &CRect(3,3,3,3)); m_btnStart.SetButtonType(en_PushButton);//en_IconButton m_btnStart.SetParentBack(hParentDC); //m_btnLocalView.SetIconImage(TEXT("SkinUI\\Main\\Tools.png")); m_btnStart.SetWindowText(TEXT("Start")); m_btnStart.SetSize(39,24);//74,24 }
BOOL CSyncDirSet::OnInitDialog() { CMyDialog::OnInitDialog(); CRect rcControl(0, 0, 0, 0); m_btClose.Create(NULL, WS_CHILD | WS_VISIBLE, rcControl, this, IDCANCEL); m_btClose.SetBackImage(_T("res\\close1.png"), _T("res\\close2.png"), _T("res\\close3.png"), _T("res\\close4.png")); m_btClose.SetButtonType(BT_PUSHBUTTON); m_btClose.SetParentBack(GetBackDC()); m_btClose.SetSize(18, 18); CRect rcCleint; GetClientRect(&rcCleint); SetControlPos(rcCleint.Width(), rcCleint.Height()); OnInitButton(); OnInitListCtrl(); return TRUE; }
void CHallQueFrontView::OnQuitmanage() { // TODO: 在此添加命令处理程序代码 if(!m_isManage) { return; } m_isManage=FALSE; CMainFrame *pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd; CRect rect; pFrame->m_wndToolBar.GetWindowRect(&rect); list<CTrackContrl*>::const_iterator itera = m_list_trackCtrl.begin(); for(itera;itera!=m_list_trackCtrl.end();itera++) { CTrackContrl* pTrackContrl = *itera; ASSERT(pTrackContrl!=NULL); pTrackContrl->SetAllCtrContralEnable(); if(pTrackContrl->GetSerialID()!=m_pTrackCtrl->GetSerialID()) { pTrackContrl->SetAllCtrlHide(); } pTrackContrl->AlterAllCtrTop(rect.Height()); } pFrame->FullScreen(); //////////////////保存背景DC GetBackDC(); ////////////////////// ////////////////////// m_pShowPageDlg->ShowWindow(SW_HIDE); ///////////////////// WritePageToFile();//写界面ID到文件,背景信息到文件 WriteCtrlDataToList();//先把控件写到链表里面 //////////////////// //写文件 WriteCtrInfoToFile();//写控件信息 //写背景信息 // WriteBackPicPathToFile(); }