本文整理汇总了C++中gtk::VBox::children方法的典型用法代码示例。如果您正苦于以下问题:C++ VBox::children方法的具体用法?C++ VBox::children怎么用?C++ VBox::children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk::VBox
的用法示例。
在下文中一共展示了VBox::children方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupFields
void DocumentProperties::setupFields (Glib::ustring const &docType)
{
Gtk::VBox *metadataBox;
xml_->get_widget ("MetadataBox", metadataBox);
if (metadataBox->children().size()) {
metadataBox->children().erase(metadataBox->children().begin());
}
DocumentType type = typeManager_.getType (docType);
int const nRows = type.requiredFields_.size() + type.optionalFields_.size();
Gtk::Table *metadataTable = new Gtk::Table (nRows, 4, false);
metadataTable->set_col_spacings (6);
metadataTable->set_row_spacings (6);
fieldEntries_.clear ();
Gtk::Label *typeLabel = Gtk::manage (new Gtk::Label (_("_Type:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true));
if (typecombochanged_)
typecombochanged_.disconnect();
typeCombo_ = Gtk::manage (new Gtk::ComboBox);
typeCombo_->set_model(typecombostore_);
typeCombo_->pack_start(typelabelcol_, true);
typeCombo_->pack_start(typebibtexnamecol_, false);
typeLabel->set_mnemonic_widget (*typeCombo_);
metadataTable->attach (*typeLabel, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
metadataTable->attach (*typeCombo_, 1, 4, 0, 1, Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
typecombostore_->clear();
for (DocumentTypeManager::TypesMap::iterator it = typeManager_.getTypes().begin();
it != typeManager_.getTypes().end();
++it) {
Gtk::TreeModel::Row row = *(typecombostore_->append());
row[typelabelcol_] = (*it).second.displayName_;
row[typebibtexnamecol_] = (*it).second.bibtexName_;
}
typecombochanged_ = typeCombo_->signal_changed().connect (
sigc::mem_fun (*this, &DocumentProperties::onTypeChanged));
int row = 1;
for (
std::vector<DocumentField>::iterator it = type.requiredFields_.begin();
it != type.requiredFields_.end();
++it) {
if (it->shortField_)
continue;
Gtk::Label *label = Gtk::manage (new Gtk::Label (it->displayName_ + ":", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
Gtk::Entry *entry = Gtk::manage (new Gtk::Entry ());
/* [bert] Minor change to actually implement and register
* a callback for changes to the DOI field. This is a bit
* ugly here since it assumes we know whether DOI is
* required or not.
*/
if (it->internalName_ == "doi") {
entry->signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::onDoiEntryChanged));
}
fieldEntries_[it->internalName_] = entry;
metadataTable->attach (*label, 0, 1, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK | Gtk::FILL, 0, 0);
metadataTable->attach (*entry, 1, 4, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
++row;
}
for (
std::vector<DocumentField>::iterator it = type.optionalFields_.begin();
it != type.optionalFields_.end();
++it) {
if (it->shortField_)
continue;
Gtk::Label *label = Gtk::manage (new Gtk::Label (it->displayName_ + ":", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
Gtk::Entry *entry = Gtk::manage (new Gtk::Entry ());
fieldEntries_[it->internalName_] = entry;
metadataTable->attach (*label, 0, 1, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK | Gtk::FILL, 0, 0);
metadataTable->attach (*entry, 1, 4, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
++row;
}
int col = 0;
for (
std::vector<DocumentField>::iterator it = type.requiredFields_.begin();
it != type.requiredFields_.end();
++it) {
if (!it->shortField_)
continue;
Gtk::Label *label = Gtk::manage (new Gtk::Label (it->displayName_ + ":", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
Gtk::Entry *entry = Gtk::manage (new Gtk::Entry ());
//.........这里部分代码省略.........