FormFrame::FormFrame( Form *form ) : Presentation( form ), FormWindow( form ), zDialogFrame( 0, new zSizer(150, 150, 800, 500), DS_MODALFRAME | WS_CAPTION, "Formular" ) { window = this; setupFields(); setupPanel(); }
void DocumentProperties::update (Document &doc) { DEBUG ("Setting uri '%1'", doc.getFileName()); filechooser_->set_local_only (false); filechooser_->set_uri (doc.getFileName()); keyentry_->set_text (doc.getKey()); iconImage_->set (doc.getThumbnail()); setupFields (doc.getBibData().getType()); bool const ignore = ignoreTypeChanged_; ignoreTypeChanged_ = true; if (typeManager_.getTypes().find(doc.getBibData().getType()) != typeManager_.getTypes().end()) { DocumentType type = typeManager_.getTypes()[doc.getBibData().getType()]; Gtk::ListStore::iterator it = typecombostore_->children().begin (); Gtk::ListStore::iterator const end = typecombostore_->children().end (); for (; it != end; ++it) { if ((*it)[typebibtexnamecol_] == type.bibtexName_) { typeCombo_->set_active(it); break; } } } else { Gtk::TreeModel::Row row = *(typecombostore_->append()); row[typelabelcol_] = doc.getBibData().getType(); row[typebibtexnamecol_] = doc.getBibData().getType(); } ignoreTypeChanged_ = ignore; extrafieldsstore_->clear (); std::map<Glib::ustring, Glib::ustring> fields = doc.getFields(); std::map<Glib::ustring, Glib::ustring>::iterator field = fields.begin (); std::map<Glib::ustring, Glib::ustring>::iterator const endField = fields.end (); for (; field != endField; ++field) { Glib::ustring const key = (*field).first; Glib::ustring const value = (*field).second; if (fieldEntries_.find(key) != fieldEntries_.end()) { fieldEntries_[key]->set_text (value); } else { Gtk::ListStore::iterator row = extrafieldsstore_->append (); (*row)[extrakeycol_] = key; (*row)[extravalcol_] = value; } } updateSensitivity (); }