本文整理汇总了C++中SPObject::desc方法的典型用法代码示例。如果您正苦于以下问题:C++ SPObject::desc方法的具体用法?C++ SPObject::desc怎么用?C++ SPObject::desc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPObject
的用法示例。
在下文中一共展示了SPObject::desc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gtk_entry_set_text
/**
* \param selection Selection to use; should not be NULL.
*/
static void
sp_item_widget_setup ( SPWidget *spw, Inkscape::Selection *selection )
{
g_assert (selection != NULL);
if (gtk_object_get_data (GTK_OBJECT (spw), "blocked"))
return;
if (!selection->singleItem()) {
gtk_widget_set_sensitive (GTK_WIDGET (spw), FALSE);
return;
} else {
gtk_widget_set_sensitive (GTK_WIDGET (spw), TRUE);
}
gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (TRUE));
SPItem *item = selection->singleItem();
/* Sensitive */
GtkWidget *w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "sensitive"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), item->isLocked());
/* Hidden */
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "hidden"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), item->isExplicitlyHidden());
if (SP_OBJECT_IS_CLONED (item)) {
/* ID */
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "id"));
gtk_entry_set_text (GTK_ENTRY (w), "");
gtk_widget_set_sensitive (w, FALSE);
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "id_label"));
gtk_label_set_text (GTK_LABEL (w), _("Ref"));
/* Label */
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "label"));
gtk_entry_set_text (GTK_ENTRY (w), "");
gtk_widget_set_sensitive (w, FALSE);
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "label_label"));
gtk_label_set_text (GTK_LABEL (w), _("Ref"));
} else {
SPObject *obj = (SPObject*)item;
/* ID */
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "id"));
gtk_entry_set_text (GTK_ENTRY (w), obj->getId());
gtk_widget_set_sensitive (w, TRUE);
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "id_label"));
gtk_label_set_markup_with_mnemonic (GTK_LABEL (w), _("_Id"));
/* Label */
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "label"));
gtk_entry_set_text (GTK_ENTRY (w), obj->defaultLabel());
gtk_widget_set_sensitive (w, TRUE);
/* Title */
w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "title"));
gchar *title = obj->title();
if (title) {
gtk_entry_set_text(GTK_ENTRY(w), title);
g_free(title);
}
else gtk_entry_set_text(GTK_ENTRY(w), "");
gtk_widget_set_sensitive(w, TRUE);
/* Description */
w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "desc"));
GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
gchar *desc = obj->desc();
if (desc) {
gtk_text_buffer_set_text(buf, desc, -1);
g_free(desc);
} else {
gtk_text_buffer_set_text(buf, "", 0);
}
w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "desc_frame"));
gtk_widget_set_sensitive(w, TRUE);
w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "interactivity"));
GtkWidget* int_table = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "interactivity_table"));
if (int_table){
gtk_container_remove(GTK_CONTAINER(w), int_table);
}
const gchar* int_labels[10] = {"onclick", "onmouseover", "onmouseout", "onmousedown", "onmouseup", "onmousemove","onfocusin", "onfocusout", "onactivate", "onload"};
int_table = sp_attribute_table_new (obj, 10, int_labels, int_labels);
gtk_widget_show_all (int_table);
gtk_object_set_data(GTK_OBJECT(spw), "interactivity_table", int_table);
gtk_container_add (GTK_CONTAINER (w), int_table);
}
//.........这里部分代码省略.........