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; }
public void LeaveDragMode(uint time) { if (DragInProgress) { Pointer.Ungrab (time); Grab.Remove (this); } MotionNotifyEvent -= new MotionNotifyEventHandler (OnMotionNotify); DragInProgress = false; }
public void LeaveDragMode(uint time) { if (DragInProgress) { Pointer.Ungrab(time); Grab.Remove(this); } MotionNotifyEvent -= new MotionNotifyEventHandler(OnMotionNotify); DragInProgress = false; }
void OnButtonPress(object obj, ButtonPressEventArgs args) { if (DragInProgress) { return; } if (args.Event.Button == 1 && args.Event.Type == EventType.ButtonPress && FindTabAtPosition(args.Event.XRoot, args.Event.YRoot) >= 0) { MotionNotifyEvent += new MotionNotifyEventHandler(OnMotionNotify); } }
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; }
public IconList() : base() { status = new Gtk.Window("status"); status_l = new Gtk.Label("Status"); status.Add(status_l); //status.ShowAll (); SetSizeRequest(670, 370); CanFocus = true; Realized += new EventHandler(RealizeHanlder); Unrealized += new EventHandler(UnrealizeHandler); SizeAllocated += new SizeAllocatedHandler(SizeAllocatedHandler); MotionNotifyEvent += new MotionNotifyEventHandler(MotionHandler); ButtonPressEvent += new ButtonPressEventHandler(ButtonHandler); KeyPressEvent += new KeyPressEventHandler(KeyPressHandler); KeyReleaseEvent += new KeyReleaseEventHandler(KeyReleaseHandler); ScrollEvent += new ScrollEventHandler(ScrollHandler); AddEvents((int)(EventMask.ExposureMask | EventMask.LeaveNotifyMask | EventMask.ButtonPressMask | EventMask.PointerMotionMask | EventMask.KeyPressMask | EventMask.ScrollMask | EventMask.KeyReleaseMask)); zoom = 1.0f; SetPreviewSize(160, 120); adjustment = new Adjustment(0, 0, 0, 0, 0, 0); adjustment.ValueChanged += new EventHandler(ValueChangedHandler); image_count = 0; Gtk.Settings s = Gtk.Settings.Default; double_click_time = (uint)s.DoubleClickTime; last_click_time = 0; }
public IconList () : base () { status = new Gtk.Window ("status"); status_l = new Gtk.Label ("Status"); status.Add (status_l); //status.ShowAll (); SetSizeRequest (670, 370); CanFocus = true; Realized += new EventHandler (RealizeHanlder); Unrealized += new EventHandler (UnrealizeHandler); SizeAllocated += new SizeAllocatedHandler (SizeAllocatedHandler); MotionNotifyEvent += new MotionNotifyEventHandler (MotionHandler); ButtonPressEvent += new ButtonPressEventHandler (ButtonHandler); KeyPressEvent += new KeyPressEventHandler (KeyPressHandler); KeyReleaseEvent += new KeyReleaseEventHandler (KeyReleaseHandler); ScrollEvent += new ScrollEventHandler (ScrollHandler); AddEvents ((int) (EventMask.ExposureMask | EventMask.LeaveNotifyMask | EventMask.ButtonPressMask | EventMask.PointerMotionMask | EventMask.KeyPressMask | EventMask.ScrollMask | EventMask.KeyReleaseMask)); zoom = 1.0f; SetPreviewSize (160, 120); adjustment = new Adjustment (0, 0, 0, 0, 0, 0); adjustment.ValueChanged += new EventHandler (ValueChangedHandler); image_count = 0; Gtk.Settings s = Gtk.Settings.Default; double_click_time = (uint) s.DoubleClickTime; last_click_time = 0; }
void OnButtonPress (object obj, ButtonPressEventArgs args) { if (DragInProgress) return; if (args.Event.Button == 1 && args.Event.Type == EventType.ButtonPress && FindTabAtPosition (args.Event.XRoot, args.Event.YRoot) >= 0) MotionNotifyEvent += new MotionNotifyEventHandler (OnMotionNotify); }
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(); }
void OnButtonRelease(object obj, ButtonReleaseEventArgs args) { if (Pointer.IsGrabbed) { Pointer.Ungrab (args.Event.Time); Grab.Remove (this); } MotionNotifyEvent -= new MotionNotifyEventHandler (OnMotionNotify); DragInProgress = false; }
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); }