private void Configure(object o, ConfigureEventArgs args) { if (!realized) return; float w = ((Widget)o).Allocation.Width; float h = ((Widget)o).Allocation.Height; float aspect; // OpenGL BEGIN m_gl.MakeCurrent(); Gl.glViewport (0, 0, (int)w, (int)h); Gl.glMatrixMode (Gl.GL_PROJECTION); Gl.glLoadIdentity (); if (w > h) { aspect = w / h; Gl.glFrustum (-aspect, aspect, -1.0, 1.0, 5.0, 60.0); } else { aspect = h / w; Gl.glFrustum (-1.0, 1.0, -aspect, aspect, 5.0, 60.0); } Gl.glMatrixMode (Gl.GL_MODELVIEW); // OpenGL END ** }
private static void OnConfigure(object obj, ConfigureEventArgs args) { if (glarea.MakeCurrent() > 0) { GL.glViewport(0, 0, glarea.Allocation.width, glarea.Allocation.height); } }
private void OnConfigure(object o, ConfigureEventArgs args) { if (!m_realized) return; //// OpenGL BEGIN ** m_gl.MakeCurrent (); Gl.glViewport (0, 0, Allocation.Width, Allocation.Height); //// OpenGL END ** }
static void ConfigureEvent (object obj, ConfigureEventArgs args) { Gdk.EventConfigure ev = args.Event; Gdk.Window window = ev.Window; Gdk.Rectangle allocation = darea.Allocation; pixmap = new Gdk.Pixmap (window, allocation.Width, allocation.Height, -1); pixmap.DrawRectangle (darea.Style.WhiteGC, true, 0, 0, allocation.Width, allocation.Height); args.RetVal = true; }
private void OnConfigure(object o, ConfigureEventArgs args) { if (!realized) return; float w = Allocation.width; float h = Allocation.height; float aspect; /*** OpenGL BEGIN ***/ m_gl.MakeCurrent (); Gl.glViewport (0, 0, (int)w, (int)h); Gl.glMatrixMode (Gl.GL_PROJECTION); Gl.glLoadIdentity (); if (w > h) { aspect = w / h; Gl.glFrustum (-aspect, aspect, -1.0f, 1.0f, 5.0f, 60.0f); } else { aspect = h / w; Gl.glFrustum (-1.0f, 1.0f, -aspect, aspect, 5.0f, 60.0f); } Gl.glMatrixMode (Gl.GL_MODELVIEW); /*** OpenGL END ***/ }
/* Event Handlers */ public void HandleResize(object sender, ConfigureEventArgs args) { Gdk.EventConfigure ev = args.Event; Console.WriteLine ("resized: " + ev.X + " " + ev.Y + " " + ev.Width + " " + ev.Height); NormalizeXY (); Repaint (ev.Width, ev.Height); }
public void HandleToplevelConfigure(object o, ConfigureEventArgs args) { int x, y; int loupe_x, loupe_y; x = args.Event.X - old_win_pos.X; y = args.Event.Y - old_win_pos.Y; GetPosition (out loupe_x, out loupe_y); Move (loupe_x + x, loupe_y + y); old_win_pos.X = args.Event.X; old_win_pos.Y = args.Event.Y; }
public void on_encoder_capture_signal_drawingarea_configure_event(object o, ConfigureEventArgs args) { Gdk.EventConfigure ev = args.Event; Gdk.Window window = ev.Window; Gdk.Rectangle allocation = encoder_capture_signal_drawingarea.Allocation; if(encoder_capture_signal_pixmap == null || encoder_capture_signal_sizeChanged || allocation.Width != encoder_capture_signal_allocationXOld) { encoder_capture_signal_pixmap = new Gdk.Pixmap (window, allocation.Width, allocation.Height, -1); if(eCapture != null && capturingCsharp == encoderCaptureProcess.CAPTURING) eCapture.EncoderCapturePointsPainted = -1; //mark meaning screen should be erased and start painting from the beginning else UtilGtk.ErasePaint(encoder_capture_signal_drawingarea, encoder_capture_signal_pixmap); encoder_capture_signal_sizeChanged = false; } encoder_capture_signal_allocationXOld = allocation.Width; }
protected virtual void OnDrawingareaConfigureEvent(object o, Gtk.ConfigureEventArgs args) { this.TransientFor = (Gtk.Window)targetWidget.Toplevel; this.Resize(Gdk.Screen.Default.Width, Gdk.Screen.Default.Height); CreatePixmaps(); }
/// <summary> /// Triggered when the drawing area is configured. /// </summary> private void OnConfigure( object obj, ConfigureEventArgs args) { // Pull out some fields EventConfigure ev = args.Event; Window window = ev.Window; int width = Allocation.Width; int height = Allocation.Height; // Create the backing pixmap pixmap = new Pixmap(window, width, height, -1); // Update the current pane // TODO, there is a bug with this and I don't know why if (currentPane != null) { currentPane.Configure(width, height - 50); } // Mark ourselves as done args.RetVal = true; }
private void OnFloatingConfigure(object o, ConfigureEventArgs e) { floatX = e.Event.X; floatY = e.Event.Y; width = e.Event.Width; height = e.Event.Height; e.RetVal = false; }
private void OnConfigureEvent(object sender, ConfigureEventArgs args) { QueueSaveState (); }
protected virtual void OnDrawingareaConfigureEvent(object o, Gtk.ConfigureEventArgs args) { // We can't set the cursor until the Gdk.Window exists DrawTool = selectedTool; }
private void OnWinConfigure(object o, ConfigureEventArgs args) { Gdk.EventConfigure e = args.Event; if (_oldWidth != e.Width || _oldHeight != e.Height) { Gdk.Pixmap tmp = new Gdk.Pixmap(_window.GdkWindow, e.Width, e.Height, -1); int minw = e.Width < _oldWidth ? e.Width : _oldWidth; int minh = e.Height < _oldHeight ? e.Height : _oldHeight; using (Context context = Gdk.CairoHelper.Create(tmp)) { Gdk.CairoHelper.SetSourcePixmap(context, _pixmap, 0, 0); context.Rectangle(0, 0, minw, minh); context.Fill(); } _pixmap = tmp; } _oldWidth = e.Width; _oldHeight = e.Height; }
private void OnConfigure(object o, ConfigureEventArgs args) { if (!realized) return; float h = (float) Allocation.Height / (float) Allocation.Width; /*** OpenGL BEGIN ***/ m_gl.MakeCurrent (); Gl.glViewport (0, 0, Allocation.Width, Allocation.Height); Gl.glMatrixMode (Gl.GL_PROJECTION); Gl.glLoadIdentity (); Gl.glFrustum (-1.0, 1.0, -h, h, 5.0, 60.0); Gl.glMatrixMode (Gl.GL_MODELVIEW); Gl.glLoadIdentity (); Gl.glTranslatef (0, 0, -40.0f); /*** OpenGL END ***/ }
private void on_MainWindow_configure_event(object o, ConfigureEventArgs e) { Gui.Settings.WindowSize = new System.Drawing.Size(e.Event.Width, e.Event.Height); Gui.Settings.WindowPosition = new System.Drawing.Point(e.Event.X, e.Event.Y); }
private void Relocate(object sender, ConfigureEventArgs e) { try { Configuration.Window.Search_Y = this.Top; Configuration.Window.Search_X = this.Left; } catch (Exception fail) { Core.handleException(fail); } }
// Create a new surface of the appropriate size to store our scribbles private void ScribbleConfigure(object o, ConfigureEventArgs args) { Widget widget = o as Widget; if (surface != null) surface.Destroy (); var allocation = widget.Allocation; surface = widget.Window.CreateSimilarSurface (Cairo.Content.Color, allocation.Width, allocation.Height); var cr = new Cairo.Context (surface); cr.SetSourceRGB (1, 1, 1); cr.Paint (); ((IDisposable)cr).Dispose (); // We've handled the configure event, no need for further processing. args.RetVal = true; }
public void on_encoder_capture_curves_bars_drawingarea_configure_event(object o, ConfigureEventArgs args) { Gdk.EventConfigure ev = args.Event; Gdk.Window window = ev.Window; Gdk.Rectangle allocation = encoder_capture_curves_bars_drawingarea.Allocation; if(encoder_capture_curves_bars_pixmap == null || encoder_capture_curves_sizeChanged || allocation.Width != encoder_capture_curves_allocationXOld || allocation.Height != encoder_capture_curves_allocationYOld) { encoder_capture_curves_bars_pixmap = new Gdk.Pixmap (window, allocation.Width, allocation.Height, -1); callPlotCurvesGraphDoPlot(); encoder_capture_curves_sizeChanged = false; } encoder_capture_curves_allocationXOld = allocation.Width; encoder_capture_curves_allocationYOld = allocation.Height; }
void WinConfigureEvent(object o, ConfigureEventArgs args) { //TODO Finished This }
private void OnConfigure(object o, ConfigureEventArgs args) { if(!MakeCurrent()) { Console.WriteLine("Warning: MakeCurrent() - OnConfigure failed"); return; } GlUtil.ContextValid = true; // setup opengl state and transform gl.Disable(gl.DEPTH_TEST); gl.Disable(gl.CULL_FACE); gl.Enable(gl.TEXTURE_2D); gl.Enable(gl.BLEND); gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); gl.ClearColor(0f, 0f, 0f, 0f); gl.Viewport(0, 0, Allocation.Width, Allocation.Height); gl.MatrixMode(gl.PROJECTION); gl.LoadIdentity(); gl.Ortho(0, Allocation.Width, Allocation.Height, 0, -1.0f, 1.0f); gl.MatrixMode(gl.MODELVIEW); gl.LoadIdentity(); GlUtil.Assert("After setting opengl transforms"); GlUtil.ContextValid = false; }
/// <summary> /// This method is called when the widget is configured, or /// resized. /// </summary> private void OnConfigure(object sender, ConfigureEventArgs args) { // Reset the central point width = args.Event.Width; height = args.Event.Height; Log.Debug("OnConfigure: {0}x{1}", width, height); }
public void on_event_execute_drawingarea_configure_event(object o, ConfigureEventArgs args) { Gdk.EventConfigure ev = args.Event; Gdk.Window window = ev.Window; Gdk.Rectangle allocation = event_execute_drawingarea.Allocation; if(event_execute_pixmap == null || sizeChanged || allocation.Width != allocationXOld) { event_execute_pixmap = new Gdk.Pixmap (window, allocation.Width, allocation.Height, -1); event_execute_erasePaint(event_execute_drawingarea); sizeChanged = false; } allocationXOld = allocation.Width; }
/// <summary> /// Triggered when the drawing area is configured. /// </summary> private void OnConfigure( object obj, ConfigureEventArgs args) { // Pull out some fields EventConfigure ev = args.Event; Window window = ev.Window; int width = Allocation.Width; int height = Allocation.Height; int min = Math.Min(width, height); viewport.Height = height; viewport.Width = width; // Create the backing pixmap pixmap = new Pixmap(window, width, height, -1); // Update the current pane if (Sprite != null) { Sprite.Height = Sprite.Width = ((int) (min * 0.75)); } // Mark ourselves as done args.RetVal = true; }
private void HandleHostConfigure(object o, ConfigureEventArgs args) { Relocate (); }
// Create a new pixmap of the appropriate size to store our scribbles private void ScribbleConfigure (object o, ConfigureEventArgs args) { Widget widget = o as Widget; Rectangle allocation = widget.Allocation; pixmap = new Pixmap (widget.GdkWindow, allocation.Width, allocation.Height, -1); // Initialize the pixmap to white pixmap.DrawRectangle (widget.Style.WhiteGC, true, 0, 0, allocation.Width, allocation.Height); // We've handled the configure event, no need for further processing. args.RetVal = true; }
/// <summary> /// Triggered when the drawing area is configured. /// </summary> private void OnConfigure( object obj, ConfigureEventArgs args) { // Pull out some fields and figure out the sizes EventConfigure ev = args.Event; Window window = ev.Window; int width = Allocation.Width; int height = Allocation.Height; int min = Math.Min(width, height); // Figure out the tile height tileSize = min / Game.Board.Size; log.Info("New tile size: {0}px", tileSize); // Adjust the viewport height viewport.Height = height; viewport.Width = width; // Create the backing pixmap pixmap = new Pixmap(window, width, height, -1); // We moved, so rapid move the tiles foreach (ISprite sprite in sprites) { ContainerSprite cs = sprite as ContainerSprite; if (cs != null) { cs.FireInvalidate(); cs.X = cs.TokenSprite.X = tileSize * cs.TokenSprite.Token.Column; cs.FireInvalidate(); } } // Mark ourselves as done QueueDraw(); args.RetVal = true; }
private void OnToplevelConfigureEvent (object o, ConfigureEventArgs args) { Relocate (); }
void OnWindowConfigured(object sender, ConfigureEventArgs args) { RepositionWpfWindow(); }
private void OnConfigureEvent(object sender, ConfigureEventArgs args) { if (UISchema.Maximized.Value == true) return; UISchema.XPos.Value = args.Event.X; UISchema.YPos.Value = args.Event.Y; UISchema.Width.Value = args.Event.Width; UISchema.Height.Value = args.Event.Height; }