本文整理汇总了C++中wxArrayInt::Item方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayInt::Item方法的具体用法?C++ wxArrayInt::Item怎么用?C++ wxArrayInt::Item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayInt
的用法示例。
在下文中一共展示了wxArrayInt::Item方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetValues
//Setting values
void wxFixWidthImportCtrl::SetValues(const wxArrayInt& values)
{
size_t nval = values.GetCount();
size_t i, j, tot;
int val;
m_values.Clear();
if ( nval < 1 )
{ Refresh();
FireEvent();
return;
}
//Add the first value
m_values.Add( values.Item(0) );
//Add/insert the rest, avoiding duplicates
for ( i=1; i<nval; i++)
{ j=0;
val = values.Item(i);
tot = m_values.GetCount();
while ( j < tot && val > m_values.Item(j) )
j++;
if ( j >= tot && val > m_values.Item(tot-1) )
m_values.Add(val);
if ( j < tot && val < m_values.Item(j) )
m_values.Insert(val, j);
}
Refresh();
FireEvent();
}
示例2: SaveSession
void MainBook::SaveSession(SessionEntry &session, wxArrayInt& intArr)
{
std::vector<LEditor*> editors;
bool retain_order(true);
GetAllEditors(editors, retain_order);
session.SetSelectedTab(0);
std::vector<TabInfo> vTabInfoArr;
for (size_t i = 0; i < editors.size(); i++) {
if ( (intArr.GetCount() > i) && (!intArr.Item(i)) ) {
// If we're saving only selected editors, and this isn't one of them...
continue;
}
if (editors[i] == GetActiveEditor()) {
session.SetSelectedTab(vTabInfoArr.size());
}
TabInfo oTabInfo;
oTabInfo.SetFileName(editors[i]->GetFileName().GetFullPath());
oTabInfo.SetFirstVisibleLine(editors[i]->GetFirstVisibleLine());
oTabInfo.SetCurrentLine(editors[i]->GetCurrentLine());
wxArrayString astrBookmarks;
editors[i]->StoreMarkersToArray(astrBookmarks);
oTabInfo.SetBookmarks(astrBookmarks);
std::vector<int> folds;
editors[i]->StoreCollapsedFoldsToArray(folds);
oTabInfo.SetCollapsedFolds(folds);
vTabInfoArr.push_back(oTabInfo);
}
session.SetTabInfoArr(vTabInfoArr);
}
示例3: IsInArray
bool DotWriter::IsInArray(int index, const wxArrayInt& arr)
{
for(unsigned int i = 0; i < arr.GetCount(); i++) {
if(arr.Item(i) == index) return true;
}
return false;
}
示例4: AppendColumnHeader
void ctlSQLGrid::AppendColumnHeader(wxString &str, wxArrayInt columns)
{
if(settings->GetColumnNames())
{
bool CopyQuoting = (settings->GetCopyQuoting() == 1 || settings->GetCopyQuoting() == 2);
size_t i;
for(i = 0; i < columns.Count() ; i++)
{
long columnPos = columns.Item(i);
if(i > 0)
str.Append(settings->GetCopyColSeparator());
if(CopyQuoting)
str.Append(settings->GetCopyQuoteChar());
str.Append(GetColumnName(columnPos));
if(CopyQuoting)
str.Append(settings->GetCopyQuoteChar());
}
str.Append(END_OF_LINE);
}
}
示例5: PolyTessGeoGL
//.........这里部分代码省略.........
y0 = y;
}
else
nPoints--;
}
if(nPoints > 5 && (m_LOD_meters > .01)){
index_keep.Clear();
index_keep.Add(0);
index_keep.Add(nPoints-1);
index_keep.Add(1);
index_keep.Add(nPoints-2);
DouglasPeucker(DPbuffer, 1, nPoints-2, m_LOD_meters/(1852 * 60), &index_keep);
// printf("DP Reduction: %d/%d\n", index_keep.GetCount(), nPoints);
g_keep += index_keep.GetCount();
g_orig += nPoints;
// printf("...................Running: %g\n", (double)g_keep/g_orig);
}
else {
index_keep.Clear();
for(int i = 0 ; i < nPoints ; i++)
index_keep.Add(i);
}
cntr[0] = index_keep.GetCount();
// Mark the keepers by adding a simple constant to X
for(unsigned int i=0 ; i < index_keep.GetCount() ; i++){
int k = index_keep.Item(i);
DPbuffer[2*k] += 2000.;
}
// Declare the gluContour and copy the points
gluTessBeginContour(GLUtessobj);
DPrun = DPbuffer;
for(ip = 0 ; ip < nPoints ; ip++)
{
x = *DPrun++;
y = *DPrun++;
if(x > 1000.){
GLdouble *ppt_top = ppt;
*ppt++ = x-2000;
*ppt++ = y;
*ppt++ = 0;
gluTessVertex( GLUtessobj, ppt_top, ppt_top ) ;
}
}
gluTessEndContour(GLUtessobj);
free(DPbuffer);
// Now the interior contours
for(iir=0 ; iir < nint ; iir++)