void FillPageSizeMenu(LayoutSet layoutSet, int resolution) { (_size.Model as ListStore).Clear(); _sizes = layoutSet.GetPageSizeSet(resolution); _sizes.ForEach(size => AppendPageSizeEntry(size)); _size.Active = 0; }
public Dialog(VariableSet variables, LayoutSet layouts, Variable <Layout> layout, Variable <ProviderFactory> loader) : base("PicturePackage", variables) { _layout = layout; _loader = loader; layouts.Load(); var hbox = new HBox(false, 12) { BorderWidth = 12 }; VBox.PackStart(hbox, true, true, 0); var vbox = new VBox(false, 12); hbox.PackStart(vbox, false, false, 0); _sf = new SourceFrame(loader); vbox.PackStart(_sf, false, false, 0); vbox.PackStart(new DocumentFrame(variables, layouts), false, false, 0); vbox.PackStart(new LabelFrame(variables), false, false, 0); var frame = new Frame(); hbox.PackStart(frame, true, true, 0); var fbox = new VBox() { BorderWidth = 12 }; frame.Add(fbox); _preview = new Preview(this, variables) { WidthRequest = 400, HeightRequest = 500, TooltipText = _("Right click to select picture") }; fbox.Add(_preview); _preview.ButtonPressEvent += PreviewClicked; _preview.DragDataReceived += OnDragDataReceived; layouts.Selected = layouts[0]; _layout.Value = layouts[0]; layouts.SelectEvent += SetLayout; DialogState = DialogStateType.SrcImgInvalid; loader.ValueChanged += delegate { RedrawPreview(); }; }
public DocumentFrame(VariableSet variables, LayoutSet layoutSet) : base(5, 3, "Document") { _layoutSet = layoutSet; CreatePageSizeWidget(variables, layoutSet); CreateLayoutWidget(layoutSet); CreateResolutionWidget(variables); CreateUnitsWidget(variables); CreateColorModeWidget(variables); CreateFlattenWidget(variables); }
void CreateLayoutWidget(LayoutSet layoutSet) { _layout = ComboBox.NewText(); FillLayoutMenu(_layoutSet); _layout.Changed += delegate { if (_layout.Active >= 0) { layoutSet.Selected = _layoutSet[_layout.Active]; } }; AttachAligned(0, 1, _("_Layout:"), 0.0, 0.5, _layout, 2, false); }
void CreatePageSizeWidget(VariableSet variables, LayoutSet layoutSet) { int resolution = variables.GetValue <int>("resolution"); _size = ComboBox.NewText(); FillPageSizeMenu(layoutSet, resolution); _size.Changed += delegate { _layoutSet = layoutSet.GetLayouts(_sizes[_size.Active], resolution); FillLayoutMenu(_layoutSet); }; AttachAligned(0, 0, _("_Page Size:"), 0.0, 0.5, _size, 2, false); }
public Dialog(VariableSet variables, LayoutSet layouts, Variable<Layout> layout, Variable<ProviderFactory> loader) : base("PicturePackage", variables) { _layout = layout; _loader = loader; layouts.Load(); var hbox = new HBox(false, 12) {BorderWidth = 12}; VBox.PackStart(hbox, true, true, 0); var vbox = new VBox(false, 12); hbox.PackStart(vbox, false, false, 0); _sf = new SourceFrame(loader); vbox.PackStart(_sf, false, false, 0); vbox.PackStart(new DocumentFrame(variables, layouts), false, false, 0); vbox.PackStart(new LabelFrame(variables), false, false, 0); var frame = new Frame(); hbox.PackStart(frame, true, true, 0); var fbox = new VBox() {BorderWidth = 12}; frame.Add(fbox); _preview = new Preview(this, variables) { WidthRequest = 400, HeightRequest = 500, TooltipText = _("Right click to select picture") }; fbox.Add(_preview); _preview.ButtonPressEvent += PreviewClicked; _preview.DragDataReceived += OnDragDataReceived; layouts.Selected = layouts[0]; _layout.Value = layouts[0]; layouts.SelectEvent += SetLayout; DialogState = DialogStateType.SrcImgInvalid; loader.ValueChanged += delegate {RedrawPreview();}; }
void FillLayoutMenu(LayoutSet layoutSet) { (_layout.Model as ListStore).Clear(); layoutSet.ForEach(layout => _layout.AppendText(layout.Name)); _layout.Active = 0; }
void CreatePageSizeWidget(VariableSet variables, LayoutSet layoutSet) { int resolution = variables.GetValue<int>("resolution"); _size = ComboBox.NewText(); FillPageSizeMenu(layoutSet, resolution); _size.Changed += delegate { _layoutSet = layoutSet.GetLayouts(_sizes[_size.Active], resolution); FillLayoutMenu(_layoutSet); }; AttachAligned(0, 0, _("_Page Size:"), 0.0, 0.5, _size, 2, false); }