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

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

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

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

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

示例1: wxFlexGridSizer

void ChaosConnectFrm::CreateGUIControls() {    /**    *   Creates all of the GUI controls on the main form.    *    *   GUI layout consists of a menu bar and status bar on the main form    *   A wxFlexGrid sizer with one column is created to hold the controls    *   Four plots are then layed out in another wxFlexGridSizer so that     *   in the first row of the overall sizer.  A horizontal wxBoxSizer is    *   then created for the bottom row so that we can add a stretchable    *   panel down there for additional controls.    */        // Create sizer    overallSizer = new wxFlexGridSizer(1);    flexSizer = new wxFlexGridSizer(2, 2, 0, 0);    bottomRowSizer = new wxBoxSizer(wxHORIZONTAL);    panel5Sizer = new wxBoxSizer(wxHORIZONTAL);        // Overall Sizer    overallSizer->Add(flexSizer, 0, wxEXPAND | wxALL);    overallSizer->AddGrowableRow(0);    overallSizer->AddGrowableCol(0);        // Make the Flex Sizer grow    flexSizer->AddGrowableRow(0);    flexSizer->AddGrowableRow(1);    flexSizer->AddGrowableCol(0);    flexSizer->AddGrowableCol(1);        // Create 4 ChaosPanel displays    display1 = new ChaosPanel(this, ID_DISPLAY1, wxPoint(0, 0), wxSize(200, 100), wxTAB_TRAVERSAL, wxT("display1"), ChaosPanel::CHAOS_XT);    flexSizer->Add(display1,0,wxEXPAND | wxALL,0);    display2 = new ChaosPanel(this, ID_DISPLAY2, wxPoint(200, 0), wxSize(200, 100), wxTAB_TRAVERSAL, wxT("display2"), ChaosPanel::CHAOS_XY);    flexSizer->Add(display2,0,wxEXPAND | wxALL,0);    display3 = new ChaosPanel(this, ID_DISPLAY3, wxPoint(0, 100), wxSize(200, 100), wxTAB_TRAVERSAL, wxT("display3"), ChaosPanel::CHAOS_BIFURCATION);    flexSizer->Add(display3,0,wxEXPAND | wxALL,0);    display4 = new ChaosPanel(this, ID_DISPLAY4, wxPoint(200, 100), wxSize(200, 100), wxTAB_TRAVERSAL, wxT("display4"), ChaosPanel::CHAOS_RETURN1);    flexSizer->Add(display4,0,wxEXPAND | wxALL,0);    // Sizer for the controls along the bottom    display5 = new wxPanel(this, ID_DISPLAY5, wxPoint(200, 100), wxSize(200, 100), wxTAB_TRAVERSAL, wxT("display5"));    overallSizer->Add(panel5Sizer, 0, wxEXPAND | wxALL);    panel5Sizer->Add(display5, 1, wxEXPAND | wxALL);    display5->SetSizer(bottomRowSizer);        // Create pause button    startStopButton = new wxButton(display5, ID_START_STOP_BTN, wxT("Pause"));        // Settings to adjust how many bifurcation steps are taken    stepsLabel = new wxStaticText(display5, wxID_ANY, wxT("Bifurcation Steps: "));    stepsSpinner = new wxSpinCtrl(display5, ID_STEPS_SPINNER, wxT("100"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 0, 4095, 100);        // Settings to adjust how many peaks are taken at each step    peaksLabel = new wxStaticText(display5, wxID_ANY, wxT("Bifurcation Peaks: "));    peaksSpinner = new wxSpinCtrl(display5, ID_PEAKS_SPINNER, wxT("10"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 0, 100, 10);        // Buttons    settingsApplyButton = new wxButton(display5, ID_SETTINGS_APPLY_BTN, wxT("Apply"));    bifEraseButton = new wxButton(display5, ID_BIF_ERASE_BTN, wxT("Redraw Bifurcation"));        bottomRowSizer->Add(stepsLabel, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 2);    bottomRowSizer->Add(stepsSpinner, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 2);    bottomRowSizer->Add(peaksLabel, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 2);    bottomRowSizer->Add(peaksSpinner, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 2);    bottomRowSizer->Add(settingsApplyButton, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 2);    bottomRowSizer->Add(bifEraseButton, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 2);        bottomRowSizer->AddStretchSpacer(1);    bottomRowSizer->Add(startStopButton, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2);        // Create status bar    // Create fields    statusBar = new wxStatusBar(this, ID_STATUSBAR);    statusBar->SetFieldsCount(5);    statusBar->SetStatusText(wxT("Connected: ?"),0);    statusBar->SetStatusText(wxT("MDAC Value: ????"),1);    statusBar->SetStatusText(wxT("Resistance: ????"),2);    statusBar->SetStatusText(wxT("(X,Y)"),3);    statusBar->SetStatusText(wxT("Updating"),4);        // Set field sizes    int statusBar_Widths[5];    statusBar_Widths[0] = 100;    statusBar_Widths[1] = 100;    statusBar_Widths[2] = 100;    statusBar_Widths[3] = 150;    statusBar_Widths[4] = -1; // Auto scale to the rest of the size    statusBar->SetStatusWidths(5,statusBar_Widths);        // Set status bar    SetStatusBar(statusBar);        // Create menu bar    menuBar = new wxMenuBar();        // File menu    wxMenu *fileMenu = new wxMenu(0);//.........这里部分代码省略.........
开发者ID:chaoscircuit,项目名称:chaosconnect,代码行数:101,


示例2: absGetStartPoint

//~~ void DrawDiamond(wxDC& dc) [glRelation] ~~glVector end = absGetStartPoint();glVector endcenter = absCalculateCenterPoint() ;glVector diff = end - endcenter;glVector diff2 = diff.RotateDegree(40*30/diff.Mod());glVector orto = diff.Dir();orto *= 6;diff =  diff.Rotate90Degree().Dir();diff *= 10;glVector u = end + diff - orto;glVector v = end + diff + orto;glVector w = endcenter + diff2;wxPoint points[4] = {    wxPoint(v.xCoord(),v.yCoord()),    wxPoint(w.xCoord(),w.yCoord()),    wxPoint(u.xCoord(),u.yCoord()),    wxPoint(end.xCoord(),end.yCoord())};dc.DrawPolygon(4, points);
开发者ID:Astade,项目名称:Astade,代码行数:25,


示例3: wxFrame

GridFrame::GridFrame()        : wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxWidgets grid class demo"),                   wxDefaultPosition,                   wxDefaultSize ){    wxMenu *fileMenu = new wxMenu;    fileMenu->Append( ID_VTABLE, _T("&Virtual table test/tCtrl-V"));    fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test/tCtrl-B"));    fileMenu->Append( ID_SMALL_GRID, _T("&Small Grid test/tCtrl-S"));    fileMenu->AppendSeparator();    fileMenu->Append( wxID_EXIT, _T("E&xit/tAlt-X") );    wxMenu *viewMenu = new wxMenu;    viewMenu->Append( ID_TOGGLEROWLABELS,  _T("&Row labels"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_TOGGLECOLLABELS,  _T("&Col labels"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_TOGGLEEDIT,  _T("&Editable"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_TOGGLEGRIDDRAGCELL, _T("&Grid drag-cell"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width...") );    viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width...") );    viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") );    viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), wxEmptyString, wxITEM_CHECK );    viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), wxEmptyString, wxITEM_CHECK );    wxMenu *rowLabelMenu = new wxMenu;    viewMenu->Append( ID_ROWLABELALIGN, _T("R&ow label alignment"),                      rowLabelMenu,                      _T("Change alignment of row labels") );    rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, _T("&Horizontal") );    rowLabelMenu->Append( ID_ROWLABELVERTALIGN, _T("&Vertical") );    wxMenu *colLabelMenu = new wxMenu;    viewMenu->Append( ID_COLLABELALIGN, _T("Col l&abel alignment"),                      colLabelMenu,                      _T("Change alignment of col labels") );    colLabelMenu->Append( ID_COLLABELHORIZALIGN, _T("&Horizontal") );    colLabelMenu->Append( ID_COLLABELVERTALIGN, _T("&Vertical") );    wxMenu *colMenu = new wxMenu;    colMenu->Append( ID_SETLABELCOLOUR, _T("Set &label colour...") );    colMenu->Append( ID_SETLABELTEXTCOLOUR, _T("Set label &text colour...") );    colMenu->Append( ID_SETLABEL_FONT, _T("Set label fo&nt...") );    colMenu->Append( ID_GRIDLINECOLOUR, _T("&Grid line colour...") );    colMenu->Append( ID_SET_CELL_FG_COLOUR, _T("Set cell &foreground colour...") );    colMenu->Append( ID_SET_CELL_BG_COLOUR, _T("Set cell &background colour...") );    wxMenu *editMenu = new wxMenu;    editMenu->Append( ID_INSERTROW, _T("Insert &row") );    editMenu->Append( ID_INSERTCOL, _T("Insert &column") );    editMenu->Append( ID_DELETEROW, _T("Delete selected ro&ws") );    editMenu->Append( ID_DELETECOL, _T("Delete selected co&ls") );    editMenu->Append( ID_CLEARGRID, _T("Cl&ear grid cell contents") );    wxMenu *selectMenu = new wxMenu;    selectMenu->Append( ID_SELECT_UNSELECT, _T("Add new cells to the selection"),                        _T("When off, old selection is deselected before ")                        _T("selecting the new cells"), wxITEM_CHECK );    selectMenu->Append( ID_SELECT_ALL, _T("Select all"));    selectMenu->Append( ID_SELECT_ROW, _T("Select row 2"));    selectMenu->Append( ID_SELECT_COL, _T("Select col 2"));    selectMenu->Append( ID_SELECT_CELL, _T("Select cell (3, 1)"));    selectMenu->Append( ID_DESELECT_ALL, _T("Deselect all"));    selectMenu->Append( ID_DESELECT_ROW, _T("Deselect row 2"));    selectMenu->Append( ID_DESELECT_COL, _T("Deselect col 2"));    selectMenu->Append( ID_DESELECT_CELL, _T("Deselect cell (3, 1)"));    wxMenu *selectionMenu = new wxMenu;    selectMenu->Append( ID_CHANGESEL, _T("Change &selection mode"),                      selectionMenu,                      _T("Change selection mode") );    selectionMenu->Append( ID_SELCELLS, _T("Select &Cells") );    selectionMenu->Append( ID_SELROWS, _T("Select &Rows") );    selectionMenu->Append( ID_SELCOLS, _T("Select C&ols") );    wxMenu *helpMenu = new wxMenu;    helpMenu->Append( wxID_ABOUT, _T("&About wxGrid demo") );    wxMenuBar *menuBar = new wxMenuBar;    menuBar->Append( fileMenu, _T("&File") );    menuBar->Append( viewMenu, _T("&View") );    menuBar->Append( colMenu,  _T("&Colours") );    menuBar->Append( editMenu, _T("&Edit") );    menuBar->Append( selectMenu, _T("&Select") );    menuBar->Append( helpMenu, _T("&Help") );    SetMenuBar( menuBar );    m_addToSel = false;    grid = new wxGrid( this,                       wxID_ANY,                       wxPoint( 0, 0 ),//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:101,


示例4: GetBestSize

bool wxRibbonPanel::ShowExpanded(){    if(!IsMinimised())    {        return false;    }    if(m_expanded_dummy != NULL || m_expanded_panel != NULL)    {        return false;    }    wxSize size = GetBestSize();    // Special case for flexible panel layout, where GetBestSize doesn't work    if (GetFlags() & wxRIBBON_PANEL_FLEXIBLE)    {        size = GetBestSizeForParentSize(wxSize(400, 1000));    }    wxPoint pos = GetExpandedPosition(wxRect(GetScreenPosition(), GetSize()),        size, m_preferred_expand_direction).GetTopLeft();    // Need a top-level frame to contain the expanded panel    wxFrame *container = new wxFrame(NULL, wxID_ANY, GetLabel(),        pos, size, wxFRAME_NO_TASKBAR | wxBORDER_NONE);    m_expanded_panel = new wxRibbonPanel(container, wxID_ANY,        GetLabel(), m_minimised_icon, wxPoint(0, 0), size, (m_flags /* & ~wxRIBBON_PANEL_FLEXIBLE */));    m_expanded_panel->SetArtProvider(m_art);    m_expanded_panel->m_expanded_dummy = this;    // Move all children to the new panel.    // Conceptually it might be simpler to reparent this entire panel to the    // container and create a new panel to sit in its place while expanded.    // This approach has a problem though - when the panel is reinserted into    // its original parent, it'll be at a different position in the child list    // and thus assume a new position.    // NB: Children iterators not used as behaviour is not well defined    // when iterating over a container which is being emptied    while(!GetChildren().IsEmpty())    {        wxWindow *child = GetChildren().GetFirst()->GetData();        child->Reparent(m_expanded_panel);        child->Show();    }    // Move sizer to new panel    if(GetSizer())    {        wxSizer* sizer = GetSizer();        SetSizer(NULL, false);        m_expanded_panel->SetSizer(sizer);    }    m_expanded_panel->Realize();    Refresh();    container->SetMinClientSize(size);    container->Show();    m_expanded_panel->SetFocus();    return true;}
开发者ID:iokto,项目名称:newton-dynamics,代码行数:63,


示例5: OrCell_Trace

/* This function is used by Retrace and read the autorouting matrix data cells to create * the real track on the physical board */static void OrCell_Trace( BOARD* pcb, int col, int row,                          int side, int orient, int current_net_code ){    int    dx0, dy0, dx1, dy1;    TRACK* newTrack;    if( orient == HOLE )  // placement of a via    {        newTrack = new SEGVIA( pcb );        g_CurrentTrackList.PushBack( newTrack );        g_CurrentTrackSegment->SetState( TRACK_AR, true );        g_CurrentTrackSegment->SetLayer( 0x0F );        g_CurrentTrackSegment->SetStart(wxPoint( pcb->GetBoundingBox().GetX() +                                        ( RoutingMatrix.m_GridRouting * row ),                                        pcb->GetBoundingBox().GetY() +                                        ( RoutingMatrix.m_GridRouting * col )));        g_CurrentTrackSegment->SetEnd( g_CurrentTrackSegment->GetStart() );        g_CurrentTrackSegment->SetWidth( pcb->GetCurrentViaSize() );        g_CurrentTrackSegment->SetShape( pcb->GetDesignSettings().m_CurrentViaType );        g_CurrentTrackSegment->SetNet( current_net_code );    }    else    // placement of a standard segment    {        newTrack = new TRACK( pcb );        g_CurrentTrackList.PushBack( newTrack );        g_CurrentTrackSegment->SetLayer( g_Route_Layer_BOTTOM );        if( side == TOP )            g_CurrentTrackSegment->SetLayer( g_Route_Layer_TOP );        g_CurrentTrackSegment->SetState( TRACK_AR, true );        g_CurrentTrackSegment->SetEnd( wxPoint( pcb->GetBoundingBox().GetX() +                                                ( RoutingMatrix.m_GridRouting * row ),                                                pcb->GetBoundingBox().GetY() +                                                ( RoutingMatrix.m_GridRouting * col )));        g_CurrentTrackSegment->SetNet( current_net_code );        if( g_CurrentTrackSegment->Back() == NULL ) /* Start trace. */        {            g_CurrentTrackSegment->SetStart( wxPoint( segm_fX, segm_fY ) );            /* Placement on the center of the pad if outside grid. */            dx1 = g_CurrentTrackSegment->GetEnd().x - g_CurrentTrackSegment->GetStart().x;            dy1 = g_CurrentTrackSegment->GetEnd().y - g_CurrentTrackSegment->GetStart().y;            dx0 = pt_cur_ch->m_PadEnd->GetPosition().x - g_CurrentTrackSegment->GetStart().x;            dy0 = pt_cur_ch->m_PadEnd->GetPosition().y - g_CurrentTrackSegment->GetStart().y;            /* If aligned, change the origin point. */            if( abs( dx0 * dy1 ) == abs( dx1 * dy0 ) )            {                g_CurrentTrackSegment->SetStart( pt_cur_ch->m_PadEnd->GetPosition() );            }            else    // Creation of a supplemental segment            {                g_CurrentTrackSegment->SetStart( pt_cur_ch->m_PadEnd->GetPosition() );                newTrack = (TRACK*)g_CurrentTrackSegment->Clone();                newTrack->SetStart( g_CurrentTrackSegment->GetEnd());                g_CurrentTrackList.PushBack( newTrack );            }        }        else        {            if( g_CurrentTrackSegment->Back() )            {                g_CurrentTrackSegment->SetStart( g_CurrentTrackSegment->Back()->GetEnd() );            }        }        g_CurrentTrackSegment->SetWidth( pcb->GetCurrentTrackWidth() );        if( g_CurrentTrackSegment->GetStart() != g_CurrentTrackSegment->GetEnd() )        {            /* Reduce aligned segments by one. */            TRACK* oldTrack = g_CurrentTrackSegment->Back();            if( oldTrack &&  oldTrack->Type() != PCB_VIA_T )            {                dx1 = g_CurrentTrackSegment->GetEnd().x - g_CurrentTrackSegment->GetStart().x;                dy1 = g_CurrentTrackSegment->GetEnd().y - g_CurrentTrackSegment->GetStart().y;                dx0 = oldTrack->GetEnd().x - oldTrack->GetStart().x;                dy0 = oldTrack->GetEnd().y - oldTrack->GetStart().y;                if( abs( dx0 * dy1 ) == abs( dx1 * dy0 ) )                {                    oldTrack->SetEnd( g_CurrentTrackSegment->GetEnd() );//.........这里部分代码省略.........
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:101,


示例6: GetBoard

//.........这里部分代码省略.........        wxTextEntryDialog angledlg( this, _( "Angle (0.1deg):" ),                                    _( "Create microwave module" ), msg );        if( angledlg.ShowModal() != wxID_OK )        {            m_canvas->MoveCursorToCrossHair();            return NULL; // cancelled by user        }        msg = angledlg.GetValue();        if( !msg.ToDouble( &fval ) )        {            DisplayError( this, _( "Incorrect number, abort" ) );            abort = true;        }        angle = std::abs( KiROUND( fval * fcoeff ) );        if( angle > 1800 )            angle = 1800;    }    if( abort )    {        m_canvas->MoveCursorToCrossHair();        return NULL;    }    module = Create_MuWaveBasicShape( cmp_name, pad_count );    pad    = module->Pads();    switch( shape_type )    {    case 0:     //Gap :        oX = -( gap_size + pad->GetSize().x ) / 2;        pad->SetX0( oX );        pad->SetX( pad->GetPos0().x + pad->GetPosition().x );        pad = pad->Next();        pad->SetX0( oX + gap_size + pad->GetSize().x );        pad->SetX( pad->GetPos0().x + pad->GetPosition().x );        break;    case 1:     //Stub :        pad->SetPadName( wxT( "1" ) );        pad = pad->Next();        pad->SetY0( -( gap_size + pad->GetSize().y ) / 2 );        pad->SetSize( wxSize( pad->GetSize().x, gap_size ) );        pad->SetY( pad->GetPos0().y + pad->GetPosition().y );        break;    case 2:     // Arc Stub created by a polygonal approach:    {        EDGE_MODULE* edge = new EDGE_MODULE( module );        module->GraphicalItems().PushFront( edge );        edge->SetShape( S_POLYGON );        edge->SetLayer( LAYER_N_FRONT );        int numPoints = angle / 50 + 3;     // Note: angles are in 0.1 degrees        std::vector<wxPoint> polyPoints = edge->GetPolyPoints();        polyPoints.reserve( numPoints );        edge->m_Start0.y = -pad->GetSize().y / 2;        polyPoints.push_back( wxPoint( 0, 0 ) );        int theta = -angle / 2;        for( int ii = 1; ii<numPoints - 1; ii++ )        {            wxPoint pt( 0, -gap_size );            RotatePoint( &pt.x, &pt.y, theta );            polyPoints.push_back( pt );            theta += 50;            if( theta > angle / 2 )                theta = angle / 2;        }        // Close the polygon:        polyPoints.push_back( polyPoints[0] );    }        break;    default:        break;    }    module->CalculateBoundingBox();    GetBoard()->m_Status_Pcb = 0;    OnModify();    return module;}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:101,


示例7: setGridOrigin

void DIALOG_SET_GRID::OnResetGridOrgClick( wxCommandEvent& event ){    setGridOrigin( wxPoint( 0, 0 ) );}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:4,


示例8: OnInit

        bool OnInit()        {#if DEBUG            wxLogWarning("MODO DEBUG");#else            wxSetAssertHandler(NULL);#endif            //i18n/l10n:            //20120603: Change suggested by Juan Pizarro to solve the i18n bug in some Windows and Linux machines:            //if ( !locale.Init(wxLANGUAGE_DEFAULT, wxLOCALE_CONV_ENCODING) )#if !defined(linux)            wxLogWarning("Esta version esta desarrollada exclusivamente para Linux");            return true;#endif/*#if defined (linux)            wxLogNull logNo;#endif*/            /*            if ( !locale.Init(wxLANGUAGE_ENGLISH, wxLOCALE_CONV_ENCODING) )                wxLogWarning(_("Error #1: This language is not supported by the system."));            */            /*            wxString lanPath(wxStandardPaths::Get().GetExecutablePath().BeforeLast(wxFileName::GetPathSeparator()) +                             wxFileName::GetPathSeparator() + wxString("GUI") +                             wxFileName::GetPathSeparator() + wxString("Texts") //##Unhardcode this in the future? I'm not sure...                            );            */            //wxString lanPath = wxStandardPaths::Get().GetExecutablePath().BeforeLast(wxFileName::GetPathSeparator()) + "/../../GUI/Texts/";            //wxLocale::AddCatalogLookupPathPrefix(lanPath);	    wxString lanPath = "/usr/share";	    locale.AddCatalogLookupPathPrefix(lanPath);            //Por defecto debe levantar en Castellano            //wxString initialCatalogName("es.mo");	    wxString initialCatalogName = "Minibloq.mo";            //wxString initialCatalogName("es.mo"); //##Debug...            if (!locale.AddCatalog(initialCatalogName))            {                //##Future: See if future wxLocale implementations solve this problem:                wxLogWarning(   _("Error #1: The installation path/n/n/"") + wxStandardPaths::Get().GetExecutablePath() +                                _("/"/n/ncontains non-English chars./n") +                                _("Please try to install Minibloq on a location without this kind of chars. ") +                                _("Otherwise, the program will run, but the translation system will not work properly.")                            );                //wxLogWarning(_("Error #2: Can't load ") + initialCatalogName);                printf("NO ENCUENTRO EL CATALOGO/n");            }            MainFrame* frame = NULL;            wxString caption = wxString(wxString("miniBloq ") + MINIBLOQ_VERSION);            wxPoint framePosition = wxDefaultPosition;            wxSize frameSize = wxDefaultSize;            long style = wxDEFAULT_FRAME_STYLE;            //Default values:            initialFrameX = 0;            initialFrameY = 0;            initialFrameHeight = 600;            initialFrameWidth = 800;            maximized = true;            centered = true;            strBoard = wxString("");            //Try to read the configuration file:            readConfig();            //Priorities:            //  maximized has priority over all the other pos and size settings.            //  centered has priority over x and y settings.            if (maximized)                style = style | wxMAXIMIZE;            if ( (initialFrameWidth > 0) && (initialFrameHeight > 0) )            {                framePosition = wxPoint(initialFrameX, initialFrameY);                frameSize = wxSize(initialFrameWidth, initialFrameHeight);            }            //TODO: Chequeo de errores	    wxString execPath = wxStandardPaths::Get().GetExecutablePath().BeforeLast(wxFileName::GetPathSeparator()); 	    wxString splashImg = execPath + "/../../GUI/Images/minibloqSplash.png";            wxBitmap splashPng;            splashPng.LoadFile(splashImg);            wxSplashScreen* splash = new wxSplashScreen(splashPng,                                                        wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,//.........这里部分代码省略.........
开发者ID:id-fga,项目名称:minibloq,代码行数:101,


示例9: PlotLayerOutlines

void PlotLayerOutlines( BOARD *aBoard, PLOTTER* aPlotter,                        LAYER_MSK aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt ){    BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );    itemplotter.SetLayerMask( aLayerMask );    CPOLYGONS_LIST outlines;    for( LAYER_NUM layer = FIRST_LAYER; layer < NB_PCB_LAYERS; layer++ )    {        LAYER_MSK layer_mask = GetLayerMask( layer );        if( (aLayerMask & layer_mask ) == 0 )            continue;        outlines.RemoveAllContours();        aBoard->ConvertBrdLayerToPolygonalContours( layer, outlines );        // Merge all overlapping polygons.        KI_POLYGON_SET kpolygons;        KI_POLYGON_SET ktmp;        outlines.ExportTo( ktmp );        kpolygons += ktmp;        // Plot outlines        std::vector< wxPoint > cornerList;        for( unsigned ii = 0; ii < kpolygons.size(); ii++ )        {            KI_POLYGON polygon = kpolygons[ii];            // polygon contains only one polygon, but it can have holes linked by            // overlapping segments.            // To plot clean outlines, we have to break this polygon into more polygons with            // no overlapping segments, using Clipper, because boost::polygon            // does not allow that            ClipperLib::Path raw_polygon;            ClipperLib::Paths normalized_polygons;            for( unsigned ic = 0; ic < polygon.size(); ic++ )            {                KI_POLY_POINT corner = *(polygon.begin() + ic);                raw_polygon.push_back( ClipperLib::IntPoint( corner.x(), corner.y() ) );            }            ClipperLib::SimplifyPolygon( raw_polygon, normalized_polygons );            // Now we have one or more basic polygons: plot each polygon            for( unsigned ii = 0; ii < normalized_polygons.size(); ii++ )            {                ClipperLib::Path& polygon = normalized_polygons[ii];                cornerList.clear();                for( unsigned jj = 0; jj < polygon.size(); jj++ )                    cornerList.push_back( wxPoint( polygon[jj].X , polygon[jj].Y ) );                // Ensure the polygon is closed                if( cornerList[0] != cornerList[cornerList.size()-1] )                    cornerList.push_back( cornerList[0] );                aPlotter->PlotPoly( cornerList, NO_FILL );            }        }        // Plot pad holes        if( aPlotOpt.GetDrillMarksType() != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )        {            for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )            {                for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )                {                    wxSize hole = pad->GetDrillSize();                    if( hole.x == 0 || hole.y == 0 )                        continue;                    if( hole.x == hole.y )                        aPlotter->Circle( pad->GetPosition(), hole.x, NO_FILL );                    else                    {                        wxPoint drl_start, drl_end;                        int width;                        pad->GetOblongDrillGeometry( drl_start, drl_end, width );                        aPlotter->ThickSegment( pad->GetPosition() + drl_start,                                pad->GetPosition() + drl_end, width, SKETCH );                    }                }            }        }        // Plot vias holes        for( TRACK* track = aBoard->m_Track; track; track = track->Next() )        {            const VIA* via = dyn_cast<const VIA*>( track );            if( via && via->IsOnLayer( layer ) )    // via holes can be not through holes            {                aPlotter->Circle( via->GetPosition(), via->GetDrillValue(), NO_FILL );//.........这里部分代码省略.........
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:101,


示例10: timedMessageBoxNoModal

void timedMessageBoxNoModal(int whichIcon, const wxString& message,			    const wxString& caption, unsigned int delay, // miliseconds			    long style, const int x, const int y){	wxWindow* parent = getParent(whichIcon);	s_timedMessageBox = new TimedMessageBox(whichIcon, parent, message, caption, delay, style, wxPoint(x, y));	s_timedMessageBox->Show(true);}
开发者ID:OursDesCavernes,项目名称:springlobby,代码行数:8,


示例11: mutelistWindow

void mutelistWindow(const wxString& message, const wxString& caption,		    long style, const int x, const int y){	wxWindow* parent = getParent(SL_MAIN_ICON);	wxIcon icon = getIcon(SL_MAIN_ICON);	if (s_mutelistWindow != 0 && s_mutelistWindow->IsShown()) {		s_mutelistWindow->AppendMessage(message);	} else {		s_mutelistWindow = new MutelistWindow(&icon, parent, wxEmptyString, caption, style, wxPoint(x, y));		s_mutelistWindow->AppendMessage(message);		s_mutelistWindow->Show(true);	}}
开发者ID:OursDesCavernes,项目名称:springlobby,代码行数:14,


示例12: wxFrame

Frame::Frame(const wxString& title, const wxPoint& pos, const wxSize& size)      : wxFrame(NULL, wxID_ANY, title, pos, size){  //Read the url for the api from the API_URL file  char url[256];  bool fileread = false;  FILE * file = fopen("API_URL", "r");  if (file != NULL){    if (fgets(url, 256, file) != NULL){      int i = 0;      while (i < 256 && url[i] != '/0'){        if (url[i] == '/n' || url[i] == '/r' || url[i] == ' '){          url[i] = '/0';          break;        }        else i++;      }      fileread = true;    } else {      fileread = false;    }    fclose(file);  }  if (fileread)    server_com = new ServerCommunication(url);  else    server_com = new ServerCommunication("http://se.putman.pw/api.php");  //Create the menu bar for the login screen  wxMenu *menuFile_login = new wxMenu; //The login File menu  menuFile_login->Append(wxID_EXIT);  menubar_login = new wxMenuBar();  menubar_login->Append(menuFile_login, "&File");  SetMenuBar(menubar_login);  //Create the menu bar for the overview screen  wxMenu *menuFile_overview = new wxMenu; //The overview File menu  menuFile_overview->Append(ID_EXPORT, wxT("&Export"));  menuFile_overview->Append(ID_LOGOUT, wxT("&Logout"));  menuFile_overview->Append(wxID_EXIT);  wxMenu *menuNew = new wxMenu;  menuNew->Append(ID_NEW_COURSE, wxT("New course"));  menuNew->Append(ID_NEW_CURRICULUM, wxT("New study program"));  menuNew->Append(ID_NEW_YEAR, wxT("New year"));  wxMenu *menuDelete = new wxMenu;  menuDelete->Append(ID_DELETE_YEAR, wxT("Delete year"));  menuDelete->Append(ID_DELETE_CURRICULUM, wxT("Delete study program"));  menuDelete->Append(ID_RESET, wxT("Delete all"));  menubar_overview = new wxMenuBar();  menubar_overview->Append(menuFile_overview, "&File");  menubar_overview->Append(menuNew, "&New");  menubar_overview->Append(menuDelete, "&Delete");  CreateStatusBar(1);  SetStatusText("");  //Create the error message that is displayed on a failed login attempt  GetStatusBar()->SetForegroundColour(wxColour(wxT("RED")));  failed_login_txt = new wxStaticText(GetStatusBar(), wxID_ANY,wxT("Login failed: incorrect username and/or password"), wxPoint(3, 5), wxDefaultSize, 0 );  failed_login_txt->Show(false);  GetStatusBar()->SetForegroundColour(wxColour(wxT("BLACK")));  if (!fileread){    failed_login_txt->SetLabel("Error reading API_URL, using the default url instead");    failed_login_txt->Show(true);  }  //Create the program title bar at the top of the screen  wxPanel *title_panel = new wxPanel(this);  title_panel->SetBackgroundColour(wxColour(0xFF,0x55,0x33));  wxStaticText *program_title_text = new wxStaticText(title_panel, wxID_ANY,                                  "Curriculum Builder", wxPoint(10,10), wxSize(100,60) );  wxFont font = program_title_text->GetFont();  font.Scale(4);  program_title_text->SetFont(font);  program_title_text->SetForegroundColour(wxColour(wxT("WHITE")));  wxStaticBoxSizer *program_title = new wxStaticBoxSizer(wxHORIZONTAL,this,"");  program_title->Add(title_panel, 1, wxEXPAND);  //Create the bar at the bottom of the screen  wxPanel *info_panel = new wxPanel(this);  info_panel->SetBackgroundColour(wxColour(0xB6,0xB6,0xB6));  wxStaticText *group_info_text = new wxStaticText(info_panel, wxID_ANY, L"/u00a9  2014 [email
C++ wxPostEvent函数代码示例
C++ wxPen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。