您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxString函数代码示例

51自学网 2021-06-03 10:12:09
  C++
这篇教程C++ wxString函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了wxString函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: clang_getNumCompletionChunks

void ClangDriver::DoParseCompletionString(CXCompletionString str,        int depth,        wxString& entryName,        wxString& signature,        wxString& completeString,        wxString& returnValue){    bool collectingSignature = false;    int numOfChunks = clang_getNumCompletionChunks(str);    for(int j = 0; j < numOfChunks; j++) {        CXString chunkText = clang_getCompletionChunkText(str, j);        CXCompletionChunkKind chunkKind = clang_getCompletionChunkKind(str, j);        switch(chunkKind) {        case CXCompletionChunk_TypedText:            entryName = wxString(clang_getCString(chunkText), wxConvUTF8);            completeString += entryName;            break;        case CXCompletionChunk_ResultType:            completeString += wxString(clang_getCString(chunkText), wxConvUTF8);            completeString += wxT(" ");            returnValue = wxString(clang_getCString(chunkText), wxConvUTF8);            break;        case CXCompletionChunk_Optional: {            // Optional argument            CXCompletionString optStr = clang_getCompletionChunkCompletionString(str, j);            wxString optionalString;            wxString dummy;            // Once we hit the 'Optional Chunk' only the 'completeString' is matter            DoParseCompletionString(optStr, depth + 1, dummy, dummy, optionalString, dummy);            if(collectingSignature) {                signature += optionalString;            }            completeString += optionalString;        }        break;        case CXCompletionChunk_LeftParen:            collectingSignature = true;            signature += wxT("(");            completeString += wxT("(");            break;        case CXCompletionChunk_RightParen:            collectingSignature = true;            signature += wxT(")");            completeString += wxT(")");            break;        default:            if(collectingSignature) {                signature += wxString(clang_getCString(chunkText), wxConvUTF8);            }            completeString += wxString(clang_getCString(chunkText), wxConvUTF8);            break;        }        clang_disposeString(chunkText);    }    // To make this tag compatible with ctags one, we need to place    // a /^ and $/ in the pattern string (we add this only to the top level completionString)    if(depth == 0) {        completeString.Prepend(wxT("/^ "));        completeString.Append(wxT(" $/"));    }}
开发者ID:since2014,项目名称:codelite,代码行数:69,


示例2: pgFrame

frmDatabaseDesigner::frmDatabaseDesigner(frmMain *form, const wxString &_title, pgConn *conn)	: pgFrame(NULL, _title){	mainForm = form;	SetTitle(wxT("Database Designer"));	SetIcon(wxIcon(*ddmodel_32_png_ico));	loading = true;	closing = false;	RestorePosition(100, 100, 600, 500, 450, 300);	SetMinSize(wxSize(450, 300));	// connection	connection = conn;	// notify wxAUI which frame to use	manager.SetManagedWindow(this);	manager.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_TRANSPARENT_DRAG);	wxWindowBase::SetFont(settings->GetSystemFont());	// Set File menu	fileMenu = new wxMenu();	fileMenu->Append(MNU_NEW, _("&New database design/tCtrl-N"), _("Create a new database design"));	fileMenu->AppendSeparator();	fileMenu->Append(MNU_LOADMODEL, _("&Open Model..."), _("Open an existing database design from a file"));	fileMenu->Append(MNU_SAVEMODEL, _("&Save Model"), _("Save changes at database design"));	fileMenu->Append(MNU_SAVEMODELAS, _("&Save Model As..."), _("Save database design at new file"));	fileMenu->AppendSeparator();	fileMenu->Append(CTL_IMPSCHEMA, _("&Import Tables..."), _("Import tables from database schema to database designer model"));	fileMenu->AppendSeparator();	fileMenu->Append(MNU_EXIT, _("E&xit/tCtrl-W"), _("Exit database designer window"));	// Set Diagram menu	diagramMenu = new wxMenu();	diagramMenu->Append(MNU_NEWDIAGRAM, _("&New model diagram"), _("Create a new diagram"));	diagramMenu->Append(MNU_DELDIAGRAM, _("&Delete selected model diagram..."), _("Delete selected diagram"));	diagramMenu->Append(MNU_RENDIAGRAM, _("&Rename selected model diagram..."), _("Rename selected diagram"));	// Set View menu	viewMenu = new wxMenu();	viewMenu->AppendCheckItem(MNU_TOGGLEMBROWSER, _("&Model Browser"), _("Show / Hide Model Browser Window"));	viewMenu->AppendCheckItem(MNU_TOGGLEDDSQL, _("&SQL Window"), _("Show / Hide SQL Window"));	viewMenu->Check(MNU_TOGGLEDDSQL, true);	viewMenu->Check(MNU_TOGGLEMBROWSER, true);	// Set Help menu	helpMenu = new wxMenu();	helpMenu->Append(MNU_CONTENTS, _("&Help"), _("Open the helpfile."));	helpMenu->Append(MNU_HELP, _("&SQL Help/tF1"), _("Display help on SQL commands."));	// Set menu bar	menuBar = new wxMenuBar();	menuBar->Append(fileMenu, _("&File"));	menuBar->Append(diagramMenu, _("&Diagram"));	menuBar->Append(viewMenu, _("&View"));	menuBar->Append(helpMenu, _("&Help"));	SetMenuBar(menuBar);	// Set status bar	int iWidths[6] = {0, -1, 40, 150, 80, 80};	CreateStatusBar(6);	SetStatusBarPane(-1);	SetStatusWidths(6, iWidths);	// Set toolbar	toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER);	toolBar->SetToolBitmapSize(wxSize(16, 16));	toolBar->AddTool(MNU_NEW, _("New Model"), *file_new_png_bmp, _("Create new model"), wxITEM_NORMAL);	toolBar->AddTool(MNU_NEWDIAGRAM, _("New Diagram"), *ddnewdiagram_png_bmp, _("Add new diagram"), wxITEM_NORMAL);	toolBar->AddSeparator();	toolBar->AddTool(MNU_LOADMODEL, _("Open Model"), *file_open_png_bmp, _("Open existing model"), wxITEM_NORMAL);	toolBar->AddTool(MNU_SAVEMODEL, _("Save Model"), *file_save_png_bmp, _("Save current model"), wxITEM_NORMAL);	toolBar->AddSeparator();	toolBar->AddTool(MNU_ADDTABLE, _("Add Table"), *table_png_bmp, _("Add empty table to the current model"), wxITEM_NORMAL);	toolBar->AddTool(MNU_DELETETABLE, _("Delete Table"), wxBitmap(*ddRemoveTable2_png_img), _("Delete selected table"), wxITEM_NORMAL);	toolBar->AddTool(MNU_ADDCOLUMN, _("Add Column"), *table_png_bmp, _("Add new column to the selected table"), wxITEM_NORMAL);	toolBar->AddSeparator();	toolBar->AddTool(MNU_GENERATEMODEL, _("Generate Model"), *continue_png_bmp, _("Generate SQL for the current model"), wxITEM_NORMAL);	toolBar->AddTool(MNU_GENERATEDIAGRAM, _("Generate Diagram"), *ddgendiagram_png_bmp, _("Generate SQL for the current diagram"), wxITEM_NORMAL);	toolBar->AddSeparator();	toolBar->AddTool(CTL_IMPSCHEMA, _("Import Tables from database..."), *conversion_png_ico, _("Import tables from database schema to database designer model"), wxITEM_NORMAL);	toolBar->AddSeparator();	toolBar->AddTool(MNU_HELP, _("Help"), *help_png_bmp, _("Display help"), wxITEM_NORMAL);	toolBar->Realize();	// Create notebook for diagrams	diagrams = new ctlAuiNotebook(this, CTL_DDNOTEBOOK, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_WINDOWLIST_BUTTON | wxAUI_NB_CLOSE_ON_ALL_TABS);	// Now, the scratchpad	sqltext = new ctlSQLBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxSIMPLE_BORDER | wxTE_RICH2);	//Now, the Objects Browser	wxSizer *browserSizer = new wxBoxSizer(wxHORIZONTAL);	browserPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);	// Add the database designer	design = new ddDatabaseDesign(diagrams, this);	// Create database model browser//.........这里部分代码省略.........
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:101,


示例3: wxString

wxString Token::GetImplFilename() const{    if (!m_TokenTree)        return wxString(_T(""));    return m_TokenTree->GetFilename(m_ImplFileIdx);}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:6,


示例4: Collapse

//------------------------------------------------------------------------------void OutputTree::UpdateOutput(bool resetTree, bool removeReports, bool removePlots){   #if DEBUG_OUTPUT_TREE   MessageInterface::ShowMessage      ("OutputTree::UpdateOutput() resetTree=%d, removeReports=%d, removePlots=%d/n",       resetTree, removeReports, removePlots);   #endif      // Collapse all reports. Consider ephemeris file as a report   if (removeReports)   {      Collapse(mReportItem);      Collapse(mEphemFileItem);      if (GmatGlobal::Instance()->IsEventLocationAvailable())         Collapse(mEventsItem);   }      // Remove all plots   if (removePlots)   {      Collapse(mOrbitViewItem);      Collapse(mGroundTrackItem);      Collapse(mXyPlotItem);   }      // Delete all reports. Consider ephemeris file as a report   if (removeReports)   {      DeleteChildren(mReportItem);      DeleteChildren(mEphemFileItem);      if (GmatGlobal::Instance()->IsEventLocationAvailable())         DeleteChildren(mEventsItem);   }      // Delete all plots   if (removePlots)   {      DeleteChildren(mOrbitViewItem);      DeleteChildren(mGroundTrackItem);      DeleteChildren(mXyPlotItem);   }      if (resetTree)    // do not load subscribers      return;      // get list of report files, ephemeris files, opengl plots, and xy plots   StringArray listOfSubs = theGuiInterpreter->GetListOfObjects(Gmat::SUBSCRIBER);      // put each subscriber in the proper folder   for (unsigned int i=0; i<listOfSubs.size(); i++)   {      Subscriber *sub =         (Subscriber*)theGuiInterpreter->GetConfiguredObject(listOfSubs[i]);            wxString objName = wxString(listOfSubs[i].c_str());      wxString objTypeName = wxString(sub->GetTypeName().c_str());      objTypeName = objTypeName.Trim();            if (objTypeName == "ReportFile")      {         AppendItem(mReportItem, objName, GmatTree::OUTPUT_ICON_REPORT_FILE, -1,                    new GmatTreeItemData(objName, GmatTree::OUTPUT_REPORT));      }      // Removed checking for write ephemeris flag sice ephemeris file can be      // toggled on after it is intially toggled off (LOJ: 2013.03.20)      else if (objTypeName == "EphemerisFile")         //&& sub->GetBooleanParameter("WriteEphemeris"))      {         if (sub->GetStringParameter("FileFormat") == "CCSDS-OEM")         {            AppendItem(mEphemFileItem, objName, GmatTree::OUTPUT_ICON_CCSDS_OEM_FILE, -1,                       new GmatTreeItemData(objName, GmatTree::OUTPUT_CCSDS_OEM_FILE));         }      }      else if (objTypeName == "OrbitView" &&               sub->GetBooleanParameter("ShowPlot"))      {         AppendItem(mOrbitViewItem, objName, GmatTree::OUTPUT_ICON_ORBIT_VIEW, -1,                    new GmatTreeItemData(objName, GmatTree::OUTPUT_ORBIT_VIEW));      }      else if (objTypeName == "GroundTrackPlot" &&               sub->GetBooleanParameter("ShowPlot"))      {         AppendItem(mGroundTrackItem, objName, GmatTree::OUTPUT_ICON_GROUND_TRACK_PLOT, -1,                    new GmatTreeItemData(objName, GmatTree::OUTPUT_GROUND_TRACK_PLOT));      }      else if (objTypeName == "XYPlot" &&               sub->GetBooleanParameter("ShowPlot"))      {         AppendItem(mXyPlotItem, objName, GmatTree::OUTPUT_ICON_XY_PLOT, -1,                    new GmatTreeItemData(objName, GmatTree::OUTPUT_XY_PLOT));      }   }   // get list of Event Locators   if (GmatGlobal::Instance()->IsEventLocationAvailable())   {      StringArray listOfEls = theGuiInterpreter->GetListOfObjects(Gmat::EVENT_LOCATOR);      for (UnsignedInt i = 0; i < listOfEls.size(); ++i)//.........这里部分代码省略.........
开发者ID:rockstorm101,项目名称:GMAT,代码行数:101,


示例5: DoSetSelection

void wxTextEntry::Remove(long from, long to){    DoSetSelection(from, to, SetSel_NoScroll);    WriteText(wxString());}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:5,


示例6: wxIMPLEMENT_DYNAMIC_CLASS_XTI

wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxMenu, wxEvtHandler, "wx/menu.h")wxCOLLECTION_TYPE_INFO( wxMenuItem *, wxMenuItemList ) ;#if wxUSE_EXTENDED_RTTI    template<> void wxCollectionToVariantArray( wxMenuItemList const &theList,                                           wxAnyList &value){    wxListCollectionToAnyList<wxMenuItemList::compatibility_iterator>( theList, value ) ;}#endifwxBEGIN_PROPERTIES_TABLE(wxMenu)wxEVENT_PROPERTY( Select, wxEVT_COMMAND_MENU_SELECTED, wxCommandEvent)wxPROPERTY( Title, wxString, SetTitle, GetTitle, wxString(), /           0 /*flags*/, wxT("Helpstring"), wxT("group") )wxREADONLY_PROPERTY_FLAGS( MenuStyle, wxMenuStyle, long, GetStyle, /                          wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), /                          wxT("group")) // stylewxPROPERTY_COLLECTION( MenuItems, wxMenuItemList, wxMenuItem*, Append, /                      GetMenuItems, 0 /*flags*/, wxT("Helpstring"), wxT("group"))wxEND_PROPERTIES_TABLE()wxEMPTY_HANDLERS_TABLE(wxMenu)wxDIRECT_CONSTRUCTOR_2( wxMenu, wxString, Title, long, MenuStyle  )wxDEFINE_FLAGS( wxMenuBarStyle )
开发者ID:beanhome,项目名称:dev,代码行数:30,


示例7: RecalculateSize

// Define a constructorTCWin::TCWin( ChartCanvas *parent, int x, int y, void *pvIDX ){    //    As a display optimization....    //    if current color scheme is other than DAY,    //    Then create the dialog ..WITHOUT.. borders and title bar.    //    This way, any window decorations set by external themes, etc    //    will not detract from night-vision    long wstyle = wxCLIP_CHILDREN | wxDEFAULT_DIALOG_STYLE /*| wxRESIZE_BORDER*/ ;    if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )            && ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );#ifdef __WXOSX__     wstyle |= wxSTAY_ON_TOP;#endif       pParent = parent;    m_x = x;    m_y = y;        m_created = false;    RecalculateSize();         wxDialog::Create( parent, wxID_ANY, wxString( _T ( "" ) ), m_position ,                      m_tc_size, wstyle );    m_created = true;    wxFont *qFont = GetOCPNScaledFont(_("Dialog"));    SetFont( *qFont );        pIDX = (IDX_entry *) pvIDX;    gpIDXn++;//    Set up plot type    if( strchr( "Tt", pIDX->IDX_type ) ) {        m_plot_type = TIDE_PLOT;        SetTitle( wxString( _( "Tide" ) ) );        gpIDX = pIDX;       // remember pointer for routeplan    } else {        m_plot_type = CURRENT_PLOT;        SetTitle( wxString( _( "Current" ) ) );    }    m_pTCRolloverWin = NULL;    int sx, sy;    GetClientSize( &sx, &sy );    //    Figure out this computer timezone minute offset    wxDateTime this_now = wxDateTime::Now();    wxDateTime this_gmt = this_now.ToGMT();#if wxCHECK_VERSION(2, 6, 2)    wxTimeSpan diff = this_now.Subtract( this_gmt );#else    wxTimeSpan diff = this_gmt.Subtract ( this_now );#endif    int diff_mins = diff.GetMinutes();    int station_offset = ptcmgr->GetStationTimeOffset( pIDX );    m_corr_mins = station_offset - diff_mins;    if( this_now.IsDST() ) m_corr_mins += 60;//    Establish the inital drawing day as today    m_graphday = wxDateTime::Now();    wxDateTime graphday_00 = wxDateTime::Today();    time_t t_graphday_00 = graphday_00.GetTicks();    //    Correct a Bug in wxWidgets time support    if( !graphday_00.IsDST() && m_graphday.IsDST() ) t_graphday_00 -= 3600;    if( graphday_00.IsDST() && !m_graphday.IsDST() ) t_graphday_00 += 3600;    m_t_graphday_00_at_station = t_graphday_00 - ( m_corr_mins * 60 );    btc_valid = false;    wxString* TClist = NULL;    m_tList = new wxListBox( this, -1, wxPoint( sx * 65 / 100, 11 ),                             wxSize( ( sx * 32 / 100 ), ( sy * 20 / 100 ) ), 0, TClist,                             wxLB_SINGLE | wxLB_NEEDED_SB | wxLB_HSCROLL  );    //  Measure the size of a generic button, with label    wxButton *test_button = new wxButton( this, wxID_OK, _( "OK" ), wxPoint( -1, -1), wxDefaultSize );    test_button->GetSize( &m_tsx, &m_tsy );    delete test_button;        //  In the interest of readability, if the width of the dialog is too narrow,     //  simply skip showing the "Hi/Lo" list control.        if( (m_tsy * 15) > sx )        m_tList->Hide();        //.........这里部分代码省略.........
开发者ID:lburais,项目名称:OpenCPN,代码行数:101,


示例8: AppendText

void NyqRedirector::AppendText(){    mText->AppendText(wxString(s.c_str(), wxConvISO8859_1));    s.clear();}
开发者ID:dot-Sean,项目名称:audio,代码行数:5,


示例9: wxGetApp

// show project properties//void CDlgItemProperties::renderInfos(PROJECT* project_in) {    std::string projectname;    //collecting infos    project_in->get_name(projectname);    //disk usage needs additional lookups    CMainDocument* pDoc = wxGetApp().GetDocument();    pDoc->CachedDiskUsageUpdate();        // CachedDiskUsageUpdate() may have invalidated our project     // pointer, so get an updated pointer to this project    PROJECT* project = pDoc->project(project_in->master_url);    if (!project) return;     // TODO: display some sort of error alert?    std::vector<PROJECT*> dp = pDoc->disk_usage.projects;    double diskusage=0.0;        for (unsigned int i=0; i< dp.size(); i++) {        PROJECT* tp = dp[i];                std::string tname;                tp->get_name(tname);        wxString t1(wxString(tname.c_str(), wxConvUTF8));        if(t1.IsSameAs(wxString(projectname.c_str(), wxConvUTF8)) || t1.IsSameAs(wxString(project->master_url, wxConvUTF8))) {            diskusage = tp->disk_usage;            break;        }    }    //set dialog title    wxString wxTitle = _("Properties of project ");    wxTitle.append(wxString(projectname.c_str(),wxConvUTF8));    SetTitle(wxTitle);    //layout controls    addSection(_("General"));    addProperty(_("URL"), wxString(project->master_url, wxConvUTF8));    addProperty(_("User name"), wxString(project->user_name.c_str(), wxConvUTF8));    addProperty(_("Team name"), wxString(project->team_name.c_str(), wxConvUTF8));    addProperty(_("Resource share"), wxString::Format(wxT("%0.0f"), project->resource_share));    if (project->min_rpc_time > dtime()) {        addProperty(_("Scheduler RPC deferred for"), FormatTime(project->min_rpc_time - dtime()));    }    if (project->download_backoff) {        addProperty(_("File downloads deferred for"), FormatTime(project->download_backoff));    }    if (project->upload_backoff) {        addProperty(_("File uploads deferred for"), FormatTime(project->upload_backoff));    }    addProperty(_("Disk usage"), FormatDiskSpace(diskusage));    addProperty(_("Computer ID"), wxString::Format(wxT("%d"), project->hostid));    if (project->non_cpu_intensive) {        addProperty(_("Non CPU intensive"), _("yes"));    }    addProperty(_("Suspended via GUI"), project->suspended_via_gui ? _("yes") : _("no"));    addProperty(_("Don't request more work"), project->dont_request_more_work ? _("yes") : _("no"));    if (project->scheduler_rpc_in_progress) {        addProperty(_("Scheduler call in progress"), _("yes"));    }    if (project->trickle_up_pending) {        addProperty(_("Trickle-up pending"), _("yes"));    }    if (strlen(project->venue)) {        addProperty(_("Host location"), wxString(project->venue, wxConvUTF8));    } else {        addProperty(_("Host location"), _("default"));    }    if (project->attached_via_acct_mgr) {        addProperty(_("Added via account manager"), _("yes"));    }    if (project->detach_when_done) {        addProperty(_("Remove when tasks done"), _("yes"));    }    if (project->ended) {        addProperty(_("Ended"), _("yes"));    }    addProperty(_("Tasks completed"), wxString::Format(wxT("%d"), project->njobs_success));    addProperty(_("Tasks failed"), wxString::Format(wxT("%d"), project->njobs_error));    addSection(_("Credit"));    addProperty(_("User"),        wxString::Format(            wxT("%0.2f total, %0.2f average"),            project->user_total_credit,            project->user_expavg_credit        )    );    addProperty(_("Host"),        wxString::Format(            wxT("%0.2f total, %0.2f average"),            project->host_total_credit,            project->host_expavg_credit        )    );        if (!project->non_cpu_intensive) {        addSection(_("Scheduling"));        addProperty(_("Scheduling priority"), wxString::Format(wxT("%0.2f"), project->sched_priority));        show_rsc(_("CPU"), project->rsc_desc_cpu);        if (pDoc->state.host_info.coprocs.have_nvidia()) {            show_rsc(                wxString(proc_type_name(PROC_TYPE_NVIDIA_GPU), wxConvUTF8),//.........这里部分代码省略.........
开发者ID:suno,项目名称:boinc,代码行数:101,


示例10: NewHandleClear

void wxMenuBar::MacInstallMenuBar(){    if ( s_macInstalledMenuBar == this )        return ;    MenuBarHandle menubar = NULL ;#if TARGET_API_MAC_OSX    menubar = NewHandleClear( 6 /* sizeof( MenuBarHeader ) */ ) ;#else    menubar = NewHandleClear( 12 ) ;    (*menubar)[3] = 0x0a ;#endif    ::SetMenuBar( menubar ) ;    DisposeMenuBar( menubar ) ;    MenuHandle appleMenu = NULL ;    verify_noerr( CreateNewMenu( kwxMacAppleMenuId , 0 , &appleMenu ) ) ;    verify_noerr( SetMenuTitleWithCFString( appleMenu , CFSTR( "/x14" ) ) );    // Add About/Preferences separator only on OS X    // KH/RN: Separator is always present on 10.3 but not on 10.2    // However, the change from 10.2 to 10.3 suggests it is preferred#if TARGET_API_MAC_OSX    InsertMenuItemTextWithCFString( appleMenu,                CFSTR(""), 0, kMenuItemAttrSeparator, 0);#endif    InsertMenuItemTextWithCFString( appleMenu,                CFSTR("About..."), 0, 0, 0);    MacInsertMenu( appleMenu , 0 ) ;    // clean-up the help menu before adding new items    static MenuHandle mh = NULL ;    if ( mh != NULL )    {        MenuItemIndex firstUserHelpMenuItem ;        if ( UMAGetHelpMenu( &mh , &firstUserHelpMenuItem) == noErr )        {            for ( int i = CountMenuItems( mh ) ; i >= firstUserHelpMenuItem ; --i )                DeleteMenuItem( mh , i ) ;        }        else        {            mh = NULL ;        }    }#if TARGET_CARBON    if ( UMAGetSystemVersion() >= 0x1000 && wxApp::s_macPreferencesMenuItemId)    {        wxMenuItem *item = FindItem( wxApp::s_macPreferencesMenuItemId , NULL ) ;        if ( item == NULL || !(item->IsEnabled()) )            DisableMenuCommand( NULL , kHICommandPreferences ) ;        else            EnableMenuCommand( NULL , kHICommandPreferences ) ;    }    // Unlike preferences which may or may not exist, the Quit item should be always    // enabled unless it is added by the application and then disabled, otherwise    // a program would be required to add an item with wxID_EXIT in order to get the    // Quit menu item to be enabled, which seems a bit burdensome.    if ( UMAGetSystemVersion() >= 0x1000 && wxApp::s_macExitMenuItemId)    {        wxMenuItem *item = FindItem( wxApp::s_macExitMenuItemId , NULL ) ;        if ( item != NULL && !(item->IsEnabled()) )            DisableMenuCommand( NULL , kHICommandQuit ) ;        else            EnableMenuCommand( NULL , kHICommandQuit ) ;    }#endif    wxString strippedHelpMenuTitle = wxStripMenuCodes( wxApp::s_macHelpMenuTitleName ) ;    wxString strippedTranslatedHelpMenuTitle = wxStripMenuCodes( wxString( _("&Help") ) ) ;    wxString strippedWindowMenuTitle = wxStripMenuCodes( wxString(wxT("&Window")) /* wxApp::s_macWindowMenuTitleName */ ) ;    wxString strippedTranslatedWindowMenuTitle = wxStripMenuCodes( wxString( _("&Window") ) ) ;    wxMenuList::compatibility_iterator menuIter = m_menus.GetFirst();    for (size_t i = 0; i < m_menus.GetCount(); i++, menuIter = menuIter->GetNext())    {        wxMenuItemList::compatibility_iterator node;        wxMenuItem *item;        wxMenu* menu = menuIter->GetData() , *subMenu = NULL ;        wxString strippedMenuTitle = wxStripMenuCodes(m_titles[i]);        if ( strippedMenuTitle == wxT("?") || strippedMenuTitle == strippedHelpMenuTitle || strippedMenuTitle == strippedTranslatedHelpMenuTitle )        {            for (node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext())            {                item = (wxMenuItem *)node->GetData();                subMenu = item->GetSubMenu() ;                if (subMenu)                {                    UMAAppendMenuItem(mh, wxStripMenuCodes(item->GetText()) , wxFont::GetDefaultEncoding() );                    MenuItemIndex position = CountMenuItems(mh);                    ::SetMenuItemHierarchicalMenu(mh, position, MAC_WXHMENU(subMenu->GetHMenu()));                }                else                {//.........这里部分代码省略.........
开发者ID:Bluehorn,项目名称:wxPython,代码行数:101,


示例11: GetSelectedCount

// -------------------------------------------------------------------------------- //void guPcListBox::CreateContextMenu( wxMenu * Menu ) const{    wxMenuItem * MenuItem;    int SelCount = GetSelectedCount();    int ContextMenuFlags = m_LibPanel->GetContextMenuFlags();    MenuItem = new wxMenuItem( Menu, ID_PLAYCOUNT_PLAY,                            wxString( _( "Play" ) ) + guAccelGetCommandKeyCodeString( ID_TRACKS_PLAY ),                            _( "Play current selected tracks" ) );    MenuItem->SetBitmap( guImage( guIMAGE_INDEX_player_tiny_light_play ) );    Menu->Append( MenuItem );    MenuItem->Enable( SelCount );    MenuItem = new wxMenuItem( Menu, ID_PLAYCOUNT_ENQUEUE_AFTER_ALL,                            wxString( _( "Enqueue" ) ) + guAccelGetCommandKeyCodeString( ID_TRACKS_ENQUEUE_AFTER_ALL ),                            _( "Add current selected tracks to playlist" ) );    MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );    Menu->Append( MenuItem );    MenuItem->Enable( SelCount );    wxMenu * EnqueueMenu = new wxMenu();    MenuItem = new wxMenuItem( EnqueueMenu, ID_PLAYCOUNT_ENQUEUE_AFTER_TRACK,                            wxString( _( "Current Track" ) ) +  guAccelGetCommandKeyCodeString( ID_TRACKS_ENQUEUE_AFTER_TRACK ),                            _( "Add current selected tracks to playlist after the current track" ) );    MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );    EnqueueMenu->Append( MenuItem );    MenuItem->Enable( SelCount );    MenuItem = new wxMenuItem( EnqueueMenu, ID_PLAYCOUNT_ENQUEUE_AFTER_ALBUM,                            wxString( _( "Current Album" ) ) +  guAccelGetCommandKeyCodeString( ID_TRACKS_ENQUEUE_AFTER_ALBUM ),                            _( "Add current selected tracks to playlist after the current album" ) );    MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );    EnqueueMenu->Append( MenuItem );    MenuItem->Enable( SelCount );    MenuItem = new wxMenuItem( EnqueueMenu, ID_PLAYCOUNT_ENQUEUE_AFTER_ARTIST,                            wxString( _( "Current Artist" ) ) +  guAccelGetCommandKeyCodeString( ID_TRACKS_ENQUEUE_AFTER_ARTIST ),                            _( "Add current selected tracks to playlist after the current artist" ) );    MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );    EnqueueMenu->Append( MenuItem );    MenuItem->Enable( SelCount );    Menu->Append( wxID_ANY, _( "Enqueue After" ), EnqueueMenu );    if( SelCount )    {        if( ContextMenuFlags & guCONTEXTMENU_EDIT_TRACKS )        {            Menu->AppendSeparator();            MenuItem = new wxMenuItem( Menu, ID_PLAYCOUNT_EDITTRACKS,                                wxString( _( "Edit Songs" ) ) +  guAccelGetCommandKeyCodeString( ID_PLAYER_PLAYLIST_EDITTRACKS ),                                _( "Edit the selected tracks" ) );            MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_edit ) );            Menu->Append( MenuItem );        }        Menu->AppendSeparator();        MenuItem = new wxMenuItem( Menu, ID_PLAYCOUNT_SAVETOPLAYLIST,                                wxString( _( "Save to Playlist" ) ) +  guAccelGetCommandKeyCodeString( ID_PLAYER_PLAYLIST_SAVE ),                                _( "Save the selected tracks to playlist" ) );        MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_doc_save ) );        Menu->Append( MenuItem );        if( ContextMenuFlags & guCONTEXTMENU_COPY_TO )        {            Menu->AppendSeparator();            m_LibPanel->CreateCopyToMenu( Menu );        }    }    m_LibPanel->CreateContextMenu( Menu );}
开发者ID:Hreinnjons,项目名称:guayadeque,代码行数:77,


示例12: OnDegButton

void ParamEdit::OnDegButton(wxCommandEvent &event) {	m_unit_input->WriteText(wxString(wxConvUTF8.cMB2WC(degree_char), *wxConvCurrent));}
开发者ID:marta09,项目名称:szarp,代码行数:3,


示例13: _T

void ParamEdit::InitWidget(wxWindow *parent) {	wxXmlResource::Get()->LoadDialog(this, parent, _T("param_edit"));		m_unit_input = XRCCTRL(*this, "text_ctrl_unit", wxTextCtrl);	assert(m_unit_input);	wxStaticText *code_editor_stub = XRCCTRL(*this, "code_editor_stub", wxStaticText);	wxSizer* stub_sizer = code_editor_stub->GetContainingSizer();	size_t i = 0;	while (stub_sizer->GetItem(i) && stub_sizer->GetItem(i)->GetWindow() != code_editor_stub)		i++;	assert(stub_sizer->GetItem(i));	wxWindow *stub_parent = code_editor_stub->GetParent();	m_formula_input = new CodeEditor(stub_parent);	m_formula_input->SetSize(code_editor_stub->GetSize());	stub_sizer->Detach(code_editor_stub);	code_editor_stub->Destroy();	stub_sizer->Insert(i, m_formula_input, 1, wxALL | wxEXPAND, 4 );	stub_sizer->Layout();	m_found_date_label = XRCCTRL(*this, "found_date_label", wxStaticText);	m_prec_spin = XRCCTRL(*this, "spin_ctrl_prec", wxSpinCtrl);		m_spin_ctrl_start_hours = XRCCTRL(*this, "spin_ctrl_start_hours", wxSpinCtrl);		m_spin_ctrl_start_minutes = XRCCTRL(*this, "spin_ctrl_start_minutes", wxSpinCtrl);		m_datepicker_ctrl_start_date = XRCCTRL(*this, "datepicker_ctrl_start_date", wxDatePickerCtrl);		m_checkbox_start = XRCCTRL(*this, "checkbox_start", wxCheckBox);	m_button_base_config = XRCCTRL(*this, "button_base_config", wxButton);	m_button_formula_undo = XRCCTRL(*this, "formula_undo_button", wxButton);	m_button_formula_redo = XRCCTRL(*this, "formula_redo_button", wxButton);	m_button_formula_new_param = XRCCTRL(*this, "formula_new_param_button", wxButton);	m_formula_type_choice = XRCCTRL(*this, "FORMULA_TYPE_CHOICE", wxChoice);	m_param_name_input = XRCCTRL(*this, "parameter_name", wxTextCtrl);	m_user_param_label = XRCCTRL(*this, "user_param_label", wxStaticText);		m_datepicker_ctrl_start_date->Enable(false);	m_datepicker_ctrl_start_date->SetValue(wxDateTime::Now());	m_spin_ctrl_start_hours->Enable(false);	m_spin_ctrl_start_minutes->Enable(false);	m_spin_ctrl_start_hours->SetValue(0);	m_spin_ctrl_start_minutes->SetValue(0);	wxButton* degree_button = XRCCTRL(*this, "button_degree", wxButton);	degree_button->SetLabel(wxString(wxConvUTF8.cMB2WC(degree_char), *wxConvCurrent));	m_inc_search = NULL;	m_error = false;	m_params_list = NULL;	SetIcon(szFrame::default_icon);	Centre();}
开发者ID:marta09,项目名称:szarp,代码行数:68,


示例14: ap

void ClangDriver::OnPrepareTUEnded(wxCommandEvent& e){    // Our thread is done    m_isBusy = false;    // Sanity    ClangThreadReply* reply = (ClangThreadReply*)e.GetClientData();    if(!reply) {        return;    }    // Make sure we delete the reply at the end...    std::auto_ptr<ClangThreadReply> ap(reply);    // Delete the fake file...    DoDeleteTempFile(reply->filename);    // Just a notification without real info?    if(reply->context == CTX_None) {        return;    }    if(reply->context == ::CTX_CachePCH || reply->context == ::CTX_ReparseTU) {        return; // Nothing more to be done    }    if(reply->context == CTX_GotoDecl || reply->context == CTX_GotoImpl) {        // Unlike other context's the 'filename' specified here        // does not belong to an editor (it could, but it is not necessarily true)        DoGotoDefinition(reply);        return;    }    // Adjust the activeEditor to fit the filename    IEditor* editor = clMainFrame::Get()->GetMainBook()->FindEditor(reply->filename);    if(!editor) {        CL_DEBUG(wxT("Could not find an editor for file %s"), reply->filename.c_str());        return;    }    m_activeEditor = editor;    // What should we do with the TU?    switch(reply->context) {    case CTX_CachePCH:        // Nothing more to be done        return;    default:        break;    }    if(!reply->results && !reply->errorMessage.IsEmpty()) {        // Notify about this error        clCommandEvent event(wxEVT_CLANG_CODE_COMPLETE_MESSAGE);        event.SetString(reply->errorMessage);        event.SetInt(1); // indicates that this is an error message        EventNotifier::Get()->AddPendingEvent(event);        return;    }    if(m_activeEditor->GetCurrentPosition() < m_position) {        CL_DEBUG(wxT("Current position is lower than the starting position, ignoring completion"));        clang_disposeCodeCompleteResults(reply->results);        return;    }    wxString typedString;    if(m_activeEditor->GetCurrentPosition() > m_position) {        // User kept on typing while the completion thread was working        typedString = m_activeEditor->GetTextRange(m_position, m_activeEditor->GetCurrentPosition());        if(typedString.find_first_not_of(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_")) !=                wxString::npos) {            // User typed some non valid identifier char, cancel code completion            CL_DEBUG(                wxT("User typed: %s since the completion thread started working until it ended, ignoring completion"),                typedString.c_str());            clang_disposeCodeCompleteResults(reply->results);            return;        }    }    // update the filter word    reply->filterWord.Append(typedString);    CL_DEBUG(wxT("clang completion: filter word is %s"), reply->filterWord.c_str());    // For the Calltip, remove the opening brace from the filter string    wxString filterWord = reply->filterWord;    if(GetContext() == CTX_Calltip && filterWord.EndsWith(wxT("("))) filterWord.RemoveLast();    wxString lowerCaseFilter = filterWord;    lowerCaseFilter.MakeLower();    unsigned numResults = reply->results->NumResults;    clang_sortCodeCompletionResults(reply->results->Results, reply->results->NumResults);    std::vector<TagEntryPtr> tags;    for(unsigned i = 0; i < numResults; i++) {        CXCompletionResult result = reply->results->Results[i];        CXCompletionString str = result.CompletionString;        CXCursorKind kind = result.CursorKind;//.........这里部分代码省略.........
开发者ID:since2014,项目名称:codelite,代码行数:101,


示例15: switch

void WXMSearchReplaceDialog::WXMSearchReplaceDialogKeyDown(wxKeyEvent& event){	int key=event.GetKeyCode();	//g_SearchReplaceDialog->SetTitle(wxString()<<key);	switch(key)	{	case WXK_ESCAPE:		g_SearchReplaceDialog->Show(false);		return;	case WXK_RETURN:	case WXK_NUMPAD_ENTER:		if(this->GetClassInfo()->GetClassName()!=wxString(wxT("wxButton")))		{			wxCommandEvent e;			wxButton* default_btn = static_cast<wxButton*>(g_SearchReplaceDialog->GetDefaultItem());			if(default_btn == g_SearchReplaceDialog->WxButtonReplace)				return g_SearchReplaceDialog->WxButtonReplaceClick(e); // no skip			return g_SearchReplaceDialog->WxButtonFindNextClick(e); // no skip		}		break;	case WXK_DOWN:		if((MadEdit*)this==g_SearchReplaceDialog->m_FindText)		{			int x,y,w,h;			g_SearchReplaceDialog->m_FindText->GetPosition(&x, &y);			g_SearchReplaceDialog->m_FindText->GetSize(&w, &h);			g_SearchReplaceDialog->PopupMenu(&g_SearchReplaceDialog->WxPopupMenuRecentFindText, x, y+h);			return;		}		else if((MadEdit*)this==g_SearchReplaceDialog->m_ReplaceText)		{			int x,y,w,h;			g_SearchReplaceDialog->m_ReplaceText->GetPosition(&x, &y);			g_SearchReplaceDialog->m_ReplaceText->GetSize(&w, &h);			g_SearchReplaceDialog->PopupMenu(&g_SearchReplaceDialog->WxPopupMenuRecentReplaceText, x, y+h);			return;		}		break;	}	extern wxAcceleratorEntry g_AccelFindNext, g_AccelFindPrev;	int flags=wxACCEL_NORMAL;	if(event.m_altDown) flags|=wxACCEL_ALT;	if(event.m_shiftDown) flags|=wxACCEL_SHIFT;	if(event.m_controlDown) flags|=wxACCEL_CTRL;	if(g_AccelFindNext.GetKeyCode()==key && g_AccelFindNext.GetFlags()==flags)	{		wxCommandEvent e;		g_SearchReplaceDialog->WxButtonFindNextClick(e);		return; // no skip	}	if(g_AccelFindPrev.GetKeyCode()==key && g_AccelFindPrev.GetFlags()==flags)	{		wxCommandEvent e;		g_SearchReplaceDialog->WxButtonFindPrevClick(e);		return; // no skip	}	event.Skip();}
开发者ID:Amuwa,项目名称:wxMEdit,代码行数:65,


示例16: ResetMessage

void WXMSearchReplaceDialog::ResetMessage(){	StaticTextStatus->SetLabel(wxString());	wxm::GetFrameStatusBar().SetField(wxm::STBF_HELP, wxEmptyString);}
开发者ID:Amuwa,项目名称:wxMEdit,代码行数:6,


示例17: stat

void Trace::parseFiles(void){	struct stat st = {0};	// No exe processing required	if (!doProcessExe)	{		pDosHeader			= NULL;		origData			= NULL;		pPeHeader			= NULL;		pOptHeader			= NULL;		pSectionHeader		= NULL;		sectionEntropy		= NULL;		sectionCharProb		= NULL;		return;	}	stat(this->orig_exe_file, &st);	dwFileSize = st.st_size;		FILE *fin = fopen(this->orig_exe_file, "rb");	if (fin == NULL)	{		throw wxString(wxT("Could not open executable file for reading"));	}		// Allocate and initialize to zero	origData = (unsigned char *) malloc(st.st_size);	if (origData == NULL)	{		throw wxString(wxT("Could not allocate data"));	}		memset(origData, 0, st.st_size);	// Read the file data	size_t readData = fread(origData, st.st_size, 1, fin);	// Should return 1 for one block read	if (readData != 1)	{		throw wxString(wxT("Could not read original file data"));	}		fclose(fin);		if (!origData)	{		//wxLogDebug(wxT("Could not MapViewOfFile for original file")); 		throw wxString(wxT("Could not MapViewOfFile for original file"));	}	// Get the DOS headers	pDosHeader = (PIMAGE_DOS_HEADER) origData;		// Check for a valid header	if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE)	{		//wxLogDebug(wxT("Not a valid DOS header"));		throw wxString(wxT("Not a valid DOS header"));	}	// Get the NT headers	// 	// WARNING FROM THE PAST:	// This code is most likely going to be the cause of problems when porting to 64-bit.	// The reason is because either the e_lfanew structure member doesn't get converted properly	// in the GCC compiler or the msvc compiler doesn't convert the pointers properly. at any	// rate they don't agree.	// Danny, August 2011	pPeHeader = (PIMAGE_NT_HEADERS) (origData + pDosHeader->e_lfanew);	if(pPeHeader->Signature != IMAGE_NT_SIGNATURE)	{		//wxLogDebug(wxT("Not a valid NT header"));		throw wxString(wxT("Not a valid NT header"));	}	pOptHeader = &(pPeHeader->OptionalHeader);	// This is going to be a 64 bit conversion problem	pSectionHeader = (PIMAGE_SECTION_HEADER) ( (DWORD) pOptHeader + (DWORD) (pPeHeader->FileHeader.SizeOfOptionalHeader));	// Calculate entropy of all the sections	// This is the standard Shannon entropy algorithm, and was adopted from Ero Carrera's	// Pefile code		sectionEntropy = (float *) malloc(sizeof(float) * pPeHeader->FileHeader.NumberOfSections);	if (sectionEntropy == NULL)	{		//wxLogDebug(wxString::Format(wxT("Could not allocate memory: %s:%u"), __FILE__, __LINE__));		return;	}	sectionCharProb = (float **) malloc(sizeof(float*) * pPeHeader->FileHeader.NumberOfSections);	//.........这里部分代码省略.........
开发者ID:nealey,项目名称:vera,代码行数:101,


示例18: GetClientSize

void TCWin::OnPaint( wxPaintEvent& event ){    int x, y;    int i;    char sbuf[100];    int w;    float tcmax, tcmin;    GetClientSize( &x, &y );//    qDebug() << "OnPaint" << x << y;#if 0        //  establish some graphic element sizes/locations    int x_graph = x * 1 / 10;    int y_graph = y * 32 / 100;    int x_graph_w = x * 8 / 10;    int y_graph_h = (y * .7)  - (3 * m_button_height);    m_graph_rect = wxRect(x_graph, y_graph, x_graph_w, y_graph_h);    wxSize texc_size = wxSize( ( x * 60 / 100 ), ( y *29 / 100 ) );    if( !m_tList->IsShown()){        texc_size = wxSize( ( x * 90 / 100 ), ( y *29 / 100 ) );    }        m_ptextctrl->SetSize(texc_size);#endif                                          wxPaintDC dc( this );    wxString tlocn( pIDX->IDX_station_name, wxConvUTF8 );//     if(1/*bForceRedraw*/)    {        int x_textbox = x * 5 / 100;        int y_textbox = 6;        int x_textbox_w = x * 51 / 100;        int y_textbox_h = y * 25 / 100;        // box the location text & tide-current table        dc.SetPen( *pblack_3 );        dc.SetBrush( *pltgray2 );        dc.DrawRoundedRectangle( x_textbox, y_textbox, x_textbox_w, y_textbox_h, 4 );    //location text box        if(m_tList->IsShown()) {            wxRect tab_rect = m_tList->GetRect();            dc.DrawRoundedRectangle( tab_rect.x - 4, y_textbox, tab_rect.width + 8, y_textbox_h, 4 ); //tide-current table box        }        //    Box the graph        dc.SetPen( *pblack_1 );        dc.SetBrush( *pltgray );        dc.DrawRectangle( m_graph_rect.x, m_graph_rect.y, m_graph_rect.width, m_graph_rect.height );        int hour_delta = 1;                //  On some platforms, we cannot draw rotated text.        //  So, reduce the complexity of horizontal axis time labels#ifndef __WXMSW__        hour_delta = 4;#endif                                //    Horizontal axis        dc.SetFont( *pSFont );        for( i = 0; i < 25; i++ ) {            int xd = m_graph_rect.x + ( ( i ) * m_graph_rect.width / 25 );            if( hour_delta != 1 ){                if( i % hour_delta == 0 ) {                    dc.SetPen( *pblack_2 );                    dc.DrawLine( xd, m_graph_rect.y, xd, m_graph_rect.y + m_graph_rect.height + 5 );                    char sbuf[5];                    sprintf( sbuf, "%02d", i );                    int x_shim = -20;                    dc.DrawText( wxString( sbuf, wxConvUTF8 ), xd + x_shim + ( m_graph_rect.width / 25 ) / 2, m_graph_rect.y + m_graph_rect.height + 8 );                }                else{                    dc.SetPen( *pblack_1 );                    dc.DrawLine( xd, m_graph_rect.y, xd, m_graph_rect.y + m_graph_rect.height + 5 );                }            }            else{                dc.SetPen( *pblack_1 );                dc.DrawLine( xd, m_graph_rect.y, xd, m_graph_rect.y + m_graph_rect.height + 5 );                wxString sst;                sst.Printf( _T("%02d"), i );                dc.DrawRotatedText( sst, xd + ( m_graph_rect.width / 25 ) / 2, m_graph_rect.y + m_graph_rect.height + 8, 270. );            }        }        //    Make a line for "right now"        time_t t_now = wxDateTime::Now().GetTicks();       // now, in ticks        float t_ratio = m_graph_rect.width * ( t_now - m_t_graphday_00_at_station ) / ( 25 * 3600 );        //must eliminate line outside the graph (in that case put it outside the window)        int xnow = ( t_ratio < 0 || t_ratio > m_graph_rect.width ) ? -1 : m_graph_rect.x + (int) t_ratio;        dc.SetPen( *pred_2 );//.........这里部分代码省略.........
开发者ID:lburais,项目名称:OpenCPN,代码行数:101,


示例19: fopen

void Trace::writeGmlFile(char *gmlfile){	FILE *fout = NULL;	const trace_address_t *addr = NULL;	const trace_edge_t *edge = NULL;	uint32_t width = 0;	size_t addrCharLen = 0;	//wxLogDebug(wxT("Writing output to %s/n"), gmlfile);	fout = fopen(gmlfile, "w");	if (fout == NULL)	{		throw wxString(wxT("Could not open gml file for output"));	}	int numedges = edgeMap.size();	int numverts = bblMap.size();	// GML header info	fprintf(fout, "Creator /"ogdf::GraphAttributes::writeGML/"/n");	fprintf(fout, "directed 1/n");	fprintf(fout, "graph [/n");	for(bblMap_t::const_iterator it = bblMap.begin() ; it != bblMap.end() ; it++)	{		addr = &it->second;		fprintf(fout, "node [/n");		fprintf(fout, "id %u/n", addr->num);		//fprintf(fout, "template /"oreas:std:rect simple/"/n");		if (it->first == START_ADDR)		{			fprintf(fout, "label /"<label font=///"Arial,10,-1,5,50,0,0,0,0,0///" align=///"68///" textColor=///"FFFFFFFF///">%8.8x</label>/"/n", addr->addr);			addrCharLen = 0;		}		else if (addr->isApi == true)		{			fprintf(fout, "label /"<label font=///"Arial,10,-1,5,50,0,0,0,0,0///" align=///"68///" textColor=///"00000000///">%s</label>/"/n", addr->info.api);			addrCharLen = strlen(addr->info.api);		}		else		{			fprintf(fout, "label /"<label font=///"Arial,10,-1,5,50,0,0,0,0,0///" align=///"68///" textColor=///"00000000///">%8.8x</label>/"/n", addr->addr);			addrCharLen = 0;		}		fprintf(fout, "graphics [/n");		fprintf(fout, "x %u.00000000/n", addr->x);		fprintf(fout, "y %u.00000000/n", addr->y);		fprintf(fout, "w %u.00000000/n", (addrCharLen <= 8 ? 80 : 10 * (unsigned int) addrCharLen));		fprintf(fout, "h 20.00000000/n");		fprintf(fout, "fill /"#%6.6x/"/n", addrColor(addr->addr));		fprintf(fout, "line /"#000000/"/n");		fprintf(fout, "pattern /"1/"/n");		fprintf(fout, "stipple 1/n");		fprintf(fout, "lineWidth 1.000000000/n");		fprintf(fout, "type /"rectangle/"/n");		fprintf(fout, "width 1.0/n");		fprintf(fout, "]/n"); // end graphics		fprintf(fout, "]/n"); // end node	}	for(edgeMap_t::const_iterator it = edgeMap.begin() ; it != edgeMap.end() ; it++)	{		edge = &it->second;		fprintf(fout, "edge [/n");		fprintf(fout, "source %u/n", bblMap[edge->src].num); 		fprintf(fout, "target %u/n", bblMap[edge->dst].num);		fprintf(fout, "generalization 0/n");		fprintf(fout, "graphics [/n");		fprintf(fout, "type /"line/"/n");		fprintf(fout, "arrow /"none/"/n");		fprintf(fout, "stipple 1/n");		if (edge->count >= 1 && edge->count <= 10)			width = edge->count;		else			width = 12;		fprintf(fout, "lineWidth %u.000000000/n", width);		fprintf(fout, "Line [/n");		fprintf(fout, "point [ x 41.00000000 y 31.00000000 ]/n");		fprintf(fout, "point [ x 41.00000000 y 31.00000000 ]/n");				if (edge->count > 10000)			fprintf(fout, "fill /"#0000bb/"/n");		else			fprintf(fout, "fill /"#000000/"/n");		fprintf(fout, "]/n"); // end line		fprintf(fout, "]/n"); // end graphics		fprintf(fout, "]/n"); // end edge	}     	fprintf(fout, "]/n"); // end graph	fprintf(fout, "rootcluster [/n");	for(bblMap_t::const_iterator it = bblMap.begin() ; it != bblMap.end() ; it++)//.........这里部分代码省略.........
开发者ID:nealey,项目名称:vera,代码行数:101,


示例20: ReadElementText

wxString XmlUtil::ReadElementText(TiXmlHandle handle, const char* elementName, const wxString& defaultValue) {  TiXmlElement* element = handle.Child(elementName, 0).ToElement();  if (element) return wxString(element->GetText(), wxConvUTF8);  return defaultValue;}
开发者ID:DocWhoChat,项目名称:appetizer,代码行数:5,


示例21: wxFileSelector

//------------------------------------------------------------------------------void OutputTree::OnCompareNumericColumns(wxCommandEvent &event){   #ifdef DEBUG_COMPARE   MessageInterface::ShowMessage("OutputTree::OnCompareNumericColumns() entered/n");   #endif      ReportFile *theReport =      (ReportFile*) theGuiInterpreter->GetConfiguredObject(theSubscriberName.c_str());      if (!theReport)   {      MessageInterface::ShowMessage         ("OutputTree::OnCompareNumericColumns() The ReportFile: %s is NULL./n",          theSubscriberName.WX_TO_C_STRING);      return;   }      std::string basefilename = theReport->GetFullPathFileName();   StringArray colTitles = theReport->GetRefObjectNameArray(Gmat::PARAMETER);   wxString filename1 =      wxFileSelector("Choose a file to open", "", "", "report|eph|txt",                     "Report files (*.report)|*.report|"                     "Text files (*.txt)|*.txt|"                     "Text ephemeris files (*.eph)|*.eph|"                     "All files (*.*)|*.*");      if (filename1.empty())      return;      Real tol = GmatFileUtil::COMPARE_TOLERANCE;   wxString tolStr;   tolStr.Printf("%e", tol);   tolStr = wxGetTextFromUser("Enter absolute tolerance to be used in flagging: ",                              "Tolerance", tolStr, this);      if (!tolStr.ToDouble(&tol))   {      wxMessageBox("Entered Invalid Tolerance", "Error", wxOK, this);      return;   }       StringArray output =      GmatFileUtil::CompareNumericColumns(1, basefilename.c_str(), filename1.c_str(), "", "",                                          tol);      ViewTextFrame *compWindow = GmatAppData::Instance()->GetCompareWindow();   if (compWindow == NULL)   {      compWindow =          new ViewTextFrame(GmatAppData::Instance()->GetMainFrame(),                           _T("Compare Utility"), 50, 50, 800, 500, "Permanent");      GmatAppData::Instance()->SetCompareWindow(compWindow);      wxString msg;      msg.Printf(_T("GMAT Build Date: %s %s/n/n"),  __DATE__, __TIME__);        compWindow->AppendText(msg);   }      compWindow->Show(true);      for (unsigned int i=0; i<output.size(); i++)   {      compWindow->AppendText(wxString(output[i].c_str()));      MessageInterface::ShowMessage(output[i].c_str());   }}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:66,


示例22: WXUNUSED

void Edit::OnAnnotationRemove(wxCommandEvent& WXUNUSED(event)){  AnnotationSetText(GetCurrentLine(), wxString());}
开发者ID:8l,项目名称:objeck-lang,代码行数:4,


示例23: wxString

wxString pgsDifferent::value() const{	return wxString() << m_left->value() << wxT(" <> ") << m_right->value();}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:4,


示例24: TRACEMSG

int Cn3DNoWin::Run(void){    TRACEMSG("Hello! Running build from " << __DATE__);    int status = 1;        try {            // validate arguments        const CArgs& args = GetArgs();        if (!(args["f"].HasValue() || args["d"].HasValue()) || (args["f"].HasValue() && args["d"].HasValue()))            ERRORTHROW("Command line: Must supply one (and only one) of -f or -d");        EModel_type model = eModel_type_ncbi_all_atom;        if (args["o"].HasValue()) {            if (args["o"].AsString() == "alpha")                model = eModel_type_ncbi_backbone;            else if (args["o"].AsString() == "PDB")                model = eModel_type_pdb_model;        }        string favorite(args["s"].HasValue() ? args["s"].AsString() : kEmptyStr);        // setup dirs        SetUpWorkingDirectories(GetArguments().GetProgramName().c_str());        // read dictionary        wxString dictFile = wxString(GetDataDir().c_str()) + "bstdt.val";        LoadStandardDictionary(dictFile.c_str());        // set up registry         LoadRegistry();        // local structure set and renderer        StructureSet *sset = NULL;        OpenGLRenderer renderer(NULL);        // load data from file        if (args["f"].HasValue()) {            // if -o is present, assume this is a Biostruc file            if (args["o"].HasValue()) {                CNcbi_mime_asn1 *mime = CreateMimeFromBiostruc(args["f"].AsString(), model);                if (!mime || !LoadDataOnly(&sset, &renderer, NULL, mime, favorite))                    ERRORTHROW("Failed to load Biostruc file " << args["f"].AsString());            } else {                if (!LoadDataOnly(&sset, &renderer, args["f"].AsString().c_str(), NULL, favorite, model))                    ERRORTHROW("Failed to load file " << args["f"].AsString());            }        }        // else network fetch        else {            CNcbi_mime_asn1 *mime = LoadStructureViaCache(args["d"].AsString(), model, 0);            if (!mime || !LoadDataOnly(&sset, &renderer, NULL, mime, favorite))                ERRORTHROW("Failed to load from network with id " << args["d"].AsString());        }        if (!sset)            ERRORTHROW("Somehow ended up with NULL sset");        auto_ptr < StructureSet > sset_ap(sset); // so we can be sure it's deleted                // export PNG image        if (!ExportPNG(NULL, &renderer, args["p"].AsString(), args["w"].AsInteger(), args["h"].AsInteger(), args["i"].HasValue()))            ERRORTHROW("PNG export failed");                TRACEMSG("Done!");        status = 0;        } catch (ncbi::CException& ce) {        ERRORMSG("Caught CException: " << ce.GetMsg());    } catch (std::exception& e) {        ERRORMSG("Caught exception: " << e.what());    } catch (...) {        ERRORMSG("Caught unknown exception");    }    return status;}
开发者ID:DmitrySigaev,项目名称:ncbi,代码行数:75,


示例25: wxString

wxString wxHtmlParser::GetInnerSource(const wxHtmlTag& tag){    return wxString(tag.GetBeginIter(), tag.GetEndIter1());}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:4,


示例26: SetText

bool wxTextDataObject::SetData(size_t len, const void *buf){    SetText( wxString((const wxChar*)buf, len/sizeof(wxChar)) );    return true;}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:6,


示例27: wxBoxSizer

void VtxSceneTabs::AddRenderTab(wxWindow *panel){    // A top-level sizer    wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);    panel->SetSizer(topSizer);    // A second box sizer to give more space around the controls    wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL);    topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);    wxStaticBoxSizer* check_options = new wxStaticBoxSizer(wxHORIZONTAL,panel,wxT("Render Options"));	m_hdr=new wxCheckBox(panel, ID_HDR, "HDR");	m_hdr->SetToolTip("Enable High dynamic range");	check_options->Add(m_hdr,0,wxALIGN_LEFT|wxALL,1);	m_shadows=new wxCheckBox(panel, ID_SHADOWS, "Shadows");	m_shadows->SetToolTip("Enable shadows");	check_options->Add(m_shadows,0,wxALIGN_LEFT|wxALL,1);	m_geometry=new wxCheckBox(panel, ID_GEOMETRY, "Geometry");	m_geometry->SetToolTip("Enable render pass geometry (tesselation)");	check_options->Add(m_geometry,0,wxALIGN_LEFT|wxALL,1);    boxSizer->Add(check_options, 0, wxALIGN_LEFT|wxALL,0);    check_options->SetMinSize(wxSize(TABS_WIDTH-TABS_BORDER,-1));	wxStaticBoxSizer* hdr_controls = new wxStaticBoxSizer(wxHORIZONTAL,panel,wxT("High Dynamic Range"));	HDRMinSlider=new SliderCtrl(panel,ID_HDRMIN_SLDR,"Min",LABEL2,VALUE2,SLIDER2);	HDRMinSlider->setRange(0.0,1.0);	HDRMinSlider->slider->SetToolTip("Increase range in dark areas");	hdr_controls->Add(HDRMinSlider->getSizer(),0,wxALIGN_LEFT|wxALL,0);	HDRMaxSlider=new SliderCtrl(panel,ID_HDRMAX_SLDR,"Max",LABEL2,VALUE2,SLIDER2);	HDRMaxSlider->setRange(0.0,5.0);	HDRMaxSlider->slider->SetToolTip("Decreases range in light areas");	hdr_controls->Add(HDRMaxSlider->getSizer(),0,wxALIGN_LEFT|wxALL,0);	boxSizer->Add(hdr_controls, 0, wxALIGN_LEFT|wxALL,0);	wxStaticBoxSizer* shadow_controls = new wxStaticBoxSizer(wxVERTICAL,panel,wxT("Shadows"));	wxBoxSizer *hline = new wxBoxSizer(wxHORIZONTAL);	ShadowBlurSlider=new SliderCtrl(panel,ID_SHADOW_BLUR_SLDR,"Blur",LABEL2,VALUE2,SLIDER2);	ShadowBlurSlider->setRange(0.25,8.0);	ShadowBlurSlider->slider->SetToolTip("Soften Shadow Edges");	hline->Add(ShadowBlurSlider->getSizer(),0,wxALIGN_LEFT|wxALL,0);	ShadowResSlider=new SliderCtrl(panel,ID_SHADOW_RES_SLDR,"Views",LABEL2,VALUE2,SLIDER2);	ShadowResSlider->setRange(1,10);	ShadowResSlider->slider->SetToolTip("Number of Light source views");	ShadowResSlider->format=wxString("%0.0f");	hline->Add(ShadowResSlider->getSizer(),0,wxALIGN_LEFT|wxALL,0);	shadow_controls->Add(hline,0,wxALIGN_LEFT|wxALL,0);	hline = new wxBoxSizer(wxHORIZONTAL);	ShadowFovSlider=new SliderCtrl(panel,ID_SHADOW_FOV_SLDR,"FOV",LABEL2,VALUE2,SLIDER2);	ShadowFovSlider->setRange(0.5,1.5);	ShadowFovSlider->slider->SetToolTip("Light source field of view");	hline->Add(ShadowFovSlider->getSizer(),0,wxALIGN_LEFT|wxALL,0);	ShadowDovSlider=new SliderCtrl(panel,ID_SHADOW_DOV_SLDR,"DOV",LABEL2,VALUE2,SLIDER2);	ShadowDovSlider->setRange(0.5,1.5);	ShadowDovSlider->slider->SetToolTip("Light source depth of view");	hline->Add(ShadowDovSlider->getSizer(),0,wxALIGN_LEFT|wxALL,0);	shadow_controls->Add(hline,0,wxALIGN_LEFT|wxALL,0);	boxSizer->Add(shadow_controls, 0, wxALIGN_LEFT|wxALL,0);}
开发者ID:dwsindorf,项目名称:VTX,代码行数:81,


示例28: KIWAY_PLAYER

SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : KIWAY_PLAYER( parent, id, title, pos, size, style, name ){	this->SetSizeHints( wxDefaultSize, wxDefaultSize );		m_mainMenu = new wxMenuBar( 0 );	m_fileMenu = new wxMenu();	wxMenuItem* m_newPlot;	m_newPlot = new wxMenuItem( m_fileMenu, wxID_NEW, wxString( _("New Plot") ) , wxEmptyString, wxITEM_NORMAL );	m_fileMenu->Append( m_newPlot );		m_fileMenu->AppendSeparator();		wxMenuItem* m_openWorkbook;	m_openWorkbook = new wxMenuItem( m_fileMenu, wxID_OPEN, wxString( _("Open Workbook") ) , wxEmptyString, wxITEM_NORMAL );	m_fileMenu->Append( m_openWorkbook );		wxMenuItem* m_saveWorkbook;	m_saveWorkbook = new wxMenuItem( m_fileMenu, wxID_SAVE, wxString( _("Save Workbook") ) , wxEmptyString, wxITEM_NORMAL );	m_fileMenu->Append( m_saveWorkbook );		m_fileMenu->AppendSeparator();		wxMenuItem* m_saveImage;	m_saveImage = new wxMenuItem( m_fileMenu, wxID_ANY, wxString( _("Save as image") ) , wxEmptyString, wxITEM_NORMAL );	m_fileMenu->Append( m_saveImage );		wxMenuItem* m_saveCsv;	m_saveCsv = new wxMenuItem( m_fileMenu, wxID_ANY, wxString( _("Save as .csv file") ) , wxEmptyString, wxITEM_NORMAL );	m_fileMenu->Append( m_saveCsv );		m_fileMenu->AppendSeparator();		wxMenuItem* m_exitSim;	m_exitSim = new wxMenuItem( m_fileMenu, wxID_CLOSE, wxString( _("Exit Simulation") ) , wxEmptyString, wxITEM_NORMAL );	m_fileMenu->Append( m_exitSim );		m_mainMenu->Append( m_fileMenu, _("File") ); 		m_simulationMenu = new wxMenu();	m_runSimulation = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Run Simulation") ) , wxEmptyString, wxITEM_NORMAL );	m_simulationMenu->Append( m_runSimulation );		m_simulationMenu->AppendSeparator();		m_addSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Add signals...") ) , wxEmptyString, wxITEM_NORMAL );	m_simulationMenu->Append( m_addSignals );		m_probeSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Probe from schematics") ) , wxEmptyString, wxITEM_NORMAL );	m_simulationMenu->Append( m_probeSignals );		m_tuneValue = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Tune component value") ) , wxEmptyString, wxITEM_NORMAL );	m_simulationMenu->Append( m_tuneValue );		m_simulationMenu->AppendSeparator();		m_settings = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Settings...") ) , wxEmptyString, wxITEM_NORMAL );	m_simulationMenu->Append( m_settings );		m_mainMenu->Append( m_simulationMenu, _("Simulation") ); 		m_viewMenu = new wxMenu();	wxMenuItem* m_zoomIn;	m_zoomIn = new wxMenuItem( m_viewMenu, wxID_ZOOM_IN, wxString( _("Zoom In") ) , wxEmptyString, wxITEM_NORMAL );	m_viewMenu->Append( m_zoomIn );		wxMenuItem* m_zoomOut;	m_zoomOut = new wxMenuItem( m_viewMenu, wxID_ZOOM_OUT, wxString( _("Zoom Out") ) , wxEmptyString, wxITEM_NORMAL );	m_viewMenu->Append( m_zoomOut );		wxMenuItem* m_zoomFit;	m_zoomFit = new wxMenuItem( m_viewMenu, wxID_ZOOM_FIT, wxString( _("Fit on Screen") ) , wxEmptyString, wxITEM_NORMAL );	m_viewMenu->Append( m_zoomFit );		m_viewMenu->AppendSeparator();		wxMenuItem* m_showGrid;	m_showGrid = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &grid") ) , wxEmptyString, wxITEM_CHECK );	m_viewMenu->Append( m_showGrid );		wxMenuItem* m_showLegend;	m_showLegend = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &legend") ) , wxEmptyString, wxITEM_CHECK );	m_viewMenu->Append( m_showLegend );		m_mainMenu->Append( m_viewMenu, _("View") ); 		this->SetMenuBar( m_mainMenu );		m_sizer1 = new wxBoxSizer( wxVERTICAL );		m_toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT ); 	m_toolBar->Realize(); 		m_sizer1->Add( m_toolBar, 0, wxEXPAND, 5 );		m_splitterPlot = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );	m_splitterPlot->SetSashGravity( 0.8 );	m_splitterPlot->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotOnIdle ), NULL, this );		m_panel2 = new wxPanel( m_splitterPlot, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );	m_sizer11 = new wxBoxSizer( wxVERTICAL );//.........这里部分代码省略.........
开发者ID:blairbonnett-mirrors,项目名称:kicad,代码行数:101,



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


C++ wxStringBuffer函数代码示例
C++ wxStrcmp函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。