Quantcast
Channel: Terra Informatica Forums - Sciter
Viewing all 617 articles
Browse latest View live

print's bugs (1 reply)

$
0
0
Hi, Andrew:
Sciter 3.3 has some problems with pager-demo.htm:
1. pager.selectPrinter() will lead to preview page into a blank page.
2. pager can not render the national chars in printed document.

Date parser (1 reply)

$
0
0
Hi Andrew,

The Date.parse method doesn't seem to work when milliseconds are specified using the ISO 8601 standard.

e.g.

Date.parse("2015-07-21T11:00:00.0Z") doesn't work but Date.parse("2015-07-21T11:00:00Z") does

SHCreateItemFromParsingName is not present in windows XP (1 reply)

$
0
0
In the new build (3.3.0.0) you use the SHCreateItemFromParsingName function that is not present in Windows XP SP3. Could you fix that?

String.strcmp() (1 reply)

$
0
0
Can the function strcmp() be added to the String class?
That is, a function that compares two string and return -1, 0 or 1 depending of the comparison result..

What`s the "$" mean? (1 reply)

$
0
0
i am a newer, and please tell me what the $ mean in the blow code:
$(ul.items).$append(<li><button type="checkbox">12333</button></li>);

first $()
next single $

thanks a lot

newbie question about sqlite example (1 reply)

$
0
0
Hi,

I've downloaded sdk package but I'm unable to run sqlite example.
I hit test button but nothing happens.
It is my fault ?

Thank you,
Alessio

How to evaluate a pre-compiled script (1 reply)

$
0
0
I have some pre-compiled scripts compiled with tiscript.exe tool and I want to evaluate them in my tiscript code.
But if I read the file in a <bytes> type variable I can't pass it to 'eval' function because it works only with strings.
On the other hand I cal evaluate such scripts using the 'include' command like:
include "file_path"
But the 'include' takes only a pre-defined strings and can't work with variables like :
include path
where path is a <string> type variable.

suspicious assert in debug version of sciter32.dll (1 reply)

$
0
0
I used the debug version of sciter32.dll and I have an assert when trying to download a file using http.download(...).
The assert:
file: f:\andromeda\stable-real\engine\xdom\xview.cpp
Line: 61
Expression: false

If I ignore it all works fine.

How to select combo opiton by index (1 reply)

$
0
0
in my project, i need to select combo`s item by index, i know a method can do that in c++ side:(pElmParent is the combo element)
struct SelectCallback :public sciter::dom::callback
{
public:
	virtual bool on_element(HELEMENT he)
	{
		sciter::dom::element elm(he);
		if (elm.index()==selIndex)
		{
			pElmParent->set_value(elm.text());
		}
		
		return false;
	}
	int selIndex;
	sciter::dom::element *pElmParent;
};

void CSciterDialog::SetSelectIndex(sciter::dom::element *pElmParent, int index)
{
	if (pElmParent)
	{
		SelectCallback cb;
		cb.selIndex = index;
		cb.pElmParent = pElmParent;
		pElmParent->select_elements(&cb, "option");
	}
}


i think that should be a better way.

Unable to get the number of tiscript function arguments in native code (1 reply)

$
0
0
TISCRIPT CODE:
var foo = function(p1, p2, p3) { };
view.bar(foo);
stdout.println(foo.length);


NATIVE CODE:
function bar(sciter::value &foo) {
    std::cout << foo.length() << std::endl;
}


The Tiscript output is '3' and the native code output is '0'.

how to create NATIVE_FUNCTOR_VALUE in c ? (4 replies)

$
0
0
the value.hpp header using

class native_function: public NATIVE_FUNCTOR_VALUE


to define a scripting functor value

but how to do it in c?

in class native_function there is only one member of class native_function
typedef std::function<value(unsigned int argc, const value* argv)> native_function_t;
native_function_t func; // this is a c++ 11 template function

I guess the funcor prototype should be:
VAULE functor(int argc, VALUE* argv)

But how to pass this prototype to ValueNativeFunctorSet ? I havn't found a way to do ValueNativeFunctorSet in c , could you help me ?

Event target element (1 reply)

$
0
0
Hi.

Just starting to use Sciter and I have a newbie question. How can I use event target element with q? My code is not working :(

self.on("click", ".test-element", function(e) {
    q(e.target).parent().addClass("active").siblings().removeClass("active");
    // q(this) is not working either
});

Thx in advance...

Translate tiscript to c++ code. (3 replies)

$
0
0
For some reason, i want translate vgrid.tis to c++ class.
the script below is come from vgrid.tis, and how can i translate it to c++ code?
var me = this;
this.sb.onScroll = function(evt) { return me.onScroll(evt); } // delegate scrollbar.onScroll to this.onScroll

i think this question maybe confused, some pseudo code will be welcome.
i have a solusion is that make a class classA, and classA inherit from sciter::event_handler, then attach classA to scrollbar element, and when classA got "onscroll" message, just post the "onscroll" message to parent class.(me).
but, the above mehtod sound very complex.

Sciter folder with file selected (1 reply)

$
0
0
It's possible to use
Sciter.launch("C:\some-folder");
to open a folder from Sciter.

Is it possible to open a folder with some file/files selected in it using Sciter?

It's possible to do using winapi:
ShellExecute(0, nil, 'explorer.exe', '/select,C:\WINDOWS\explorer.exe', nil,
  SW_SHOWNORMAL)

In Linux it's not allowed at all as far as I remember (no system api call to select file when you open a folder)

And I'm not sure about Mac.

But is possible to do "show in a folder" with Sciter without going to native system API, if not, maybe there are some workarounds?

Thank you!

what's the meaning of SciterVersion returned value? (1 reply)

$
0
0
Using SDK version 3.2.0.9 SciterVersion(TRUE) returns 196610 SciterVersion(FALSE) returns 9,

What's the meaning of these numbers and how are they relates to 3.2.0.9 ?

Thanks in advance :)

Context menu - get item on which context menu has been called (1 reply)

$
0
0
There is a simple HTML page with one context menu applied to every option in select - [pastebin.com]

When the context menu item "Action 1" is called "this" (line #37) points to HTML element of menu "<li#action1>"

How to get the actual option on which the context menu has been called?

Something like "<option#element-39>" instead of "<li#action1>" is needed.

Options are added to select dynamically during runtime.


In the case of external link being broken, here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[www.w3.org];
<html xmlns="[www.w3.org];
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Untitled Document</title>
 
        <style>
 
                select { display:block; }
 
                .element {
                        context-menu: selector(menu#element-context);
                        margin: 3px;
                }
 
                #elements {
                        height: *;
                        width: *;
                        background-color: #c0c0c0;
                        overflow-y:auto;
                }
 
               
        </style>
 
        <script type="text/tiscript">
 
              var elements = $( #elements );
              for (var i = 1; i < 40; i++) {
                elements.$prepend ( <option id="element-{i}" value="eleent-{i}" class="element">
                                                Element {i}
                                                </option>);
              };
 
              $(#element-context #action1).onClick = function()
              {
                stdout.println(this);
              }
             
            </script>
 
    </head>
   
    <body>
 
      <select type="select" id="elements" name="elements" multiple>
      </select>
 
          <popup>
                  <menu.context id="element-context">
                    <li id="action1">Action 1</li>
                    <li id="action2">Action 2</li>
                    <li id="action3">Action 3</li>
                  </menu>
          </popup>
 
    </body>
 
</html>

Hidden layered window (3 replies)

$
0
0
Hi Andrew,

when I use ShowWindow(hWnd, SW_HIDE) to hide Sciter window created with WS_EX_LAYERED Sciter starts receiving one message. Since message number differs every run and is in range documentation states for RegisterWindowMessage it probably is some registered message. Examining call stack shows it has something to do with drawing. One example where sciter32.dll is loaded at 0x0d100000):

 	gdi32.dll!_NtGdiBitBlt@44?()	Unknown
 	gdi32.dll!_BitBlt@36?()	Unknown
 	d2d1.dll!DCRenderTargetHelper::InitFromDC(void)	Unknown
 	d2d1.dll!CHWDCRenderTarget::BeginDrawInternal(void)	Unknown
 	d2d1.dll!DrawingContext::BeginDraw(void)	Unknown
 	d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext>::BeginDraw(void)	Unknown
 	sciter32.dll!0d114185()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for sciter32.dll]	
 	sciter32.dll!0d123c2e()	Unknown
 	...

It is same when I create window myself using SciterClassName(...) or by using SciterCreateWindow(SW_ALPHA...).

Martin

Private fonts (3 replies)

$
0
0
Hi Andrew,

is it possible to use font loaded using
AddFontResourceEx(pFilename, FR_PRIVATE | FR_NOT_ENUM, 0);
in Sciter? We are using it in common GDI calls like CreateFontIndirect(pFontname, ...).

Martin

AJAX with Sciter. (1 reply)

$
0
0
Hi,

Could you please explain me how AJAX works with Sciter.

Thanks and Regards,
Shreyas.

MD5 check on file downloading (1 reply)

$
0
0
In your file downloading example (/samples/communacation/file-download.html) you check md5 in the on_success callback
function onsuccess(md5) {
    progress.attributes["hidden"] = true;
    if(md5)
        out.text = String.printf("done");
     else
        out.text = "error writing file";
}

What exactly the 'md5' variable mean in that context? Is it a boolean flag thar tells you if MD5 checksum of the downloaded data match the checksum of the file written to the disk?
Viewing all 617 articles
Browse latest View live