コード例 #1
0
        void FillPageSizeMenu(LayoutSet layoutSet, int resolution)
        {
            (_size.Model as ListStore).Clear();

            _sizes = layoutSet.GetPageSizeSet(resolution);
            _sizes.ForEach(size => AppendPageSizeEntry(size));
            _size.Active = 0;
        }
コード例 #2
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(); };
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: DocumentFrame.cs プロジェクト: unhammer/gimp-sharp
        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);
        }
コード例 #5
0
 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);
 }
コード例 #6
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);
        }
コード例 #7
0
ファイル: DocumentFrame.cs プロジェクト: unhammer/gimp-sharp
 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);
 }
コード例 #8
0
ファイル: Dialog.cs プロジェクト: unhammer/gimp-sharp
        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();};
        }
コード例 #9
0
 void FillLayoutMenu(LayoutSet layoutSet)
 {
     (_layout.Model as ListStore).Clear();
     layoutSet.ForEach(layout => _layout.AppendText(layout.Name));
     _layout.Active = 0;
 }
コード例 #10
0
ファイル: DocumentFrame.cs プロジェクト: unhammer/gimp-sharp
        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);
        }
コード例 #11
0
ファイル: DocumentFrame.cs プロジェクト: unhammer/gimp-sharp
        void FillPageSizeMenu(LayoutSet layoutSet, int resolution)
        {
            (_size.Model as ListStore).Clear();

              _sizes = layoutSet.GetPageSizeSet(resolution);
              _sizes.ForEach(size => AppendPageSizeEntry(size));
              _size.Active = 0;
        }
コード例 #12
0
ファイル: DocumentFrame.cs プロジェクト: unhammer/gimp-sharp
 void FillLayoutMenu(LayoutSet layoutSet)
 {
     (_layout.Model as ListStore).Clear();
       layoutSet.ForEach(layout => _layout.AppendText(layout.Name));
       _layout.Active = 0;
 }