C# Class SciterSharp.SciterWindow

Inheritance: System.Windows.Forms.IWin32Window
ファイルを表示 Open project: MISoftware/SciterSharp Class Usage Examples

Protected Properties

Property Type Description
_api SciterSharp.Interop.SciterX.ISciterAPI

Public Methods

Method Description
CallFunction ( string name ) : SciterValue
CenterTopLevelWindow ( ) : void

Centers the window in the screen. You must call it after the window is created, but before it is shown to avoid flickering

Close ( ) : void

Close the window. Posts WM_CLOSE message on Windows.

CreateChildWindow ( IntPtr hwnd_parent ) : void

Create an owned top-level Sciter window

CreateMainWindow ( int width, int height, SciterXDef creationFlags = DefaultCreateFlags ) : void
CreateOwnedWindow ( IntPtr owner, int width, int height, SciterXDef creationFlags = DefaultCreateFlags ) : void
CreateWindow ( PInvokeUtils frame = newPInvokeUtils.RECT(), SciterXDef creationFlags = DefaultCreateFlags, IntPtr parent = newIntPtr() ) : void

Creates the Sciter window and returns the native handle

Destroy ( ) : void
ElementAtPoint ( int x, int y ) : SciterElement

Find element at point x/y of the window, client area relative

ElementByUID ( uint uid ) : SciterElement

Searches this windows DOM tree for element with the given UID

EvalScript ( string script ) : SciterValue
GetMinHeight ( uint for_width ) : uint
GetMinWidth ( ) : uint
GetPrimaryMonitorScreenSize ( ) : PInvokeUtils.SIZE

Cross-platform handy method to get the size of the screen

LoadHtml ( string html, string baseUrl = null ) : bool

Loads HTML input from a string

LoadPage ( string url_or_filepath ) : bool

Loads the page resource from the given URL or file path

SciterWindow ( ) : System
SetMediaType ( string mediaType ) : bool

For example media type can be "handheld", "projection", "screen", "screen-hires", etc. By default sciter window has "screen" media type. Media type name is used while loading and parsing style sheets in the engine so you should call this function* before* loading document in it.

SetMediaVars ( SciterValue mediaVars ) : bool

For example media type can be "handheld:true", "projection:true", "screen:true", etc. By default sciter window has "screen:true" and "desktop:true"/"handheld:true" media variables. Media variables can be changed in runtime. This will cause styles of the document to be reset.

SetSciterOption ( SciterXDef option, IntPtr value ) : bool
Show ( bool show = true ) : void
ShowModal ( ) : void
UpdateWindow ( ) : bool

Update pending changes in Sciter window and forces painting if necessary

Protected Methods

Method Description
ProcessWindowMessage ( IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam, IntPtr &lResult ) : bool

Private Methods

Method Description
InternalProcessSciterWindowMessage ( IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam, IntPtr pParam, bool &handled ) : IntPtr

Method Details

CallFunction() public method

public CallFunction ( string name ) : SciterValue
name string
return SciterValue

CenterTopLevelWindow() public method

Centers the window in the screen. You must call it after the window is created, but before it is shown to avoid flickering
public CenterTopLevelWindow ( ) : void
return void

Close() public method

Close the window. Posts WM_CLOSE message on Windows.
public Close ( ) : void
return void

CreateChildWindow() public method

Create an owned top-level Sciter window
public CreateChildWindow ( IntPtr hwnd_parent ) : void
hwnd_parent System.IntPtr
return void

CreateMainWindow() public method

public CreateMainWindow ( int width, int height, SciterXDef creationFlags = DefaultCreateFlags ) : void
width int
height int
creationFlags SciterSharp.Interop.SciterXDef
return void

CreateOwnedWindow() public method

public CreateOwnedWindow ( IntPtr owner, int width, int height, SciterXDef creationFlags = DefaultCreateFlags ) : void
owner System.IntPtr
width int
height int
creationFlags SciterSharp.Interop.SciterXDef
return void

CreateWindow() public method

Creates the Sciter window and returns the native handle
public CreateWindow ( PInvokeUtils frame = newPInvokeUtils.RECT(), SciterXDef creationFlags = DefaultCreateFlags, IntPtr parent = newIntPtr() ) : void
frame SciterSharp.Interop.PInvokeUtils Rectangle of the window
creationFlags SciterSharp.Interop.SciterXDef Flags for the window creation, defaults to SW_MAIN | SW_TITLEBAR | SW_RESIZEABLE | SW_CONTROLS | SW_ENABLE_DEBUG
parent System.IntPtr
return void

Destroy() public method

public Destroy ( ) : void
return void

ElementAtPoint() public method

Find element at point x/y of the window, client area relative
public ElementAtPoint ( int x, int y ) : SciterElement
x int
y int
return SciterElement

ElementByUID() public method

Searches this windows DOM tree for element with the given UID
public ElementByUID ( uint uid ) : SciterElement
uid uint
return SciterElement

EvalScript() public method

public EvalScript ( string script ) : SciterValue
script string
return SciterValue

GetMinHeight() public method

public GetMinHeight ( uint for_width ) : uint
for_width uint
return uint

GetMinWidth() public method

public GetMinWidth ( ) : uint
return uint

GetPrimaryMonitorScreenSize() public static method

Cross-platform handy method to get the size of the screen
public static GetPrimaryMonitorScreenSize ( ) : PInvokeUtils.SIZE
return SciterSharp.Interop.PInvokeUtils.SIZE

LoadHtml() public method

Loads HTML input from a string
public LoadHtml ( string html, string baseUrl = null ) : bool
html string HTML of the page to be loaded
baseUrl string Base Url given to the loaded page
return bool

LoadPage() public method

Loads the page resource from the given URL or file path
public LoadPage ( string url_or_filepath ) : bool
url_or_filepath string URL or file path of the page
return bool

ProcessWindowMessage() protected method

protected ProcessWindowMessage ( IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam, IntPtr &lResult ) : bool
hwnd System.IntPtr
msg uint
wParam System.IntPtr
lParam System.IntPtr
lResult System.IntPtr
return bool

SciterWindow() public method

public SciterWindow ( ) : System
return System

SetMediaType() public method

For example media type can be "handheld", "projection", "screen", "screen-hires", etc. By default sciter window has "screen" media type. Media type name is used while loading and parsing style sheets in the engine so you should call this function* before* loading document in it.
public SetMediaType ( string mediaType ) : bool
mediaType string
return bool

SetMediaVars() public method

For example media type can be "handheld:true", "projection:true", "screen:true", etc. By default sciter window has "screen:true" and "desktop:true"/"handheld:true" media variables. Media variables can be changed in runtime. This will cause styles of the document to be reset.
public SetMediaVars ( SciterValue mediaVars ) : bool
mediaVars SciterValue Map that contains name/value pairs - media variables to be set
return bool

SetSciterOption() public method

public SetSciterOption ( SciterXDef option, IntPtr value ) : bool
option SciterSharp.Interop.SciterXDef
value System.IntPtr
return bool

Show() public method

public Show ( bool show = true ) : void
show bool
return void

ShowModal() public method

public ShowModal ( ) : void
return void

UpdateWindow() public method

Update pending changes in Sciter window and forces painting if necessary
public UpdateWindow ( ) : bool
return bool

Property Details

_api protected_oe static_oe property

protected static SciterX.ISciterAPI,SciterSharp.Interop _api
return SciterSharp.Interop.SciterX.ISciterAPI