protected virtual void OnMapDrag(MouseEventArgs e)
        {
            MapEventHandler handler = MapDrag;

            if (handler != null)
            {
                HexCoordinate hexMapCoordinate = PositionManager.ScreenToHex(e.X, e.Y).Plus(TopLeftCoordinate);
                MapEventArgs  args             = new MapEventArgs(e.X, e.Y, e.Button, e.Clicks, hexMapCoordinate);
                handler(this, args);
            }
        }
Exemple #2
0
        public GearsArea(GdkGL.Config glconfig)
        {
            // Enable GL Widget and schedule context creating
            m_gl = new GlWidget (this, glconfig);

            // Events
            ExposeEvent += new ExposeEventHandler (OnExpose);
            ConfigureEvent += new ConfigureEventHandler (OnConfigure);
            Realized += new EventHandler (OnRealize);
            MapEvent += new MapEventHandler (OnMap);
            UnmapEvent += new UnmapEventHandler (OnUnmap);
            VisibilityNotifyEvent += new VisibilityNotifyEventHandler (OnVisible);
            AddEvents ((int)Gdk.EventMask.VisibilityNotifyMask);

            // Timers
            Timeout.Add (s_timerPeriod, new Function (OnTimer));
        }
Exemple #3
0
 public static object AddHandler(MapEntity entity, string eventName, MapEventHandler handler)
 {
     return null;
 }
Exemple #4
0
		private void CreateWindow (string query)
		{
			Title = Best.DefaultWindowTitle;

			DeleteEvent += new DeleteEventHandler (this.DoDelete);
			MapEvent += new MapEventHandler (MapIt);
			UnmapEvent += new UnmapEventHandler (UnmapIt);

			Icon = Images.GetPixbuf ("best.png");

			Widget content = CreateContents ();

			VBox main = new VBox (false, 3);
			main.PackStart (content, true, true, 3);
			content.Show ();
			Add (main);
			main.Show ();
			main.Realize ();
			canvas.Realize ();

			root = new SimpleRootTile ();
			canvas.Root = root;

			DefaultWidth = 600;
			DefaultHeight = 675;

			accel_group = new Gtk.AccelGroup ();
			this.AddAccelGroup (accel_group);
			global_keys = new GlobalKeybinder (accel_group);

			// Close window (Ctrl-W)
			global_keys.AddAccelerator (new EventHandler (this.HideWindowHandler),
						    (uint) Gdk.Key.w, 
						    Gdk.ModifierType.ControlMask,
						    Gtk.AccelFlags.Visible);

			// Close window (Escape)
			global_keys.AddAccelerator (new EventHandler (this.HideWindowHandler),
						    (uint) Gdk.Key.Escape, 
						    0,
						    Gtk.AccelFlags.Visible);

			// Show source (Ctrl+U)
			global_keys.AddAccelerator (new EventHandler (this.ShowSource),
						    (uint) Gdk.Key.U, 
						    Gdk.ModifierType.ControlMask,
						    Gtk.AccelFlags.Visible);

			// Focus Entry (Ctrl+L)
			global_keys.AddAccelerator (new EventHandler (this.FocusEntryHandler),
						    (uint) Gdk.Key.L, 
						    Gdk.ModifierType.ControlMask,
						    Gtk.AccelFlags.Visible);

			// Previous Page (PageUp)
			global_keys.AddAccelerator (new EventHandler (this.PageBackHandler),
						    (uint) Gdk.Key.Page_Up, 
						    0,
						    Gtk.AccelFlags.Visible);

			// Next Page (PageDown)
			global_keys.AddAccelerator (new EventHandler (this.PageForwardHandler),
						    (uint) Gdk.Key.Page_Down, 
						    0,
						    Gtk.AccelFlags.Visible);

			UpdateFromConf ();
			UpdatePage ();

			if (query != null)
				Search (query);
			
		}
Exemple #5
0
        private void CreateWindow(string query)
        {
            Title = Best.DefaultWindowTitle;

            DeleteEvent += new DeleteEventHandler(this.DoDelete);
            MapEvent    += new MapEventHandler(MapIt);
            UnmapEvent  += new UnmapEventHandler(UnmapIt);

            Icon = Images.GetPixbuf("best.png");

            Widget content = CreateContents();

            VBox main = new VBox(false, 3);

            main.PackStart(content, true, true, 3);
            content.Show();
            Add(main);
            main.Show();
            main.Realize();
            canvas.Realize();

            root        = new SimpleRootTile();
            canvas.Root = root;

            DefaultWidth  = 600;
            DefaultHeight = 675;

            accel_group = new Gtk.AccelGroup();
            this.AddAccelGroup(accel_group);
            global_keys = new GlobalKeybinder(accel_group);

            // Close window (Ctrl-W)
            global_keys.AddAccelerator(new EventHandler(this.HideWindowHandler),
                                       (uint)Gdk.Key.w,
                                       Gdk.ModifierType.ControlMask,
                                       Gtk.AccelFlags.Visible);

            // Close window (Escape)
            global_keys.AddAccelerator(new EventHandler(this.HideWindowHandler),
                                       (uint)Gdk.Key.Escape,
                                       0,
                                       Gtk.AccelFlags.Visible);

            // Show source (Ctrl+U)
            global_keys.AddAccelerator(new EventHandler(this.ShowSource),
                                       (uint)Gdk.Key.U,
                                       Gdk.ModifierType.ControlMask,
                                       Gtk.AccelFlags.Visible);

            // Focus Entry (Ctrl+L)
            global_keys.AddAccelerator(new EventHandler(this.FocusEntryHandler),
                                       (uint)Gdk.Key.L,
                                       Gdk.ModifierType.ControlMask,
                                       Gtk.AccelFlags.Visible);

            // Previous Page (PageUp)
            global_keys.AddAccelerator(new EventHandler(this.PageBackHandler),
                                       (uint)Gdk.Key.Page_Up,
                                       0,
                                       Gtk.AccelFlags.Visible);

            // Next Page (PageDown)
            global_keys.AddAccelerator(new EventHandler(this.PageForwardHandler),
                                       (uint)Gdk.Key.Page_Down,
                                       0,
                                       Gtk.AccelFlags.Visible);

            UpdateFromConf();
            UpdatePage();

            if (query != null)
            {
                Search(query);
            }
        }
Exemple #6
0
        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);
        }
Exemple #7
0
 public void RemoveEventHandler(MapEventHandler handler)
 {
     _OnMapSelected -= handler;
 }
Exemple #8
0
 public static object AddThrottledHandler(MapEntityCollection entities, string eventName, MapEventHandler handler, int interval)
 {
     return null;
 }
Exemple #9
0
 public static object AddHandler(MapEntityCollection entities, string eventName, MapEventHandler handler)
 {
     return(null);
 }
Exemple #10
0
 public static object AddHandler(MapEntity entity, string eventName, MapEventHandler handler)
 {
     return(null);
 }
 public static object AddHandler(MapInfobox infobox, string eventName, MapEventHandler handler)
 {
     return(null);
 }
 public static object AddHandler(MapLayer layer, string eventName, MapEventHandler handler)
 {
     return(null);
 }
 public static void AddOne(MapLayer layer, string eventName, MapEventHandler handler)
 {
 }
 public static void AddOne(MapEntityCollection entities, string eventName, MapEventHandler handler)
 {
 }
 public static void AddOne(MapEntity entity, string eventName, MapEventHandler handler)
 {
 }
Exemple #16
0
 public static object AddHandler(MapEntityCollection entities, string eventName, MapEventHandler handler)
 {
     return null;
 }
Exemple #17
0
 public static object AddThrottledHandler(Map map, string eventName, MapEventHandler handler, int interval)
 {
     return null;
 }
Exemple #18
0
 public static object AddThrottledHandler(Map map, string eventName, MapEventHandler handler, int interval)
 {
     return(null);
 }
Exemple #19
0
 public static object AddThrottledHandler(MapEntityCollection entities, string eventName, MapEventHandler handler, int interval)
 {
     return(null);
 }
Exemple #20
0
 public void AddEventHandler(MapEventHandler handler)
 {
     _OnMapSelected += handler;
 }