本文整理汇总了C++中COptionUI::IsSelected方法的典型用法代码示例。如果您正苦于以下问题:C++ COptionUI::IsSelected方法的具体用法?C++ COptionUI::IsSelected怎么用?C++ COptionUI::IsSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COptionUI
的用法示例。
在下文中一共展示了COptionUI::IsSelected方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetData
void CLoginWnd::GetData()
{
CEditUI* pAccount = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("account")));
m_strAccount = pAccount->GetText();
CEditUI* pWord = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("password")));
m_strPassWord = pWord->GetText();
COptionUI* pLeft = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("remember")));
m_IsLeftSelected = pLeft->IsSelected();
COptionUI* pRight = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("autolog")));
m_IsRightSeleced = pRight->IsSelected();
}
示例2: Notify
void CLoginWnd::Notify(TNotifyUI& msg)
{
if (msg.sType ==DUI_MSGTYPE_CLICK)
{
CDuiString str = msg.pSender->GetName();
if ( str == _T("configbtn"))
{
CConfigWnd* pConfig = new CConfigWnd;
pConfig->Create(NULL,_T("服务器配置"),UI_WNDSTYLE_FRAME,WS_EX_WINDOWEDGE);
pConfig->CenterWindow();
pConfig->ShowModal();
delete pConfig;
}
else if ( str == _T("login"))
{
Login();
}
}
if (msg.sType == DUI_MSGTYPE_SELECTCHANGED)
{
if (msg.pSender->GetName()==_T("autolog"))
{
COptionUI* pLeft = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("remember")));
COptionUI* pRight = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("autolog")));
if (!pLeft->IsSelected())
{
pLeft->Selected(true);
}
}
}
return WindowImplBase::Notify(msg);
}
示例3: DeleteFileItem
void CDuiFrameWnd::DeleteFileItem()
{
COptionUI* pOption = NULL;
CVerticalLayoutUI* pLayout = (CVerticalLayoutUI*)m_PaintManager.FindControl(_T("playlist"));
int nIndex = pLayout->GetCount();
for (int i = 0; i < nIndex;i++)
{
pOption = (COptionUI*)pLayout->GetItemAt(i);
if (pOption->IsSelected())
{
CDuiString strPath = pOption->GetUserData();
m_cPlayList.deleteFile(strPath.GetData());
pLayout->RemoveAt(i);
break;
}
}
}
示例4: Notify
//.........这里部分代码省略.........
CFrameBusinessData::Instance()->setProjectItem(pData);
}
}
else if (msg.pSender->GetName() == "btn_bussiness_chat")
{
sProjectItem* pData = (sProjectItem*)msg.pSender->GetParent()->GetParent()->GetParent()->GetTag();
if (NULL != pData)
{
//没有创建房间,就需要重新选人。
if (pData->strRoomID.empty())
{
CAddNewGroupMember* pAddGroupMemWnd = new CAddNewGroupMember(m_PaintManager);
if (NULL != pAddGroupMemWnd)
{
pAddGroupMemWnd->SetShowMode(true);
pAddGroupMemWnd->CreateWnd();
pAddGroupMemWnd->Initialize();//初始化一次。
}
//bool bWithProperty = m_pComboResProperty->GetCurSel() == 1;
pAddGroupMemWnd->SetResProperty(false, pData->strProjID, pData->strProjName);
pAddGroupMemWnd->ShowWindow(true);
}
else
{
//我有可能不是这个群里面的成员,就需要判断下。如果我不是这个群里面的人,就不能进去。
tstring strMyPhone = CController::Instance()->GetXmppClient()->jid().username();
tstring strMyAccount = strMyPhone+MMPC_ACCOUNT;
if(CController::Instance()->GetRoomManager()->IsInThisRoom(pData->strRoomID, strMyAccount ))
{
CController::Instance()->GetRoomManager()->EnterRoom(pData->strRoomID, strMyPhone);
if (pData->strDestOrgID.empty() && pData->strDestOrgName.empty())
{
if (pData->vecDestParticipants.size()>0)
{
mainDlg::getInstance()->OnShowGroupChatWnd_Personal(pData->vecDestParticipants[0], pData->strRoomID);
}
}
else
{
mainDlg::getInstance()->OnShowGroupChatWnd(pData->strDestOrgID, pData->strDestOrgName, pData->strRoomID);
}
}
else
{
CMsgBox* pMsgBox = new CMsgBox("错误","您不是该群组成员!");
pMsgBox->ShowModal();
}
}
}
}
//增加搜索功能 by HQ 20160519
else if (msg.pSender->GetName() == "btn_Search")
{
COptionUI* OptionToday = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionToday"));
COptionUI* OptionWeek = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionWeek"));
COptionUI* OptionMonth = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionMonth"));
COptionUI* OptionAll = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionAll"));
tstring sSelectedTime=(_T(""));
if (OptionToday->IsSelected())
{
time_t tToday = time(0);
sSelectedTime = GetYMDTimeString(tToday);
}
else if (OptionWeek->IsSelected())
{
time_t tToday = time(0);
time_t tOneWeekAgo = tToday - const_one_week_seconds;
sSelectedTime = GetYMDTimeString(tOneWeekAgo);
}
else if (OptionMonth->IsSelected())
{
time_t tToday = time(0);
time_t tOneMonthAgo = tToday - const_one_month_seconds;
sSelectedTime = GetYMDTimeString(tOneMonthAgo);
}
else if (OptionAll->IsSelected())
{
//do nothing...
}
CEditUI* edtSearchString = static_cast<CEditUI*>(m_PaintManager->FindControl("edt_SearchString"));
tstring sSearchString = edtSearchString->GetText();
//允许空字符串查询 by HQ 20160519
//if(sSearchString == "")
//{
// CMsgBox* pMsgBox = new CMsgBox("错误","请输入查找条件!");
// pMsgBox->ShowModal();
// edtSearchString->SetFocus();
//}
//else
//{
FetchProjects(sSelectedTime,sSearchString);
//}
}
}
示例5: TBCIASendMessage
NSDUILIB_API void TBCIASendMessage(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)
{
HWND hwnd = (HWND)popint();
TCHAR msgID[MAX_PATH];
TCHAR wParam[MAX_PATH];
TCHAR lParam[MAX_PATH];
EXDLL_INIT();
ZeroMemory(msgID, MAX_PATH*sizeof(TCHAR));
ZeroMemory(wParam, MAX_PATH*sizeof(TCHAR));
ZeroMemory(lParam, MAX_PATH*sizeof(TCHAR));
DEBUG_INFO("to send message stringsize %d MAX_PATH %d\n",g_stringsize,MAX_PATH);
popstring( msgID,sizeof(msgID) );
popstring( wParam,sizeof(wParam) );
popstring( lParam ,sizeof(lParam));
if( _tcsicmp( msgID, _T("WM_TBCIAMIN")) == 0 )
::SendMessage( hwnd, WM_TBCIAMIN, (WPARAM)wParam, (LPARAM)lParam );
else if( _tcsicmp( msgID, _T("WM_TBCIACLOSE")) == 0 )
::SendMessage( hwnd, WM_TBCIACLOSE, (WPARAM)wParam, (LPARAM)lParam );
else if( _tcsicmp( msgID, _T("WM_TBCIABACK")) == 0 )
::SendMessage( hwnd, WM_TBCIABACK, (WPARAM)g_installPageTabName.GetData(), (LPARAM)lParam );
else if( _tcsicmp( msgID, _T("WM_TBCIANEXT")) == 0 )
::SendMessage( hwnd, WM_TBCIANEXT, (WPARAM)g_installPageTabName.GetData(), (LPARAM)lParam );
else if( _tcsicmp( msgID, _T("WM_TBCIACANCEL")) == 0 )
{
LPCTSTR lpTitle = (LPCTSTR)wParam;
LPCTSTR lpText = (LPCTSTR)lParam;
DEBUG_BUFFER_FMT(lpTitle,_tcslen(lpTitle) + sizeof(TCHAR),"lpTitle :");
DEBUG_BUFFER_FMT(lpText,_tcslen(lpText) + sizeof(TCHAR),"lpText :");
if( IDYES == MessageBox( hwnd, lpText, lpTitle, MB_YESNO)/*TBCIAMessageBox( hwnd, lpTitle, lpText )*/)
{
pushint( 0 );
::SendMessage( hwnd, WM_TBCIACLOSE, (WPARAM)wParam, (LPARAM)lParam );
}
else
pushint( -1 );
}
else if (_tcsicmp( msgID, _T("WM_QAUERYCANCEL")) == 0)
{
LPCTSTR lpTitle = (LPCTSTR)wParam;
LPCTSTR lpText = (LPCTSTR)lParam;
if( IDYES == MessageBox( hwnd, lpText, lpTitle, MB_YESNO)/*TBCIAMessageBox( hwnd, lpTitle, lpText )*/)
{
pushint( 0 );
}
else
pushint( -1 );
}
else if( _tcsicmp( msgID, _T("WM_TBCIASTARTINSTALL")) == 0 )
{
::SendMessage( hwnd, WM_TBCIASTARTINSTALL, (WPARAM)g_installPageTabName.GetData(), (LPARAM)lParam );
}
else if( _tcsicmp( msgID, _T("WM_TBCIASTARTUNINSTALL")) == 0 )
::SendMessage( hwnd, WM_TBCIASTARTUNINSTALL, (WPARAM)g_installPageTabName.GetData(), (LPARAM)lParam );
else if( _tcsicmp( msgID, _T("WM_TBCIAFINISHEDINSTALL")) == 0 )
::SendMessage( hwnd, WM_TBCIAFINISHEDINSTALL, (WPARAM)wParam, (LPARAM)lParam );
else if( _tcsicmp( msgID, _T("WM_TBCIAOPTIONSTATE")) == 0 ) // 返回option的状态
{
COptionUI* pOption = static_cast<COptionUI*>(g_pFrame->GetPaintManager().FindControl( wParam ));
if( pOption == NULL )
return;
DEBUG_INFO("selected %s\n",pOption->IsSelected() ? "yes" : "no");
pushint( pOption->IsSelected() );
}
else if (_tcsicmp( msgID, _T("WM_TBCIASETSTATE")) == 0)
{
COptionUI* pOption = static_cast<COptionUI*>(g_pFrame->GetPaintManager().FindControl( wParam ));
if( pOption == NULL )
return;
if (_tcsicmp(lParam,_T("1"))== 0)
{
pOption->Selected(true);
}
else
{
pOption->Selected(false);
}
DEBUG_INFO("selected %s\n",pOption->IsSelected() ? "yes" : "no");
pOption->PaintStatusImage(g_pFrame->GetPaintManager().GetPaintDC());
pushint( pOption->IsSelected() );
}
else if (_tcsicmp(msgID,_T("WM_TBCIAEXIT"))==0)
{
::SendMessage(hwnd,WM_CLOSE,0,0);
}
else if( _tcsicmp( msgID, _T("WM_TBCIAOPENURL")) == 0 )
{
CDuiString url = (CDuiString)wParam;
if( url.Find( _T("https://") ) == -1 &&
url.Find(_T("http://")) == -1)
{
pushstring( _T("url error") );
return;
}
CDuiString lpCmdLine = _T("explorer \"");
lpCmdLine += url;
lpCmdLine += _T("\"");
//.........这里部分代码省略.........
示例6: Notify
void MainFrame::Notify(TNotifyUI& msg)
{
if (_tcsicmp(msg.sType, kWindowInit) == 0)
{
OnPrepare(msg);
}
else if (_tcsicmp(msg.sType, kClick) == 0)
{
if (_tcsicmp(msg.pSender->GetName(), kCloseButtonControlName) == 0 || _tcsicmp(msg.pSender->GetName(), kCancelButtonControlName) == 0)
{
OnExit(msg);
}
else if (_tcsicmp(msg.pSender->GetName(), kMinButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_MINIMIZE);
#else
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kMaxButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_MAXIMIZE);
CControlUI* pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kMaxButtonControlName));
if( pControl ) pControl->SetVisible(false);
pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kRestoreButtonControlName));
if( pControl ) pControl->SetVisible(true);
#else
SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kRestoreButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_RESTORE);
CControlUI* pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kMaxButtonControlName));
if( pControl ) pControl->SetVisible(true);
pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kRestoreButtonControlName));
if( pControl ) pControl->SetVisible(false);
#else
SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), _T("select_all_btn")) == 0)
{
CContainerUI* pDriverList = static_cast<CContainerUI*>(paint_manager_.FindControl(_T("driver_list")));
for (int i = 0; (pDriverList != NULL) && (i < pDriverList->GetCount()); ++i)
{
COptionUI* pDriver = static_cast<COptionUI*>(pDriverList->GetItemAt(i)->GetInterface(_T("Option")));
if (pDriver != NULL)
pDriver->Selected(true);
}
}
else if (_tcsicmp(msg.pSender->GetName(), _T("uninstall_btn")) == 0)
{
vector<tString> deleted_printer_driver;
DWORD dwError = 0;
TCHAR szBuf[MAX_PATH] = {0};
CContainerUI* pDriverList = static_cast<CContainerUI*>(paint_manager_.FindControl(_T("driver_list")));
for (int i = 0; (pDriverList != NULL) && (i < pDriverList->GetCount()); ++i)
{
COptionUI* pDriver = static_cast<COptionUI*>(pDriverList->GetItemAt(i)->GetInterface(_T("Option")));
if ((pDriver != NULL) && pDriver->IsSelected())
{
// 涉及到的API: DeletePrinter DeletePrinterDriver
HANDLE hPrinter = NULL;
_stprintf_s(szBuf, MAX_PATH - 1, pDriver->GetText().GetData());
PRINTER_DEFAULTS PrtDefault = {NULL, NULL, PRINTER_ALL_ACCESS};
OpenPrinter(szBuf, &hPrinter, &PrtDefault);
if (hPrinter != NULL)
{
DWORD dwNeeded = 0;
GetPrinter(hPrinter, 2, NULL, 0, &dwNeeded);
LPBYTE lpBuffer = (LPBYTE)malloc(dwNeeded);
if (lpBuffer != NULL)
{
GetPrinter(hPrinter, 2, lpBuffer, dwNeeded, &dwNeeded);
DeletePrinter(hPrinter);
dwError = GetLastError();
vector<tString>::const_iterator citer = find(deleted_printer_driver.begin(), deleted_printer_driver.end(), ((PRINTER_INFO_2*)lpBuffer)->pDriverName);
if (citer == deleted_printer_driver.end())
{
deleted_printer_driver.push_back(((PRINTER_INFO_2*)lpBuffer)->pDriverName);
}
ClosePrinter(hPrinter);
free(lpBuffer);
}
}
}
}
for (vector<tString>::const_iterator citer = deleted_printer_driver.begin(); citer != deleted_printer_driver.end(); ++citer)
{
_stprintf_s(szBuf, MAX_PATH - 1, citer->c_str());
DeletePrinterDriver(NULL, NULL, szBuf);
//.........这里部分代码省略.........