这篇教程C++ wxCHECK_RET函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxCHECK_RET函数的典型用法代码示例。如果您正苦于以下问题:C++ wxCHECK_RET函数的具体用法?C++ wxCHECK_RET怎么用?C++ wxCHECK_RET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxCHECK_RET函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxCHECK_RETvoid wxPlotCurve::SetClientData( void *data ){ wxCHECK_RET(M_PLOTCURVEDATA, wxT("invalid plotcurve")); M_PLOTCURVEDATA->SetClientData(data);}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:5,
示例2: wxCHECK_RETvoid wxRadioBox::SetLabel( const wxString& label ){ wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); GTKSetLabelForFrame(GTK_FRAME(m_widget), label);}
开发者ID:EdgarTx,项目名称:wx,代码行数:6,
示例3: wxCHECK_RETvoid wxTextCtrl::Paste(){ wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); gtk_editable_paste_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG);}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:5,
示例4: ExportSingleDatasetSelectvoid ExportSingleDatasetSelect(wxWindow* pWnd, IGxDataset* const pGxDataset){ wxCHECK_RET(pGxDataset, wxT("The input pointer (IGxDataset*) is NULL")); wxGxObject* pGxSrcObj = dynamic_cast<wxGxObject*>(pGxDataset); wxString sName = pGxSrcObj->GetName(); sName = ClearExt(sName); wxGxObjectDialog dlg(pWnd, wxID_ANY, _("Select output")); dlg.SetName(sName); dlg.SetAllowMultiSelect(false); dlg.SetAllFilters(false); wxGISEnumDatasetType eType = pGxDataset->GetType(); int eSubType = pGxDataset->GetSubType(); bool bDefaultSet = false; int eDefaulSubType = 0; if (eType == enumGISFeatureDataset) { for (size_t i = enumVecUnknown + 1; i < enumVecMAX; ++i) { wxGISEnumVectorDatasetType eCurrentSubType = (wxGISEnumVectorDatasetType)i; if (eCurrentSubType != eSubType && IsFileDataset(enumGISFeatureDataset, eCurrentSubType)) { if (bDefaultSet) { dlg.AddFilter(new wxGxFeatureDatasetFilter(eCurrentSubType), false); } else { dlg.AddFilter(new wxGxFeatureDatasetFilter(eCurrentSubType), true); bDefaultSet = true; eDefaulSubType = eCurrentSubType; } } } if (eSubType != enumVecPostGIS) { dlg.AddFilter(new wxGxFeatureDatasetFilter(enumVecPostGIS), false); } } else if (eType == enumGISRasterDataset) { //for (size_t i = enumRasterUnknown + 1; i < enumRasterMAX; ++i) //{ // wxGISEnumRasterDatasetType eCurrentSubType = (wxGISEnumRasterDatasetType)i; // if (eCurrentSubType != eSubType && IsFileDataset(enumGISRasterDataset, eCurrentSubType)) // { // if (bDefaultSet) // { // dlg.AddFilter(new wxGxRasterDatasetFilter(eCurrentSubType), false); // } // else // { // dlg.AddFilter(new wxGxRasterDatasetFilter(eCurrentSubType), true); // bDefaultSet = true; // eDefaulSubType = eCurrentSubType; // } // } //} //if (eSubType != enumRasterPostGIS) //{ // dlg.AddFilter(new wxGxRasterDatasetFilter(enumRasterPostGIS), false); //} } else if (eType == enumGISTableDataset) { for (size_t i = enumTableUnknown + 1; i < enumTableMAX; ++i) { wxGISEnumTableDatasetType eCurrentSubType = (wxGISEnumTableDatasetType)i; if (eCurrentSubType != eSubType && IsFileDataset(enumGISTableDataset, eCurrentSubType)) { if (bDefaultSet) { dlg.AddFilter(new wxGxTableDatasetFilter(eCurrentSubType), false); } else { dlg.AddFilter(new wxGxTableDatasetFilter(eCurrentSubType), true); bDefaultSet = true; eDefaulSubType = eCurrentSubType; } } } if (eSubType != enumTablePostgres) { dlg.AddFilter(new wxGxTableDatasetFilter(enumTablePostgres), false); } } dlg.SetButtonCaption(_("Export")); dlg.SetOverwritePrompt(true); wxGxObject* pGxParentObj = pGxSrcObj->GetParent();//.........这里部分代码省略.........
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:101,
示例5: wxCHECK_RETvoid wxClientDCImpl::DoGetSize(int *width, int *height) const{ wxCHECK_RET( m_window, wxT("wxClientDCImpl without a window?") ); m_window->GetClientSize(width, height);}
开发者ID:chromylei,项目名称:third_party,代码行数:6,
示例6: GetScreenvoid SCH_EDIT_FRAME::EndSegment( wxDC* DC ){ SCH_SCREEN* screen = GetScreen(); SCH_LINE* segment = (SCH_LINE*) screen->GetCurItem(); if( segment == NULL || segment->Type() != SCH_LINE_T || !segment->IsNew() ) return; // Delete zero length segments and clear item flags. SCH_ITEM* item = s_wires.begin(); while( item ) { item->ClearFlags(); wxCHECK_RET( item->Type() == SCH_LINE_T, wxT( "Unexpected object type in wire list." ) ); segment = (SCH_LINE*) item; item = item->Next(); if( segment->IsNull() ) delete s_wires.Remove( segment ); } if( s_wires.GetCount() == 0 ) return; // Get the last non-null wire (this is the last created segment). SetRepeatItem( segment = (SCH_LINE*) s_wires.GetLast() ); screen->SetCurItem( NULL ); m_canvas->EndMouseCapture( -1, -1, wxEmptyString, false ); // store the terminal point of this last segment: a junction could be needed // (the last wire could be merged/deleted/modified, and lost) wxPoint endpoint = segment->GetEndPoint(); // store the starting point of this first segment: a junction could be needed SCH_LINE* firstsegment = (SCH_LINE*) s_wires.GetFirst(); wxPoint startPoint = firstsegment->GetStartPoint(); screen->Append( s_wires ); // Correct and remove segments that need to be merged. screen->SchematicCleanUp( NULL, DC ); // A junction could be needed to connect the end point of the last created segment. if( screen->IsJunctionNeeded( endpoint ) ) screen->Append( AddJunction( DC, endpoint ) ); // A junction could be needed to connect the start point of the set of new created wires if( screen->IsJunctionNeeded( startPoint ) ) screen->Append( AddJunction( DC, startPoint ) ); m_canvas->Refresh(); // Put the snap shot of the previous wire, buses, and junctions in the undo/redo list. PICKED_ITEMS_LIST oldItems; oldItems.m_Status = UR_WIRE_IMAGE; while( s_oldWires.GetCount() != 0 ) { ITEM_PICKER picker = ITEM_PICKER( s_oldWires.PopFront(), UR_WIRE_IMAGE ); oldItems.PushItem( picker ); } SaveCopyInUndoList( oldItems, UR_WIRE_IMAGE ); OnModify();}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:71,
示例7: wxCHECK_RETvoid wxMenuBase::AddSubMenu(wxMenu *submenu){ wxCHECK_RET( submenu, wxT("can't add a NULL submenu") ); submenu->SetParent((wxMenu *)this);}
开发者ID:beanhome,项目名称:dev,代码行数:6,
示例8: wxCHECK_RET// ----------------------------------------------------------------------------// client data// ----------------------------------------------------------------------------void wxChoice::DoSetItemClientData(unsigned int n, void* clientData){ wxCHECK_RET( IsValid(n), wxT("wxChoice::DoSetItemClientData: invalid index") ); m_datas[n] = (char*)clientData ;}
开发者ID:SCP-682,项目名称:Cities3D,代码行数:9,
示例9: ifwxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext *other, const wxGLContextAttrs *ctxAttrs){ const int* contextAttribs = NULL; bool needsARB = false; if ( ctxAttrs ) { contextAttribs = ctxAttrs->GetGLAttrs(); needsARB = ctxAttrs->NeedsARB(); } else if ( win->GetGLCTXAttrs().GetGLAttrs() ) { // If OpenGL context parameters were set at wxGLCanvas ctor, get them now contextAttribs = win->GetGLCTXAttrs().GetGLAttrs(); needsARB = win->GetGLCTXAttrs().NeedsARB(); } // else use GPU driver defaults m_isOk = false; // We need to create a temporary context to get the pointer to // wglCreateContextAttribsARB function HGLRC tempContext = wglCreateContext(win->GetHDC()); wxCHECK_RET( tempContext, "wglCreateContext failed!" ); wglMakeCurrent(win->GetHDC(), tempContext); PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) wglGetProcAddress("wglCreateContextAttribsARB"); wglMakeCurrent(win->GetHDC(), NULL); wglDeleteContext(tempContext); // The preferred way is using wglCreateContextAttribsARB, even for old context if ( !wglCreateContextAttribsARB && needsARB ) // OpenGL 3 context creation { wxLogMessage(_("OpenGL 3.0 or later is not supported by the OpenGL driver.")); return; } if ( wglCreateContextAttribsARB ) { m_glContext = wglCreateContextAttribsARB(win->GetHDC(), other ? other->m_glContext : 0, contextAttribs); } else { // Create legacy context m_glContext = wglCreateContext(win->GetHDC()); // Set shared context if ( other && !wglShareLists(other->m_glContext, m_glContext) ) wxLogLastError("wglShareLists"); } if ( !m_glContext ) wxLogMessage(_("Couldn't create OpenGL context")); else m_isOk = true;}
开发者ID:gdos,项目名称:wxWidgets,代码行数:61,
示例10: wxCHECK_RETvoid wxWizard::SetPageSize(const wxSize& size){ wxCHECK_RET(!m_started, wxT("wxWizard::SetPageSize after RunWizard")); m_sizePage = size;}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:5,
示例11: wxCHECK_RETvoid hoxTable::SetBoard( hoxBoard* pBoard ){ wxCHECK_RET(m_board == NULL, "The Board has already been set."); m_board = pBoard;}
开发者ID:DoBuiThao,项目名称:hoxchess,代码行数:6,
示例12: WXUNUSEDvoid wxMenuBar::Refresh(bool WXUNUSED(eraseBackground), const wxRect *WXUNUSED(rect)){ wxCHECK_RET( IsAttached(), wxT("can't refresh unatteched menubar") ); DrawMenuBar();}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:6,
示例13: wxCHECK_RETvoid wxColourData::SetCustomColour(int i, const wxColour& colour){ wxCHECK_RET( i >= 0 && i < NUM_CUSTOM, wxT("custom colour index out of range") ); m_custColours[i] = colour;}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:6,
示例14: GetCrossHairPositionvoid SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ){ SCH_LINE* segment; SCH_LINE* nextSegment; wxPoint cursorpos = GetCrossHairPosition(); // We should know if a segment is currently in progress segment = (SCH_LINE*) GetScreen()->GetCurItem(); if( segment ) // a current item exists, but not necessary a currently edited item { if( !segment->GetFlags() || ( segment->Type() != SCH_LINE_T ) ) { if( segment->GetFlags() ) { wxLogDebug( wxT( "BeginSegment: item->GetFlags()== %X" ), segment->GetFlags() ); } // no wire, bus or graphic line in progress segment = NULL; } } if( !segment ) /* first point : Create first wire or bus */ { GetScreen()->ExtractWires( s_oldWires, true ); GetScreen()->SchematicCleanUp( m_canvas ); switch( type ) { default: segment = new SCH_LINE( cursorpos, LAYER_NOTES ); break; case LAYER_WIRE: segment = new SCH_LINE( cursorpos, LAYER_WIRE ); /* A junction will be created later, when we'll know the * segment end position, and if the junction is really needed */ break; case LAYER_BUS: segment = new SCH_LINE( cursorpos, LAYER_BUS ); break; } segment->SetFlags( IS_NEW ); s_wires.PushBack( segment ); GetScreen()->SetCurItem( segment ); // We need 2 segments to go from a given start pin to an end point when the horizontal // and vertical lines only switch is on. if( GetForceHVLines() ) { nextSegment = new SCH_LINE( *segment ); nextSegment->SetFlags( IS_NEW ); s_wires.PushBack( nextSegment ); GetScreen()->SetCurItem( nextSegment ); } m_canvas->SetMouseCapture( DrawSegment, AbortCreateNewLine ); SetRepeatItem( NULL ); } else // A segment is in progress: terminates the current segment and add a new segment. { SCH_LINE* prevSegment = (SCH_LINE*) segment->Back(); // Be aware prevSegment can be null when the horizontal and vertical lines only switch is off // when we create the first segment. if( !GetForceHVLines() ) { // If only one segment is needed and it has a zero length, do not create a new one. if( segment->IsNull() ) return; } else { wxCHECK_RET( prevSegment != NULL, wxT( "Failed to create second line segment." ) ); // If two segments are required and they both have zero length, do not // create a new one. if( prevSegment && prevSegment->IsNull() && segment->IsNull() ) return; } m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); // Terminate the command if the end point is on a pin, junction, or another wire or bus. if( GetScreen()->IsTerminalPoint( cursorpos, segment->GetLayer() ) ) { EndSegment( DC ); return; } // Create a new segment, and chain it after the current new segment. nextSegment = new SCH_LINE( *segment ); nextSegment->SetStartPoint( cursorpos ); s_wires.PushBack( nextSegment ); segment->SetEndPoint( cursorpos );//.........这里部分代码省略.........
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:101,
示例15: wxCHECK_RETvoid wxBitmapComboBoxBase::DoSetItemBitmap(unsigned int n, const wxBitmap& bitmap){ wxCHECK_RET( n < m_bitmaps.size(), "invalid item index" ); *GetBitmapPtr(n) = bitmap;}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:5,
示例16: wxCHECK_RETvoid wxWindowDFB::PaintWindow(const wxRect& rect){ wxCHECK_RET( !IsFrozen() && IsShown(), "shouldn't be called" ); wxLogTrace(TRACE_PAINT, "%p ('%s'): painting region [%i,%i,%i,%i]", this, GetName().c_str(), rect.x, rect.y, rect.GetRight(), rect.GetBottom()); m_updateRegion = rect; // FIXME_DFB: don't waste time rendering the area if it's fully covered // by some children, go directly to rendering the children // (unless some child has HasTransparentBackground()=true!) // NB: unconditionally send wxEraseEvent, because our implementation of // wxWindow::Refresh() ignores the eraseBack argument wxWindowDC dc((wxWindow*)this); wxEraseEvent eventEr(m_windowId, &dc); eventEr.SetEventObject(this); HandleWindowEvent(eventEr); wxRect clientRect(GetClientRect()); // only send wxNcPaintEvent if drawing at least part of nonclient area: if ( !clientRect.Contains(rect) ) { wxNcPaintEvent eventNc(GetId()); eventNc.SetEventObject(this); HandleWindowEvent(eventNc); } else { wxLogTrace(TRACE_PAINT, "%p ('%s'): not sending wxNcPaintEvent", this, GetName().c_str()); } // only send wxPaintEvent if drawing at least part of client area: if ( rect.Intersects(clientRect) ) { wxPaintEvent eventPt(GetId()); eventPt.SetEventObject(this); HandleWindowEvent(eventPt); } else { wxLogTrace(TRACE_PAINT, "%p ('%s'): not sending wxPaintEvent", this, GetName().c_str()); } // draw window's overlays on top of the painted window, if we have any: PaintOverlays(rect); m_updateRegion.Clear(); // client area portion of 'rect': wxRect rectClientOnly(rect); rectClientOnly.Intersect(clientRect); // paint the children: wxPoint origin = GetClientAreaOrigin(); wxWindowList& children = GetChildren(); for ( wxWindowList::iterator i = children.begin(); i != children.end(); ++i ) { wxWindow *child = *i; if ( child->IsFrozen() || !child->IsShown() ) continue; // don't paint anything if the window is frozen or hidden // compute child's area to repaint wxRect childrect(child->GetRect()); childrect.Offset(origin); if ( child->CanBeOutsideClientArea() ) childrect.Intersect(rect); else childrect.Intersect(rectClientOnly); if ( childrect.IsEmpty() ) continue; // and repaint it: childrect.Offset(-child->GetPosition()); childrect.Offset(-origin); child->PaintWindow(childrect); }}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:88,
示例17: ExportMultipleDatasetsSelectvoid ExportMultipleDatasetsSelect(wxWindow* pWnd, wxVector<IGxDataset*> &paDatasets){ wxCHECK_RET(paDatasets.size() > 1, wxT("The input dataset array is empty")); wxGxContainerDialog dlg(pWnd, wxID_ANY, _("Select output")); dlg.SetAllFilters(false); dlg.ShowExportFormats(true); wxGxObject* pGxSrcObj = dynamic_cast<wxGxObject*>(paDatasets[0]); wxGISEnumDatasetType eType = paDatasets[0]->GetType(); int eSubType = paDatasets[0]->GetSubType(); bool bDefaultSet = false; int eDefaulSubType = 0; if (eType == enumGISFeatureDataset) { for (size_t i = enumVecUnknown + 1; i < enumVecMAX; ++i) { wxGISEnumVectorDatasetType eCurrentSubType = (wxGISEnumVectorDatasetType)i; if (eCurrentSubType != eSubType && IsFileDataset(enumGISFeatureDataset, eCurrentSubType)) { if (bDefaultSet) { dlg.AddFilter(new wxGxFeatureDatasetFilter(eCurrentSubType), false); } else { dlg.AddFilter(new wxGxFeatureDatasetFilter(eCurrentSubType), true); bDefaultSet = true; eDefaulSubType = eCurrentSubType; } } } if (eSubType != enumVecPostGIS) { dlg.AddFilter(new wxGxFeatureDatasetFilter(enumVecPostGIS), false); } } else if (eType == enumGISRasterDataset) { //for (size_t i = enumRasterUnknown + 1; i < enumRasterMAX; ++i) //{ // wxGISEnumRasterDatasetType eCurrentSubType = (wxGISEnumRasterDatasetType)i; // if (eCurrentSubType != eSubType && IsFileDataset(enumGISRasterDataset, eCurrentSubType)) // { // if (bDefaultSet) // { // dlg.AddFilter(new wxGxRasterDatasetFilter(eCurrentSubType), false); // } // else // { // dlg.AddFilter(new wxGxRasterDatasetFilter(eCurrentSubType), true); // bDefaultSet = true; // eDefaulSubType = eCurrentSubType; // } // } //} //if (eSubType != enumRasterPostGIS) //{ // dlg.AddFilter(new wxGxRasterDatasetFilter(enumRasterPostGIS), false); //} } else if (eType == enumGISTableDataset) { for (size_t i = enumTableUnknown + 1; i < enumTableMAX; ++i) { wxGISEnumTableDatasetType eCurrentSubType = (wxGISEnumTableDatasetType)i; if (eCurrentSubType != eSubType && IsFileDataset(enumGISTableDataset, eCurrentSubType)) { if (bDefaultSet) { dlg.AddFilter(new wxGxTableDatasetFilter(eCurrentSubType), false); } else { dlg.AddFilter(new wxGxTableDatasetFilter(eCurrentSubType), true); bDefaultSet = true; eDefaulSubType = eCurrentSubType; } } } if (eSubType != enumTablePostgres) { dlg.AddFilter(new wxGxTableDatasetFilter(enumTablePostgres), false); } } dlg.AddShowFilter(new wxGxFolderFilter()); dlg.AddShowFilter(new wxGxRemoteDBSchemaFilter()); dlg.ShowCreateButton(true); wxGxObject* pGxParentObj = pGxSrcObj->GetParent(); wxString sStartLoc; if (pGxParentObj) {//.........这里部分代码省略.........
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:101,
示例18: wxCHECK_RETvoid wxMenuItem::Check( bool bCheck){ bool bOk; wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); if (m_isChecked == bCheck) return; HMENU hMenu = GetHmenuOf(m_parentMenu); if (GetKind() == wxITEM_RADIO) { // // It doesn't make sense to uncheck a radio item - what would this do? // if (!bCheck) return; // // Get the index of this item in the menu // const wxMenuItemList& rItems = m_parentMenu->GetMenuItems(); int nPos = rItems.IndexOf(this); wxCHECK_RET( nPos != wxNOT_FOUND ,wxT("menuitem not found in the menu items list?") ); // // Get the radio group range // int nStart; int nEnd; if (m_bIsRadioGroupStart) { // // We already have all information we need // nStart = nPos; nEnd = m_vRadioGroup.m_nEnd; } else // next radio group item { // // Get the radio group end from the start item // nStart = m_vRadioGroup.m_nStart; nEnd = rItems.Item(nStart)->GetData()->m_vRadioGroup.m_nEnd; } // // Also uncheck all the other items in this radio group // wxMenuItemList::compatibility_iterator node = rItems.Item(nStart); for (int n = nStart; n <= nEnd && node; n++) { if (n == nPos) { ::WinSendMsg( hMenu ,MM_SETITEMATTR ,MPFROM2SHORT(n, TRUE) ,MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED) ); } if (n != nPos) { node->GetData()->m_isChecked = FALSE; ::WinSendMsg( hMenu ,MM_SETITEMATTR ,MPFROM2SHORT(n, TRUE) ,MPFROM2SHORT(MIA_CHECKED, FALSE) ); } node = node->GetNext(); } } else // check item { if (bCheck) bOk = (bool)::WinSendMsg( hMenu ,MM_SETITEMATTR ,MPFROM2SHORT(GetRealId(), TRUE) ,MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED) ); else bOk = (bool)::WinSendMsg( hMenu ,MM_SETITEMATTR ,MPFROM2SHORT(GetRealId(), TRUE) ,MPFROM2SHORT(MIA_CHECKED, FALSE) ); } if (!bOk) { wxLogLastError(wxT("CheckMenuItem")); } wxMenuItemBase::Check(bCheck);//.........这里部分代码省略.........
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:101,
示例19: ExportMultipleVectorDatasetsvoid ExportMultipleVectorDatasets(wxWindow* pWnd, const CPLString &sPath, wxGxObjectFilter* const pFilter, wxVector<EXPORTED_DATASET> &paDatasets){ wxCHECK_RET(pWnd && pFilter && paDatasets.size() > 1, wxT("The input pointer is NULL or datasets array is empty")); wxGISProgressDlg ProgressDlg(_("Exporting..."), _("Begin operation..."), 100, pWnd); ProgressDlg.SetAddPercentToMessage(false); ProgressDlg.ShowProgress(true); for (size_t i = 0; i < paDatasets.size(); ++i) { ProgressDlg.SetTitle(wxString::Format(_("Proceed %ld of %ld..."), i + 1, paDatasets.size())); wxGISDataset* pDataset = paDatasets[i].pDSet->GetDataset(false, &ProgressDlg); wxVector<wxGISFeatureDataset*> apFeatureDatasets; if (pDataset->GetSubsetsCount() == 0) { wxGISFeatureDataset* pFeatureDataset = wxDynamicCast(pDataset, wxGISFeatureDataset); if (NULL != pFeatureDataset) { pFeatureDataset->Reference(); apFeatureDatasets.push_back(pFeatureDataset); } } else { for (size_t j = 0; j < pDataset->GetSubsetsCount(); ++j) { wxGISFeatureDataset* pFeatureDataset = wxDynamicCast(pDataset->GetSubset(j), wxGISFeatureDataset); if (NULL != pFeatureDataset) { pFeatureDataset->Reference(); apFeatureDatasets.push_back(pFeatureDataset); } } } if (apFeatureDatasets.size() == 0) { wxMessageBox(_("The dataset is empty"), _("Error"), wxCENTRE | wxICON_ERROR | wxOK, pWnd); wxLogError(_("wxGISFeatureDataset pointer is null returned")); return; } for (size_t j = 0; j < apFeatureDatasets.size(); ++j) { if(!ProgressDlg.Continue()) break; if (!apFeatureDatasets[j]->IsOpened()) { if (!apFeatureDatasets[j]->Open(0, TRUE, false, &ProgressDlg)) { wxMessageBox(ProgressDlg.GetLastMessage(), _("Error"), wxCENTRE | wxICON_ERROR | wxOK, pWnd); wxLogError(ProgressDlg.GetLastMessage()); wsDELETE(apFeatureDatasets[j]); continue; } } if (!ExportFormat(apFeatureDatasets[j], sPath, paDatasets[i].sName, pFilter, wxGISNullSpatialFilter, NULL, NULL, true, static_cast<ITrackCancel*>(&ProgressDlg))) { wxMessageBox(ProgressDlg.GetLastMessage(), _("Error"), wxCENTRE | wxICON_ERROR | wxOK, pWnd); wxLogError(ProgressDlg.GetLastMessage()); wsDELETE(apFeatureDatasets[j]); continue; } wsDELETE(apFeatureDatasets[j]); } } if (ProgressDlg.GetWarningCount() > 0 && ProgressDlg.Continue()) { ShowMessageDialog(pWnd, ProgressDlg.GetWarnings()); }}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:73,
示例20: wxPMTextToLabelvoid wxMenuItem::SetItemLabel( const wxString& rText ){ // // Don't do anything if label didn't change // wxString sText = wxPMTextToLabel(rText); if (m_text == sText) return; // wxMenuItemBase will do stock ID checks wxMenuItemBase::SetItemLabel(sText); HWND hMenu = GetHmenuOf(m_parentMenu); wxCHECK_RET(hMenu, wxT("menuitem without menu"));#if wxUSE_ACCEL m_parentMenu->UpdateAccel(this);#endif // wxUSE_ACCEL USHORT uId = (USHORT)GetRealId(); MENUITEM vItem; USHORT uFlagsOld; if (!::WinSendMsg( hMenu ,MM_QUERYITEM ,MPFROM2SHORT(uId, TRUE) ,(MPARAM)&vItem )) { wxLogLastError(wxT("GetMenuState")); } else { uFlagsOld = vItem.afStyle; if (IsSubMenu()) { uFlagsOld |= MIS_SUBMENU; } char* pData;#if wxUSE_OWNER_DRAWN if (IsOwnerDrawn()) { uFlagsOld |= MIS_OWNERDRAW; pData = (char*)this; } else#endif //owner drawn { uFlagsOld |= MIS_TEXT; pData = (char*) m_text.wx_str(); } // // Set the style // if (!::WinSendMsg( hMenu ,MM_SETITEM ,MPFROM2SHORT(uId, TRUE) ,(MPARAM)&vItem )) { wxLogLastError(wxT("ModifyMenu")); } // // Set the text // if (::WinSendMsg( hMenu ,MM_SETITEMTEXT ,MPFROMSHORT(uId) ,(MPARAM)pData )) { wxLogLastError(wxT("ModifyMenu")); } }} // end of wxMenuItem::SetText
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:81,
示例21: wxCHECK_RETvoid CClientList::AddToKadList(CUpDownClient* toadd){ wxCHECK_RET(toadd, wxT("NULL pointer in AddToKadList")); m_KadSources.insert(CCLIENTREF(toadd, wxT("CClientList::AddToKadList"))); // This will take care of duplicates.}
开发者ID:geekt,项目名称:amule,代码行数:6,
示例22: wxCHECK_RETvoid wxListBox::GtkAddItem( const wxString &item, int pos ){ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") ); GtkWidget *list_item; wxString label(item);#if wxUSE_CHECKLISTBOX if (m_hasCheckBoxes) { label.Prepend(wxCHECKLBOX_STRING); }#endif // wxUSE_CHECKLISTBOX list_item = gtk_list_item_new_with_label( wxGTK_CONV( label ) ); GList *gitem_list = g_list_alloc (); gitem_list->data = list_item; if (pos == -1) gtk_list_append_items( GTK_LIST (m_list), gitem_list ); else gtk_list_insert_items( GTK_LIST (m_list), gitem_list, pos ); gtk_signal_connect_after( GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this ); if (HasFlag(wxLB_MULTIPLE) || HasFlag(wxLB_EXTENDED)) gtk_signal_connect_after( GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(gtk_listitem_deselect_callback), (gpointer)this ); gtk_signal_connect( GTK_OBJECT(list_item), "button_press_event", (GtkSignalFunc)gtk_listbox_button_press_callback, (gpointer) this ); gtk_signal_connect_after( GTK_OBJECT(list_item), "button_release_event", (GtkSignalFunc)gtk_listbox_button_release_callback, (gpointer) this ); gtk_signal_connect( GTK_OBJECT(list_item), "key_press_event", (GtkSignalFunc)gtk_listbox_key_press_callback, (gpointer)this ); gtk_signal_connect( GTK_OBJECT(list_item), "focus_in_event", GTK_SIGNAL_FUNC(gtk_listitem_focus_in_callback), (gpointer)this ); gtk_signal_connect( GTK_OBJECT(list_item), "focus_out_event", GTK_SIGNAL_FUNC(gtk_listitem_focus_out_callback), (gpointer)this ); ConnectWidget( list_item ); if (GTK_WIDGET_REALIZED(m_widget)) { gtk_widget_show( list_item ); gtk_widget_realize( list_item ); gtk_widget_realize( GTK_BIN(list_item)->child );#if wxUSE_TOOLTIPS if (m_tooltip) m_tooltip->Apply( this );#endif } // Apply current widget style to the new list_item GtkRcStyle *style = CreateWidgetStyle(); if (style) { gtk_widget_modify_style( GTK_WIDGET( list_item ), style ); GtkBin *bin = GTK_BIN( list_item ); gtk_widget_modify_style( GTK_WIDGET( bin->child ), style ); gtk_rc_style_unref( style ); }}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:77,
示例23: whilevoid CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName ){ COMPONENT* component; bool hasFootprint = false; int componentIndex; wxString description; if( m_netlist.IsEmpty() ) return; // If no component is selected, select the first one if( m_ListCmp->GetFirstSelected() < 0 ) { componentIndex = 0; m_ListCmp->SetSelection( componentIndex, true ); } // iterate over the selection while( m_ListCmp->GetFirstSelected() != -1 ) { // Get the component for the current iteration componentIndex = m_ListCmp->GetFirstSelected(); component = m_netlist.GetComponent( componentIndex ); if( component == NULL ) return; // Check to see if the component has already a footprint set. hasFootprint = !component->GetFPID().empty(); FPID fpid; if( !aFootprintName.IsEmpty() ) { wxCHECK_RET( fpid.Parse( aFootprintName ) < 0, wxString::Format( wxT( "<%s> is not a valid FPID." ), GetChars( aFootprintName ) ) ); } component->SetFPID( fpid ); // create the new component description description.Printf( CMP_FORMAT, componentIndex + 1, GetChars( component->GetReference() ), GetChars( component->GetValue() ), GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) ); // If the component hasn't had a footprint associated with it // it now has, so we decrement the count of components without // a footprint assigned. if( !hasFootprint ) { hasFootprint = true; m_undefinedComponentCnt -= 1; } // Set the new description and deselect the processed component m_ListCmp->SetString( componentIndex, description ); m_ListCmp->SetSelection( componentIndex, false ); } // Mark this "session" as modified m_modified = true; // select the next component, if there is one if( componentIndex < (m_ListCmp->GetCount() - 1) ) componentIndex++; m_ListCmp->SetSelection( componentIndex, true ); // update the statusbar DisplayStatus();}
开发者ID:jerkey,项目名称:kicad,代码行数:73,
示例24: FindFocusvoid wxRadioButton::SetValue(bool value){ ::SendMessage(GetHwnd(), BM_SETCHECK, value ? BST_CHECKED : BST_UNCHECKED, 0); m_isChecked = value; if ( !value ) return; // if we set the value of one radio button we also must clear all the other // buttons in the same group: Windows doesn't do it automatically // // moreover, if another radiobutton in the group currently has the focus, // we have to set it to this radiobutton, else the old radiobutton will be // reselected automatically, if a parent window loses the focus and regains // it. wxWindow * const focus = FindFocus(); wxTopLevelWindow * const tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); wxCHECK_RET( tlw, wxT("radio button outside of TLW?") ); wxWindow * const focusInTLW = tlw->GetLastFocus(); const wxWindowList& siblings = GetParent()->GetChildren(); wxWindowList::compatibility_iterator nodeThis = siblings.Find(this); wxCHECK_RET( nodeThis, wxT("radio button not a child of its parent?") ); // this will be set to true in the code below if the focus is in our TLW // and belongs to one of the other buttons in the same group bool shouldSetFocus = false; // this will be set to true if the focus is outside of our TLW currently // but the remembered focus of this TLW is one of the other buttons in the // same group bool shouldSetTLWFocus = false; // if it's not the first item of the group ... if ( !HasFlag(wxRB_GROUP) ) { // ... turn off all radio buttons before it for ( wxWindowList::compatibility_iterator nodeBefore = nodeThis->GetPrevious(); nodeBefore; nodeBefore = nodeBefore->GetPrevious() ) { wxRadioButton *btn = wxDynamicCast(nodeBefore->GetData(), wxRadioButton); if ( !btn ) { // don't stop on non radio buttons, we could have intermixed // buttons and e.g. static labels continue; } if ( btn->HasFlag(wxRB_SINGLE) ) { // A wxRB_SINGLE button isn't part of this group break; } if ( btn == focus ) shouldSetFocus = true; else if ( btn == focusInTLW ) shouldSetTLWFocus = true; btn->SetValue(false); if ( btn->HasFlag(wxRB_GROUP) ) { // even if there are other radio buttons before this one, // they're not in the same group with us break; } } } // ... and also turn off all buttons after this one for ( wxWindowList::compatibility_iterator nodeAfter = nodeThis->GetNext(); nodeAfter; nodeAfter = nodeAfter->GetNext() ) { wxRadioButton *btn = wxDynamicCast(nodeAfter->GetData(), wxRadioButton); if ( !btn ) continue; if ( btn->HasFlag(wxRB_GROUP | wxRB_SINGLE) ) { // no more buttons or the first button of the next group break; } if ( btn == focus ) shouldSetFocus = true; else if ( btn == focusInTLW ) shouldSetTLWFocus = true; btn->SetValue(false); }//.........这里部分代码省略.........
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:101,
示例25: InitPlotCurveDefaultPensvoid wxPlotCurve::SetDefaultPen(wxPlotPen_Type colour_type, const wxGenericPen &pen ){ InitPlotCurveDefaultPens(); wxCHECK_RET((colour_type >= 0) && (colour_type < int(wxPlotCurveRefData::sm_defaultPens.GetCount())), wxT("invalid plot colour")); wxPlotCurveRefData::sm_defaultPens[colour_type] = pen;}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:6,
注:本文中的wxCHECK_RET函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wxChar函数代码示例 C++ wxCHECK_MSG函数代码示例 |