本文整理汇总了C++中wxArrayPtrVoid类的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayPtrVoid类的具体用法?C++ wxArrayPtrVoid怎么用?C++ wxArrayPtrVoid使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxArrayPtrVoid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
wxPdfParser::GetPageContent(wxPdfObject* contentRef, wxArrayPtrVoid& contents)
{
int type = contentRef->GetType();
if (type == OBJTYPE_INDIRECT)
{
wxPdfObject* content = ResolveObject(contentRef);
if (content->GetType() == OBJTYPE_ARRAY)
{
GetPageContent(content, contents);
delete content;
}
else
{
contents.Add(content);
}
}
else if (type == OBJTYPE_ARRAY)
{
wxPdfArray* contentArray = (wxPdfArray*) contentRef;
size_t n = contentArray->GetSize();
size_t j;
for (j = 0; j < n; j++)
{
GetPageContent(contentArray->Get(j), contents);
}
}
}
示例2: ImprovedTable
// Better table
void ImprovedTable(wxArrayString& header,wxArrayPtrVoid& data)
{
// Column widths
double w[4] = {40,35,40,45};
// Header
size_t i;
for (i = 0; i <header.GetCount(); i++)
{
Cell(w[i],7,header[i],wxPDF_BORDER_FRAME,0,wxPDF_ALIGN_CENTER);
}
Ln();
// Data
size_t j;
for (j = 0; j < data.GetCount(); j++)
{
wxArrayString* row = (wxArrayString*) data[j];
Cell(w[0],6,(*row)[0],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT);
Cell(w[1],6,(*row)[1],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT);
Cell(w[2],6,(*row)[2],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_RIGHT);
Cell(w[3],6,(*row)[3],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_RIGHT);
Ln();
}
// Closure line
Cell((w[0]+w[1]+w[2]+w[3]),0,wxS(""),wxPDF_BORDER_TOP);
}
示例3: FancyTable
// Colored table
void FancyTable(wxArrayString& header, wxArrayPtrVoid& data)
{
// Colors, line width and bold font
SetFillColour(wxColour(255,0,0));
SetTextColour(255);
SetDrawColour(wxColour(128,0,0));
SetLineWidth(.3);
SetFont(wxS(""),wxS("B"));
//Header
double w[4] = {40,35,40,45};
size_t i;
for (i = 0; i < header.GetCount(); i++)
{
Cell(w[i],7,header[i],wxPDF_BORDER_FRAME, 0, wxPDF_ALIGN_CENTER, 1);
}
Ln();
// Color and font restoration
SetFillColour(wxColour(224,235,255));
SetTextColour(0);
SetFont(wxS(""));
// Data
int fill = 0;
size_t j;
for (j = 0; j < data.GetCount(); j++)
{
wxArrayString* row = (wxArrayString*) data[j];
Cell(w[0],6,(*row)[0],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_LEFT,fill);
Cell(w[1],6,(*row)[1],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_LEFT,fill);
Cell(w[2],6,(*row)[2],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_RIGHT,fill);
Cell(w[3],6,(*row)[3],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_RIGHT,fill);
Ln();
fill = 1 - fill;
}
Cell((w[0]+w[1]+w[2]+w[3]),0,wxS(""),wxPDF_BORDER_TOP);
}
示例4: GetMediaViewersList
// -------------------------------------------------------------------------------- //
void GetMediaViewersList( const guTrackArray &tracks, wxArrayPtrVoid &MediaViewerPtrs )
{
int Index;
int Count = tracks.Count();
for( Index = 0; Index < Count; Index++ )
{
guTrack &Track = tracks[ Index ];
guMediaViewer * MediaViewer = Track.m_MediaViewer;
if( MediaViewer )
{
if( MediaViewerPtrs.Index( MediaViewer ) == wxNOT_FOUND )
{
MediaViewerPtrs.Add( MediaViewer );
}
}
}
}
示例5: TypAdaptation
bool RecBookFile::TypAdaptation( wxArrayPtrVoid params, AxProgressDlg *dlg )
{
// params 0: nbfiles (unused)
// params 1: paths (unused)
// params 2: filenames
// params 3: is the cache ok ?
// params 4: fast adaptation ? (unused)
wxArrayString *filenames = (wxArrayString*)params[2];
bool isCacheOk = *(bool*)params[3];
// name of model to generate - temporary...
RecTypModel model( "rec_typ_adapt" );
if ( isCacheOk || wxFileExists( GetTypCacheFilename() ) )
model.Open( GetTypCacheFilename() );
else
model.New();
// name of adapted model to generate - temporary...
RecTypModel outModel( "rec_typ_adapt_out" );
outModel.New();
params.Add( &outModel );
bool failed = false;
if ( !failed )
failed = !model.AddFiles( params, dlg );
if ( !failed )
failed = !model.Commit( dlg );
if ( !failed )
failed = !model.SaveAs( GetTypCacheFilename() );
if ( !failed )
failed = !model.Adapt( params, dlg );
if ( !failed )
failed = !outModel.SaveAs( GetTypFilename() );
if ( !failed )
{
if ( isCacheOk )
{
WX_APPEND_ARRAY( m_optFiles, *filenames );
}
else
{
m_optFiles = *filenames;
}
}
return ( !failed );
}
示例6: BasicTable
// Simple table
void BasicTable(wxArrayString& header,wxArrayPtrVoid& data)
{
size_t j;
// Header
for (j = 0; j < header.GetCount(); j++)
{
Cell(40,7,header[j],wxPDF_BORDER_FRAME);
}
Ln();
// Data
for (j = 0; j < data.GetCount(); j++)
{
wxArrayString* row = (wxArrayString*) data[j];
size_t k;
for (k = 0; k < (*row).GetCount(); k++)
{
Cell(40,6,(*row)[k],wxPDF_BORDER_FRAME);
}
Ln();
}
}
示例7: LoadData
// Load data
void LoadData(const wxString& file, wxArrayPtrVoid& data)
{
// Read file lines
wxFileInputStream f(file);
wxTextInputStream text( f );
wxString line;
while (!f.Eof())
{
text >> line;
if (!f.Eof() && line.Length() > 0)
{
wxArrayString* row = new wxArrayString;
data.Add(row);
wxStringTokenizer tkz(line, wxS(";"));
while ( tkz.HasMoreTokens() )
{
wxString token = tkz.GetNextToken();
row->Add(token);
}
}
}
}
示例8: DrawPolygonsTessellated
void ODDC::DrawPolygonsTessellated( int n, int npoints[], wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
if( dc ) {
int prev = 0;
for( int i = 0; i < n; i++ ) {
dc->DrawPolygon( npoints[i], &points[i + prev], xoffset, yoffset );
prev += npoints[i];
}
}
#ifdef ocpnUSE_GL
else {
GLUtesselator *tobj = gluNewTess();
gluTessCallback( tobj, GLU_TESS_VERTEX, (_GLUfuncptr) &ODDCvertexCallback );
gluTessCallback( tobj, GLU_TESS_BEGIN, (_GLUfuncptr) &ODDCbeginCallback );
gluTessCallback( tobj, GLU_TESS_END, (_GLUfuncptr) &ODDCendCallback );
gluTessCallback( tobj, GLU_TESS_COMBINE, (_GLUfuncptr) &ODDCcombineCallback );
gluTessCallback( tobj, GLU_TESS_ERROR, (_GLUfuncptr) &ODDCerrorCallback );
gluTessNormal( tobj, 0, 0, 1);
gluTessProperty(tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
gluTessProperty(tobj, GLU_TESS_BOUNDARY_ONLY, GL_FALSE);
if(glIsEnabled(GL_TEXTURE_2D)) g_bTexture2D = true;
else g_bTexture2D = false;
ConfigurePen();
if( ConfigureBrush() ) {
gluTessBeginPolygon(tobj, NULL);
int prev = 0;
for( int j = 0; j < n; j++ ) {
gluTessBeginContour(tobj);
for( int i = 0; i < npoints[j]; i++ ) {
GLvertex* vertex = new GLvertex();
gTesselatorVertices.Add( vertex );
vertex->info.x = (GLdouble) points[i + prev].x;
vertex->info.y = (GLdouble) points[i + prev].y;
vertex->info.z = (GLdouble) 0.0;
vertex->info.r = (GLdouble) 0.0;
vertex->info.g = (GLdouble) 0.0;
vertex->info.b = (GLdouble) 0.0;
vertex->info.a = (GLdouble) 0.0;
gluTessVertex( tobj, (GLdouble*)vertex, (GLdouble*)vertex );
}
gluTessEndContour( tobj );
prev += npoints[j];
}
gluTessEndPolygon(tobj);
}
gluDeleteTess(tobj);
for (unsigned int i = 0; i<gTesselatorVertices.Count(); i++)
delete (GLvertex*)gTesselatorVertices.Item(i);
gTesselatorVertices.Clear();
}
#endif
}
示例9: DrawPolygonTessellated
void ocpnDC::DrawPolygonTessellated( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
if( dc )
dc->DrawPolygon( n, points, xoffset, yoffset );
#ifdef ocpnUSE_GL
else {
# ifndef ocpnUSE_GLES // tessalator in glues is broken
if( n < 5 )
# endif
{
DrawPolygon( n, points, xoffset, yoffset );
return;
}
glPushAttrib( GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_LINE_BIT | GL_HINT_BIT | GL_POLYGON_BIT ); //Save state
SetGLAttrs( false );
static GLUtesselator *tobj = NULL;
if( ! tobj ) tobj = gluNewTess();
gluTessCallback( tobj, GLU_TESS_VERTEX, (_GLUfuncptr) &ocpnDCvertexCallback );
gluTessCallback( tobj, GLU_TESS_BEGIN, (_GLUfuncptr) &ocpnDCbeginCallback );
gluTessCallback( tobj, GLU_TESS_END, (_GLUfuncptr) &ocpnDCendCallback );
gluTessCallback( tobj, GLU_TESS_COMBINE, (_GLUfuncptr) &ocpnDCcombineCallback );
gluTessCallback( tobj, GLU_TESS_ERROR, (_GLUfuncptr) &ocpnDCerrorCallback );
gluTessNormal( tobj, 0, 0, 1);
gluTessProperty( tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO );
if( ConfigureBrush() ) {
gluTessBeginPolygon( tobj, NULL );
gluTessBeginContour( tobj );
for( int i = 0; i < n; i++ ) {
GLvertex* vertex = new GLvertex();
gTesselatorVertices.Add( vertex );
vertex->info.x = (GLdouble) points[i].x;
vertex->info.y = (GLdouble) points[i].y;
vertex->info.z = (GLdouble) 0.0;
vertex->info.r = (GLdouble) 0.0;
vertex->info.g = (GLdouble) 0.0;
vertex->info.b = (GLdouble) 0.0;
gluTessVertex( tobj, (GLdouble*)vertex, (GLdouble*)vertex );
}
gluTessEndContour( tobj );
gluTessEndPolygon( tobj );
}
glPopAttrib();
for( unsigned int i=0; i<gTesselatorVertices.Count(); i++ )
delete (GLvertex*)gTesselatorVertices.Item(i);
gTesselatorVertices.Clear();
}
#endif
}
示例10:
wxSpeedButton::~wxSpeedButton() {
int n;
// release the mouse
// if (HasCapture()) ReleaseMouse();
// erase entry in master array
n = sbgArray.Index((void *) this);
if (n != wxNOT_FOUND) sbgArray.RemoveAt(n);
}
示例11: if
void wxSpeedButton::SetAllUp(wxSpeedButton *inButton) {
int i,n;
wxSpeedButton *b;
// no button?
if (inButton == NULL) return;
// simple button
if (inButton->mGroupIndex == 0) {
inButton->mButtonDown = false;
inButton->Refresh(false);
}
// toggle button
else if (inButton->mGroupIndex == -1) {
inButton->mButtonDown = false;
inButton->Refresh(false);
}
// group button, grouped by immediate parent
else if (inButton->mGroupIndex == -2) {
n = sbgArray.GetCount();
for(i=0; i<n; i++) {
b = (wxSpeedButton *) sbgArray.Item(i);
if (b->mParent == inButton->mParent) {
b->mButtonDown = false;
b->Refresh(false);
};
};
}
// all else is a group toggle button, grouped by index and top-level parent
else {
n = sbgArray.GetCount();
for(i=0; i<n; i++) {
b = (wxSpeedButton *) sbgArray.Item(i);
if ((b->mGroupIndex == inButton->mGroupIndex) && (b->mTopParent == inButton->mTopParent)) {
b->mButtonDown = false;
b->Refresh(false);
};
};
};
}
示例12: wxThreadInternal
wxThread::wxThread(wxThreadKind kind)
{
g_numberOfThreads++;
m_internal = new wxThreadInternal();
m_isDetached = kind == wxTHREAD_DETACHED;
s_threads.Add( (void*) this ) ;
}
示例13: DoGetGridInfoString
void DoGetGridInfoString()
{
int row, col, i;
wxString strFilterName, strFilterPath;
row = m_grid_dir->GetNumberRows();
col = m_grid_dir->GetNumberCols();
m_GridInfoPtr.Empty();
for (i=0; i<row; i++) {
strFilterName = m_grid_dir->GetCellValue(i, 0);
strFilterPath = m_grid_dir->GetCellValue(i, 1);
if (strFilterName.IsEmpty())
break;
CGridInfo *pInfo = new CGridInfo;
pInfo->strFilterName = strFilterName;
pInfo->strFilterPath = strFilterPath;
m_GridInfoPtr.Add(pInfo);
}
}
示例14: ODDCcombineCallback
void __CALL_CONVENTION ODDCcombineCallback(GLdouble coords[3], GLdouble *vertex_data[4], GLfloat weight[4], GLdouble **dataOut)
{
GLvertex *vertex;
vertex = new GLvertex();
gTesselatorVertices.Add(vertex );
vertex->info.x = coords[0];
vertex->info.y = coords[1];
vertex->info.z = coords[2];
for( int i = 3; i < 7; i++ ) {
vertex->data[i] = weight[0] * vertex_data[0][i] + weight[1] * vertex_data[1][i];
}
*dataOut = &(vertex->data[0]);
}
示例15: MacGetCurrentThread
// static functions
// ----------------
wxThread *wxThread::This()
{
wxMacStCritical critical ;
ThreadID current ;
OSErr err ;
err = MacGetCurrentThread( ¤t ) ;
for ( size_t i = 0 ; i < s_threads.Count() ; ++i )
{
if ( ( (wxThread*) s_threads[i] )->GetId() == current )
return (wxThread*) s_threads[i] ;
}
wxLogSysError(_("Couldn't get the current thread pointer"));
return NULL;
}