Logo Search packages:      
Sourcecode: inkscape version File versions

static void sp_export_spinbutton_new ( gchar *  key,
float  val,
float  min,
float  max,
float  step,
float  page,
GtkWidget *  us,
GtkWidget *  t,
int  x,
int  y,
const gchar *  ll,
const gchar *  lr,
int  digits,
unsigned int  sensitive,
GCallback  cb,
GtkWidget *  dlg 
) [static]

Creates a new spin button for the export dialog.

Parameters:
key The name of the spin button
val A default value for the spin button
min Minimum value for the spin button
max Maximum value for the spin button
step The step size for the spin button
page Size of the page increment
us Unit selector that effects this spin button
t Table to put the spin button in
x X location in the table t to start with
y Y location in the table t to start with
ll Text to put on the left side of the spin button (optional)
lr Text to put on the right side of the spin button (optional)
digits Number of digits to display after the decimal
sensitive Whether the spin button is sensitive or not
cb Callback for when this spin button is changed (optional)
dlg Export dialog the spin button is being placed in

Definition at line 189 of file export.cpp.

Referenced by sp_export_dialog().

{

    GtkWidget *l, *sb;
    GtkObject *a;
    int pos;

    a = gtk_adjustment_new (val, min, max, step, page, page);
    gtk_object_set_data (a, "key", key);
    gtk_object_set_data (GTK_OBJECT (dlg), (const gchar *)key, a);
    
    if (us) {
        sp_unit_selector_add_adjustment ( SP_UNIT_SELECTOR (us), 
                                          GTK_ADJUSTMENT (a) );
    }
    
    pos = 0;

    if (ll) {
    
        l = gtk_label_new ((const gchar *)ll);
        gtk_misc_set_alignment (GTK_MISC (l), 1.0, 0.5);
        gtk_table_attach ( GTK_TABLE (t), l, x + pos, x + pos + 1, y, y + 1, 
                           (GtkAttachOptions)0, (GtkAttachOptions)0, 0, 0 );
        gtk_widget_set_sensitive (l, sensitive);
        pos += 1;
    
    }

    sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 1.0, digits);
    gtk_table_attach ( GTK_TABLE (t), sb, x + pos, x + pos + 1, y, y + 1, 
                       (GtkAttachOptions)0, (GtkAttachOptions)0, 0, 0 );
    gtk_widget_set_usize (sb, 64, -1);
    gtk_widget_set_sensitive (sb, sensitive);
    pos += 1;

    if (lr) {
    
        l = gtk_label_new ((const gchar *)lr);
        gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
        gtk_table_attach ( GTK_TABLE (t), l, x + pos, x + pos + 1, y, y + 1, 
                           (GtkAttachOptions)0, (GtkAttachOptions)0, 0, 0 );
        gtk_widget_set_sensitive (l, sensitive);
        pos += 1;
    
    }

    if (cb) 
        gtk_signal_connect (a, "value_changed", cb, dlg);

    return;
} // end of sp_export_spinbutton_new()


Generated by  Doxygen 1.6.0   Back to index