// ----------------------------------------------------------------------------- // Places the canvas on top of a new wxPanel and returns the panel. // This is sometimes needed to fix redraw problems in Windows XP // ----------------------------------------------------------------------------- wxWindow* OGLCanvas::toPanel(wxWindow* parent) { #ifdef USE_SFML_RENDERWINDOW #ifdef __WXGTK__ // Reparenting the window causes a crash under gtk, so don't do it there // (this was only to fix a bug in winxp anyway) return this; #endif #endif // Create panel auto panel = new wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SIMPLE); // Reparent Reparent(panel); // Create sizer auto sizer = new wxBoxSizer(wxHORIZONTAL); panel->SetSizer(sizer); // Add to sizer sizer->Add(this, 1, wxEXPAND); return panel; }
CatheterCmdGrid & CatheterCmdGrid::operator=(const CatheterCmdGrid& C) { if (this != &C) { Reparent(C.GetParent()); cmd_count = C.cmd_count; copyEditWindow(&C); SetSize(C.GetSize()); } return *this; }
EditPanel & EditPanel::operator=(const EditPanel& C) { if (this != &C) { delete cmd_grid; Reparent(C.GetParent()); cmd_grid = new CatheterCmdGrid(this); cmd_grid->copyEditWindow(C.cmd_grid); setCmdCount((C.cmd_grid)->getCmdCount()); } return *this; }
bool wxReparenter::ProcessXEvent(WXEvent* event) { XEvent* xevent = (XEvent*) event; Window client; if (!sm_done) { if (xevent->type == MapNotify) { wxLogDebug(_T("Window was mapped")); } if (xevent->type == MapNotify && !xevent->xmap.override_redirect && (client = (Window) FindAClientWindow((WXWindow) xevent->xmap.window, sm_name))) { wxLogDebug(_T("Found a client window, about to reparent")); wxASSERT(sm_toReparent->GetParent() == NULL); sm_toReparent->SetHandle((WXWindow) client); sm_newParent->AddChild(sm_toReparent); sm_done = Reparent(sm_newParent, sm_toReparent); return sm_done; } else if (xevent->type == MapNotify && xevent->xmap.override_redirect && xevent->xmap.window) { wxLogDebug(_T("Found an override redirect window, about to reparent")); sm_toReparent->SetHandle((WXWindow) xevent->xmap.window); sm_newParent->AddChild(sm_toReparent); wxASSERT(sm_toReparent->GetParent() == NULL); sm_done = Reparent(sm_newParent, sm_toReparent); return sm_done; } } return FALSE; }
/* public reparent that forces parenting to the root */ void KW_ReparentWidget(KW_Widget * widget, KW_Widget * newparent) { /* don't allow a null parent. not for users, at least. */ if (newparent == NULL) newparent = widget->gui->rootwidget; /* don't allow widgets from different guis to interact */ if (newparent->gui != widget->gui) return; if (newparent == widget->parent) return; Reparent(widget, newparent); }
void GraphicsImageCanvas::OnDoubleClick (wxMouseEvent& event) { if (NULL == fullscreen) { fullscreen = new wxFrame (GetParent(), wxID_ANY, wxT ("Fullscreen")); fullscreen->Show (TRUE); fullscreen->ShowFullScreen (true, wxFULLSCREEN_ALL); fullscreen->SetBackgroundColour (wxT ("black")); Reparent (fullscreen); SetSize (wxGetDisplaySize()); CentreOnParent(); return; } else { Reparent (fullscreen->GetParent()); (GetParent())->Layout(); fullscreen->Close (TRUE); delete fullscreen; fullscreen = (wxFrame*) NULL; return; } }
void FreeWidget(KW_Widget * widget, int freechildren) { KW_Widget * tofree; /* recursively delete children */ if (freechildren) { while (widget->childrencount > 0) { tofree = widget->children[0]; Reparent(tofree, NULL); FreeWidget(tofree, freechildren); } } free(widget->children); if (widget->destroy != NULL) { widget->destroy(widget); } free(widget); }
void TorrentFilesModel::handleFileRenamed (int torrent, int file, const QString& newName) { if (torrent != Index_) return; const auto filePos = std::find_if (Path2Node_.begin (), Path2Node_.end (), [file] (const Path2Node_t::value_type& pair) { return pair.second->FileIndex_ == file; }); if (filePos == Path2Node_.end ()) { qWarning () << Q_FUNC_INFO << "unknown file index" << file << "for torrent" << torrent << "was renamed to" << newName; return; } const auto node = filePos->second; ClearEmptyParents (filePos->first); const boost::filesystem::path newPath { newName.toUtf8 ().constData () }; const auto& parentNode = MkParentIfDoesntExist (newPath, true); node->Name_ = QString::fromUtf8 (newPath.leaf ().string ().c_str ()); node->Reparent (parentNode); beginInsertRows (FindIndex (newPath.branch_path ()), parentNode->GetRowCount (), parentNode->GetRowCount ()); Path2Node_ [newPath] = node; parentNode->AppendExisting (node); endInsertRows (); UpdateSizeGraph (RootNode_); }
logical ServerConnection :: CacheConnection (char *connection_string ) { logical term = NO; BEGINSEQ if ( sc_connection ) SDBERR(99) if ( !connection_string || !*connection_string ) // not cached sc_connection = new SC_Connection(this); else { if ( !(sc_connection = odaba_server->ProvideConnection(this,connection_string)) ) SDBERR(99) if ( sc_connection->get_sub_handles() ) { delete sub_handles; Reparent(sc_connection); } } RECOVER term = YES; ENDSEQ return(term); }
void Menu::Include(Control* c) { scene_->Insert(c); c->SetState(GetBodyState()); Reparent(c, this); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); scene = new Scene(this); ui->glwidget->SetScene(scene); //ui->raycastwidget->s = scene; QObject::connect(ui->object_create_button, SIGNAL(clicked(bool)), scene, SLOT(CreateObject())); QObject::connect(ui->octree_create_button, SIGNAL(clicked(bool)), this, SLOT(CreateOctreePressed())); QObject::connect(ui->object_tree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(SelectObject(QTreeWidgetItem *, QTreeWidgetItem *))); QObject::connect(scene, SIGNAL(UpdateObjList()), this, SLOT(UpdateObjList())); QObject::connect(scene, SIGNAL(UpdateDrawing()), this, SLOT(UpdateDrawing())); QObject::connect(ui->octree_spread_slider, SIGNAL(valueChanged(int)), scene, SLOT(ChangeOctreeSpread(int))); QObject::connect(ui->pos_x, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->pos_y, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->pos_z, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->rot_x, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->rot_y, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->rot_z, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->sca_x, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->sca_y, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->sca_z, SIGNAL(valueChanged(double)), this, SLOT(UpdateCurrentObjectTransform(double))); QObject::connect(ui->name_lineEdit, SIGNAL(textEdited(QString)), this, SLOT(UpdateCurrentObjectName(QString))); QObject::connect(ui->lines_checkBox, SIGNAL(toggled(bool)), this, SLOT(UpdateCurrentObjectCheck(bool))); QObject::connect(ui->hide_checkBox, SIGNAL(toggled(bool)), this, SLOT(UpdateCurrentObjectCheck(bool))); ui->obj_content->setEnabled(false); QObject::connect(ui->object_tree, SIGNAL(ChangeParent(QString, QString)), scene, SLOT(Reparent(QString, QString))); QObject::connect(ui->delete_object, SIGNAL(clicked(bool)), scene, SLOT(DeleteCurrentObject())); QObject::connect(ui->operate_octree_button, SIGNAL(clicked(bool)), this, SLOT(OperateOctreePressed())); QObject::connect(ui->save_pushButton,SIGNAL(clicked(bool)),this,SLOT(SaveScenePress())); QObject::connect(ui->load_pushButton,SIGNAL(clicked(bool)),this,SLOT(LoadScenePress())); QObject::connect(ui->duplicate_button,SIGNAL(clicked(bool)),this,SLOT(DuplicateObjectPressed())); QObject::connect(ui->faceColor,SIGNAL(clicked(bool)),this,SLOT(SetFaceColor())); QObject::connect(ui->lineColor,SIGNAL(clicked(bool)),this,SLOT(SetLineColor())); faceColor = QColor(0,0,0); ui->faceColor->setStyleSheet(colorButtonStyle.arg(faceColor.name())); lineColor = QColor(255,255,255); ui->lineColor->setStyleSheet(colorButtonStyle.arg(lineColor.name())); QObject::connect(ui->clear_pushButton,SIGNAL(clicked(bool)),this,SLOT(ClearScene())); QObject::connect(ui->create_csg_pushButton,SIGNAL(clicked(bool)),this,SLOT(CreateCSGPressed())); QObject::connect(ui->create_he_button,SIGNAL(clicked(bool)),this,SLOT(CreateHEPressed())); QObject::connect(ui->edge_spinBox,SIGNAL(valueChanged(int)),this,SLOT(UpdateCurrentObjectHE())); //QObject::connect(ui->face_spinBox,SIGNAL(valueChanged(int)),this,SLOT(UpdateCurrentObjectHE())); // QObject::connect(ui->face_pushButton,SIGNAL(clicked(bool)),this,SLOT(GetEdgeFace())); QObject::connect(ui->next_pushButton,SIGNAL(clicked(bool)),this,SLOT(GetNextEdge())); QObject::connect(ui->mate_pushButton,SIGNAL(clicked(bool)),this,SLOT(GetMateEdge())); QObject::connect(ui->mef,SIGNAL(clicked(bool)),this,SLOT(MEF())); QObject::connect(ui->mev,SIGNAL(clicked(bool)),this,SLOT(MEV())); QObject::connect(ui->translate,SIGNAL(clicked(bool)),this,SLOT(Translate())); QObject::connect(ui->extrude,SIGNAL(clicked(bool)),this,SLOT(Extrude())); QObject::connect(ui->create_bezier_button,SIGNAL(clicked(bool)),this,SLOT(CreateBezierPressed())); QObject::connect(ui->bezi,SIGNAL(valueChanged(int)),this,SLOT(SelectBezierControl())); QObject::connect(ui->bezj,SIGNAL(valueChanged(int)),this,SLOT(SelectBezierControl())); QObject::connect(ui->bezx,SIGNAL(valueChanged(double)),this,SLOT(SelectBezierPosition())); QObject::connect(ui->bezy,SIGNAL(valueChanged(double)),this,SLOT(SelectBezierPosition())); QObject::connect(ui->bezz,SIGNAL(valueChanged(double)),this,SLOT(SelectBezierPosition())); ui->specific_stackedWidget->setCurrentWidget(ui->default_page); }