Esempio n. 1
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(); };
        }
Esempio n. 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();};
        }