public void CreateOwnedWindow(IntPtr owner, int width, int height, SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags) { PInvokeUtils.RECT frame = new PInvokeUtils.RECT(); frame.right = width; frame.bottom = height; CreateWindow(frame, creationFlags, owner); }
/* * /// <summary> * /// Create an owned top-level Sciter window * /// </summary> * /// <param name="width"></param> * /// <param name="height"></param> * /// <param name="owner_hwnd"></param> * public void CreatePopupAlphaWindow(int width, int height, IntPtr owner_hwnd) * { * PInvokeUtils.RECT frame = new PInvokeUtils.RECT(); * frame.right = width; * frame.bottom = height; * CreateWindow(frame, SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ALPHA | SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_TOOL, owner_hwnd); * // Sciter BUG: window comes with WM_EX_APPWINDOW style * }*/ #if WINDOWS public void CreateChildWindow(IntPtr hwnd_parent, SciterXDef.SCITER_CREATE_WINDOW_FLAGS flags = SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_CHILD) { if (PInvokeWindows.IsWindow(hwnd_parent) == false) { throw new ArgumentException("Invalid parent window"); } PInvokeUtils.RECT frame; PInvokeWindows.GetClientRect(hwnd_parent, out frame); #if true string wndclass = Marshal.PtrToStringUni(_api.SciterClassName()); _hwnd = PInvokeWindows.CreateWindowEx(0, wndclass, null, PInvokeWindows.WS_CHILD, 0, 0, frame.right, frame.bottom, hwnd_parent, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); //SetSciterOption(SciterXDef.SCITER_RT_OPTIONS.SCITER_SET_DEBUG_MODE, new IntPtr(1));// NO, user should opt for it #else _hwnd = _api.SciterCreateWindow(flags, ref frame, _proc, IntPtr.Zero, hwnd_parent); #endif if (_hwnd == IntPtr.Zero) { throw new Exception("CreateChildWindow() failed"); } }
/// <summary> /// Creates the Sciter window and returns the native handle /// </summary> /// <param name="frame">Rectangle of the window</param> /// <param name="creationFlags">Flags for the window creation, defaults to SW_MAIN | SW_TITLEBAR | SW_RESIZEABLE | SW_CONTROLS | SW_ENABLE_DEBUG</param> public void CreateWindow(PInvokeUtils.RECT frame = new PInvokeUtils.RECT(), SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags, IntPtr parent = new IntPtr()) { _hwnd = _api.SciterCreateWindow( creationFlags, ref frame, _proc, IntPtr.Zero, parent ); Debug.Assert(_hwnd != IntPtr.Zero); if (_hwnd == IntPtr.Zero) { throw new Exception("CreateWindow() failed"); } #if GTKMONO _gtkwindow = PInvokeGTK.gtk_widget_get_toplevel(_hwnd); Debug.Assert(_gtkwindow != IntPtr.Zero); #elif OSX _nsview = new NSView(_hwnd); #endif }