// Background color class void ImodvBkgColor::openDialog() { mSelector = new ColorSelector(imodvDialogManager.parent(IMODV_DIALOG), "3dmodv background color.", Imodv->rbgcolor->red(), Imodv->rbgcolor->green(), Imodv->rbgcolor->blue(), hotSliderFlag(), hotSliderKey(), ImodPrefs->getRoundedStyle(), "selector"); connect(mSelector, SIGNAL(newColor(int, int, int)), this, SLOT(newColorSlot(int, int, int))); connect(mSelector, SIGNAL(done()), this, SLOT(doneSlot())); connect(mSelector, SIGNAL(closing()), this, SLOT(closingSlot())); connect(mSelector, SIGNAL(keyPress(QKeyEvent *)), this, SLOT(keyPressSlot(QKeyEvent *))); connect(mSelector, SIGNAL(keyRelease(QKeyEvent *)), this, SLOT(keyReleaseSlot(QKeyEvent *))); setModvDialogTitle(mSelector, "3dmodv: "); imodvDialogManager.add((QWidget *)mSelector, IMODV_DIALOG); adjustGeometryAndShow((QWidget *)mSelector, IMODV_DIALOG); }
/* * Create the object list dialog */ void imodvObjectListDialog(ImodvApp *a, int state) { int m; if (!state){ if (Oolist_dialog) Oolist_dialog->close(); return; } if (Oolist_dialog){ Oolist_dialog->raise(); return; } grouping = false; // Get number of buttons, number of columns and number per column // Make maximum number of buttons needed for all loaded models for (m = 0; m < a->numMods; m++) if (numOolistButtons < a->mod[m]->objsize) numOolistButtons = a->mod[m]->objsize; if (numOolistButtons > MAX_OOLIST_BUTTONS) numOolistButtons = MAX_OOLIST_BUTTONS; OolistButtons = (QCheckBox **)malloc(numOolistButtons * sizeof(QCheckBox *)); groupButtons = (QCheckBox **)malloc(numOolistButtons * sizeof(QCheckBox *)); if (!OolistButtons || !groupButtons) { if (OolistButtons) free(OolistButtons); if (groupButtons) free(groupButtons); numOolistButtons = 0; wprint("\aMemory error getting array for checkboxes\n"); return; } Oolist_dialog = new ImodvOlist(imodvDialogManager.parent(IMODV_DIALOG)); imodvOlistUpdateOnOffs(a); // Get sizes to adjust window size with QSize svSize = Oolist_dialog->mScroll->sizeHint(); QSize frameSize = Oolist_dialog->mFrame->sizeHint(); imod_info_input(); Oolist_dialog->adjustSize(); // 4 pixels added was enough to prevent scroll bars // If width is constrained, allow more height for horizontal scroll bar int newWidth = Oolist_dialog->width() + frameSize.width() - svSize.width() + 8; int newHeight = Oolist_dialog->height() + frameSize.height() - svSize.height() + 8; if (newWidth > MAX_OOLIST_WIDTH) { newWidth = MAX_OOLIST_WIDTH; newHeight += 20; } if (newHeight > QApplication::desktop()->height() - 100) newHeight = QApplication::desktop()->height() - 100; Oolist_dialog->resize(newWidth, newHeight); setModvDialogTitle(Oolist_dialog, "3dmodv Object List: "); imodvDialogManager.add((QWidget *)Oolist_dialog, IMODV_DIALOG); // After getting size with group buttons present, maybe hide them Oolist_dialog->updateGroups(a); adjustGeometryAndShow((QWidget *)Oolist_dialog, IMODV_DIALOG); Oolist_dialog->adjustFrameSize(); }