コード例 #1
0
        public SourceFrame(Variable <ProviderFactory> loader) : base(3, 2, "Source")
        {
            _loader = loader;

            Table.ColumnSpacing = 12;

            var imageButton = CreateImageButton();

            Attach(imageButton, 0, 1, 0, 1);

            var hbox = new HBox();

            Attach(hbox, 1, 2, 0, 1);

            _imageBox = CreateImageComboBox();
            hbox.Add(_imageBox);
            _refresh = CreateRefreshButton();
            hbox.PackEnd(_refresh, false, false, 0);

            var fileButton = CreateFileButton(imageButton);

            Attach(fileButton, 0, 1, 1, 2);

            var folderButton = CreateFolderButton(fileButton);

            Attach(folderButton, 0, 1, 2, 3);

            _include = CreateIncludeToggleButton();
            Attach(_include, 1, 2, 2, 3);

            SetFileEntry(false);
            _choose.Sensitive = false;
        }
コード例 #2
0
ファイル: SourceFrame.cs プロジェクト: unhammer/gimp-sharp
        public SourceFrame(Variable<ProviderFactory> loader)
            : base(3, 2, "Source")
        {
            _loader = loader;

              Table.ColumnSpacing = 12;

              var imageButton = CreateImageButton();
              Attach(imageButton, 0, 1, 0, 1);

              var hbox = new HBox();
              Attach(hbox, 1, 2, 0, 1);

              _imageBox = CreateImageComboBox();
              hbox.Add(_imageBox);
              _refresh = CreateRefreshButton();
              hbox.PackEnd(_refresh, false, false, 0);

              var fileButton = CreateFileButton(imageButton);
              Attach(fileButton, 0, 1, 1, 2);

              var folderButton = CreateFolderButton(fileButton);
              Attach(folderButton, 0, 1, 2, 3);

              _include = CreateIncludeToggleButton();
              Attach(_include, 1, 2, 2, 3);

              SetFileEntry(false);
              _choose.Sensitive = false;
        }
コード例 #3
0
        ImageComboBox CreateImageComboBox()
        {
            var imageBox = new ImageComboBox();

            imageBox.Changed += delegate
            {
                _loader.Value = new FrontImageProviderFactory(imageBox.Active);
            };
            return(imageBox);
        }
コード例 #4
0
        /// <summary>
        /// Genera una lista de tipos de circulación
        /// </summary>
        /// <param name="control">Control contenedor de la lista</param>
        /// <param name="selected">Valor seleccionado por defecto</param>
        public static void TypesList(ImageComboBox control, OTCCirculationTypes selected)
        {
            ImageComboBoxItem item = null;

            foreach (OTCCirculationTypes val in Enum.GetValues(typeof(OTCCirculationTypes)))
            {
                item = new ImageComboBoxItem(OTCCirculations.TypeName(val), (int)val);
                control.Items.Add(item);
                if (selected == val)
                {
                    control.SelectedItem = item;
                }
            }
        }
コード例 #5
0
        public static void RefreshPortraitComboBox(ImageComboBox portraitComboBox, Class charaClass)
        {
            if (ImageHelper.CharacterIcons.ContainsKey(charaClass))
            {
                portraitComboBox.Enabled   = true;
                portraitComboBox.ImageList = ImageHelper.CharacterIcons[charaClass];
            }
            else
            {
                portraitComboBox.Enabled   = false;
                portraitComboBox.ImageList = null;
            }

            portraitComboBox.Invalidate();
        }
コード例 #6
0
        Button CreateRefreshButton()
        {
            var refresh = new Button();
            var image   = new Gtk.Image(Stock.Refresh, IconSize.Button);

            refresh.Add(image);
            refresh.Clicked += delegate
            {
                var hbox = _imageBox.Parent as HBox;
                _imageBox.Destroy();
                _imageBox = CreateImageComboBox();
                hbox.Add(_imageBox);
                _imageBox.Show();
                _loader.Value = new FrontImageProviderFactory(_imageBox.Active);
            };
            return(refresh);
        }
コード例 #7
0
        public static void InitializePortraitComboBox(ImageComboBox portraitComboBox, ComboBox classComboBox, object binding)
        {
            classComboBox.Tag = portraitComboBox;
            classComboBox.SelectedValueChanged += ((s, e) =>
            {
                ComboBox ccb = (s as ComboBox);
                ImageComboBox pcb = (ccb.Tag as ImageComboBox);
                RefreshPortraitComboBox(pcb, (Class)ccb.SelectedValue);
            });

            portraitComboBox.Items.Clear();
            for (int j = 0; j < 16; j++)
            {
                portraitComboBox.Items.Add(new ImageComboItem(string.Empty, j));
            }
            portraitComboBox.SetBinding("SelectedIndex", binding, "Portrait");

            RefreshPortraitComboBox(portraitComboBox, (Class)classComboBox.SelectedValue);
        }
コード例 #8
0
 /// <summary>
 /// Genera una lista de tipos de circulación
 /// </summary>
 /// <param name="control">Control contenedor de la lista</param>
 public static void TypesList(ImageComboBox control)
 {
     OTCCirculations.TypesList(control, OTCCirculationTypes.None);
 }
コード例 #9
0
ファイル: MouldCurveEditor.cs プロジェクト: GabeTesta/Warps
 void SetCombo(ImageComboBox box, Type fpType)
 {
     //search the dropdowns for the type you want
     foreach (DropDownImage fitpt in box.Items)
         if (fitpt.Tag.Equals(fpType))//find the correct item
         {
             if (fitpt != box.SelectedItem)//dont reselect
                 box.SelectedItem = fitpt;
             break;
         }
 }
コード例 #10
0
ファイル: MouldCurveEditor.cs プロジェクト: GabeTesta/Warps
        ImageComboBox ImageBox(Type ptType)
        {
            ImageComboBox box = new ImageComboBox();
            box.Width = 38;
            box.DropDownWidth = 75;
            box.DropDownStyle = ComboBoxStyle.DropDownList;
            box.FlatStyle = FlatStyle.Flat;
            box.SelectionChangeCommitted += box_SelectionChangeCommitted;
            box.IntegralHeight = false;

            box.Items.Add(new DropDownImage("Point", Warps.Properties.Resources.fixedpt, typeof(FixedPoint)));
            box.Items.Add(new DropDownImage("Curve", Warps.Properties.Resources.curvept, typeof(CurvePoint)));
            box.Items.Add(new DropDownImage("Slide", Warps.Properties.Resources.slidept, typeof(SlidePoint)));

            foreach (DropDownImage img in box.Items)
            {
                if (img.Tag.Equals(ptType))
                {
                    box.SelectedItem = img;
                    break;
                }
            }
            return box;
        }
コード例 #11
0
ファイル: SourceFrame.cs プロジェクト: unhammer/gimp-sharp
 Button CreateRefreshButton()
 {
     var refresh = new Button();
       var image = new Gtk.Image(Stock.Refresh, IconSize.Button);
       refresh.Add(image);
       refresh.Clicked += delegate
     {
       var hbox = _imageBox.Parent as HBox;
       _imageBox.Destroy();
       _imageBox = CreateImageComboBox();
       hbox.Add(_imageBox);
       _imageBox.Show();
       _loader.Value = new FrontImageProviderFactory(_imageBox.Active);
     };
       return refresh;
 }
コード例 #12
0
ファイル: SourceFrame.cs プロジェクト: unhammer/gimp-sharp
 ImageComboBox CreateImageComboBox()
 {
     var imageBox = new ImageComboBox();
       imageBox.Changed += delegate
     {
       _loader.Value = new FrontImageProviderFactory(imageBox.Active);
     };
       return imageBox;
 }