// Create a top-level application window. public IToolkitTopLevelWindow CreateTopLevelWindow (int width, int height, IToolkitEventSink sink) { ValidateWindowSize(ref width, ref height); return(new DrawingTopLevelWindow (this, String.Empty, width, height, sink)); }
// Create a top-level dialog shell. public IToolkitWindow CreateTopLevelDialog (int width, int height, bool modal, bool resizable, IToolkitWindow dialogParent, IToolkitEventSink sink) { DrawingTopLevelWindow window; window = new DrawingTopLevelWindow (this, String.Empty, width, height, sink); /*if(dialogParent is TopLevelWindow) * { * window.TransientFor = (TopLevelWindow)dialogParent; * } * if(modal) * { * window.InputType = MotifInputType.ApplicationModal; * } * else * { * window.InputType = MotifInputType.Modeless; * } * if(!resizable) * { * window.Decorations = MotifDecorations.Border | * MotifDecorations.Title | * MotifDecorations.Menu; * window.Functions = MotifFunctions.Move | * MotifFunctions.Close; * }*/ AddWindow(window, dialogParent as DrawingWindow); window.CreateWindow(); return(window); }
// Create a top-level dialog shell. public IToolkitWindow CreateTopLevelDialog (int width, int height, bool modal, bool resizable, IToolkitWindow dialogParent, IToolkitEventSink sink) { DrawingTopLevelWindow window; ValidateWindowSize(ref width, ref height); window = new DrawingTopLevelWindow (this, String.Empty, width, height, sink); if (dialogParent is TopLevelWindow) { window.TransientFor = (TopLevelWindow)dialogParent; } if (modal) { window.InputType = MotifInputType.ApplicationModal; } else { window.InputType = MotifInputType.Modeless; } if (!resizable) { window.Decorations = MotifDecorations.Border | MotifDecorations.Title | MotifDecorations.Menu; window.Functions = MotifFunctions.Move | MotifFunctions.Close; } return(window); }
public DrawingTopLevelWindow(DrawingToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base(toolkit) { this.sink = sink; //Console.WriteLine("DrawingTopLevelWindow"); dimensions = new Rectangle(0, 0, width, height); // At the moment we create a unique class name for EVERY window. SWF does it for each unique window class className = "DrawingTopLevelWindow" + createCount++; // Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); // We will draw windowsClass.hbrBackground = IntPtr.Zero; windowsClass.lpszClassName = className; if (Win32.Api.RegisterClassA(ref windowsClass) == 0) { throw new Exception("Failed to register Windows class " + className); } // Set default window characteristics flags = ToolkitWindowFlags.Menu | ToolkitWindowFlags.Close | ToolkitWindowFlags.Minimize | ToolkitWindowFlags.Maximize | ToolkitWindowFlags.Caption | ToolkitWindowFlags.ResizeHandles; toolkit.GetWin32StylesFromFlags(flags, out style, out extendedStyle); menu = false; extendedStyle = 0; topOfhierarchy = this; }
public DrawingTopLevelWindow(DrawingToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base ( toolkit ) { this.sink = sink; //Console.WriteLine("DrawingTopLevelWindow"); dimensions = new Rectangle(0, 0, width, height); // At the moment we create a unique class name for EVERY window. SWF does it for each unique window class className = "DrawingTopLevelWindow" + createCount++; // Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); // We will draw windowsClass.hbrBackground = IntPtr.Zero; windowsClass.lpszClassName = className ; if (Win32.Api.RegisterClassA( ref windowsClass)==0) { throw new Exception("Failed to register Windows class " + className); } // Set default window characteristics flags = ToolkitWindowFlags.Menu | ToolkitWindowFlags.Close | ToolkitWindowFlags.Minimize | ToolkitWindowFlags.Maximize | ToolkitWindowFlags.Caption | ToolkitWindowFlags.ResizeHandles; toolkit.GetWin32StylesFromFlags( flags, out style, out extendedStyle); menu = false; extendedStyle = 0; topOfhierarchy = this; }
public DrawingPopupWindow(DrawingToolkit toolkit, int x, int y, int width, int height, IToolkitEventSink sink) : base ( toolkit ) { //Console.WriteLine("DrawingPopupWindow"); this.sink = sink; dimensions = new Rectangle(x, y, width, height); // At the moment we create a unique class name for EVERY window. SWF does it for each unique window class className = "DrawingPopupWindow" + createCount++; // Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); // We will draw windowsClass.hbrBackground = IntPtr.Zero; windowsClass.lpszClassName = className ; if (Win32.Api.RegisterClassA( ref windowsClass)==0) { throw new Exception("Failed to register Windows class " + className); } // Set default window characteristics style = Win32.Api.WindowStyle.WS_POPUP; menu = false; extendedStyle = Win32.Api.WindowsExtendedStyle.WS_EX_TOOLWINDOW; // We capture the mouse, and we want the client windows to be notified topOfhierarchy = this; }
public DrawingPopupWindow(DrawingToolkit toolkit, int x, int y, int width, int height, IToolkitEventSink sink) : base(toolkit) { //Console.WriteLine("DrawingPopupWindow"); this.sink = sink; dimensions = new Rectangle(x, y, width, height); // At the moment we create a unique class name for EVERY window. SWF does it for each unique window class className = "DrawingPopupWindow" + createCount++; // Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); // We will draw windowsClass.hbrBackground = IntPtr.Zero; windowsClass.lpszClassName = className; if (Win32.Api.RegisterClassA(ref windowsClass) == 0) { throw new Exception("Failed to register Windows class " + className); } // Set default window characteristics style = Win32.Api.WindowStyle.WS_POPUP; menu = false; extendedStyle = Win32.Api.WindowsExtendedStyle.WS_EX_TOOLWINDOW; // We capture the mouse, and we want the client windows to be notified topOfhierarchy = this; }
// Constructors. public DrawingTopLevelWindow(IToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base(name, width, height) { this.sink = sink; this.toolkit = toolkit; this.AutoMapChildren = false; }
// Create a form. public IToolkitTopLevelWindow CreateTopLevelWindow(int width, int height, IToolkitEventSink sink) { DrawingTopLevelWindow window = new DrawingTopLevelWindow(this, string.Empty, width, height, sink); AddWindow(window, null); window.CreateWindow(); return(window); }
// Constructors. public DrawingTopLevelWindow(IToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base(name, width, height) { this.sink = sink; this.toolkit = toolkit; this.AutoMapChildren = false; }
public void ToolkitStateChanged(int state) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitStateChanged(state); } }
public void ToolkitMdiActivate(IToolkitWindow child) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitMdiActivate(child); } }
public void ToolkitBeginInvoke(IntPtr i_gch) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitBeginInvoke(i_gch); } }
public void ToolkitPrimaryFocusLeave() { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitPrimaryFocusLeave(); } }
// Constructor. public DrawingPopupWindow (IToolkit toolkit, int x, int y, int width, int height, IToolkitEventSink sink) : base(x, y, width, height) { this.sink = sink; this.toolkit = toolkit; this.AutoMapChildren = false; }
public void ToolkitExternalResize(int width, int height) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitExternalResize(width, height); } }
public void ToolkitExternalMove(int x, int y) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitExternalMove(x, y); } }
// Create a top-level popup window. Popup windows do not have // any borders and grab the mouse and keyboard when they are mapped // to the screen. They are used for menus, drop-down lists, etc. public IToolkitWindow CreatePopupWindow (int x, int y, int width, int height, IToolkitEventSink sink) { DrawingWindow window = new DrawingPopupWindow(this, x, y, width, height, sink); AddWindow(window, null); window.CreateWindow(); return(window); }
// Constructor. public DrawingPopupWindow (IToolkit toolkit, int x, int y, int width, int height, IToolkitEventSink sink) : base(x, y, width, height) { this.sink = sink; this.toolkit = toolkit; this.AutoMapChildren = false; }
public void ToolkitMouseWheel(ToolkitMouseButtons buttons, ToolkitKeys modifiers, int clicks, int x, int y, int delta) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitMouseWheel(buttons, modifiers, clicks, x, y, delta); } }
// Constructor. public DrawingMdiClient (IToolkit toolkit, Widget parent, int x, int y, int width, int height, IToolkitEventSink sink) : base(parent, x, y, width, height) { this.sink = sink; this.toolkit = toolkit; this.AutoMapChildren = false; }
// Constructor. public DrawingMdiClient (IToolkit toolkit, Widget parent, int x, int y, int width, int height, IToolkitEventSink sink) : base(parent, x, y, width, height) { this.sink = sink; this.toolkit = toolkit; this.AutoMapChildren = false; }
public void ToolkitHelp() { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitHelp(); } }
public void ToolkitExpose(Graphics graphics) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { co.ToolkitExpose(graphics); } }
public bool ToolkitKeyUp(ToolkitKeys key) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { return(co.ToolkitKeyUp(key)); } return(false); }
public bool ToolkitKeyChar(char charCode) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { return(co.ToolkitKeyChar(charCode)); } return(false); }
// Destroy this window and all of its children. void IToolkitWindow.Destroy() { Destroy(); /* * if the window is destroyed, set toolkit and sink to zero. * otherwise, we couold get events like LostFocus... */ toolkit = null; sink = null; }
// Create a child window underneath this MDI client. IToolkitTopLevelWindow IToolkitMdiClient.CreateChildWindow (int x, int y, int width, int height, IToolkitEventSink sink) { DrawingTopLevelWindow window = CreateChild(String.Empty, width, height, typeof(DrawingTopLevelWindow)) as DrawingTopLevelWindow; window.SetSink(sink); return(window); }
// Create a child window. If "parent" is null, then the child // does not yet have a "real" parent - it will be reparented later. public IToolkitWindow CreateChildWindow (IToolkitWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) { Widget wparent; if (parent is Widget) { wparent = ((Widget)parent); } else { wparent = placeholder; } ValidateWindowPosition(ref x, ref y); ValidateWindowSize(ref width, ref height); return(new DrawingWindow(this, wparent, x, y, width, height, sink)); }
// Create a child window. If "parent" is null, then the child // does not yet have a "real" parent - it will be reparented later. public IToolkitWindow CreateChildWindow (IToolkitWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) { DrawingWindow dparent; if (parent is DrawingWindow) { dparent = ((DrawingWindow)parent); } else { dparent = null; } DrawingWindow window = new DrawingControlWindow(this, "", dparent, x, y, width, height, sink); AddWindow(window, parent as DrawingWindow); window.CreateWindow(); return(window); }
public DrawingHiddenWindow(DrawingToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base(toolkit) { className = "DrawingHiddenWindow"; // Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); // We will draw windowsClass.hbrBackground = IntPtr.Zero; windowsClass.lpszClassName = className; if (Win32.Api.RegisterClassA(ref windowsClass) == 0) { throw new Exception("Failed to register Windows class " + className); } // Set default window characteristics style = Win32.Api.WindowStyle.WS_OVERLAPPEDWINDOW; extendedStyle = 0; topOfhierarchy = this; }
public DrawingHiddenWindow(DrawingToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base ( toolkit ) { className = "DrawingHiddenWindow"; // Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); // We will draw windowsClass.hbrBackground = IntPtr.Zero; windowsClass.lpszClassName = className ; if (Win32.Api.RegisterClassA( ref windowsClass)==0) { throw new Exception("Failed to register Windows class " + className); } // Set default window characteristics style = Win32.Api.WindowStyle.WS_OVERLAPPEDWINDOW; extendedStyle = 0; topOfhierarchy = this; }
public DrawingControlWindow(DrawingToolkit toolkit, string name, DrawingWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) : base (toolkit) { this.sink = sink; //Console.WriteLine("DrawingControlWindow"); this.parent = parent; dimensions = new Rectangle( x, y, width, height ); //At the moment we create a unique class name for EVERY window. SWF does it for each window type className = "DrawingControlWindow" + createCount++; //Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); windowsClass.hbrBackground = IntPtr.Zero; //(IntPtr)(Win32.Api.COLOR_WINDOW + 1); windowsClass.lpszClassName = className ; if (Win32.Api.RegisterClassA( ref windowsClass)==0) { throw new Exception("Failed to register Windows class " + className); } //Set default windows settings style = Win32.Api.WindowStyle.WS_CHILD | Win32.Api.WindowStyle.WS_TABSTOP | Win32.Api.WindowStyle.WS_CLIPSIBLINGS; extendedStyle = 0; }
// Create a child window. If "parent" is null, then the child // does not yet have a "real" parent - it will be reparented later. public virtual IToolkitWindow CreateChildWindow (IToolkitWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) { return null; }
// Create a child window underneath this MDI client. IToolkitTopLevelWindow IToolkitMdiClient.CreateChildWindow (int x, int y, int width, int height, IToolkitEventSink sink) { DrawingTopLevelWindow window = CreateChild(String.Empty, width, height, typeof(DrawingTopLevelWindow)) as DrawingTopLevelWindow; window.SetSink(sink); return window; }
// Create a top-level popup window. Popup windows do not have // any borders and grab the mouse and keyboard when they are mapped // to the screen. They are used for menus, drop-down lists, etc. public IToolkitWindow CreatePopupWindow (int x, int y, int width, int height, IToolkitEventSink sink) { DrawingWindow window = new DrawingPopupWindow(this, x, y, width, height, sink); AddWindow(window, null); window.CreateWindow(); return window; }
// Create a child window. If "parent" is null, then the child // does not yet have a "real" parent - it will be reparented later. public IToolkitWindow CreateChildWindow (IToolkitWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) { DrawingWindow dparent; if(parent is DrawingWindow) { dparent = ((DrawingWindow)parent); } else { dparent = null; } DrawingWindow window = new DrawingControlWindow(this, "", dparent, x, y, width, height, sink); AddWindow(window, parent as DrawingWindow); window.CreateWindow(); return window; }
public DrawingRootTopLevelWindow(DrawingToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base (toolkit, name, width, height, sink) {}
// Create an MDI client area. public virtual IToolkitMdiClient CreateMdiClient (IToolkitWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) { return null; }
public DrawingRootTopLevelWindow(DrawingToolkit toolkit, String name, int width, int height, IToolkitEventSink sink) : base(toolkit, name, width, height, sink) { }
// Set the sink. public void SetSink(IToolkitEventSink sink) { this.sink = sink; }
// Create a top-level dialog shell. public IToolkitWindow CreateTopLevelDialog (int width, int height, bool modal, bool resizable, IToolkitWindow dialogParent, IToolkitEventSink sink) { DrawingTopLevelWindow window; ValidateWindowSize(ref width, ref height); window = new DrawingTopLevelWindow (this, String.Empty, width, height, sink); if(dialogParent is TopLevelWindow) { window.TransientFor = (TopLevelWindow)dialogParent; } if(modal) { window.InputType = MotifInputType.ApplicationModal; } else { window.InputType = MotifInputType.Modeless; } if(!resizable) { window.Decorations = MotifDecorations.Border | MotifDecorations.Title | MotifDecorations.Menu; window.Functions = MotifFunctions.Move | MotifFunctions.Close; } return window; }
// Create a top-level application window. public IToolkitTopLevelWindow CreateTopLevelWindow (int width, int height, IToolkitEventSink sink) { ValidateWindowSize(ref width, ref height); return new DrawingTopLevelWindow (this, String.Empty, width, height, sink); }
// Create a top-level popup window. Popup windows do not have // any borders and grab the mouse and keyboard when they are mapped // to the screen. They are used for menus, drop-down lists, etc. public IToolkitWindow CreatePopupWindow (int x, int y, int width, int height, IToolkitEventSink sink) { return new DrawingPopupWindow(this, x, y, width, height, sink); }
// Set the sink. public void SetSink(IToolkitEventSink sink) { this.sink = sink; }
// Create a form. public IToolkitTopLevelWindow CreateTopLevelWindow(int width, int height, IToolkitEventSink sink) { DrawingTopLevelWindow window = new DrawingTopLevelWindow(this, string.Empty, width, height, sink); AddWindow(window, null); window.CreateWindow(); return window; }
public ControlWeakRef( IToolkitEventSink control ) { this.mControlWeakRef = new WeakReference( control, false ); }
// Create a top-level application window. public virtual IToolkitTopLevelWindow CreateTopLevelWindow (int width, int height, IToolkitEventSink sink) { return null; }
public ControlWeakRef(IToolkitEventSink control) { this.mControlWeakRef = new WeakReference(control, false); }
// Create a top-level popup window. Popup windows do not have // any borders and grab the mouse and keyboard when they are mapped // to the screen. They are used for menus, drop-down lists, etc. public virtual IToolkitWindow CreatePopupWindow (int x, int y, int width, int height, IToolkitEventSink sink) { return null; }
// Create an MDI client area. public IToolkitMdiClient CreateMdiClient (IToolkitWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) { Widget wparent; if(parent is Widget) { wparent = ((Widget)parent); } else { wparent = placeholder; } ValidateWindowPosition(ref x, ref y); ValidateWindowSize(ref width, ref height); return new DrawingMdiClient (this, wparent, x, y, width, height, sink); }
// Create a top-level dialog shell. public virtual IToolkitWindow CreateTopLevelDialog (int width, int height, bool modal, bool resizable, IToolkitWindow dialogParent, IToolkitEventSink sink) { return null; }
public DrawingControlWindow(DrawingToolkit toolkit, string name, DrawingWindow parent, int x, int y, int width, int height, IToolkitEventSink sink) : base(toolkit) { this.sink = sink; //Console.WriteLine("DrawingControlWindow"); this.parent = parent; dimensions = new Rectangle(x, y, width, height); //At the moment we create a unique class name for EVERY window. SWF does it for each window type className = "DrawingControlWindow" + createCount++; //Register the windows class windowsClass = new Win32.Api.WNDCLASS(); windowsClass.style = Win32.Api.WindowClassStyle.CS_DBLCLKS; windowsClass.lpfnWndProc = new Win32.Api.WNDPROC(toolkit.WindowsLoop); windowsClass.hbrBackground = IntPtr.Zero; //(IntPtr)(Win32.Api.COLOR_WINDOW + 1); windowsClass.lpszClassName = className; if (Win32.Api.RegisterClassA(ref windowsClass) == 0) { throw new Exception("Failed to register Windows class " + className); } //Set default windows settings style = Win32.Api.WindowStyle.WS_CHILD | Win32.Api.WindowStyle.WS_TABSTOP | Win32.Api.WindowStyle.WS_CLIPSIBLINGS; extendedStyle = 0; }
// Destroy this window and all of its children. void IToolkitWindow.Destroy() { Destroy(); /* * if the window is destroyed, set toolkit and sink to zero. * otherwise, we couold get events like LostFocus... */ toolkit = null; sink = null; }