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

Toggle button (2 replies)

$
0
0
Hi,

I want to create a toggle button(on-off button). I have seen all the sample codes from sdk. There the code has been implemented using css only, no TIScript has been used.

Could you please guide me and let me know how do I achieve the toggle functionality on a click event? I also need to ge the state of the button whether on or off - in a variable.

Thanks and Regards

how to distinguish "Enter" and "Ctrl+Enter" at 'richtext' (1 reply)

$
0
0
HTML:base on "sciter-sdk-3\samples\richtext\richtext.htm" and "sciter-sdk-3\samples\+plus\plus.tis plus.css"

<html>
  <head>
    <title>Richtext sample</title>
    <style>
	  @import url(../plus.css);
      @import url(richtext.css);
      body { margin:0;}
      plaintext { font-family:monospace; overflow:scroll-indicator; white-space:pre-wrap; }
      
    </style>
    <script type="text/tiscript">
    
    !function() {
    
      var richtext = $(richtext);
      var plaintext = $(plaintext);
            
      richtext.on("change", function() {
        plaintext.text = this.source;
      });
      
    
    }();
    
	  include "../plus.tis"; // we use @observing so need to include plus.tis upfront.  
      namespace Todo // our model
      {  
		  function ChatMessageSendTo(el){
			stdout.println("ChatMessageSendTo:",el.@["id"]);			
		}
      }
    </script>
  </head>
<body model="Todo">
  <frameset cols="*,*" enter="ChatMessageSendTo(this)" id="testEnterAction">
  <richtext>
    <h1>behavior:richtext</h1>
    <p>Image editing is driven by <code>class EditableImage</code> from richtext-utils.tis</p>
    <p><img src="../graphics/last-diligence-from-gabriola.jpg" width="200" >image test</p>
    <p>Table in editing mode contains additional caret positions at start and end of each row to insert new rows while typing.</p>
    <table>
      <tr><td>First cell</td><td rowspan=2>Second cell</td></tr>
      <tr><td>Third cell</td></tr>
      <tr><td>Fourth cell</td><td>Fifth cell</td></tr>
    </table>
    
    <p>Test of input handling inside editing environment <input type="text" value="non editable"></p>
    <p>Note: <em style="color:red">Not finished, work in progress!</em></p>
  </richtext>
  <splitter/>
  <plaintext></plaintext>
  </frameset>
</body>
</html>

I want to use keybord “Ctrl+Enter” to flip-flop "function ChatMessageSendTo(el)",this is normal working,this is what I want.

but when I edit "richtext" elment use "Enter" key to line feed,But at the same time flip-flop "function ChatMessageSendTo(el)",this is not what I want! how can I avoid this happened,
need you advice,thanks!

request 302 redirect trouble (1 reply)

$
0
0
Hi!
Sciter have problem with 302 rederict. Url params are missed.


<?php
header("Location: [www.google.ru];);
exit;
?>


The code above will send us to http: //www.google.ru/search not a http ://www.google.ru/search?q=test

initial the richtext's content is null,then Can't find the cursor (1 reply)

$
0
0
html: (base on "sciter-sdk-3\samples\richtext")

<html>
  <head>
    <title>Richtext sample</title>
    <style>
      @import url(richtext.css);
      body { margin:0;}
      plaintext { font-family:monospace; overflow:scroll-indicator; white-space:pre-wrap; }
      
    </style>
    <script type="text/tiscript">
    
    !function() {
    
      var richtext = $(richtext);
      var plaintext = $(plaintext);
      
      richtext.on("change", function() {
        plaintext.text = this.source;
      });
      
    
    }();
    
    
    </script>
  </head>
<body>
  <frameset cols="*,*">
  <richtext>
  
  </richtext>
  <splitter/>
  <plaintext></plaintext>
  </frameset>
</body>
</html>


if I initial the richtext's content is null,then Can't find the cursor,When I enter the letters,I view the "sciter dom inspector",
<richtext>
   <toolbar>...<toolbar>
    "what are you doing!"
   <htmlarea></htmlarea>
</richtext>


I find it is not in the 'htmlarea' !
(ps:My input is 'what are you doing')

how do I use a simple way to find the child element? (1 reply)

$
0
0
html:
<richtext #IDRecordList>
     <div cookie="801">
            <div .clDivHeadimg><img src="xxxxx" /></div>
             <div .clDivImg><img .clTransferState TransferState="1" /></div>
             <div .clDivMessage>hello</div>
     </div>
    <div cookie="802">
            <div .clDivHeadimg><img src="xxxxx" /></div>
             <div .clDivImg><img .clTransferState TransferState="1" /></div>
             <div .clDivMessage>hello</div>
     </div>
.
.
.
</richtext>


TIScript:
var tarCookie = "802";
	var item = $(#IDRecordList>div[cookie={tarCookie}]);
       for(var childItem in item)
      {
         if(childItem.@["class"] ==" clDivImg")
          {
              for(var childItem2 in childItem )
              {
                    if(childItem2 .@["class"]=="clTransferState ")
                     {
                         childItem2.@["TransferState"] ="2";
                      }
              }
          }
      }


I want to find .clTransferState ,but this approach is too complicated!
how do I use a simple way? need you advice,thanks!

value (1 reply)

$
0
0
<html>
<head>
<script type="text/tiscript">
	$(button).onClick = function() {
		stdout.println( $(widget).value );
	};
</script>
	
</head>

<body>
	<form>
		<widget type="checkbox">A Checkbox!</widget>
		<button>Click me!</button>
	</form>
</body>
</html>
BUG: checkbox value is starting as 'undefined'. I think the correct is it to start with boolean 'false'.

You see, checking and then uncheking the checkbox makes the value be setted to 'false', not to undefined, so it is clearly an inconsistency...

float right,then show disorder (no replies)

$
0
0
html:
<frameset rows="*,50px">
<div .clChatRecords>
<richtext .clRecordBoxRichtext readonly>
<div .clDIVMessageFriend cookie="101">
<div ><img .clMessageHeadImg src="../HeadImage/HeadImage_109.jpg"/>
<code>jack 2015/7/22 08:30:36</code>
<img .clTransferState TransferState="1" />
</div>
<div .clMessageConent>
<code><p>hello!</p><img src="../HeadImage/HeadImage_108.jpg"/>gaga</code>
</div>
</div>
<div .clDIVMessageMe cookie="102">
<div style="float:right"><img style="float:right" src="../HeadImage/HeadImage_111.jpg">
<code style="float:right">jone 2015/7/22 08:30:36</code>
<img style="float:right" TransferState="1" />
</div>
<div .clMessageConent style="float:right">
<code>what are you doing<img src="../HeadImage/HeadImage_10.jpg"/></code>
</div>
</div>
</richtext>
</div>
<splitter/>
<div .clChatMessages>
<richtext .clSendBoxrichtext #IDSendBoxrichtext>
<p></p>
</richtext>
</div>
</frameset>

CSS:
.clSendBoxrichtext {
display:block;
display-model:blocks-inside;
style-set: std-richtext;
prototype: Richtext url(richtext.tis);
}
.clRecordBoxRichtext {
size:*; border:1px solid blue;
overflow:scroll-indicator;
}

I want to achieve the div(class=clDIVMessageMe )'s child element float right,but I found that shows disorder.
what am I wrong,how to solve this problem,need your advice,thanks!

(PS:Thank you for the last Topic's advice,now I really spend some time to study CSS selectors)

About call e.style:set_prop from C++ code (1 reply)

$
0
0
I want to call tiscript::set_prop(e.style, key, value) in c++ code,but it don't work.why?

In TiScipt,It's OK.

Radio button state (1 reply)

$
0
0
Hi,

I have 3 radio buttons. How do I get the value of the selected radio button?

I was refering some code :

<html>
  <head>
    <title>q test suite</title>
    <style>
      ul.selectable > li { behavior:radio; /*all li's behave as radio buttons */ }
      ul.selectable > li:checked { background:gold; }
      ul.selectable > li:checked > span { color:red; }
    </style>
  </head>
<body>
  
  <ul.selectable>
    <li><span>First</span> item</li>
    <li><span>Second</span> item</li>
    <li><span>Third</span> item</li>
  </ul>
  
</body>
</html>

ul.selectable > li { behavior:radio; }

This code is perfect for radio buttons, but it is not working for me.

Could you please help me

Thanks in advance.

@font-face with font-weight: bold; (no replies)

$
0
0
I am trying to use @font-face while using font-weight: bold; too, as follow:
<html>
<style>
@font-face
{
	font-family: 'Josefin Slab';
	src: url(JosefinSlab-Regular.ttf);
}
@font-face
{
	font-family: 'Josefin Slab';
	font-weight: bold;
	src: url(JosefinSlab-Bold.ttf);
}
div { font-size: 50px; }
</style>
<body>
	<div style="font-family: 'Josefin Slab';">Josefin Slab AaBbCc 1234</div>
	<div style="font-family: 'Josefin Slab'; font-weight: bold;">Josefin Slab AaBbCc 1234</div>
</body>
</html>
Problem is, engine doesn't recognize the second @font-face rule as being the bold version of the Josefin Slab font.
Complete demo is hero: [www.dropbox.com]
Notice that the second div is NOT correctly rendered with the weight of the font file, but rather with a fake bold...

view.msgbox() buttons (2 replies)

$
0
0
I want my view.msgbox() dialog to display button #ok and #cancel, so I guess I shoud call it the following way:
view.msgbox(#information, "whatever", "whatever", (#ok | #cancel));
But it gives me an TIScript error:
Error: Wrong type - ok, expected instance of float,integer
  at @160@43 (file://D:/Projetos-D/AnionTasks/res/default.html(168))
I guess the '#ok | #cancel' expression is invalid..

invalid http response code (2 replies)

$
0
0
intercept an GET http request in the native code like:
LRESULT on_load_data(LPSCN_LOAD_DATA pnmld)
{
    //...
    ::SciterDataReady( pnmld->hwnd, pnmld->uri, adata.start, adata.length);
     return LOAD_OK;
}

And in tiscript I get a 0 return code (instead of expected 200):
view.root.request(function (data, status) 
{
    // HERE THE STATUS CODE IS 0, BUT THE DATA IS FINE.
}, #get, url);


Is it normal behaviour? If so, is there a way to return a 200 code myself?

vs2013 release buid speed slowly (2 replies)

$
0
0
i use sciter in static link and buid my project with "release" option, the speed is slow.(very slow, even i just modify only one word)
but when i use debug option to buid, very fast!
why?

Issues with "length" property. (2 replies)

$
0
0
Hi,

Recently I had been working on some Sciter code and came across few difficulties.

I had to visit the child elements of an element and also find the length of the child elements, so I used the following code for that:

$("div#abc > button")

$("div#abc > button").length


This did not work for me....I was not able to reach all the child element.

What could be the error?

Thanks in advance.

details view (3 replies)

$
0
0
Is there some Sciter example which mimics the the 'details view':

AKA table where you can resize columns
?

SC_DATA_LOADED sent twice (1 reply)

$
0
0
I am getting two SC_DATA_LOADED notifications for a loaded resource, and all fields of the LPSCN_DATA_LOADED struct seems to have the same value in each notification, so the notification are repeated.. is there any particular reason for that?

how can I close this dialog. (1 reply)

$
0
0
base on:sciter-sdk-3.3.0.1\samples\ideas\lightbox-dialog\lightbox-dialog.html
var res = dialog { body:$(form#data-dialog),
                         returns: #values,
                         buttons: [ ]    //change
                        };


I don't want: { caption: "Yep!", role:#ok, value:true } and { caption: "No way!", role:#cancel, value:false }

I wrote a button: <button #BtnCloseDialog>close</button>
$(#BtnCloseDialog).onClick = function{
        here,
        how can I close this dialog.
}

Websocket is broken atm? (2 replies)

$
0
0
Hi.

It seems, latest version have some troubles with it.

samples/websockets/client.htm works, but DOM Inspector displays a warning messages from (I guess) socket.poll():

Quote

WARNING:use of obsolete method
at connection.@20@35 (samples/websockets/client/connection.tis(21))

`autobahn` test have the same warnings and didn't works at all. If I comment out "socket.poll()", similar warnings has been shown from another socket access places like `socket.onText`.

Something wrong?

Problem with .load() method (1 reply)

$
0
0
Hi,

I have been working on some small task.

I have 3 html pages and I want to link them one after another.

first two pages has clickables that will take us from one page to another. After reaching the last page(3rd page) we can come back using a button step by step.

For achieving this I was using load method of element object, but this method works for the first click(page 1 to page 2) and after that it does not work for second click.

Do we need to clear first page and then load another or what....Please help me with this.

Thanks in advance.

Centering dialog (1 reply)

$
0
0
view.dialog{} centres the dialog on the desktop window, can it be made to centre on the application window?
Viewing all 617 articles
Browse latest View live