• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ FindById函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: FindById

wxString wxToolBarBase::GetToolLongHelp(int toolid) const
{
    wxToolBarToolBase *tool = FindById(toolid);
    wxCHECK_MSG( tool, wxEmptyString, wxT("no such tool") );

    return tool->GetLongHelp();
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:7,代码来源:tbarbase.cpp


示例2: finally

bool TrackList::ApplyPendingTracks()
{
   bool result = false;

   ListOfTracks additions;
   ListOfTracks updates;
   {
      // Always clear, even if one of the update functions throws
      auto cleanup = finally( [&] { ClearPendingTracks( &additions ); } );
      UpdatePendingTracks();
      updates.swap( mPendingUpdates );
   }

   // Remaining steps must be NOFAIL-GUARANTEE so that this function
   // gives STRONG-GUARANTEE

   std::vector< std::shared_ptr<Track> > reinstated;

   for (auto &pendingTrack : updates) {
      if (pendingTrack) {
         auto src = FindById( pendingTrack->GetId() );
         if (src)
            this->Replace(src, pendingTrack), result = true;
         else
            // Perhaps a track marked for pending changes got deleted by
            // some other action.  Recreate it so we don't lose the
            // accumulated changes.
            reinstated.push_back(pendingTrack);
      }
   }

   // If there are tracks to reinstate, append them to the list.
   for (auto &pendingTrack : reinstated)
      if (pendingTrack)
         this->Add( pendingTrack ), result = true;

   // Put the pending added tracks back into the list, preserving their
   // positions.
   bool inserted = false;
   ListOfTracks::iterator first;
   for (auto &pendingTrack : additions) {
      if (pendingTrack) {
         auto iter = ListOfTracks::begin();
         std::advance( iter, pendingTrack->GetIndex() );
         iter = ListOfTracks::insert( iter, pendingTrack );
         pendingTrack->SetOwner( shared_from_this(), {iter, this} );
         pendingTrack->SetId( TrackId{ ++sCounter } );
         if (!inserted) {
            first = iter;
            inserted = true;
         }
      }
   }
   if (inserted) {
      RecalcPositions({first, this});
      result = true;
   }

   return result;
}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:60,代码来源:Track.cpp


示例3: FindById

wxString wxToolBarBase::GetToolShortHelp(int id) const
{
    wxToolBarToolBase *tool = FindById(id);
    wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") );

    return tool->GetShortHelp();
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:7,代码来源:tbarbase.cpp


示例4: SetToolShortHelp

void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
{
    wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));

    if ( tool )
    {
        (void)tool->SetShortHelp(helpString);
        if (tool->m_item)
        {
#if GTK_CHECK_VERSION(2, 12, 0)
            if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,12,0) == NULL)
            {
                gtk_tool_item_set_tooltip_text(tool->m_item,
                    wxGTK_CONV(helpString));
            }
            else
#endif
            {
#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
                gtk_tool_item_set_tooltip(tool->m_item,
                    m_tooltips, wxGTK_CONV(helpString), "");
#endif
            }
        }
    }
}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:26,代码来源:toolbar.cpp


示例5: FindById

BOOL CJabberClientCaps::SetPartialCaps(int nIqId, JabberCapsBits jcbCaps)
{
	CJabberClientPartialCaps *pCaps = FindById(nIqId);
	if (!pCaps)
		return FALSE;

	pCaps->SetCaps(jcbCaps, -1);
	return TRUE;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:9,代码来源:jabber_caps.cpp


示例6: SetToolDisabledBitmap

void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
    wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
    if ( tool )
    {
        wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));

        tool->SetDisabledBitmap(bitmap);
    }
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:10,代码来源:tbargtk.cpp


示例7: SetToolShortHelp

void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
{
    wxToolBarTool *tool = (wxToolBarTool *)FindById(id);

    if ( tool )
    {
        (void)tool->SetShortHelp(helpString);
        gtk_tooltips_set_tip(m_toolbar->tooltips, tool->m_item,
                             wxGTK_CONV( helpString ), "");
    }
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:11,代码来源:tbargtk.cpp


示例8: SetToolShortHelp

void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
{
    wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
    if ( tool )
    {
        (void)tool->SetShortHelp(helpString);
        //TODO - other qt actions for tool tip string
//        if (tool->m_item)
//        {}
    }
}
开发者ID:vadz,项目名称:wxWidgets,代码行数:11,代码来源:toolbar.cpp


示例9: FindById

void CHuiFxEffectCache::ParsingEnded(TInt aHandle)
    {
    //MHuiFxEffectCacheNode **node2 = iDuplicateEffects.Find(aHandle);
    TInt index = FindById(aHandle);
    if (index == -1) return;
    MHuiFxEffectCacheNode *node = iDuplicateEffects[index].iNode;
    node->ParsingEndedBefore();
    iCachedEffects.AppendL(node); // takes ownership
    iDuplicateEffects.Remove(index);
    node->Ref(1);
    node->ParsingEndedAfter(node);
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:12,代码来源:HuiFxEffectCache.cpp


示例10: WXUNUSED

bool wxToolMenuBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id_)
{
    const int id = (signed short)id_;

    wxToolBarToolBase *tool = FindById(id);
    if ( !tool )
    {
        bool checked = false;
        if ( m_menuBar )
        {
            wxMenuItem *item = m_menuBar->FindItem(id);
            if ( item && item->IsCheckable() )
            {
                item->Toggle();
                checked = item->IsChecked();
            }
        }

        wxCommandEvent event(wxEVT_MENU);
        event.SetEventObject(this);
        event.SetId(id);
        event.SetInt(checked);

        return GetEventHandler()->ProcessEvent(event);
    }

    if ( tool->CanBeToggled() )
    {
        LRESULT state = ::SendMessage(GetHwnd(), TB_GETSTATE, id, 0);
        tool->Toggle((state & TBSTATE_CHECKED) != 0);
    }

    bool toggled = tool->IsToggled();

    // avoid sending the event when a radio button is released, this is not
    // interesting
    if ( !tool->CanBeToggled() || tool->GetKind() != wxITEM_RADIO || toggled )
    {
        // OnLeftClick() can veto the button state change - for buttons which
        // may be toggled only, of course.
        if ( !OnLeftClick((int)id, toggled) && tool->CanBeToggled() )
        {
            // revert back
            toggled = !toggled;
            tool->SetToggle(toggled);

            ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0));
        }
    }

    return true;
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:52,代码来源:tbarwce.cpp


示例11: SetToolShortHelp

void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
{
    wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));

    if ( tool )
    {
        (void)tool->SetShortHelp(helpString);
        if (tool->m_item)
        {
            gtk_tool_item_set_tooltip(tool->m_item,
                m_tooltips, wxGTK_CONV(helpString), "");
        }
    }
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:14,代码来源:tbargtk.cpp


示例12: FindById

//
// Okay, so we've left the tool we're in ... we must check if the tool we're
// leaving was a 'sprung push button' and if so, spring it back to the up
// state.
//
void wxToolBar::SpringUpButton(
  int                               vId
)
{
    wxToolBarToolBase*              pTool = FindById(vId);

    if (pTool && pTool->CanBeToggled())
    {
        if (pTool->IsToggled())
            pTool->Toggle();

        DrawTool(pTool);
    }
} // end of wxToolBar::SpringUpButton
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:19,代码来源:toolbar.cpp


示例13: InsertById

int InsertById(mlink * h, id_tm key, id_tm nid)
{
	mlink *where = h;

	if (NULL == h)
		return -1;

	if (NULL == (where = FindById(where, key)))
		return -1;

	if (-1 == Insert(where, nid))
		return -1;

	return 0;
}
开发者ID:Qiuyongjie,项目名称:memlink,代码行数:15,代码来源:memfunc.c


示例14: GetId

void Track::SetY(int y)
{
   auto pList = mList.lock();
   if (pList && !pList->mPendingUpdates.empty()) {
      auto orig = pList->FindById( GetId() );
      if (orig && orig != this) {
         // delegate, and rely on the update to copy back
         orig->SetY(y);
         pList->UpdatePendingTracks();
         return;
      }
   }

   DoSetY(y);
}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:15,代码来源:Track.cpp


示例15: ChangeById

int ChangeById(mlink * h, id_tm who, mem_t sz, maddr_t * addr)
{
	mlink *p = h;

	if (NULL == h || sz < 0)
		return -1;

	if (NULL == (p = FindById(p, who)))
		return -1;

	if (-1 == Change(p, sz, addr))
		return -1;

	return 0;
}
开发者ID:Qiuyongjie,项目名称:memlink,代码行数:15,代码来源:memfunc.c


示例16: strtoul

bool MCNativeControl::FindByNameOrId(const char *p_name, MCNativeControl*& r_control)
{
	char *t_id_end;
	uint32_t t_id;
	t_id = strtoul(p_name, &t_id_end, 10);
	if (t_id_end != p_name)
		return FindById(t_id, r_control);
	
	for(MCNativeControl *t_control = s_native_controls; t_control != nil; t_control = t_control -> m_next)
		if (!t_control -> m_deleted && t_control -> GetName() != nil && MCCStringEqualCaseless(t_control -> GetName(), p_name))
		{
			r_control = t_control;
			return true;
		}
	
	return false;
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:17,代码来源:mblcontrol.cpp


示例17: FindById

void CToolBar::MakeDropdownTool(int id)
{
	wxToolBarToolBase* pOldTool = FindById(id);
	if (!pOldTool)
		return;

	wxToolBarToolBase* pTool = new wxToolBarToolBase(0, id,
		pOldTool->GetLabel(), pOldTool->GetNormalBitmap(), pOldTool->GetDisabledBitmap(),
		wxITEM_DROPDOWN, NULL, pOldTool->GetShortHelp(), pOldTool->GetLongHelp());

	int pos = GetToolPos(id);
	wxASSERT(pos != wxNOT_FOUND);

	DeleteToolByPos(pos);
	InsertTool(pos, pTool);
	Realize();
}
开发者ID:bugiii,项目名称:filezilla3ex,代码行数:17,代码来源:toolbar.cpp


示例18: strtoul

bool MCAd::FindByNameOrId(const char *p_name, MCAd *&r_ad)
{   
	char *t_id_end;
	uint32_t t_id;
	t_id = strtoul(p_name, &t_id_end, 10);
	if (t_id_end != p_name)
		return FindById(t_id, r_ad);
	
	for(MCAd *t_ad = s_ads; t_ad != nil; t_ad = t_ad -> m_next)
		if (t_ad -> GetName() != nil && MCCStringEqualCaseless(t_ad -> GetName(), p_name))
		{
			r_ad = t_ad;
			return true;
		}
	
	return false;
}
开发者ID:MichalEuro,项目名称:livecode,代码行数:17,代码来源:mblad.cpp


示例19: FindById

void TrackList::UpdatePendingTracks()
{
   auto pUpdater = mUpdaters.begin();
   for (const auto &pendingTrack : mPendingUpdates) {
      // Copy just a part of the track state, according to the update
      // function
      const auto &updater = *pUpdater;
      auto src = FindById( pendingTrack->GetId() );
      if (pendingTrack && src) {
         if (updater)
            updater( *pendingTrack, *src );
         pendingTrack->DoSetY(src->GetY());
         pendingTrack->DoSetHeight(src->GetActualHeight());
         pendingTrack->DoSetMinimized(src->GetMinimized());
         pendingTrack->DoSetLinked(src->GetLinked());
      }
      ++pUpdater;
   }
}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:19,代码来源:Track.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FindCharBySerial函数代码示例发布时间:2022-05-30
下一篇:
C++ FindByID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap