public FontChooserDialog(int x, int y, int width, FontEventHandler onFontChange, Dictionary <String, Font> FontStore, HFontPicker father) : base(Gtk.WindowType.Popup)
        {
            this.father       = father;
            this.FontStore    = FontStore;
            this.OnFontChange = onFontChange;
            this.Move(x, y);
            this.Resize(width, 200);


            this.Build();

            //grab dialog
            GrabUtil.GrabWindow(this);
            instance = this;
            TvFonts.GrabFocus();

            while (Gtk.Application.EventsPending())
            {
                Gtk.Application.RunIteration();
            }

            Thread t = new Thread(new ThreadStart(AddFontsToList));

            t.Start();
        }
 private void Close()
 {
     //remove focus
     GrabUtil.RemoveGrab(this);
     this.Hide();
     combo_parent.OnDropDownClosed(this, new EventArgs());
 }
 private void Close()
 {
     SelectCurrentFont();
     GrabUtil.RemoveGrab(this);
     father.FocusOnEntry();
     this.Hide();
 }
Ejemplo n.º 4
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 void ShowMe(Gdk.Rectangle area, String path)
 {
     Move(area.X, area.Y);
     Resize(area.Width, area.Height);
     ShowAll();
     GrabUtil.GrabWindow(this);
     FolderTree.GrabFocus();
     SetPath(path);
 }
        public void ShowMe(Gdk.Rectangle rect)
        {
            Move(rect.X, rect.Y);
            Resize(rect.Width, rect.Height);

            this.Visible = true;
            this.ShowAll();

            GrabUtil.GrabWindow(this);
            Tree.GrabFocus();
        }
        public DateEditDialog(int x, int y, DateTime defDate, DateEventHandler handler) : base(Gtk.WindowType.Popup)
        {
            this.Move(x, y);
            this.Build();
            this.OnChange = handler;
            GrabUtil.GrabWindow(this);

            TxtHour.Value  = defDate.Hour;
            TxtMin.Value   = defDate.Minute;
            TxtSec.Value   = defDate.Second;
            CCalendar.Date = defDate;

            RefreshClock();
        }
 public void ShowMe(int x, int y, int width, int height)
 {
     if (height == 0)
     {
         height = 200;
     }
     this.Move(x, y);
     this.Resize(width, height);
     this.ShowAll();
     //grab focus
     GrabUtil.GrabWindow(this);
     this.TvList.GrabFocus();
     //invoke DropDownOpened
     combo_parent.OnDropDownOpened(this, new EventArgs());
 }
 private static void ShowInstance(int x, int y, int width, FontEventHandler OnFontChange, Dictionary <String, Font> FontStore, String SelectedFont, HFontPicker father)
 {
     instance.FontStore = FontStore;
     instance.Move(x, y);
     instance.Resize(width, instance.Allocation.Height);
     instance.OnFontChange  = null;
     instance.OnFontChange += OnFontChange;
     instance.Show();
     instance.QueueResize();
     instance.SizeRequest();
     instance.TreeviewFonts.GrabFocus();
     //selecteaza fontul ales
     instance.SelectedFont = SelectedFont;
     GrabUtil.GrabWindow(instance);
 }
 private void Close()
 {
     GrabUtil.RemoveGrab(this);
     this.Destroy();
 }
 public void Close()
 {
     Hide();
     GrabUtil.RemoveGrab(this);
 }