188
189
{ "Business Card (US)", 2, 3.5, SP_UNIT_IN },
189
190
{ "Business Card (Europe)", 55, 85, SP_UNIT_MM },
190
191
{ "Business Card (Aus/NZ)", 55, 90, SP_UNIT_MM },
193
// Start Arch Series List
196
{ "Arch A", 9, 12, SP_UNIT_IN }, // 229 x 305 mm
197
{ "Arch B", 12, 18, SP_UNIT_IN }, // 305 x 457 mm
198
{ "Arch C", 18, 24, SP_UNIT_IN }, // 457 x 610 mm
199
{ "Arch D", 24, 36, SP_UNIT_IN }, // 610 x 914 mm
200
{ "Arch E", 36, 48, SP_UNIT_IN }, // 914 x 1219 mm
201
{ "Arch E1", 30, 42, SP_UNIT_IN }, // 762 x 1067 mm
204
* The above list of Arch sizes were taken from the following site:
205
* http://en.wikipedia.org/wiki/Paper_size
206
* Further detail can be found at http://www.ansi.org
207
* Sizes are assumed to be arbitrary rounding to MM unless shown to be otherwise
208
* No conflicting information was found regarding sizes in MM
209
* September 2009 - DAK
191
212
{ NULL, 0, 0, SP_UNIT_PX },
209
230
_dimensionUnits( _("U_nits:"), "units", _wr ),
210
231
_dimensionWidth( _("_Width:"), _("Width of paper"), "width", _dimensionUnits, _wr ),
211
232
_dimensionHeight( _("_Height:"), _("Height of paper"), "height", _dimensionUnits, _wr ),
233
_marginTop( _("T_op margin:"), _("Top margin"), "fit-margin-top", _wr ),
234
_marginLeft( _("L_eft:"), _("Left margin"), "fit-margin-left", _wr),
235
_marginRight( _("Ri_ght:"), _("Right margin"), "fit-margin-right", _wr),
236
_marginBottom( _("Botto_m:"), _("Bottom margin"), "fit-margin-bottom", _wr),
212
238
_widgetRegistry(&_wr)
214
240
//# Set up the Paper Size combo box
253
279
// _paperSizeListSelection->select(iter);
256
pack_start (_paperSizeListBox, true, true, 0);
257
_paperSizeListLabel.set_label(_("P_age size:"));
258
_paperSizeListLabel.set_use_underline();
259
_paperSizeListBox.pack_start (_paperSizeListLabel, false, false, 0);
260
_paperSizeListLabel.set_mnemonic_widget (_paperSizeList);
261
_paperSizeListBox.pack_start (_paperSizeListScroller, true, true, 0);
282
pack_start (_paperSizeListScroller, true, true, 0);
263
284
//## Set up orientation radio buttons
264
285
pack_start (_orientationBox, false, false, 0);
265
_orientationLabel.set_label(_("Page orientation:"));
286
_orientationLabel.set_label(_("Orientation:"));
266
287
_orientationBox.pack_start(_orientationLabel, false, false, 0);
267
288
_landscapeButton.set_use_underline();
268
289
_landscapeButton.set_label(_("_Landscape"));
279
300
//## Set up custom size frame
280
301
_customFrame.set_label(_("Custom size"));
281
302
pack_start (_customFrame, false, false, 0);
282
_customTable.resize(2, 2);
283
_customTable.set_border_width (4);
284
_customTable.set_row_spacings (4);
285
_customTable.set_col_spacings (4);
286
_customTable.attach(_dimensionWidth, 0,1,0,1);
287
_customTable.attach(_dimensionUnits, 1,2,0,1);
288
_customTable.attach(_dimensionHeight, 0,1,1,2);
289
_customTable.attach(_fitPageButton, 1,2,1,2);
290
_customFrame.add(_customTable);
303
_customFrame.add(_customDimTable);
305
_customDimTable.resize(3, 2);
306
_customDimTable.set_border_width(4);
307
_customDimTable.set_row_spacings(4);
308
_customDimTable.set_col_spacings(4);
309
_customDimTable.attach(_dimensionWidth, 0,1, 0,1);
310
_customDimTable.attach(_dimensionUnits, 1,2, 0,1);
311
_customDimTable.attach(_dimensionHeight, 0,1, 1,2);
312
_customDimTable.attach(_fitPageMarginExpander, 0,2, 2,3);
314
_dimTabOrderGList = NULL;
315
_dimTabOrderGList = g_list_append(_dimTabOrderGList, _dimensionWidth.gobj());
316
_dimTabOrderGList = g_list_append(_dimTabOrderGList, _dimensionHeight.gobj());
317
_dimTabOrderGList = g_list_append(_dimTabOrderGList, _dimensionUnits.gobj());
318
_dimTabOrderGList = g_list_append(_dimTabOrderGList, _fitPageMarginExpander.gobj());
319
Glib::ListHandle<Widget *> dimFocusChain(_dimTabOrderGList, Glib::OWNERSHIP_NONE);
320
_customDimTable.set_focus_chain(dimFocusChain);
322
//## Set up fit page expander
323
_fitPageMarginExpander.set_use_underline();
324
_fitPageMarginExpander.set_label(_("Resi_ze page to content..."));
325
_fitPageMarginExpander.add(_marginTable);
327
//## Set up margin settings
328
_marginTable.resize(4, 2);
329
_marginTable.set_border_width(4);
330
_marginTable.set_row_spacings(4);
331
_marginTable.set_col_spacings(4);
332
_marginTable.attach(_marginTopAlign, 0,2, 0,1);
333
_marginTable.attach(_marginLeftAlign, 0,1, 1,2);
334
_marginTable.attach(_marginRightAlign, 1,2, 1,2);
335
_marginTable.attach(_marginBottomAlign, 0,2, 2,3);
336
_marginTable.attach(_fitPageButtonAlign, 0,2, 3,4);
338
_marginTopAlign.set(0.5, 0.5, 0.0, 1.0);
339
_marginTopAlign.add(_marginTop);
340
_marginLeftAlign.set(0.0, 0.5, 0.0, 1.0);
341
_marginLeftAlign.add(_marginLeft);
342
_marginRightAlign.set(1.0, 0.5, 0.0, 1.0);
343
_marginRightAlign.add(_marginRight);
344
_marginBottomAlign.set(0.5, 0.5, 0.0, 1.0);
345
_marginBottomAlign.add(_marginBottom);
347
_fitPageButtonAlign.set(0.5, 0.5, 0.0, 1.0);
348
_fitPageButtonAlign.add(_fitPageButton);
292
349
_fitPageButton.set_use_underline();
293
_fitPageButton.set_label(_("_Fit page to selection"));
350
_fitPageButton.set_label(_("_Resize page to drawing or selection"));
294
351
_tips.set_tip(_fitPageButton, _("Resize the page to fit the current selection, or the entire drawing if there is no selection"));
451
* Updates the scalar widgets for the fit margins. (Just changes the value
452
* of the ui widgets to match the xml).
455
PageSizer::updateFitMarginsUI(Inkscape::XML::Node *nv_repr)
458
if (sp_repr_get_double(nv_repr, "fit-margin-top", &value)) {
459
_marginTop.setValue(value);
461
if (sp_repr_get_double(nv_repr, "fit-margin-left", &value)) {
462
_marginLeft.setValue(value);
464
if (sp_repr_get_double(nv_repr, "fit-margin-right", &value)) {
465
_marginRight.setValue(value);
467
if (sp_repr_get_double(nv_repr, "fit-margin-bottom", &value)) {
468
_marginBottom.setValue(value);
393
474
* Returns an iterator pointing to a row in paperSizeListStore which
529
Inkscape::XML::Node *nv_repr;
530
if ((doc = sp_desktop_document(SP_ACTIVE_DESKTOP))
531
&& (nv = sp_document_namedview(doc, 0))
532
&& (nv_repr = SP_OBJECT_REPR(nv))) {
533
sp_repr_set_svg_double(nv_repr, "fit-margin-top", _marginTop.getValue());
534
sp_repr_set_svg_double(nv_repr, "fit-margin-left", _marginLeft.getValue());
535
sp_repr_set_svg_double(nv_repr, "fit-margin-right", _marginRight.getValue());
536
sp_repr_set_svg_double(nv_repr, "fit-margin-bottom", _marginBottom.getValue());
446
538
Verb *verb = Verb::get( SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING );
448
540
SPAction *action = verb->get_action(dt);
450
542
sp_action_perform(action, NULL);