Example #1
0
        public ColorPickerDialog(int x, int y, HColorPicker parent) :
            base(Gtk.WindowType.Toplevel)
        {
            this.parent       = parent;
            this.AppPaintable = true;
            Move(x - 180, y);
            Resize(120, 120);
            this.Build();
            addColors();
            //add buttons

            int  cols = 8;
            uint left = 0;
            uint top  = 0;

            foreach (Color c in colors)
            {
                if (left == cols)
                {
                    left = 0;
                    top++;
                }
                //color button
                ColorButton btn = new ColorButton(c);
                btn.BorderWidth   = 1;
                btn.HeightRequest = 20;
                btn.WidthRequest  = 20;
                //
                btn.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnColorChange);
                TblColors.Attach(btn, left, left + 1, top, top + 1);
                left++;
            }
            ShowAll();
            GrabUtil.GrabWindow(this);
        }
        public ColorPickerDialog( int x, int y, HColorPicker parent )
            : base(Gtk.WindowType.Toplevel)
        {
            this.parent       = parent;
            this.AppPaintable = true;
            Move  ( x - 180 , y   );
            Resize( 120     , 120 );
            this.Build();
            addColors();
            //add buttons

            int cols  = 8;
            uint left = 0;
            uint top  = 0;

            foreach( Color c in colors )
            {

                if( left == cols )
                {
                    left = 0;
                    top++;
                }
                //color button
                ColorButton btn   = new ColorButton( c );
                btn.BorderWidth   = 1;
                btn.HeightRequest = 20;
                btn.WidthRequest  = 20;
                //
                btn.ButtonPressEvent += new Gtk.ButtonPressEventHandler( OnColorChange );
                TblColors.Attach( btn, left, left + 1, top, top + 1 );
                left++;
            }
            ShowAll();
            GrabUtil.GrabWindow(this);
        }
 public static void ShowMe( int x, int y, HColorPicker parent)
 {
     new ColorPickerDialog( x, y, parent );
 }
Example #4
0
 public static void ShowMe(int x, int y, HColorPicker parent)
 {
     new ColorPickerDialog(x, y, parent);
 }