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

problem with reloading (4 replies)

$
0
0
I am trying to implement a F5-type reload for an online application. When I get the F5 I reload the URL from the server

::SciterLoadFile(hwnd, L"http:// dkiosk/index.html");

It works on startup, then when I hit F5 I get none of the css or script files reloaded (or executed). I am also calling DeleteUrlCacheEntryW(pns->uri) in SC_DATA_LOAD to kill the cache and make sure we pull new data.

debug output from SC_DATA_LOADED

reloading html
loaded http:// dkiosk/index.html with size 342, status 0
loaded http:// dkiosk/scripts/main.tis with size 4467, status 0
loaded http:// dkiosk/css/reset.css with size 729, status 0
loaded http:// dkiosk/scripts/main.tis with size 0, status 0
loaded http:// dkiosk/css/main.css with size 433, status 0
loaded http:// dkiosk/images/background.jpg with size 42076, status 0
reloading html
loaded http:// dkiosk/index.html with size 342, status 0
loaded http:// dkiosk/scripts/main.tis with size 0, status 0
loaded http:// dkiosk/css/reset.css with size 0, status 0
loaded http:// dkiosk/css/main.css with size 0, status 0
loaded http:// dkiosk/scripts/main.tis with size 0, status 0

cookies (3 replies)

$
0
0
Is there a way to set a cookie from tiscript?

absolute images (1 reply)

$
0
0
There seems to be something wrong with absolute images on the right.

<html>
<body>
    <img src="logo.png" style="position: absolute; left: 0; top: 0; width: 200px">
    <img src="logo.png" style="position: absolute; right: 0; top: 0; width: 200px">
    <img src="logo.png" style="position: absolute; left: 0; bottom: 0; width: 200px">
    <img src="logo.png" style="position: absolute; right: 0; bottom: 0; width: 200px">
</body>
</html>

popover tooltips (1 reply)

$
0
0
I want to use the element.popover() script feature to create popovers that are tooltips when the user hovers the mouse in a button.

However, I think popovers have a hardcoded implementation that makes them disapear when the user clicks anywhere in the page, so when user clicks the button, the tooltip disappear, which is not a desired behavior...

<html>

<head>
	<style>
	#tooltip
	{
		background: silver;
		border: solid 1px black;
	}
	</style>
	
	<script type="text/tiscript">
		$(button).onMouse = function(e)
		{
			if(e.type==Event.MOUSE_ENTER)
				this.popup(self#tooltip, 8);
			else if(e.type==Event.MOUSE_LEAVE)
				self#tooltip.closePopup();
		};
	</script>
</head>


<body>
	<button>Hover and then click me!</button>
	<popover #tooltip>Tooltip of the button</popover>
</body>

</html>
I think the implementation should have an optional flag to turn on/off this behavior

parse query string method (3 replies)

$
0
0
Sciter has a function crackUrl that parses a url into it's parts. Is there an builtin equivalent to parseQuery, which will parse a query string into an object?

var result = URI.parseQuery("foo=bar&hello=world&hello=mars&bam=&yup");
result === {
  foo: "bar",
  hello: ["world", "mars"],
  bam: "",
  yup: null
};

websocket ping/pongs (7 replies)

$
0
0
We use websockets extensively for our app, and taking the sample provided in the SDK things sort of work. Does the websocket implementation correctly handle returning pongs when the server sends a ping message? Our server has a ping/pong sweep every 1 minute and every time it hits sciter, it disconnects for failure to receive a pong response.

Is this something I'm supposed to handle in-script (like the polling loop) with a onPing event or something or is this something that is supposed to happen behind the scenes and it's just not implemented?

Organization Question (3 replies)

$
0
0
Hello. I'm working on a program for drawing (line-art specifically), and I'd like to switch to using Sciter. I have a couple of questions about organization before I dig into the code. Have a look at this screenshot (no sciter yet):



Currently the main window (which contains the menu bar and the toolbar) is also a DX9 window (the canvas). I'd like to switch to using sciter for everything except the DX9 canvas.

My question is: would it be better to have one sciter engine for the main window, and implement all the other floating windows (tool settings, toolbar, brush resizer... etc) as popup divs, or would it be better to keep the windows separate from the main html document? In other words, a separate HTML document per window, or a single HTML document with multiple popups?

Also, I will be using a pie menu that will popup over the canvas when the user right-clicks with the mouse. What's the best way to achieve that using Sciter, keeping in mind that the window underneath is not a sciter document but instead a DX9 canvas?

Thanks in advance!

How to use LOAD_DELAYED? (1 reply)

$
0
0
Hello.

I'm trying to handle SC_LOAD_DATA request to load external images from the web by myself instead of allowing Sciter to do that for me. To achieve that I am returning LOAD_DELAYED code from SC_LOAD_DATA handler but Sciter still loading data on its own. What may be wrong?

Resource heavy timeline.tis (5 replies)

$
0
0
Hello,

I've noticed that with the latest version of Sciter 3.1.0.11 the samples/animations sample is very resource heavy. In my application simple animations are slowing down our entire software. I'm guessing has something to do with the fix in 3.1.0.9 for smoother animations on windows. In timeline.tis I've changed the following to set some limit on the frame rate when using this sample.

  function advance(toTime) 
  {
      if( this._state == #cancel )
           return false;
      this._time = toTime;
      var localtime = toTime - this.startTime;
                  
      if( localtime < 0.0 )
         return 30; // some set frame rate
 //      return true; // not started yet
      if( localtime >= this.duration ) {
         if(this.state != #complete) {
              this.render( .9999999 ); //1.0 is not included
              this.state = #complete;
          }
         return false; // finished
      }
      var progress = // 0.0 .. 1.0
      localtime / this.duration;
      this.state = #active;                    
      this.render( progress );
      return 30; // some set frame rate
//      return true; // is active
   }

Anyone else have similar issues ?
Thought I'd share if anyone else has similar problems.

Context Menus and Master CSS (3 replies)

$
0
0
Hi. I'm working on a project and using Sciter for the first time. So I have a couple of questions, and I will probably have more questions as I continue working on the project. Would the mod prefer that I create a separate thread for each question or just ask all questions here?

1: My application has a floating toolbar window. What is the best way to resize the window so that it displays all the buttons in a single row? The window is not resizable by the user. In other words, how to resize the view to fit the contents of the view?

2: The context menu samples in the SDK have this in the css:
.with-context-menu
    {
      context-menu: selector(menu#context);
    }

I tried to find in the documentation more information about the context-menu css property, but I can't find anything for Sciter. What other special css properties that Sciter supports? Also, the popup tag seems to have a hidden display type in sciter's master css, but I can't find any information about this master css which sciter uses.

About the select folder (no replies)

$
0
0
I use Sciter3, did not provide selected folder path label,
I look at the examples are not found,
thank you

About the select path (no replies)

$
0
0
I use Sciter3, did not provide selected folder path label,
I look at the examples are not found,
thank you

bug report:sciter 3.1.0.15 (1 reply)

$
0
0
OS:XP SP3 VS2010
1. get_ctl_type() return the wrong CTL_TYPE with checkbox and radio
in file sciter-x-dom.hpp:
CTL_TYPE get_ctl_type() const
    {
      UINT t = 0;
      SCDOM_RESULT r = ::SciterControlGetType(he,&t);
      assert(r == SCDOM_OK); r;
      return CTL_TYPE(t);
    }


<button type="checkbox" id="btn1"></button>
<button type="radio" id="btn2"></button>

sciter::dom::element el = root.get_element_by_id("btn1");
CTL_TYPE t = el.get_ctl_type();//the t = CTL_RADIO
ASSERT(t == CTL_CHECKBOX);

el = root.get_element_by_id("btn2");
CTL_TYPE t = el.get_ctl_type();//the t= CTL_SELECT_SINGLE
ASSERT(t == CTL_RADIO);

2.theme images
most of theme images are not exist,eg. column-header-normal,toolbar-h-splitter...

sciter 3.1.0.16 crash (1 reply)

$
0
0
sciter 3.1.0.16 crashed on copy/paste

- run sciter.exe
- open sample samples\richtext\richtext.htm
- select text and copy it to clipboard
- sciter crashed

Color Chooser (3 replies)

$
0
0
Hi. Is there a ready-to-use color chooser in sciter or do I have to implement it myself? There are old articles on the site that mention a color chooser in samples/tests/basic, but currently there is nothing there. Thanks.

uminimal questions (3 replies)

$
0
0
Hi. In the uminimal demo application, this code is in main.html:

 !function(){
        if( !view.api )
          View.api = view.nativeApi(); // getting API and assigning it to global View.api veriable seen by all windows
      }();

First, what does the '!' mean in the first line?
Second, is 'View.varName' different from 'view.varName'? Is 'View' like a variable for all 'view's?
Thanks!

sciter::vfunc must return a value? (1 reply)

$
0
0
//C++
bool nativeFunc1() { /*...*/ return true; }
void nativeFunc2() { /*...*/ }

sciter::value v; v.set_item( sciter::value( "funcName"), sciter::vfunc( nativeFunc1 ) ); // compiles
sciter::value v; v.set_item( sciter::value( "funcName"), sciter::vfunc( nativeFunc2 ) ); // doesn't compile

Is this a bug?

bug!jpg find a error,but png is well! (4 replies)

$
0
0
HI,Andrew:
I try to test the demo plain-win with sciter3.1.0.18.
first,I load a htm file.here is test.htm.Note that background-image's format is jpg.
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
             #testImg
        {
            width:200px; height:200px;
            background-image:url(photo.jpg);    
        }
    </style>
</head>
<body>
    <div id="testImg"/>
</body>
</html>
second,I create a member dom::element for the root,just like this.
class window: public sciter::host<window>
{
  HWND _hwnd;
  dom::element m_elem;
..................................
...................................
}
//..........................
bool window::init()
{
   SetWindowLongPtr(_hwnd, GWLP_USERDATA, LONG_PTR(this));
   setup_callback();
   load_file(L"test.htm");

   m_elem=dom::element(get_root());
   //sciter::inspect(_hwnd);
   return true;
}
third,I run it under the VS2010 debugging.when I closed the window,A dom::element error occurred at method unuse().
under the file sciter-x-api.h
  class element
  {

  protected:
    HELEMENT he;

    void use(HELEMENT h) { he = ( Sciter_UseElement(h) == SCDOM_OK)? h: 0; }
    void unuse() { if(he) Sciter_UnuseElement(he); he = 0; }     <<========ERROR OCCURED
    void set(HELEMENT h) { unuse(); use(h); }
Then I make test in different img.I find that jpg and bmp will lead to the error,but png is well.
I,m so confused about this question.

Stock Resources (2 replies)

$
0
0
Hello again. I've come across this in a css file in the SDK:
foreground-image:url(stock:arrow-right);

What are the available stock images/glyphs that can be used in css?

Free license question (4 replies)

$
0
0
Hi! I read about license information, but i can't understand, can i use sciter 3 for free(all version mac + win + gtk?(it's not released yet ?)). Thanks, i love your products! Its amazing!
Viewing all 617 articles
Browse latest View live


Latest Images