void ZLWin32MessageBox::addButton(const std::string &text) { W32WidgetPtr button = new W32PushButton(text); myButtons.push_back(button); ((W32Control&)*button).addListener(this); button->setVisible(true); myButtonBox->addElement(button); if (myButtons.size() > 1) { myPanel.setExitOnOk(false); } }
void W32Table::setElement(W32WidgetPtr element, int row, int fromColumn, int toColumn) { if (!element.isNull()) { if (row >= (int)myRows.size()) { myRows.insert(myRows.end(), row - myRows.size() + 1, RowList()); } RowList &rowList = myRows[row]; RowList::iterator it = rowList.begin(); bool canInsertAfter = true; for (; it != rowList.end(); ++it) { if (it->XFrom > toColumn) { break; } canInsertAfter = it->XTo < fromColumn; } if (canInsertAfter) { rowList.insert(it, CellInfo(fromColumn, toColumn, element)); } } }
void W32Box::addElement(W32WidgetPtr element) { if (!element.isNull()) { myElements.push_back(element); } }
void ZLWin32Dialog::addButton(const ZLResourceKey &key, bool accept) { W32WidgetPtr button = new W32PushButton(ZLDialogManager::buttonName(key), accept ? W32PushButton::OK_BUTTON : W32PushButton::CANCEL_BUTTON); button->setVisible(true); myButtonBox->addElement(button); }