You additionally need Sciter32.dll.
Are the protoypes defined somewhere?
Anybody made Sciter running with PB incl. callbacks?
Thanks a lot!
Main.pb:
Code: Select all
EnableExplicit
define NrLibSciter
define FName.s
declare getWindowNrFromHandle (Handle)
declare.q PeekUI (*addr.Long)
declare PokeUI (*addr.Long, number.q)
Structure SciterRect
Left .i
Top .i
Right .i
Bottom .i
EndStructure
Prototype SciterAPIPrototype()
Prototype SciterClassNamePrototype()
Prototype SciterLoadFilePrototype(hWndSciter, *Filename) ; BOOL SCAPI SciterLoadFile (HWINDOW hWndSciter, LPCWSTR filename) { return SAPI()->SciterLoadFile (hWndSciter,filename); }
Prototype SciterProcNDPrototype(hwnd, msg, wParam, lParam, *Handled) ; LRESULT SCAPI SciterProcND (HWINDOW hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL* pbHandled)
Prototype SciterVersionPrototype(Major)
Prototype SciterWindowDelegate(hwnd, msg, wParam, lParam, pParam, *handled);
Prototype SciterCreateWindowPrototype(CreationFlags, *Frame.Rect, delegate.SciterWindowDelegate, delegateParam, parent) ; HWINDOW SCFN( SciterCreateWindow )( UINT creationFlags,LPRECT frame, SciterWindowDelegate* delegate, LPVOID delegateParam, HWINDOW parent);
Structure Sciter
PVersion .i
ClassName .SciterClassNamePrototype
Version .SciterVersionPrototype
DataReady .i
DataReadyAsync .i
Proc .i
ProcND .SciterProcNDPrototype
LoadFile .SciterLoadFilePrototype
LoadHtml .i
SetCallback .i
SetMasterCSS .i
AppendMasterCSS .i
SetCSS .i
SetMediaType .i
SetMediaVars .i
GetMinWidth .i
GetMinHeight .i
Call .i
Eval .i
UpdateWindow .i
TranslateMessage .i
SetOption .i
GetPPI .i
GetViewExpando .i
RenderD2D .i
D2DFactory .i
DWFactory .i
GraphicsCaps .i
SetHomeURL .i
CreateWindow .SciterCreateWindowPrototype
SetupDebugOutput .i
_UseElement .i
_UnuseElement .i
GetRootElement .i
GetFocusElement .i
FindElement .i
GetChildrenCount .i
GetNthChild .i
GetParentElement .i
GetElementHtmlCB .i
GetElementTextCB .i
SetElementText .i
GetAttributeCount .i
GetNthAttributeNameCB .i
GetNthAttributeValueCB .i
GetAttributeByNameCB .i
SetAttributeByName .i
ClearAttributes .i
GetElementIndex .i
GetElementType .i
GetElementTypeCB .i
GetStyleAttributeCB .i
SetStyleAttribute .i
GetElementLocation .i
ScrollToView .i
UpdateElement .i
RefreshElementArea .i
SetCapture .i
ReleaseCapture .i
GetElementHwnd .i
CombineURL .i
SelectElements .i
SelectElementsW .i
SelectParent .i
SelectParentW .i
SetElementHtml .i
GetElementUID .i
GetElementByUID .i
ShowPopup .i
ShowPopupAt .i
HidePopup .i
GetElementState .i
SetElementState .i
CreateElement .i
CloneElement .i
InsertElement .i
DetachElement .i
DeleteElement .i
SetTimer .i
DetachEventHandler .i
AttachEventHandler .i
WindowAttachEventHandler .i
WindowDetachEventHandler .i
SendEvent .i
PostEvent .i
CallBehaviorMethod .i
RequestElementData .i
HttpRequest .i
GetScrollInfo .i
SetScrollPos .i
GetElementIntrinsicWidths .i
GetElementIntrinsicHeight .i
IsElementVisible .i
IsElementEnabled .i
SortElements .i
SwapElements .i
TraverseUIEvent .i
CallScriptingMethod .i
CallScriptingFunction .i
EvalElementScript .i
AttachHwndToElement .i
ControlGetType .i
GetValue .i
SetValue .i
GetExpando .i
GetObject .i
GetElementNamespace .i
GetHighlightedElement .i
SetHighlightedElement .i
NodeAddRef .i
NodeRelease .i
NodeCastFromElement .i
NodeCastToElement .i
NodeFirstChild .i
NodeLastChild .i
NodeNextSibling .i
NodePrevSibling .i
NodeParent .i
NodeNthChild .i
NodeChildrenCount .i
NodeType .i
NodeGetText .i
NodeSetText .i
NodeInsert .i
NodeRemove .i
CreateTextNode .i
CreateCommentNode .i
ValueInit .i
ValueClear .i
ValueCompare .i
ValueCopy .i
ValueIsolate .i
ValueType .i
ValueStringData .i
ValueStringDataSet .i
ValueIntData .i
ValueIntDataSet .i
ValueInt64Data .i
ValueInt64DataSet .i
ValueFloatData .i
ValueFloatDataSet .i
ValueBinaryData .i
ValueBinaryDataSet .i
ValueElementsCount .i
ValueNthElementValue .i
ValueNthElementValueSet .i
ValueNthElementKey .i
ValueEnumElements .i
ValueSetValueToKey .i
ValueGetValueOfKey .i
ValueToString .i
ValueFromString .i
ValueInvoke .i
ValueNativeFunctorSet .i
ValueIsNativeFunctor .i
TIScriptAPI .i
GetVM .i
_v2V .i ; (HVM vm, tiscript_value script_value, VALUE* value, BOOL isolate)
_v2vV .i ; (HVM vm, const VALUE* valuev, tiscript_value* script_value)
OpenArchive .i
GetArchiveItem .i
CloseArchive .i
FireEvent .i
GetCallbackParam .i
PostCallback .i
GetSciterGraphicsAPI .i
GetSciterRequestAPI .i
CreateOnDirectXWindow .i
RenderOnDirectXWindow .i
RenderOnDirectXTexture .i
EndStructure
global *Sciter.Sciter
Procedure SciterCallback(hwnd, msg, wParam, lParam);, pParam, *handled)
Protected R
Protected bHandled .b
R = *Sciter\ProcND(hwnd, msg, wParam, lParam, @bHandled)
if bHandled
procedurereturn R
endif
select msg
case #WM_CREATE
*Sciter\LoadFile(hwnd, @"test-inputs.html");
default
endSelect
ProcedureReturn #PB_ProcessPureBasicEvents
endProcedure ; SciterCallback(hwnd, msg, wParam, lParam);, pParam, *handled)
define SciterAPI.SciterAPIPrototype
NrLibSciter = OpenLibrary(#PB_Any, "Sciter32.dll")
if NrLibSciter
SciterAPI = GetFunctionEntry(NrLibSciter, 1)
*Sciter = SciterAPI()
define *Rect.Rect = AllocateStructure(Rect)
with *Rect
\left = 16
\top = 16
\right = 16 + 480
\bottom = 16 + 320
endWith
SetWindowCallback(@SciterCallback());, NrWindow)
define NrWindow = openWindow(#PB_Any, 16, 16, 480, 320, "Test Sciter", #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
if NrWindow
repeat
define Event = WaitWindowEvent()
if Event = #PB_Event_CloseWindow
break
endif
forever
endif
else
Debug "OpenLibrary('Sciter32.dll') not successful"
endif
end
procedure getWindowNrFromHandle(Handle)
define R = GetProp_(Handle, "PB_WindowID") - 1
procedureReturn R
endProcedure
Procedure.q PeekUI(*addr.Long)
;-- Reads 4 bytes from the specified memory address,
; and returns the value as *unsigned* integer
; (minimum = 0, maximum = 4294967295).
If *addr\l < 0
ProcedureReturn *addr\l + $100000000
Else
ProcedureReturn *addr\l
EndIf
EndProcedure ; .q PeekUI(*addr.Long)
Procedure PokeUI(*addr.Long, number.q)
;-- Writes an *unsigned* integer of 4 bytes size
; to the specified memory address.
If number >= 0 And number <= $FFFFFFFF
If number > $7FFFFFFF
*addr\l = number - $100000000
Else
*addr\l = number
EndIf
EndIf
EndProcedure ; PokeUI(*addr.Long, number.q)
Code: Select all
<html>
<head>
<title>Basic set of inputs</title>
<style>
div.h-flow
{
flow:horizontal-flow;
padding:0;
border-spacing:10px;
}
div.h-flow > *
{
//display:block;
height:*;
min-height:100px;
}
select { vertical-align:baseline; }
button {
font:system;
font-rendering-mode:snap-pixel;
}
//*:focus { background:yellow; }*/
</style>
<script type="text/tiscript"></script>
</head>
<body>
<h2>Standard HTML4 inputs</h2>
<h3>Inline-block versions</h3>
select:
<select size=4>
<optgroup label="First quater">
<option>One</option>
<option selected>Two</option>
<option>Three</option>
<option>Four</option>
</optgroup>
<option>Five</option>
<option>Six</option>
<option>Seven</option>
<option>Eight</option>
<option>Nine</option>
<option>Ten</option>
<option>Eleven</option>
<option>Twelve</option>
</select>
combobox <select>
<option>One</option>
<option>Two</option>
<option>Three</option>
<option selected>Four</option>
<option>Five</option>
<option>Six</option>
<option>Seven</option>
<option>Eight</option>
<option>Nine</option>
<option>Ten</option>
<option>Eleven</option>
<option>Twelve</option>
</select>
textarea <textarea cols=40 rows=4>Sample</textarea>
edit <input type="text" value="" />
<button type="checkbox">Checkbox</button>
<button type="radio" name="rg1" checked>radio 1</button>
<button type="radio" name="rg1">radio 2</button>
<button type="radio" name="rg1">radio 3</button>
<h2>HTML5 + HSMILE inputs</h2>
<p>Date: <input type="date" value="today" />
Time: <input type="time" value="now" />
</p>
<p>input type=number:<input!number step=10 min=40 max=160/></p>
<p>input type=decimal:<input!decimal step=10 min=40 max=160/></p>
<p>Calendar: <input type="calendar" value="today" /></p>
<h2>Block versions</h2>
<div .h-flow>
<select size=4 .block>
<optgroup label="First quarter">
<option>One</option>
<option>Two</option>
<option>Three</option>
<option>Four</option>
</optgroup>
<optgroup label="Second quarter">
<option>Five</option>
<option>Six</option>
<option>Seven</option>
<option>Eight</option>
</optgroup>
<optgroup label="Third quarter">
<option>Nine</option>
<option>Ten</option>
<option>Eleven</option>
<option>Twelve</option>
</optgroup>
</select>
<textarea cols=40 rows=4>Sample</textarea>
</div>
</body>
</html>