예제 #1
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;
    }