当前位置: 首页>>代码示例>>C++>>正文


C++ IsChecked函数代码示例

本文整理汇总了C++中IsChecked函数的典型用法代码示例。如果您正苦于以下问题:C++ IsChecked函数的具体用法?C++ IsChecked怎么用?C++ IsChecked使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IsChecked函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Check

wxWebUpdatePackage *wxWebUpdateListCtrl::GetNextPackageToDownload()
{
    if (!IsShown()) {

        // we are hidden; thus the user cannot check the packages he wants
        // to install... we will just select automatically *all* available
        // packages...
        for (int i=0; i < GetItemCount(); i++)
            if (CanBeChecked(i))
                Check(i, TRUE);
    }

    // launch the download of the selected packages
    int todownload = -1;
    for (int i=0; i<GetItemCount(); i++) {

        // download the first package which is checked and that has not been
        // downloaded yet...
        if (IsChecked(i) && !m_bDownloaded[GetPackageIndexForItem(i)]) {
            todownload = i;
            break;
        }
    }

    if (todownload == -1)
        return NULL;

    return  &m_arrRemotePackages[GetPackageIndexForItem(todownload)];
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:29,代码来源:webupdatectrl.cpp

示例2: IsChecked

void wxCheckListBox::GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value )
{
    if ( col == m_checkColumn )
        value.Check( IsChecked( n ) );
    else
        wxListBox::GetValueCallback( n, col, value );
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:7,代码来源:checklst_osx.cpp

示例3: SetCheck

FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
	if (IsReadOnly()) return FALSE;

	SetCheck(!IsChecked());
	return TRUE;
}
开发者ID:151706061,项目名称:PDFium,代码行数:7,代码来源:PWL_SpecialButton.cpp

示例4: GetSelection

bool wxCheckListBox::PerformAction(const wxControlAction& action,
                                   long numArg,
                                   const wxString& strArg)
{
    if ( action == wxACTION_CHECKLISTBOX_TOGGLE )
    {
        int sel = (int)numArg;
        if ( sel == -1 )
        {
            sel = GetSelection();
        }

        if ( sel != -1 )
        {
            Check(sel, !IsChecked(sel));

            SendEvent(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, sel);
        }
    }
    else
    {
        return wxListBox::PerformAction(action, numArg, strArg);
    }

    return true;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:26,代码来源:checklst.cpp

示例5: GetListCellSize

void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
{
    // clicking on the item selects it, clicking on the checkmark toggles
    if ( event.GetX() <= 20 /*check width*/ ) {
        int lineheight ;
        int topcell ;
#if TARGET_CARBON
        Point pt ;
        GetListCellSize( (ListHandle)m_macList , &pt ) ;
        lineheight = pt.v ;
        ListBounds visible ;
        GetListVisibleCells( (ListHandle)m_macList , &visible ) ;
        topcell = visible.top ;
#else
        lineheight =  (**(ListHandle)m_macList).cellSize.v ;
        topcell = (**(ListHandle)m_macList).visible.top ;
#endif
        size_t nItem = ((size_t)event.GetY()) / lineheight + topcell ;
        
        if ( nItem < (size_t)m_noItems )
        {
            Check(nItem, !IsChecked(nItem) ) ;
            wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId());
            event.SetInt(nItem);
            event.SetEventObject(this);
            GetEventHandler()->ProcessEvent(event);
        }
        //else: it's not an error, just click outside of client zone
    }
    else {
        // implement default behaviour: clicking on the item selects it
        event.Skip();
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:34,代码来源:checklst.cpp

示例6: DisableIfChecked

void OptionPage::DisableIfChecked(wxControl *cbx, wxControl *ctrl) {
	auto cb = dynamic_cast<wxCheckBox*>(cbx);
	if (!cb) return;

	ctrl->Enable(!cb->IsChecked());
	cb->Bind(wxEVT_CHECKBOX, [=](wxCommandEvent& evt) { ctrl->Enable(!evt.GetInt()); evt.Skip(); });
}
开发者ID:Aegisub,项目名称:Aegisub,代码行数:7,代码来源:preferences_base.cpp

示例7: OnCheck

    void OnCheck(wxCommandEvent&)
    {
        if (m_Def->m_Action==NULL) return;

        m_Def->m_Context=m_Context;
        m_Def->m_Action->Action(IsChecked() ? 1 : 0);
        m_Def->Update();
    }
开发者ID:SamanthaClark,项目名称:UI-Builder,代码行数:8,代码来源:IwLayoutToolBar.cpp

示例8: GetManager

LRESULT CSysCheckBoxUI::CommandHandler( int code )
{
	if(GetManager() && code == BN_CLICKED){
		GetManager()->SendNotify(this, DUI_MSGTYPE_CLICK, WPARAM(IsChecked()));
		return 0;
	}
	return 0;
}
开发者ID:asdlei00,项目名称:duilib-1,代码行数:8,代码来源:SysButton.cpp

示例9: OnLButtonUp

void SCheckBox::OnLButtonUp(UINT nFlags, CPoint point)
{
    if (IsChecked())
        ModifyState(0, WndState_Check,TRUE);
    else
        ModifyState(WndState_Check, 0,TRUE);
    __super::OnLButtonUp(nFlags,point);
}
开发者ID:kenchen1101,项目名称:soui,代码行数:8,代码来源:SCmnCtrl.cpp

示例10: SetCheck

 bool NFrameBase::SetCheck(bool checked)
 {
     if(checked == IsChecked())
         return false;
     ForceInvalidate();
     Util::Misc::CheckFlag(frameStatus_, NFrameBase::StatusChecked, checked);
     return true;
 }
开发者ID:hufuman,项目名称:nui,代码行数:8,代码来源:NFrameBaseImpl.cpp

示例11: OnCheck

void wxRearrangeList::OnCheck(wxCommandEvent& event)
{
    // update the internal state to match the new item state
    const int n = event.GetInt();

    if ( (m_order[n] >= 0) != IsChecked(n) )
        m_order[n] = ~m_order[n];
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:8,代码来源:rearrangectrl.cpp

示例12: OnMouseMove

 void SCaptureButton::OnMouseMove( UINT nFlags, CPoint point )
 {
     if(IsChecked())
     {
         EventCapture evt(this,point);
         FireEvent(evt);
     }
 }
开发者ID:hdwdsj,项目名称:SoUiTestProject,代码行数:8,代码来源:SCaptureButton.cpp

示例13: int

void Checkbox::RenderCheck(Rect& rectArea)
{
    Rect rectBox = rectArea;

    int iBoxMargin = int(rectArea.Height() * 0.2);
    int iBoxMarginRight = int(rectArea.Height() * 0.8 * 0.75);

    rectBox.Left(rectBox.Left() + iBoxMargin);
    rectBox.Right(rectBox.Left() + iBoxMarginRight);
    rectBox.Top(rectBox.Top() + iBoxMargin);
    rectBox.Bottom(rectBox.Bottom() - iBoxMargin);

    OpenGL::PushedAttributes attr(GL_ENABLE_BIT | GL_LINE_BIT | GL_POINT_BIT);

    glDisable(GL_TEXTURE_2D);
    glEnable(GL_LINE_SMOOTH);
    glEnable(GL_POINT_SMOOTH);

    Color cBox = GetAttrAsColor(CheckboxAttr::BoxColor);
    glColor4ubv(cBox.m_color);
    glLineWidth(2.0);
    glBegin(GL_LINE_LOOP);
    glVertex2i(rectBox.Left(), rectBox.Bottom());
    glVertex2i(rectBox.Right(), rectBox.Bottom());
    glVertex2i(rectBox.Right(), rectBox.Top());
    glVertex2i(rectBox.Left(), rectBox.Top());
    glEnd();

    if (IsChecked())
    {
        double iCheckUnit = rectBox.Height() * 0.1;

        Point point1(int(rectBox.Left() + 3 * iCheckUnit), int(rectBox.Bottom() - 6 * iCheckUnit));
        Point point2(int(rectBox.Left() + 6 * iCheckUnit), int(rectBox.Bottom() - 3 * iCheckUnit));
        Point point3(int(rectBox.Left() + 11* iCheckUnit), int(rectBox.Bottom() - 11* iCheckUnit));

        Color cCheck = GetAttrAsColor(CheckboxAttr::CheckColor);
        glColor4ubv(cCheck.m_color);
        glLineWidth(4.0);
        glBegin(GL_LINES);
        glVertex2i(point1.X(), point1.Y());
        glVertex2i(point2.X(), point2.Y());
        glVertex2i(point2.X(), point2.Y());
        glVertex2i(point3.X(), point3.Y());
        glEnd();

        glPointSize(3.0);
        glBegin(GL_POINTS);
        glVertex2i(point1.X(), point1.Y());
        glVertex2i(point2.X(), point2.Y());
        glVertex2i(point3.X(), point3.Y());
        glEnd();
    }

    // adjust rect for size of checkbox
    int iOffset = int(rectArea.Height() * 1.1);
    rectArea.Left(rectArea.Left() + iOffset);
}
开发者ID:vividos,项目名称:MultiplayerOnlineGame,代码行数:58,代码来源:Checkbox.cpp

示例14: Check

void wxRearrangeList::Check(unsigned int item, bool check)
{
    if ( check == IsChecked(item) )
        return;

    wxCheckListBox::Check(item, check);

    m_order[item] = ~m_order[item];
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:9,代码来源:rearrangectrl.cpp

示例15: SetCheck

bool Checkbox::OnMouseButtonEvent(bool bPressed, int /*iMouseButton*/, unsigned int /*x*/, unsigned int /*y*/)
{
    if (bPressed)
        return false;

    SetCheck(!IsChecked());

    return true;
}
开发者ID:vividos,项目名称:MultiplayerOnlineGame,代码行数:9,代码来源:Checkbox.cpp


注:本文中的IsChecked函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。