da-baranov / SciDe

Sciter component for Delphi
76 stars 26 forks source link

SetOptions #6

Closed Mikanoshi closed 8 years ago

Mikanoshi commented 8 years ago

SciterSetOption doesn't seem to be working, This doesn't disable smooth scrolling: SetOption(SCITER_SMOOTH_SCROLL, UINT_PTR(False)); I also want to attach inspector, is it SCITER_SET_DEBUG_MODE = 1?

Delphi 10, SciDe for Sciter 3.2.0.7

da-baranov commented 8 years ago

There is a missing check within TSciter.SetOption procedure. It should be:

procedure TSciter.SetOption(const Key: SCITER_RT_OPTIONS; const Value: UINT_PTR); begin if not API.SciterSetOption(Handle, Key, Value) then raise ESciterException.Create('Failed to set Sciter option'); end;

if API.SciterSetOption returns TRUE then it's definitely a Sciter internal issue.

Mikanoshi commented 8 years ago

SetOption is working now after I updated to 3.3.0.6, I'm able to use Inspector.exe. But still cannot disable smooth scrolling (added check, exception is not raised). I only wanted to disable smooth scrolling to make sure SetOption works though))

gxlmyacc commented 8 years ago

try this css property: scroll-manner:inherit ( default value ). This allows to define scroll manner for all scrollables in the document in single place. To disable animated scroll in all scrollables inside the document use this: html { scroll-manner: scroll-manner(animation:false); }

Mikanoshi commented 8 years ago

@gxlmyacc Yes, it's working. But what I really need is inspector.exe debugging, SCITER_SET_DEBUG_MODE does nothing in 3.2. I hope someone can make Sciter 3.3 work in Delphi, because debugging scripts with inspector is a lot easier.

gxlmyacc commented 8 years ago

see this code: function TDebugOutput.Inspect(const root: IDomElement; const IP: WideString): Boolean; var sScript: WideString; sInspectorFile: string; begin sInspectorFile := ExtractFilePath(GetModuleName(SysInit.HInstance)) + 'inspector.exe'; if FileExists(sInspectorFile) and (not InspectorIsPresent) then ShellExecuteA(0, 'open', PChar(sInspectorFile), '', PChar(ExtractFilePath(GetModuleName(SysInit.HInstance))), SW_SHOWNORMAL);

sScript := 'if (view.connectToInspector )' + sLineBreak; if IP = EmptyStr then sScript := sScript + Format('view.connectToInspector($(%s))', [root.UniqueSelector]) else sScript := sScript + Format('view.connectToInspector($(%s), "%s")', [root.UniqueSelector, IP]); root.Eval(sScript); Result := True; end;