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


C++ FindById函数代码示例

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


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


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