Example #1
0
    wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 )
    {
        wxWindow* frame = NULL;

        switch( aClassId )
        {
        case FRAME_PCB:
            frame = dynamic_cast< wxWindow* >( new PCB_EDIT_FRAME( aKiway, aParent ) );

#if defined( KICAD_SCRIPTING )
            // give the scripting helpers access to our frame
            ScriptingSetPcbEditFrame( (PCB_EDIT_FRAME*) frame );
#endif

            if( Kiface().IsSingle() )
            {
                // only run this under single_top, not under a project manager.
                CreateServer( frame, KICAD_PCB_PORT_SERVICE_NUMBER );
            }

            break;

        case FRAME_PCB_MODULE_EDITOR:
            frame = dynamic_cast< wxWindow* >( new FOOTPRINT_EDIT_FRAME( aKiway, aParent ) );
            break;

        case FRAME_PCB_MODULE_VIEWER:
        case FRAME_PCB_MODULE_VIEWER_MODAL:
            frame = dynamic_cast< wxWindow* >( new FOOTPRINT_VIEWER_FRAME( aKiway, aParent,
                                                                           FRAME_T( aClassId ) ) );
            break;

        case FRAME_PCB_FOOTPRINT_WIZARD_MODAL:
            frame = dynamic_cast< wxWindow* >( new FOOTPRINT_WIZARD_FRAME( aKiway, aParent,
                                                                           FRAME_T( aClassId ) ) );
            break;

        default:
            break;
        }

        return frame;
    }
Example #2
0
bool KIWAY::PlayersClose( bool doForce )
{
    bool ret = true;

    for( unsigned i=0; i < KIWAY_PLAYER_COUNT;  ++i )
    {
        ret = ret && PlayerClose( FRAME_T( i ), doForce );
    }

    return ret;
}
Example #3
0
    wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 )
    {
        switch( aClassId )
        {
        case FRAME_SCH:
            {
                SCH_EDIT_FRAME* frame = new SCH_EDIT_FRAME( aKiway, aParent );

                if( Kiface().IsSingle() )
                {
                    // only run this under single_top, not under a project manager.
                    CreateServer( frame, KICAD_SCH_PORT_SERVICE_NUMBER );
                }
                return frame;
            }
            break;

        case FRAME_SCH_LIB_EDITOR:
            {
                LIB_EDIT_FRAME* frame = new LIB_EDIT_FRAME( aKiway, aParent );
                return frame;
            }
            break;

#ifdef KICAD_SPICE
        case FRAME_SIMULATOR:
            {
                SIM_PLOT_FRAME* frame = new SIM_PLOT_FRAME( aKiway, aParent );
                return frame;
            }
            break;
#endif /* KICAD_SPICE */

        case FRAME_SCH_VIEWER:
        case FRAME_SCH_VIEWER_MODAL:
            {
                LIB_VIEW_FRAME* frame = new LIB_VIEW_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
                return frame;
            }
            break;

        default:
            return NULL;
        }
    }
Example #4
0
    wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 )
    {
        switch( aClassId )
        {
        case FRAME_PCB:
            {
                PCB_EDIT_FRAME* frame = new PCB_EDIT_FRAME( aKiway, aParent );

                frame->Zoom_Automatique( true );

#if defined(KICAD_SCRIPTING)
                // give the scripting helpers access to our frame
                ScriptingSetPcbEditFrame( frame );
#endif

                if( Kiface().IsSingle() )
                {
                    // only run this under single_top, not under a project manager.
                    CreateServer( frame, KICAD_PCB_PORT_SERVICE_NUMBER );
                }
                return frame;
            }
            break;

        case FRAME_PCB_MODULE_EDITOR:
            {
                FOOTPRINT_EDIT_FRAME* frame = new FOOTPRINT_EDIT_FRAME( aKiway, aParent );

                frame->Zoom_Automatique( true );

                /* Read a default config file in case no project given on command line.
                frame->LoadProjectFile( wxEmptyString, true );
                */
                return frame;
            }
            break;

        case FRAME_PCB_MODULE_VIEWER:
        case FRAME_PCB_MODULE_VIEWER_MODAL:
            {
                FOOTPRINT_VIEWER_FRAME* frame = new FOOTPRINT_VIEWER_FRAME(
                        aKiway, aParent, FRAME_T( aClassId ) );

                frame->Zoom_Automatique( true );

                /* Read a default config file in case no project given on command line.
                frame->LoadProjectFile( wxEmptyString, true );
                */
                return frame;
            }
            break;

        case FRAME_PCB_FOOTPRINT_WIZARD_MODAL:
            {
                FOOTPRINT_WIZARD_FRAME* frame = new FOOTPRINT_WIZARD_FRAME(
                    aKiway, aParent, FRAME_T( aClassId ) );

                return frame;
            }
            break;

        default:
            ;
        }

        return NULL;
    }