Esempio n. 1
0
		/// <summary>
		/// Window has changed size
		/// </summary>
		/// <param name="window">RenderWindow that caused the event</param>
		public void WindowResized( RenderWindow window )
		{
			Contract.RequiresNotNull( window, "window" );

			if ( this._windows.Contains( window ) )
			{
				// Notify Window of Move or Resize
				window.WindowMovedOrResized();

				// Notify listeners of Resize
				foreach ( var listener in this._listeners[ window ] )
				{
					listener.WindowResized( window );
				}
				return;
			}
		}
Esempio n. 2
0
		/// <summary>
		/// Internal winProc (RenderWindow's use this when creating the Win32 Window)
		/// </summary>
		/// <param name="m"></param>
		static public bool WndProc( RenderWindow win, ref Message m )
		{
			switch ( (WindowMessage)m.Msg )
			{
				case WindowMessage.Activate:
					{
                        bool active = ((ActivateState)(m.WParam.ToInt32() & 0xFFFF)) != ActivateState.InActive;
						win.IsActive = active;
						WindowEventMonitor.Instance.WindowFocusChange( win, active );
						break;
					}
				case WindowMessage.SysKeyDown:
					switch ( (VirtualKeys)m.WParam )
					{
						case VirtualKeys.Control:
						case VirtualKeys.Shift:
						case VirtualKeys.Menu: //ALT
							//return true to bypass defProc and signal we processed the message
							return true;
					}
					break;
				case WindowMessage.SysKeyUp:
					switch ( (VirtualKeys)m.WParam )
					{
						case VirtualKeys.Control:
						case VirtualKeys.Shift:
						case VirtualKeys.Menu: //ALT
							//return true to bypass defProc and signal we processed the message
							return true;
					}
					break;
				case WindowMessage.EnterSizeMove:
					//log->logMessage("WM_ENTERSIZEMOVE");
					break;
				case WindowMessage.ExitSizeMove:
					//log->logMessage("WM_EXITSIZEMOVE");
					break;
				case WindowMessage.Move:
					//log->logMessage("WM_MOVE");
					win.WindowMovedOrResized();
					WindowEventMonitor.Instance.WindowMoved( win );
					break;
				case WindowMessage.Size:
					//log->logMessage("WM_SIZE");
					//win.WindowMovedOrResized();
					WindowEventMonitor.Instance.WindowResized( win );
					break;
				case WindowMessage.GetMinMaxInfo:
					// Prevent the window from going smaller than some minimum size
					//((MINMAXINFO*)lParam)->ptMinTrackSize.x = 100;
					//((MINMAXINFO*)lParam)->ptMinTrackSize.y = 100;
					break;
				case WindowMessage.Close:
					//log->logMessage("WM_CLOSE");
					//win.Dispose();
					WindowEventMonitor.Instance.WindowClosed( win );
					return true;
			}
			return false;
		}