BlockAdapter::BlockAdapter(const Controller& c, org_scilab_modules_scicos::model::Block* adaptee) : BaseAdapter<BlockAdapter, org_scilab_modules_scicos::model::Block>(c, adaptee), doc_content(nullptr), from_vec(), to_vec(), list_objects(nullptr), contrib_content(nullptr) { if (property<BlockAdapter>::properties_have_not_been_set()) { property<BlockAdapter>::fields.reserve(4); property<BlockAdapter>::add_property(L"graphics", &graphics::get, &graphics::set); property<BlockAdapter>::add_property(L"model", &model::get, &model::set); property<BlockAdapter>::add_property(L"gui", &gui::get, &gui::set); property<BlockAdapter>::add_property(L"doc", &doc::get, &doc::set); } setListObjects(new types::List()); setContribContent(new types::List()); setDocContent(new types::List()); // model::get will set the adapter's content (listObjects, from_vec & to_vec) if needed Controller controller; model::get(*this, controller); }
/** * Initialize the Help window with a tabbed HelpPanel in the center of the * screen. Populate each tab. */ void HelpFrame::initPanels() { // Create a Help panel. myHelpPanel = new HelpPanel(this); wxBoxSizer *helpSizer = new wxBoxSizer(wxVERTICAL); helpSizer->Add(myHelpPanel, 1, wxEXPAND | wxALL, 0); this->SetSizer(helpSizer); // Set size and position to center of screen. wxDisplay *d = new wxDisplay(); wxRect r = d->GetClientArea(); wxSize w = myHelpPanel->GetMinSize(); wxPoint p; p.x = (r.x + r.width) / 2 - (w.x / 2); p.y = (r.y + r.height) /2 - (w.y / 2); this->SetPosition(p); this->SetSize(w); this->SetMinSize(w); // Populate the tabbed panels. setAboutContent(); setDocContent(); setCreditContent(); }
BlockAdapter::BlockAdapter(const BlockAdapter& adapter) : BaseAdapter<BlockAdapter, org_scilab_modules_scicos::model::Block>(adapter, false), doc_content(nullptr), from_vec(), to_vec(), list_objects(nullptr), contrib_content(nullptr) { Controller controller; if (adapter.getListObjects()->getSize() > 0) { types::InternalType* model = model::get(adapter, controller); model::set(*this, model, controller); model->killMe(); } else { setListObjects(new types::List()); setContribContent(new types::List()); } setDocContent(adapter.getDocContent()); }