int Frigid::init() { //Load stuff //TODO: Change to the refresh rate of the monitor. //mWindow.setFramerateLimit(30); //Get the user folder path. char path[MAX_PATH]; if (SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path) != S_OK) { _error("Could not get the user path") } mPrefs = Preferences::instance(); mPrefs->setHomeDir(path); mPrefs->setConfigDir(String(path) + "/Documents/_quark"); BindingManager::instance()->setDefaultBindings(); loadConfig(); uint32 w = mPrefs->getStartingWindowWidth(); uint32 h = mPrefs->getStartingWindowHeight(); bool m = mPrefs->getStartMaximized(); if (w == 0 || h == 0) { m = true; w = 1024; h = 600; } mWindow = new RenderWindow(VideoMode(w, h, 32, m), "Quark"); mMainPanel = Panel(); tempHelpText = Text("Press control + ? for help.", *mPrefs->getFont(), 12); getPreferences(); CodeEditor *editor = new CodeEditor(); mMainPanel.setWidget(editor); Input::initInput(); WindowEvent e; e.type = WindowEvent::Resized; e.size.width = mWindow->getWidth(); e.size.height = mWindow->getHeight(); Rectf visibleArea(0, 0, staticCastf(e.size.width), staticCastf(e.size.height)); mWindow->setView(View(visibleArea)); mMainPanel.resizeEvent(e); update(); quit(); return 0; }
// Simplify_Interface(): // Simplify Object Replacement Plug-In's Interface Function XCALL_ (int) Simplify_Interface( long version, GlobalFunc *global, void *local, void *serverData ) { SimplifyInstance *si = (SimplifyInstance *) local; // Version Check if( version != 1 ) return( AFUNC_BADVERSION ); XCALL_INIT; // Required LW Plug-In Initialization Call int retval; SimplifyInterface Panel( global, si, retval ); return retval; }
/* The default layout is 1080p(1920x1080) 1280 1920 +-------------------------------+---------------+ | | | | | Global | | | Localizer | | | | | HandyCam | | | +---------------+ 440 | | | | | | | | | +----------------+--------------+ Navigator | 720 | | | | | RoadFinder | Saliency | | | | Match | | | | | | +----------------+--------------+---------------+ 1080 720 1280 */ BeoVisualizer::BeoVisualizer(OptionManager& mgr, const std::string& descrName, const std::string& tagName) : RobotBrainComponent(mgr, descrName, tagName), itsTimer(1000000), itsCurrMessageID(0), itsOfs(new OutputFrameSeries(mgr)) { addSubComponent(itsOfs); itsDispImage = Image<PixRGB<byte> >(IMG_WIDTH,IMG_HEIGHT,ZEROS); itsHandycam = Panel(Point2D<int>(0,0) ,Dims(1280,720), "HandyCam"); itsRoadFinder= Panel(itsHandycam.bl() ,Dims(1280,360), "RoadFinder"); itsImageMatch= Panel(itsRoadFinder.tr(),Dims(560 ,360), "ImageMatch"); itsLocalizer = Panel(itsHandycam.tr() ,Dims(640 ,440), "Global Map"); itsNavigator = Panel(itsLocalizer.bl() ,Dims(640 ,640), "Local Map"); itsPilot= Panel(itsLocalizer.bl() ,Dims(640 ,640), "Pilot"); itsSim = Panel(itsLocalizer.bl() ,Dims(640 ,400), "Pilot"); //fake image just for display test FIXXXXXX //Image<PixRGB<byte> > fakeHandyCamImg = Raster::ReadRGB("HandyCam.png"); //itsHandycam.updateImage(fakeHandyCamImg); }
ControllElement* GuiManager::Element(unsigned panelID,unsigned elementID) { return Panel(panelID)->GetConnected<ControllElement>(elementID); }
ControllElement* GuiManager::Element(string panelName,ConID ID) { return Panel(panelName)->GetConnected<ControllElement>(ID); }
Panel open(bool activePanel) { auto tmp = simstd::make_unique<FacadeImpl>(activePanel); return tmp->is_valid() ? Panel(simstd::move(tmp)) : Panel(); }