本文整理汇总了C++中wxArrayInt::Index方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayInt::Index方法的具体用法?C++ wxArrayInt::Index怎么用?C++ wxArrayInt::Index使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayInt
的用法示例。
在下文中一共展示了wxArrayInt::Index方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TranslateToIndex
/// Int-to-Index (choices can be items like e.g 0x400120 )
int ShuttleGuiBase::TranslateToIndex( const int Value, const wxArrayInt &Choices )
{
int n = Choices.Index( Value );
if( n== wxNOT_FOUND )
n=miNoMatchSelector;
miNoMatchSelector = 0;
return n;
}
示例2: OnFont
bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf,
const LPTEXTMETRIC tm) const
{
if ( m_enumEncodings )
{
// is this a new charset?
int cs = lf->lfCharSet;
if ( m_charsets.Index(cs) == wxNOT_FOUND )
{
wxConstCast(this, wxFontEnumeratorHelper)->m_charsets.Add(cs);
wxFontEncoding enc = wxGetFontEncFromCharSet(cs);
return m_fontEnum->OnFontEncoding(lf->lfFaceName,
wxFontMapper::GetEncodingName(enc));
}
else
{
// continue enumeration
return true;
}
}
if ( m_fixedOnly )
{
// check that it's a fixed pitch font (there is *no* error here, the
// flag name is misleading!)
if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH )
{
// not a fixed pitch font
return true;
}
}
if ( m_charset != DEFAULT_CHARSET )
{
// check that we have the right encoding
if ( lf->lfCharSet != m_charset )
{
return true;
}
}
else // enumerating fonts in all charsets
{
// we can get the same facename twice or more in this case because it
// may exist in several charsets but we only want to return one copy of
// it (note that this can't happen for m_charset != DEFAULT_CHARSET)
if ( m_facenames.Index(lf->lfFaceName) != wxNOT_FOUND )
{
// continue enumeration
return true;
}
wxConstCast(this, wxFontEnumeratorHelper)->
m_facenames.Add(lf->lfFaceName);
}
return m_fontEnum->OnFacename(lf->lfFaceName);
}
示例3:
FbAuthListModel::FbAuthListModel(const wxArrayInt &items, int code)
{
m_position = items.Count() ? 1 : 0;
Append(items);
if (code) {
int i = items.Index(code);
if (i != wxNOT_FOUND) m_position = (size_t)i + 1;
}
}
示例4: SetRadioGenresFilters
// -------------------------------------------------------------------------------- //
void guDbRadios::SetRadioGenresFilters( const wxArrayInt &filters )
{
if( filters.Index( 0 ) != wxNOT_FOUND )
{
m_RaGeFilters.Empty();
}
else
{
m_RaGeFilters = filters;
}
//m_RadioSource = false;
}
示例5: SetRadioLabelsFilters
// -------------------------------------------------------------------------------- //
void guDbRadios::SetRadioLabelsFilters( const wxArrayInt &filters )
{
if( filters.Index( 0 ) != wxNOT_FOUND )
{
m_RaLaFilters.Empty();
}
else
{
m_RaLaFilters = filters;
}
m_RaGeFilters.Empty();
}
示例6: GetColumnPos
unsigned int wxHeaderCtrlBase::GetColumnPos(unsigned int idx) const
{
const unsigned count = GetColumnCount();
wxCHECK_MSG( idx < count, wxNO_COLUMN, "invalid index" );
const wxArrayInt order = GetColumnsOrder();
int pos = order.Index(idx);
wxCHECK_MSG( pos != wxNOT_FOUND, wxNO_COLUMN, "column unexpectedly not displayed at all" );
return (unsigned int)pos;
}
示例7: MoveColumnInOrderArray
/* static */
void wxHeaderCtrlBase::MoveColumnInOrderArray(wxArrayInt& order,
unsigned int idx,
unsigned int pos)
{
int posOld = order.Index(idx);
wxASSERT_MSG( posOld != wxNOT_FOUND, "invalid index" );
if ( pos != (unsigned int)posOld )
{
order.RemoveAt(posOld);
order.Insert(idx, pos);
}
}
示例8: WXUNUSED
bool
wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak,
const wxArrayInt& known_pagebreaks,
int WXUNUSED(pageHeight)) const
{
// When we are counting pages, 'known_pagebreaks' is non-NULL.
// That's the only time we change 'pagebreak'. Otherwise, pages
// were already counted, 'known_pagebreaks' is NULL, and we don't
// do anything except return false.
//
// We also simply return false if the 'pagebreak' argument is
// less than (vertically above) or the same as the current
// vertical position. Otherwise we'd be setting a pagebreak above
// the current cell, which is incorrect, or duplicating a
// pagebreak that has already been set.
if( known_pagebreaks.GetCount() == 0 || *pagebreak <= m_PosY)
{
return false;
}
// m_PosY is only the vertical offset from the parent. The pagebreak
// required here is the total page offset, so m_PosY must be added
// to the parent's offset and height.
int total_height = m_PosY;
for ( wxHtmlCell *parent = GetParent(); parent; parent = parent->GetParent() )
{
total_height += parent->GetPosY();
}
// Search the array of pagebreaks to see whether we've already set
// a pagebreak here.
int where = known_pagebreaks.Index( total_height);
// Add a pagebreak only if there isn't one already set here.
if( wxNOT_FOUND != where)
{
return false;
}
else
{
*pagebreak = m_PosY;
return true;
}
}