<object class="GtkVBox" id="name_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="label1">
<object class="GtkVBox" id="pg_size_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="label43">
<object class="GtkVBox" id="shape_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="label13">
<child>
<object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkRadioButton" id="shape_rect_radio">
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkRadioButton" id="shape_ellipse_radio">
+ <property name="label" translatable="yes">Elliptical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">shape_rect_radio</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
<child>
<object class="GtkRadioButton" id="shape_cd_radio">
<property name="label" translatable="yes">CD/DVD (including credit card CDs)</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
<object class="GtkVBox" id="rect_size_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="label14">
<property name="tab_fill">False</property>
</packing>
</child>
+ <child>
+ <object class="GtkVBox" id="ellipse_size_page">
+ <property name="visible">True</property>
+ <property name="border_width">18</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">24</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Please enter the following size parameters of a single label or card in your template.</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkTable" id="table5">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">1. Width:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">2. Height:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">3. Waste (overprint allowed):</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="ellipse_w_units_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">inches</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="ellipse_h_units_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">inches</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="ellipse_waste_units_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">inches</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="ellipse_w_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="adjustment">adjustment3</property>
+ <property name="climb_rate">0.0099999997764800008</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="ellipse_h_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="adjustment">adjustment4</property>
+ <property name="climb_rate">0.0099999997764800008</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="ellipse_waste_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="adjustment">adjustment6</property>
+ <property name="climb_rate">0.0099999997764800008</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">4. Margin</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="ellipse_margin_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="adjustment">adjustment8</property>
+ <property name="climb_rate">0.0099999997764800008</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="ellipse_margin_units_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">inches</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="ellipse_image">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">ellipse_page</property>
+ </object>
+ <packing>
+ <property name="position">10</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
<child>
<object class="GtkVBox" id="round_size_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="label23">
</child>
</object>
<packing>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
<child type="tab">
<property name="label">round_size_page</property>
</object>
<packing>
- <property name="position">5</property>
+ <property name="position">6</property>
<property name="tab_fill">False</property>
</packing>
</child>
<object class="GtkVBox" id="cd_size_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="label32">
</child>
</object>
<packing>
- <property name="position">6</property>
+ <property name="position">7</property>
</packing>
</child>
<child type="tab">
<property name="label">cd_size_page</property>
</object>
<packing>
- <property name="position">6</property>
+ <property name="position">7</property>
<property name="tab_fill">False</property>
</packing>
</child>
<object class="GtkVBox" id="nlayouts_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="label9">
<child>
<object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkImage" id="nlayouts_image1">
<property name="visible">True</property>
<child>
<object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkImage" id="nlayouts_image2">
<property name="visible">True</property>
</child>
</object>
<packing>
- <property name="position">7</property>
+ <property name="position">8</property>
</packing>
</child>
<child type="tab">
<property name="label">nlayouts_page</property>
</object>
<packing>
- <property name="position">7</property>
+ <property name="position">8</property>
<property name="tab_fill">False</property>
</packing>
</child>
<object class="GtkVBox" id="layout_page">
<property name="visible">True</property>
<property name="border_width">18</property>
+ <property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label48">
<child>
<object class="GtkVBox" id="vbox15">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkVBox" id="mini_preview_vbox">
</child>
</object>
<packing>
- <property name="position">8</property>
+ <property name="position">9</property>
</packing>
</child>
<child type="tab">
<property name="label">layout_page</property>
</object>
<packing>
- <property name="position">8</property>
+ <property name="position">9</property>
<property name="tab_fill">False</property>
</packing>
</child>
or "Back" to continue editing this design.</property>
</object>
<packing>
- <property name="position">9</property>
+ <property name="position">10</property>
</packing>
</child>
<child type="tab">
<property name="label">finish_page</property>
</object>
<packing>
- <property name="position">9</property>
+ <property name="position">10</property>
<property name="tab_fill">False</property>
</packing>
</child>
#define DEFAULT_RECT_R 0.0
#define DEFAULT_RECT_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */
+#define DEFAULT_ELLIPSE_W 252.0
+#define DEFAULT_ELLIPSE_H 144.0
+#define DEFAULT_ELLIPSE_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */
+
#define DEFAULT_ROUND_R 72.0
#define DEFAULT_ROUND_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */
GtkWidget *pg_size_page;
GtkWidget *shape_page;
GtkWidget *rect_size_page;
+ GtkWidget *ellipse_size_page;
GtkWidget *round_size_page;
GtkWidget *cd_size_page;
GtkWidget *nlayouts_page;
/* Shape page controls */
GtkWidget *shape_rect_radio;
+ GtkWidget *shape_ellipse_radio;
GtkWidget *shape_round_radio;
GtkWidget *shape_cd_radio;
GtkWidget *rect_y_waste_units_label;
GtkWidget *rect_margin_units_label;
+ /* Label size (elliptical) page controls */
+ GtkWidget *ellipse_image;
+ GtkWidget *ellipse_w_spin;
+ GtkWidget *ellipse_h_spin;
+ GtkWidget *ellipse_waste_spin;
+ GtkWidget *ellipse_margin_spin;
+ GtkWidget *ellipse_w_units_label;
+ GtkWidget *ellipse_h_units_label;
+ GtkWidget *ellipse_waste_units_label;
+ GtkWidget *ellipse_margin_units_label;
+
/* Label size (round) page controls */
GtkWidget *round_image;
GtkWidget *round_r_spin;
PG_SIZE_PAGE_NUM,
SHAPE_PAGE_NUM,
RECT_SIZE_PAGE_NUM,
+ ELLIPSE_SIZE_PAGE_NUM,
ROUND_SIZE_PAGE_NUM,
CD_SIZE_PAGE_NUM,
NLAYOUTS_PAGE_NUM,
static void construct_rect_size_page (glTemplateDesigner *dialog,
GdkPixbuf *logo);
+static void construct_ellipse_size_page (glTemplateDesigner *dialog,
+ GdkPixbuf *logo);
+
static void construct_round_size_page (glTemplateDesigner *dialog,
GdkPixbuf *logo);
static void rect_size_page_prepare_cb (glTemplateDesigner *dialog);
+static void ellipse_size_page_prepare_cb (glTemplateDesigner *dialog);
+
static void round_size_page_prepare_cb (glTemplateDesigner *dialog);
static void cd_size_page_prepare_cb (glTemplateDesigner *dialog);
"pg_size_page",
"shape_page",
"rect_size_page",
+ "ellipse_size_page",
"round_size_page",
"cd_size_page",
"nlayouts_page",
construct_pg_size_page (dialog, logo);
construct_shape_page (dialog, logo);
construct_rect_size_page (dialog, logo);
+ construct_ellipse_size_page (dialog, logo);
construct_round_size_page (dialog, logo);
construct_cd_size_page (dialog, logo);
construct_nlayouts_page (dialog, logo);
gl_debug (DEBUG_TEMPLATE, "START");
gl_builder_util_get_widgets (dialog->priv->builder,
- "shape_page", &dialog->priv->shape_page,
- "shape_rect_radio", &dialog->priv->shape_rect_radio,
- "shape_round_radio", &dialog->priv->shape_round_radio,
- "shape_cd_radio", &dialog->priv->shape_cd_radio,
+ "shape_page", &dialog->priv->shape_page,
+ "shape_rect_radio", &dialog->priv->shape_rect_radio,
+ "shape_ellipse_radio", &dialog->priv->shape_ellipse_radio,
+ "shape_round_radio", &dialog->priv->shape_round_radio,
+ "shape_cd_radio", &dialog->priv->shape_cd_radio,
NULL);
}
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Construct ellipse size page. */
+/*--------------------------------------------------------------------------*/
+static void
+construct_ellipse_size_page (glTemplateDesigner *dialog,
+ GdkPixbuf *logo)
+{
+ gchar *pixbuf_filename;
+ GdkPixbuf *pixbuf;
+
+ gl_debug (DEBUG_TEMPLATE, "START");
+
+ gl_builder_util_get_widgets (dialog->priv->builder,
+ "ellipse_size_page", &dialog->priv->ellipse_size_page,
+ "ellipse_image", &dialog->priv->ellipse_image,
+ "ellipse_w_spin", &dialog->priv->ellipse_w_spin,
+ "ellipse_h_spin", &dialog->priv->ellipse_h_spin,
+ "ellipse_waste_spin", &dialog->priv->ellipse_waste_spin,
+ "ellipse_margin_spin", &dialog->priv->ellipse_margin_spin,
+ "ellipse_w_units_label", &dialog->priv->ellipse_w_units_label,
+ "ellipse_h_units_label", &dialog->priv->ellipse_h_units_label,
+ "ellipse_waste_units_label", &dialog->priv->ellipse_waste_units_label,
+ "ellipse_margin_units_label", &dialog->priv->ellipse_margin_units_label,
+ NULL);
+
+
+ gtk_assistant_append_page (GTK_ASSISTANT (dialog),
+ dialog->priv->ellipse_size_page);
+
+ gtk_assistant_set_page_title (GTK_ASSISTANT (dialog),
+ dialog->priv->ellipse_size_page,
+ _("Label or Card Size"));
+ gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog),
+ dialog->priv->ellipse_size_page,
+ logo);
+ gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog),
+ dialog->priv->ellipse_size_page,
+ TRUE);
+
+ /* Initialize illustration. */
+ pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-ellipse-size.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL);
+ g_free (pixbuf_filename);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->ellipse_image), pixbuf);
+
+ /* Apply units to spinbuttons and units labels. */
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin),
+ dialog->priv->digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin),
+ dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate);
+ gtk_label_set_text (GTK_LABEL(dialog->priv->ellipse_w_units_label),
+ dialog->priv->units_string);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin),
+ dialog->priv->digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin),
+ dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate);
+ gtk_label_set_text (GTK_LABEL(dialog->priv->ellipse_h_units_label),
+ dialog->priv->units_string);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin),
+ dialog->priv->digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin),
+ dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate);
+ gtk_label_set_text (GTK_LABEL(dialog->priv->ellipse_waste_units_label),
+ dialog->priv->units_string);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->ellipse_margin_spin),
+ dialog->priv->digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->ellipse_margin_spin),
+ dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate);
+ gtk_label_set_text (GTK_LABEL(dialog->priv->ellipse_margin_units_label),
+ dialog->priv->units_string);
+
+ /* Load some realistic defaults. */
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin),
+ DEFAULT_ELLIPSE_W * dialog->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin),
+ DEFAULT_ELLIPSE_H * dialog->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin),
+ DEFAULT_ELLIPSE_WASTE * dialog->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_margin_spin),
+ DEFAULT_MARGIN * dialog->priv->units_per_point);
+
+ gl_debug (DEBUG_TEMPLATE, "END");
+}
+
+
/*--------------------------------------------------------------------------*/
/* PRIVATE. Construct round size page. */
/*--------------------------------------------------------------------------*/
break;
case LGL_TEMPLATE_FRAME_SHAPE_ELLIPSE:
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->shape_ellipse_radio), TRUE);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin), frame->rect.w*upp);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin), frame->rect.h*upp);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin), frame->rect.y_waste*upp);
break;
case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
if ( markup->type == LGL_TEMPLATE_MARKUP_MARGIN )
{
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), markup->margin.size*upp);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_margin_spin), markup->margin.size*upp);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), markup->margin.size*upp);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), markup->margin.size*upp);
}
rect_size_page_prepare_cb (dialog);
break;
+ case ELLIPSE_SIZE_PAGE_NUM:
+ ellipse_size_page_prepare_cb (dialog);
+ break;
+
case ROUND_SIZE_PAGE_NUM:
round_size_page_prepare_cb (dialog);
break;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) {
return RECT_SIZE_PAGE_NUM;
}
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_ellipse_radio))) {
+ return ELLIPSE_SIZE_PAGE_NUM;
+ }
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) {
return ROUND_SIZE_PAGE_NUM;
}
break;
case RECT_SIZE_PAGE_NUM:
+ case ELLIPSE_SIZE_PAGE_NUM:
case ROUND_SIZE_PAGE_NUM:
case CD_SIZE_PAGE_NUM:
return NLAYOUTS_PAGE_NUM;
}
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Prepare ellipse size page. */
+/*--------------------------------------------------------------------------*/
+static void
+ellipse_size_page_prepare_cb (glTemplateDesigner *dialog)
+{
+ gdouble max_w, max_h;
+ gdouble w, h, waste, margin;
+
+ /* Limit label size based on already chosen page size. */
+ max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin));
+ max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin));
+
+ w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin));
+ h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin));
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_margin_spin));
+
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->ellipse_w_spin),
+ dialog->priv->climb_rate, max_w);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->ellipse_h_spin),
+ dialog->priv->climb_rate, max_h);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->ellipse_waste_spin),
+ 0.0, MIN(max_w, max_h)/4.0);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->ellipse_margin_spin),
+ 0.0, MIN(max_w, max_h)/4.0);
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin), w);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin), h);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin), waste);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_margin_spin), margin);
+
+}
+
+
/*--------------------------------------------------------------------------*/
/* PRIVATE. Prepare round size page. */
/*--------------------------------------------------------------------------*/
x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin));
y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin));
}
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_ellipse_radio))) {
+ w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin));
+ h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin));
+ y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin));
+ y_waste = x_waste;
+ }
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) {
w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin));
h = w;
x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin));
- y_waste = x_waste;
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) {
w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin));
margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin));
}
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_ellipse_radio))) {
+ shape = LGL_TEMPLATE_FRAME_SHAPE_ELLIPSE;
+ w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_w_spin));
+ h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_h_spin));
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->ellipse_margin_spin));
+ }
+
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) {
shape = LGL_TEMPLATE_FRAME_SHAPE_ROUND;
r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin));
switch (shape) {
case LGL_TEMPLATE_FRAME_SHAPE_RECT:
- frame = lgl_template_frame_rect_new ("0",
- w/upp, h/upp, r/upp,
- x_waste/upp, y_waste/upp);
+ frame = lgl_template_frame_rect_new ("0", w/upp, h/upp, r/upp, x_waste/upp, y_waste/upp);
+ break;
+ case LGL_TEMPLATE_FRAME_SHAPE_ELLIPSE:
+ frame = lgl_template_frame_ellipse_new ("0", w/upp, h/upp, waste/upp);
break;
case LGL_TEMPLATE_FRAME_SHAPE_ROUND:
frame = lgl_template_frame_round_new ("0", r/upp, waste/upp);
break;
case LGL_TEMPLATE_FRAME_SHAPE_CD:
- frame = lgl_template_frame_cd_new ("0",
- radius/upp, hole/upp,
- w/upp, h/upp,
- waste/upp);
+ frame = lgl_template_frame_cd_new ("0", radius/upp, hole/upp, w/upp, h/upp, waste/upp);
break;
default:
g_assert_not_reached ();