summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5adebf9)
raw | patch | inline | side by side (parent: 5adebf9)
author | joncruz <joncruz@users.sourceforge.net> | |
Tue, 24 Oct 2006 01:51:47 +0000 (01:51 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Tue, 24 Oct 2006 01:51:47 +0000 (01:51 +0000) |
src/ege-adjustment-action.cpp | patch | blob | history | |
src/ege-adjustment-action.h | patch | blob | history | |
src/widgets/toolbox.cpp | patch | blob | history |
index a2ea9ff0db9842fc8d3b28c2134351c8feeea71f..95ea548caa577c38be024bbdef00edc617a3fbe4 100644 (file)
gdouble climbRate;
guint digits;
gchar* selfId;
+ EgeWidgetFixup toolPost;
gdouble lastVal;
gdouble step;
gdouble page;
PROP_FOCUS_WIDGET,
PROP_CLIMB_RATE,
PROP_DIGITS,
- PROP_SELFID
+ PROP_SELFID,
+ PROP_TOOL_POST
};
GType ege_adjustment_action_get_type( void )
@@ -174,6 +176,13 @@ static void ege_adjustment_action_class_init( EgeAdjustmentActionClass* klass )
0,
(GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT) ) );
+ g_object_class_install_property( objClass,
+ PROP_TOOL_POST,
+ g_param_spec_pointer( "tool-post",
+ "Tool Widget post process",
+ "Function for final adjustments",
+ (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT) ) );
+
g_type_class_add_private( klass, sizeof(EgeAdjustmentActionClass) );
}
}
action->private_data->climbRate = 0.0;
action->private_data->digits = 2;
action->private_data->selfId = 0;
+ action->private_data->toolPost = 0;
action->private_data->lastVal = 0.0;
action->private_data->step = 0.0;
action->private_data->page = 0.0;
@@ -239,6 +249,10 @@ static void ege_adjustment_action_get_property( GObject* obj, guint propId, GVal
g_value_set_string( value, action->private_data->selfId );
break;
+ case PROP_TOOL_POST:
+ g_value_set_pointer( value, (void*)action->private_data->toolPost );
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID( obj, propId, pspec );
}
@@ -288,6 +302,12 @@ void ege_adjustment_action_set_property( GObject* obj, guint propId, const GValu
}
break;
+ case PROP_TOOL_POST:
+ {
+ action->private_data->toolPost = (EgeWidgetFixup)g_value_get_pointer( value );
+ }
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID( obj, propId, pspec );
}
gtk_widget_show_all( item );
+
+ /* Shrink or whatnot after shown */
+ if ( act->private_data->toolPost ) {
+ act->private_data->toolPost( item );
+ }
} else {
item = gParentClass->create_tool_item( action );
}
index 109b5ff7625e2e773a17e37591d178020b3f1af3..45049fbf5b6a95f7160a554e688aba5619d8ff33 100644 (file)
void ege_adjustment_action_set_focuswidget( EgeAdjustmentAction* action, GtkWidget* widget );
GtkWidget* ege_adjustment_action_get_focuswidget( EgeAdjustmentAction* action );
+
+typedef void (*EgeWidgetFixup)(GtkWidget *widget);
+
+
G_END_DECLS
#endif /* SEEN_EGE_ADJUSTMENT_ACTION */
index 68e9a065369ea268a6b7aa7f56cb951e206aec81..def0885635327e3b61f8f02d270d7101d3ff43c9 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
gtk_object_set_data( GTK_OBJECT(dataKludge), data, adj );
}
+ // Using a cast just to make sure we pass in the right kind of function pointer
+ g_object_set( G_OBJECT(act), "tool-post", static_cast<EgeWidgetFixup>(sp_set_font_size_smaller), NULL );
+
return act;
}