Exemple #1
0
            /// <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</param>
            /// <param name="parent"></param>
            public IntPtr CreateWindow(SciterRectangle frame           = new SciterRectangle(),
                                       CreateWindowFlags creationFlags = DefaultCreateFlags, IntPtr?parent = null)
            {
#if DEBUG
                // Force Sciter SW_ENABLE_DEBUG in Debug build.
                creationFlags |= CreateWindowFlags.EnableDebug;
#endif

                var result = SciterApi.SciterCreateWindow(
                    creationFlags,
                    frame,
                    null,
                    IntPtr.Zero,
                    parent ?? IntPtr.Zero
                    );

                Debug.Assert(result != IntPtr.Zero);

                if (result == IntPtr.Zero)
                {
                    throw new Exception("CreateWindow() failed");
                }

                return(result);
            }
Exemple #2
0
        //public SciterWindow CreateWindow(SciterRectangle frame = new SciterRectangle(), SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags, IntPtr parent = new IntPtr())
        //public SciterWindow CreateMainWindow(int width, int height, SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags)
        //public SciterWindow CreateMainWindow(int width, int height, SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags)
        //public SciterWindow CreateOwnedWindow(IntPtr owner, int width, int height, SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags)

        /*/// <summary>
         * /// Sets the default flags of the <see cref="SciterWindow"/>
         * /// <para>Main, TitleBar, Resizeable, Controls, Glassy</para>
         * /// </summary>
         * public SciterWindowBuilder DefaultWindowFlags()
         * {
         *  _flags = DefaultCreateWindowFlags;
         *  return this;
         * }
         *
         * /// <summary>
         * /// Adds the specified <paramref name="flags"></paramref>
         * /// </summary>
         * public SciterWindowBuilder AddWindowFlags(CreateWindowFlags flags)
         * {
         *  _flags |= flags;
         *  return this;
         * }
         *
         * /// <summary>
         * /// Removes the specified <paramref name="flags"></paramref>
         * /// </summary>
         * public SciterWindowBuilder RemoveWindowFlags(CreateWindowFlags flags)
         * {
         *  _flags &= ~flags;
         *  return this;
         * }*/

        /// <summary>
        ///
        /// </summary>
        public SciterWindowBuilder AsMain()
        {
            /*			CreateWindowFlags.Main |
             *          CreateWindowFlags.Titlebar |
             *          CreateWindowFlags.Resizeable |
             *          CreateWindowFlags.Controls |
             *          CreateWindowFlags.Glassy;*/
            _flags |= CreateWindowFlags.Main | CreateWindowFlags.Titlebar | CreateWindowFlags.Controls;
            _flags &= ~CreateWindowFlags.Child;
            return(this);
        }
Exemple #3
0
 /// <summary>
 /// Make the window `Inspector Ready`
 /// </summary>
 public SciterWindowBuilder WithDebug()
 {
     _flags |= CreateWindowFlags.EnableDebug;
     return(this);
 }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 public SciterWindowBuilder WithTitlebar()
 {
     _flags |= CreateWindowFlags.Titlebar;
     return(this);
 }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 public SciterWindowBuilder AsResizeable()
 {
     _flags |= CreateWindowFlags.Resizeable;
     return(this);
 }
Exemple #6
0
 /// <summary>
 ///
 /// </summary>
 public SciterWindowBuilder WithControls()
 {
     _flags |= CreateWindowFlags.Controls;
     return(this);
 }
Exemple #7
0
 /// <summary>
 ///
 /// </summary>
 public SciterWindowBuilder WithGlassy()
 {
     _flags |= CreateWindowFlags.Glassy;
     return(this);
 }
Exemple #8
0
 /// <summary>
 ///
 /// </summary>
 public SciterWindowBuilder AsChild()
 {
     _flags |= CreateWindowFlags.Child | CreateWindowFlags.Titlebar | CreateWindowFlags.Controls;
     _flags &= ~CreateWindowFlags.Main;
     return(this);
 }