本文整理汇总了C++中SetCheck函数的典型用法代码示例。如果您正苦于以下问题:C++ SetCheck函数的具体用法?C++ SetCheck怎么用?C++ SetCheck使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetCheck函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetCheck
HTREEITEM KUIMulStatusTree::InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter, int nCheck)
{
HTREEITEM hResult = CTreeViewCtrl::InsertItem(lpszItem, hParent, hInsertAfter);
SetCheck(hResult, nCheck);
return hResult;
}
示例2: InsertItem
int CPPageInternalFiltersListBox::AddFilter(filter_t* filter, bool checked)
{
int index = InsertItem(GetItemCount(), filter->label);
// SetItemDataPtr must be called before SetCheck
SetItemData(index, reinterpret_cast<DWORD_PTR>(filter));
SetCheck(index, checked);
return index;
}
示例3: AddString
int CPPageInternalFiltersListBox::AddFilter(filter_t* filter, bool checked)
{
int index = AddString(filter->label);
// SetItemDataPtr must be called before SetCheck
SetItemDataPtr(index, filter);
SetCheck(index, checked);
return index;
}
示例4: SetCheck
// 键盘事件处理
BOOL CCheckButton::OnControlKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// 处理快捷键
if((m_nShortcutKey != 0) && (nChar == m_nShortcutKey) && (nFlags == m_nShortcutFlag))
{
SetCheck(!GetCheck());
return true;
}
// 如果当前处于焦点状态,用空格键可以切换check
if(m_bIsFocus && (nChar == VK_SPACE) && (nFlags == 0))
{
SetCheck(!GetCheck());
return true;
}
return false;
}
示例5: SetCheck
// 从XML设置check属性
HRESULT CCheckButton::OnAttributeCheck(const CString& strValue, BOOL bLoading)
{
if (strValue.IsEmpty()) return E_FAIL;
BOOL bCheck = (strValue == "true");
SetCheck(bCheck);
return bLoading?S_FALSE:S_OK;
}
示例6: SetCheck
bool Checkbox::OnMouseButtonEvent(bool bPressed, int /*iMouseButton*/, unsigned int /*x*/, unsigned int /*y*/)
{
if (bPressed)
return false;
SetCheck(!IsChecked());
return true;
}
示例7: SetItemData
int CIconListBox::AddString(LPCTSTR lpszItem, int iImg)
{
int iRet = CListBox::AddString(lpszItem);
if (iRet >= 0){
SetItemData(iRet, iImg);
SetCheck(iImg,1);
SetCurSel(iImg);
}
return iRet;
}
示例8: GetCount
void ShipCheckListBox::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == VK_SPACE)
{
int i, list_size;
list_size = GetCount();
for (i=0; i<list_size; i++)
if (GetSel(i) > 0)
{
if (GetCheck(i))
SetCheck(i, 0);
else
SetCheck(i, 1);
}
} else
CCheckListBox::OnKeyDown(nChar, nRepCnt, nFlags);
}
示例9: SetCheck
void CheckButton::OnMouseLeftButtonUp(suic::MouseEventArg& e)
{
if (IsMouseOver())
{
// 触发选中事件
SetCheck(!_bChecked);
}
__super::OnMouseLeftButtonUp(e);
}
示例10: if
//
/// transfers state information for the TCheckBox
//
/// Overrides TWindow::Transfer. Transfers the check state of the check box to or
/// from buffer, using the values specified in the table in GetCheck(). If direction
/// is tdGetDate, the check box state is transferred into the buffer. If direction
/// is tdSetData, the check box state is changed to the settings in the transfer
/// buffer.
/// Transfer() returns the size of the transfer data in bytes. To get the size without
/// actually transferring the check box, use tdSizeData as the direction argument.
//
uint
TCheckBox::Transfer(void* buffer, TTransferDirection direction)
{
if (direction == tdGetData)
*(uint16*)buffer = (uint16)GetCheck();
else if (direction == tdSetData)
SetCheck(*(uint16*)buffer);
return sizeof(uint16);
}
示例11: SetCheck
// 键盘事件处理
BOOL CDuiRadioButton::OnControlKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// 处理快捷键
if((m_nShortcutKey != 0) && (nChar == m_nShortcutKey) && (nFlags == m_nShortcutFlag))
{
SetCheck(TRUE);
SendMessage(MSG_BUTTON_CHECK, 0, GetCheck());
return true;
}
// 如果当前处于焦点状态,用空格键可以切换check
if(m_bIsFocus && (nChar == VK_SPACE) && (nFlags == 0))
{
SetCheck(TRUE);
SendMessage(MSG_BUTTON_CHECK, 0, GetCheck());
return true;
}
return false;
}
示例12: OnLButtonUp
/////////////////////////////////////////////////////////////////////////////
//
//Method......: OnLButtonUp
//Class.......: CxSkinButton
//
//Author......: Milan Gardian
//Created.....: MAR-2001
//
//Return value: NONE
//Parameters..: As follows
// > [in] nFlags: not used
// > [in] point: coordinates of the mouse pointer when this event was spawned
//Exceptions..: NONE
//------------
//Description :
//
// > Handle event when left button is released (goes up)
//
//---------------------------------------------------------
void CxSkinButton::OnLButtonUp(UINT nFlags, CPoint point)
{
//TRACE("* %08X: up\n", ::GetTickCount());
if (m_Style){ //track mouse for radio & check buttons
POINT p2 = point;
::ClientToScreen(m_hWnd, &p2);
HWND mouse_wnd = ::WindowFromPoint(p2);
if (mouse_wnd == m_hWnd){ // mouse is in button
if (m_Style==BS_CHECKBOX) SetCheck(m_Checked ? 0 : 1);
if (m_Style==BS_RADIOBUTTON) SetCheck(1);
}
}
//Pass this message to the ToolTip control
RelayEvent(WM_LBUTTONUP,(WPARAM)nFlags,MAKELPARAM(LOWORD(point.x),LOWORD(point.y)));
//Default-process the message
m_button_down = false;
CButton::OnLButtonUp(nFlags, point);
}
示例13: SetTextFromOption
bool COptionsPageEditAssociations::LoadPage()
{
bool failure = false;
COptions* pOptions = COptions::Get();
SetTextFromOption(XRCID("ID_ASSOCIATIONS"), OPTION_EDIT_CUSTOMASSOCIATIONS, failure);
SetCheck(XRCID("ID_INHERIT"), pOptions->GetOptionVal(OPTION_EDIT_INHERITASSOCIATIONS) != 0, failure);
return !failure;
}
示例14: SetCheck
void CMyCheckBox::OnLButtonDown(UINT nFlags, CPoint point)
{
BOOL bChecked=0;
if (m_nMyCBoxID==MyCBox_LiveView)
{
m_bCheckedLiveview ^= 1;
SetCheck(m_bCheckedLiveview ? BST_CHECKED : BST_UNCHECKED);
bChecked=m_bCheckedLiveview;
}
else if (m_nMyCBoxID==MyCBox_IPWall)
{
m_bCheckedIPwall ^= 1;
SetCheck(m_bCheckedIPwall ? BST_CHECKED : BST_UNCHECKED);
bChecked=m_bCheckedIPwall;
}
((CMainFrame*)AfxGetMainWnd())->m_bAutoScan = bChecked;
((CMainFrame*)AfxGetMainWnd())->vSetAutoScan(bChecked,m_nMyCBoxID);
CButton::OnLButtonDown(nFlags, point);
}
示例15: Reset
void OptionsColumns::OnResetCanon()
{
Reset(item_canon_);
SetCheck(COL_EXP_PROG, false); // exp. program
SetCheck(COL_LIGHT_SRC, false); // light src.
SetCheck(COL_CAN_LENS, true); // lens attached
SetCheck(COL_CAN_TIMER, true); // self timer
SetCheck(COL_CAN_DRIVE, true); // drive mode
SetCheck(COL_CAN_FOCUS, true); // focus mode
SetCheck(COL_CAN_PROGRAM, true); // program
SetCheck(COL_CAN_MET_MODE, true); // metering
}