コード例 #1
0
ファイル: list.cs プロジェクト: RoDaniel/featurehouse
 public BigList(IListModel provider)
 {
     this.provider = provider;
       RefAccessible ().Role = Atk.Role.List;
       hAdjustment = new Gtk.Adjustment (0, 0, currentWidth, 1, 1, 1);
       hAdjustment.ValueChanged += new EventHandler (HAdjustmentValueChangedHandler);
       vAdjustment = new Gtk.Adjustment (0, 0, provider.Rows, 1, 1, 1);
       vAdjustment.ValueChanged += new EventHandler (VAdjustmentValueChangedHandler);
       layout = new Pango.Layout (PangoContext);
       ExposeEvent += new ExposeEventHandler (ExposeHandler);
       ButtonPressEvent += new ButtonPressEventHandler (ButtonPressEventHandler);
       ButtonReleaseEvent += new ButtonReleaseEventHandler (ButtonReleaseEventHandler);
       KeyPressEvent += new KeyPressEventHandler (KeyHandler);
       Realized += new EventHandler (RealizeHandler);
       Unrealized += new EventHandler (UnrealizeHandler);
       ScrollEvent += new ScrollEventHandler (ScrollHandler);
         SizeAllocated += new SizeAllocatedHandler (SizeAllocatedHandler);
       MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotifyEventHandler);
       AddEvents ((int) EventMask.ButtonPressMask | (int) EventMask.ButtonReleaseMask | (int) EventMask.KeyPressMask | (int) EventMask.PointerMotionMask);
       CanFocus = true;
       style_widget = new EventBox ();
       style_widget.StyleSet += new StyleSetHandler (StyleHandler);
       layout.SetMarkup (ellipsis);
       layout.GetPixelSize (out ellipsis_width, out line_height);
       layout.SetMarkup ("n");
       layout.GetPixelSize (out en_width, out line_height);
       layout.SetMarkup ("W");
       layout.GetPixelSize (out en_width, out line_height);
       old_width = Allocation.Width;
 }
コード例 #2
0
ファイル: DragNotebook.cs プロジェクト: moscrif/ide
        public DragNotebook()
        {
            ButtonPressEvent += new ButtonPressEventHandler (OnButtonPress);
            ButtonReleaseEvent += new ButtonReleaseEventHandler (OnButtonRelease);
            ChangeCurrentPage += new ChangeCurrentPageHandler(OnPageChanged);

            AddEvents ((Int32) (EventMask.AllEventsMask));
        }
コード例 #3
0
        public DragNotebook()
        {
            ButtonPressEvent   += new ButtonPressEventHandler(OnButtonPress);
            ButtonReleaseEvent += new ButtonReleaseEventHandler(OnButtonRelease);
            ChangeCurrentPage  += new ChangeCurrentPageHandler(OnPageChanged);

            AddEvents((Int32)(EventMask.AllEventsMask));
        }
コード例 #4
0
		public DragNotebook () {
			ButtonPressEvent += new ButtonPressEventHandler (OnButtonPress);
			ButtonReleaseEvent += new ButtonReleaseEventHandler (OnButtonRelease);
			AddEvents ((Int32) (EventMask.AllEventsMask));
			
			//FIXME: we make the tabs smaller by shrinking the border, but this looks ugly with the windows theme
			if (!MonoDevelop.Core.PropertyService.IsWindows)
				this.SetProperty ("tab-border", new GLib.Value (0));
		}
コード例 #5
0
 public KeyButton(string text, ButtonReleaseEventHandler handler)
 {
     this.text     = text;
     this.textSize = 13;
     if (handler != null)
     {
         ButtonReleaseEvent += handler;
     }
 }
コード例 #6
0
ファイル: DragNotebook.cs プロジェクト: zheref/monodevelop
        public DragNotebook()
        {
            ButtonPressEvent   += new ButtonPressEventHandler(OnButtonPress);
            ButtonReleaseEvent += new ButtonReleaseEventHandler(OnButtonRelease);
            AddEvents((Int32)(EventMask.AllEventsMask));

            //FIXME: we make the tabs smaller by shrinking the border, but this looks ugly with the windows theme
            if (!MonoDevelop.Core.Platform.IsWindows)
            {
                this.SetProperty("tab-border", new GLib.Value(0));
            }
        }
コード例 #7
0
        public EditorNotebook()
        {
            listEditor      = new List <IEditor>();
            this.Scrollable = true;

            ButtonPressEvent   += new ButtonPressEventHandler(OnButtonPress);
            ButtonReleaseEvent += new ButtonReleaseEventHandler(OnButtonRelease);
            this.CanFocus       = false;

            this.SwitchPage += new SwitchPageHandler(OnSwitchPage);

            /*	filllStartPageThread = new Thread(new ThreadStart(ExecEditorThread));
             *      //filllStartPageThread.Priority = ThreadPriority.Normal;
             *      filllStartPageThread.Name = "ExecEditorThread";
             *      filllStartPageThread.IsBackground = true;
             *      //filllStartPageThread.Start();*/
        }
コード例 #8
0
ファイル: list.cs プロジェクト: lulzzz/ifolder
        int currentWidth = 50; // pixels

        public BigList(IListModel provider)
        {
            this.provider = provider;

            //Accessibility
            RefAccessible().Role = Atk.Role.List;

            hAdjustment = new Gtk.Adjustment(0, 0, currentWidth, 1, 1, 1);
            hAdjustment.ValueChanged += new EventHandler(HAdjustmentValueChangedHandler);

            vAdjustment = new Gtk.Adjustment(0, 0, provider.Rows, 1, 1, 1);
            vAdjustment.ValueChanged += new EventHandler(VAdjustmentValueChangedHandler);

            layout = new Pango.Layout(PangoContext);

            ExposeEvent        += new ExposeEventHandler(ExposeHandler);
            ButtonPressEvent   += new ButtonPressEventHandler(ButtonPressEventHandler);
            ButtonReleaseEvent += new ButtonReleaseEventHandler(ButtonReleaseEventHandler);
            KeyPressEvent      += new KeyPressEventHandler(KeyHandler);
            Realized           += new EventHandler(RealizeHandler);
            Unrealized         += new EventHandler(UnrealizeHandler);
            ScrollEvent        += new ScrollEventHandler(ScrollHandler);
            SizeAllocated      += new SizeAllocatedHandler(SizeAllocatedHandler);
            MotionNotifyEvent  += new MotionNotifyEventHandler(MotionNotifyEventHandler);

            AddEvents((int)EventMask.ButtonPressMask | (int)EventMask.ButtonReleaseMask | (int)EventMask.KeyPressMask | (int)EventMask.PointerMotionMask);
            CanFocus = true;

            style_widget           = new EventBox();
            style_widget.StyleSet += new StyleSetHandler(StyleHandler);

            //
            // Compute the height and ellipsis width of the font,
            // and the en_width for our ellipsizing algorithm
            //
            layout.SetMarkup(ellipsis);
            layout.GetPixelSize(out ellipsis_width, out line_height);

            layout.SetMarkup("n");
            layout.GetPixelSize(out en_width, out line_height);

            layout.SetMarkup("W");
            layout.GetPixelSize(out en_width, out line_height);

            old_width = Allocation.Width;
        }
コード例 #9
0
ファイル: EditorNotebook.cs プロジェクト: moscrif/ide
        public EditorNotebook()
        {
            listEditor = new List<IEditor>();
            this.Scrollable = true;

            ButtonPressEvent += new ButtonPressEventHandler(OnButtonPress);
            ButtonReleaseEvent += new ButtonReleaseEventHandler(OnButtonRelease);
            this.CanFocus = false;

            this.SwitchPage += new SwitchPageHandler(OnSwitchPage);

            /*	filllStartPageThread = new Thread(new ThreadStart(ExecEditorThread));
            //filllStartPageThread.Priority = ThreadPriority.Normal;
            filllStartPageThread.Name = "ExecEditorThread";
            filllStartPageThread.IsBackground = true;
            //filllStartPageThread.Start();*/
        }
コード例 #10
0
	protected IconView () : base (null, null)
	{
		cache = new FSpot.PixbufCache ();
		cache.OnPixbufLoaded += HandlePixbufLoaded;

		ScrollAdjustmentsSet += new ScrollAdjustmentsSetHandler (HandleScrollAdjustmentsSet);
		
		ButtonPressEvent += new ButtonPressEventHandler (HandleButtonPressEvent);
		ButtonReleaseEvent += new ButtonReleaseEventHandler (HandleButtonReleaseEvent);
		KeyPressEvent += new KeyPressEventHandler (HandleKeyPressEvent);
		ScrollEvent += new ScrollEventHandler(HandleScrollEvent);

		Destroyed += HandleDestroyed;

		AddEvents ((int) EventMask.KeyPressMask
			   | (int) EventMask.KeyReleaseMask 
			   | (int) EventMask.PointerMotionMask);
		
		CanFocus = true;

		//FSpot.Global.ModifyColors (this);
	}
コード例 #11
0
            public VirtualKeyboard(Entry e, ButtonReleaseEventHandler handler)
            {
                SetSizeRequest(505, 205);

                row1 = new KeyButton[10];
                row2 = new KeyButton[9];
                row3 = new KeyButton[7];

                for (int i = 0; i < 10; ++i)
                {
                    row1[i] = new KeyButton(qwerty1Lower[i].ToString(), handler);
                    Put(row1[i], (i * 50) + 5, 5);
                    row1[i].Show();
                }

                for (int i = 0; i < 9; ++i)
                {
                    row2[i] = new KeyButton(qwerty2Lower[i].ToString(), handler);
                    Put(row2[i], (i * 50) + 30, 55);
                    row2[i].Show();
                }

                for (int i = 0; i < 7; ++i)
                {
                    row3[i] = new KeyButton(qwerty3Lower[i].ToString(), handler);
                    Put(row3[i], (i * 50) + 80, 105);
                    row3[i].Show();
                }

                shiftState = ShiftKeyState.Lower;
                var shiftKey = new TouchButton();

                shiftKey.SetSizeRequest(70, 45);
                shiftKey.text                = Convert.ToChar(0x21E7).ToString();
                shiftKey.buttonColor         = "grey3";
                shiftKey.ButtonReleaseEvent += (o, args) => {
                    if (shiftState == ShiftKeyState.Lower)
                    {
                        ToUpper();
                        shiftKey.buttonColor = "pri";
                        shiftKey.QueueDraw();
                        shiftState = ShiftKeyState.Shifted;
                    }
                    else if (shiftState == ShiftKeyState.Shifted)
                    {
                        shiftKey.buttonColor = "seca";
                        shiftKey.QueueDraw();
                        shiftState = ShiftKeyState.Caps;
                    }
                    else     // Caps
                    {
                        ToLower();
                        shiftKey.buttonColor = "grey3";
                        shiftKey.QueueDraw();
                        shiftState = ShiftKeyState.Lower;
                    }
                };
                Put(shiftKey, 5, 105);
                shiftKey.Show();

                var delete = new TouchButton();

                delete.SetSizeRequest(70, 45);
                delete.text                = Convert.ToChar(0x232B).ToString();
                delete.textSize            = 15;
                delete.ButtonReleaseEvent += (o, args) => {
                    int pos = e.Position;
                    e.DeleteText(e.Position - 1, e.Position);
                };
                Put(delete, 430, 105);
                delete.Show();

                var space = new TouchButton();

                space.text = "Space";
                space.SetSizeRequest(245, 45);
                space.ButtonReleaseEvent += (o, args) => {
                    int pos = e.Position;
                    e.InsertText(" ", ref pos);
                    ++e.Position;
                };
                Put(space, 130, 155);
                space.Show();

                e.TextInserted += (o, args) => {
                    if (shiftState == ShiftKeyState.Shifted)
                    {
                        ToLower();
                        shiftKey.buttonColor = "grey3";
                        shiftKey.QueueDraw();
                        shiftState = ShiftKeyState.Lower;
                    }
                };

                Show();
            }
コード例 #12
0
ファイル: MainWindow.cs プロジェクト: escelia/photobooth
        public MainWindow() : base("Main Window")
        {
            SetDefaultSize(800, 650);
            DeleteEvent += new DeleteEventHandler(delete_cb);
            bool isUniform = false;
            int  margin    = 5;

            VBox topPanel = new VBox(isUniform, margin);
            HBox layCan   = new HBox(isUniform, margin);
            VBox layout   = new VBox(isUniform, margin);
            VBox layBtn   = new VBox(isUniform, margin);

            ButtonPressEvent   += new ButtonPressEventHandler(ButtonPressHandler);
            MotionNotifyEvent  += new MotionNotifyEventHandler(MotionNotifyHandler);
            ButtonReleaseEvent += new ButtonReleaseEventHandler(ButtonReleaseHandler);

            // menu bar

            MenuBar  mb        = new MenuBar();
            Menu     file_menu = new Menu();
            MenuItem exit_item = new MenuItem("Exit");
            MenuItem save_item = new MenuItem("Save");
            MenuItem open_item = new MenuItem("Open");

            exit_item.Activated += new EventHandler(on_exit_item_activate);
            open_item.Activated += new EventHandler(OnOpenCallback);
            save_item.Activated += new EventHandler(onSaveCallback);
            file_menu.Append(open_item);
            file_menu.Append(save_item);
            file_menu.Append(exit_item);
            MenuItem file_item = new MenuItem("File");

            file_item.Submenu = file_menu;
            mb.Append(file_item);


            layout.Add(Align(mb, 0, 0.5f, 1, 1));

            // toolbar

            Toolbar toolbar = new Toolbar();

            ToolButton buttonMove = new ToggleToolButton();

            buttonMove.IconWidget = new Gtk.Image("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/ops/move.png");
            buttonMove.Clicked   += new EventHandler(OnMoveClick);

            ToolButton buttonSelect = new ToggleToolButton();

            buttonSelect.IconWidget = new Gtk.Image("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/ops/scale.png");
            buttonSelect.Clicked   += new EventHandler(OnSelectClick);

            ToolButton buttonStar = new ToggleToolButton();
            var        pixbufStar = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/star.png");

            buttonStar.IconWidget = new Gtk.Image(pixbufStar.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonStar.Clicked   += new EventHandler(OnStarClick);

            ToolButton buttonAviator = new ToggleToolButton();
            var        pixbufAv      = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/aviator.png");

            buttonAviator.IconWidget = new Gtk.Image(pixbufAv.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonAviator.Clicked   += new EventHandler(OnAviatorClick);

            ToolButton buttonHeart = new ToggleToolButton();
            var        pixbufH     = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/heart.png");

            buttonHeart.IconWidget = new Gtk.Image(pixbufH.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonHeart.Clicked   += new EventHandler(OnHeartClick);

            ToolButton buttonNerd = new ToggleToolButton();
            var        pixbufN    = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/nerd.png");

            buttonNerd.IconWidget = new Gtk.Image(pixbufN.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonNerd.Clicked   += new EventHandler(OnNerdClick);

            ToolButton buttonHorns = new ToggleToolButton();
            var        pixbufHorns = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/horns.png");

            buttonHorns.IconWidget = new Gtk.Image(pixbufHorns.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonHorns.Clicked   += new EventHandler(OnHornsClick);

            ToolButton buttonHalo = new ToggleToolButton();
            var        pixbufHalo = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/halo.png");

            buttonHalo.IconWidget = new Gtk.Image(pixbufHalo.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonHalo.Clicked   += new EventHandler(OnHaloClick);

            ToolButton buttonTiara = new ToggleToolButton();
            var        pixbufT     = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/tiara.png");

            buttonTiara.IconWidget = new Gtk.Image(pixbufT.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonTiara.Clicked   += new EventHandler(OnTiaraClick);

            ToolButton buttonMous = new ToggleToolButton();
            var        pixbufM    = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/moustache.png");

            buttonMous.IconWidget = new Gtk.Image(pixbufM.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonMous.Clicked   += new EventHandler(OnMousClick);

            ToolButton buttonLib = new ToggleToolButton();
            var        pixbufL   = new Gdk.Pixbuf("/Users/eliaanagnostou/Documents/cs71/03-photobooth-eanagno1-zbatool1/accessories/librarian.png");

            buttonLib.IconWidget = new Gtk.Image(pixbufL.ScaleSimple(30, 30, Gdk.InterpType.Bilinear));
            buttonLib.Clicked   += new EventHandler(OnLibClick);


            SeparatorToolItem sep = new SeparatorToolItem();

            toolbar.Insert(buttonMove, -1);
            toolbar.Insert(buttonSelect, -1);
            toolbar.Insert(sep, -1);
            toolbar.Insert(buttonStar, -1);
            toolbar.Insert(buttonAviator, -1);
            toolbar.Insert(buttonHeart, -1);
            toolbar.Insert(buttonNerd, -1);
            toolbar.Insert(buttonHorns, -1);
            toolbar.Insert(buttonHalo, -1);
            toolbar.Insert(buttonTiara, -1);
            toolbar.Insert(buttonMous, -1);
            toolbar.Insert(buttonLib, -1);

            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            toolbar.ShowArrow    = false;
            layout.Add(Align(toolbar, 0, 0.25f, 1, 0));


            layBtn.Add(Align(_list, 1, 0, 0, 1));


            Button btn = new Button("Delete layer");

            btn.Clicked += new EventHandler(btn_click);
            layBtn.Add(Align(btn, 0, 0, 1, 1));
            layCan.Add(Align(layBtn, 1, 0, 0, 1));


            layCan.Add(Align(_canv, 1, 0, 1, 1));


            topPanel.Add(Align(layout, 1, 0, 1, 1));
            topPanel.Add(Align(layCan, 1, 0, 0, 1));
            Add(topPanel);
            ShowAll();
        }
コード例 #13
0
ファイル: shapes.cs プロジェクト: GNOME/gtkglext-sharp
        public ShapesArea(Config config)
        {
            m_gl = new GlWidget (this, config);

            AddEvents (	(int)(Gdk.EventMask.Button1MotionMask |
                        Gdk.EventMask.Button2MotionMask |
                        Gdk.EventMask.ButtonPressMask |
                        Gdk.EventMask.ButtonReleaseMask |
                        Gdk.EventMask.VisibilityNotifyMask) );
            Realized += new EventHandler (OnRealize);
            ConfigureEvent += new ConfigureEventHandler (OnConfigure);
            ExposeEvent += new ExposeEventHandler (OnExpose);

            ButtonPressEvent += new ButtonPressEventHandler (OnButtonPress);
            ButtonReleaseEvent += new ButtonReleaseEventHandler (OnButtonRelease);
            MotionNotifyEvent += new MotionNotifyEventHandler (OnMotionNotify);

            MapEvent += new MapEventHandler (OnMap);
            UnmapEvent += new UnmapEventHandler (OnUnmap);
            VisibilityNotifyEvent += new VisibilityNotifyEventHandler (OnVisibilityNotify);
            KeyPressEvent += new KeyPressEventHandler (OnKeyPress);

            int i = 0;
            shapeArray = new ShapeProp [9];
            shapeArray[i++] = new ShapeProp ("Cube");
            shapeArray[i++] = new ShapeProp ("Sphere");
            shapeArray[i++] = new ShapeProp ("Cone");
            shapeArray[i++] = new ShapeProp ("Torus");
            shapeArray[i++] = new ShapeProp ("Tetrahedron");
            shapeArray[i++] = new ShapeProp ("Octahedron");
            shapeArray[i++] = new ShapeProp ("Dodecahedron");
            shapeArray[i++] = new ShapeProp ("Icosahedron");
            shapeArray[i  ] = new ShapeProp ("Teapot");
            shape_current = i;
            mat_current = (MaterialProp)materialList[0];

            /*
            * Popup menu.
            */
            CreatePopupMenu ();
            ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressPopupMenu);
        }