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

whenever "get_location" is valid? (1 reply)

$
0
0
I have a div, and the div will be filled by a button click.
eg:
div.append(newButton)
div.append(newLabel)
...
and how can i bind a function when all the child element was rendered?
when child element created, call the metod "newButton.get_location(rc);" , then the retrun value is not correct.
if i set a timer to call get_location metod, all is ok.

also, it is called in C++ side, i wan`t to use box metod, but i don`t know how to use it in c++ side.

i want find a event to bind div complete layout, just like frame`s DOCUMENT_COMPLETE.

Form elements (1 reply)

$
0
0
Hi,

I want to collect all the form elements on a single page and make them functional.

Could you please explain me how should I proceed. Please explain me with any one form control like a combo box - how should I create html file css file and how to run in sciter window...

Thanks and Regards,
Shreyas.

for loop does not conform with the documentation (1 reply)

$
0
0
The docs in SDK states the following about the 'for loop' enumeration when used in an Element :
for ... in
for(varnode inelement){ /* loop body */}
Executes body of the loop for all child nodes of the element. Value of node variable is either text or element object.
Example, for p element in html: 
<p>Hello <em>wonderfull</em> world</p>
loop will be executed three times and node variable will be equal to: "Hello ", Element("em") and " world" on correspondent iteration.

The following sample proves that it is not working, it should print 3 times, but it is only printing the "em" element
<html>
<head>
<script type="text/tiscript">
	for(var el in $(p))
	{
		stdout.println(el);
	}
</script>
	
</head>

<body>
	<p>Hello <em>wonderfull</em> world</p>
</body>
</html>

children() method from jQuery. (1 reply)

$
0
0
Hi,

We have children() method in jQuery for selecting the child elements of a parent.

What do we have in Sciter asa replacement for this children() method.

Thanks and Regards,
Shreyas.

Can not got KEY_DOWN event of arrow key. (3 replies)

$
0
0
I have a c++ class inherit from sciter::event_handler, i want to deal with KEY_DOWN event,
when i press an arrow key, only got the KEY_UP messge,can not got KEY_DOWN.
code like
bool CMainDialog::on_key(HELEMENT he, HELEMENT target, UINT event_type, UINT code, UINT keyboardStates)
{
     if (event_type == (KEY_UP | SINKING))
     {
            //all key worked fine
     }
     if (event_type == (KEY_DOWN | SINKING))
     {
           // all key worked fine but arrow keys(up, down, left, right).
     }
}

bug or my code error?

A tiscirpt qustion (1 reply)

$
0
0
You tell me to study tiscirpt first, but our big boss force me to complete work 8 days, so no time to study tis in full... :(
i want attack him by big gun!
var r = evt.target.$p(th);
please tell me what the top line mean, thanks a lot.

struct MOUSE_PARAMS (2 replies)

$
0
0
struct MOUSE_PARAMS
{
UINT cmd; // MOUSE_EVENTS
HELEMENT target; // target element
POINT pos; // position of cursor, element relative
POINT pos_view; // position of cursor, view relative
UINT button_state; // MOUSE_BUTTONS
UINT alt_state; // KEYBOARD_STATES
UINT cursor_type; // CURSOR_TYPE to set, see CURSOR_TYPE
BOOL is_on_icon; // mouse is over icon (foreground-image, foreground-repeat:no-repeat)

HELEMENT dragging; // element that is being dragged over, this field is not NULL if (cmd & DRAGGING) != 0
UINT dragging_mode;// see DRAGGING_TYPE.

};

i want to deal with MOSE_WHEEL event, but can`t find the param wheelDelta.

Can't Select the tab by script (1 reply)

$
0
0
I have a tab view(there are 4 tabs in it),and I want to select one tab by my script function.
All tabs are overlapped ,I want to select one tab,and the tab will be obvious.

the html:
<div class="tabs">
<div class="strip" role="page-tab-list"> <!-- our tab strip, can be placed on any side of tab container. -->
<div .PanelSytle #IDDIVPanelFriends panel="panel-Friends" selected="selected" role="page-tab" title="Friends">Friends</div>
<div .PanelSytle #IDDIVPanelGroups panel="panel-Groups" role="page-tab" title="Groups">Groups</div>
<div .PanelSytle #IDDIVPanelCompany panel="panel-Company" role="page-tab" title="Company">Company</div>
</div>
<div id="panel-Friends" .clTabsTyle></div>
<div id="panel-Groups" .clTabsTyle></div>
<div id="panel-Company" .clTabsTyle></div>
</div>

my script function sample:
$(#IDDIVPanelFriends).attributes.remove("selected");
$(#IDDIVPanelGroups).@["selected"] = "selected";

and:
.tabs
{
aspect:Tabs;
}

What's wrong in my code?or what should I do?
In inspector,the "selected" is OK,but the tab view can't be obviours.

exception details (1 reply)

$
0
0
When I use sciter::value::make_error to throw an exception in tiscript from my native code I get some extra details in the erroк, like:
Error: Some error text.
	at SomeClass.foo ((2))
	at SomeOtherClass._do.@103@47 (this://xxx/logic/SomeFile.tis(112))

But, when I throw an exception in tiscript, like:
throw "Some error text";
I get only the string I have threw.
Is there a way to get these extra details in tiscript code?

Custom Popup. (1 reply)

$
0
0
Hi,

I want to open a popup box on a click of button.
This popup should be created through HTML with a
header(for popup title) and a close button.

TIScript will take care of click event on button
for opening the popup and also the close button
functionality should come through TIScript.

Could you please help me out with this
functionality. I have seen the sample codes fron
SDK but could not find the solution.

I'll follow:
1. Mark up in : HTML
2. Scripting through : TIScript

Thanks and Regards,
Shreyas.

Resizing WS_EX_LAYERED window does not work (1 reply)

$
0
0
Hi Andrew,

using Sciter for more and more things in UI I found another issue.

Problem
If I create Sciter window with WS_EX_LAYERED style then SetWindowPos does not update window's size (position and visiblity are correctly handled):
void ListWndT::ShowPopup( const POINT& Where )
{
	CRect WindowRect = CRect(0, 0, 320, 240);

	if (!::IsWindow(m_hWnd))
		Create(WS_POPUP, WS_EX_LAYERED, WindowRect, AfxGetMainWnd(), 0);

	UINT Width = ::SciterGetMinWidth(m_hWnd);
	UINT Height = ::SciterGetMinHeight(m_hWnd, Width);

	WindowRect = CRect(0, 0, Width, Height);
	WindowRect.OffsetRect(Where.x - WindowRect.Width(), Where.y);

	SetWindowPos(&CWnd::wndTop, WindowRect.left, WindowRect.top, WindowRect.Width(), WindowRect.Height(), SWP_SHOWWINDOW);
}

If I create window without WS_EX_LAYERED everything works as expected.

Workaround
As setting window size using "view.move(...)" works fine I was able to implement following (quite suboptimal) workaround into my base class:

void WndT::OnWindowPosChanging( WINDOWPOS* lpwndpos )
{
	// there is neither SWP_NOMOVE nor SWP_NOSIZE flag - position and/or size of window is changing
	if (!IS_BIT_SET(lpwndpos->flags, SWP_NOMOVE) || !IS_BIT_SET(lpwndpos->flags, SWP_NOSIZE))
	{
		// layered window not currently handling WM_WINDOWPOSCHANGING - update size using script call
		if (!m_WindowPosChanging && IS_BIT_SET(GetExStyle(), WS_EX_LAYERED))
		{
			m_WindowPosChanging = true;

			POINT Position = { lpwndpos->x, lpwndpos->y };
			SIZE Size = { lpwndpos->cx, lpwndpos->cy };

			// we have SWP_NOMOVE or SWP_NOSIZE flag - we need current window rect
			if (IS_BIT_SET(lpwndpos->flags, SWP_NOMOVE) || IS_BIT_SET(lpwndpos->flags, SWP_NOSIZE))
			{
				CRect WindowRect;
				GetWindowRect(&WindowRect);

				if (IS_BIT_SET(lpwndpos->flags, SWP_NOMOVE))
					Position = WindowRect.TopLeft();

				if (IS_BIT_SET(lpwndpos->flags, SWP_NOSIZE))
					Size = WindowRect.Size();
			}

			std::wstring Script = boost::str( boost::wformat(L"view.move(%d,%d,%d,%d)") % Position.x % Position.y % Size.cx % Size.cy );
			sciter::value RetVal;
			::SciterEval(m_hWnd, Script.c_str(), Script.size(), &RetVal);

			m_WindowPosChanging = false;
		}
	}

	__super::OnWindowPosChanging(lpwndpos);
}

Expected behavior
It would be fine if Sciter can handle SetWindowPos correctly even for layered windows.

Thank you,
Martin

Make hole in Sciter (1 reply)

$
0
0
Hi Andrew,

I need to show "first-run" overlay as semi-transparent window over UI. I created layered window with rgba(0,0,0,0.5) background color. Now I need to highlight some par of UI so I need to make some rectangle areas more transparent. Any ideas?

I'm considering following:
1) Something with SetWindowRgn(...). I don't like this at all
2) Made background out of four rectangles around hole. Difficult to support arbitrary number of rectangles
3) Draw background using Graphics. But it seems like I need to draw rectangles around hole so it is basicly same as 2).

Martin

best way to dynamically load a font-face (no replies)

$
0
0
I want to implement a font-picker plugin, so, when the user triggers the plugin's popup, it will list a number of fonts face, the user will choose one font, and it will be applied to the parent page.

Problem is, how do I inject in the parent page the CSS @font-face declaration to make the it available?

a problem of tiscript.exe (1 reply)

$
0
0
Hi, Andrew.
I tested \samples\loader\compiled\test.htm, and change foo.tis to:
function foo() {
  $(body).$append(<p>的身份</p>);
}
run compile.bat, then open \samples\loader\compiled\test.htm with Sciter.exe, here is output:

Default exception handlers (1 reply)

$
0
0
Since tiscript exceptions are not forwarding to the native code, I think it would be useful to have the ability to define default exception handlers for uncaught exceptions. Like:
function def_ex_hndl(ex) {
    stdout.println("Unhandled exception" + ex.toString());
    view.terminate_my_application();
}

function do_throw() {
    throw "error";
}

self.on("complete", function() 
{
    SetDefaultExceptionHandler(def_ex_hndl);

    try {
        do_throw(); //will be catched by the 'catch' below
    catch() { }

    do_throw(); //will be catched by the default exception handler
});

table(how scroll to position) (1 reply)

$
0
0
html:
<table id="thetable">
  <thead>
<tr><th .sortable .forText>Time</th><th .sortable .forText>Type</th><th .sortable .forText>Environment Name</th>
<th .sortable .forText>Source Name</th><th .sortable .forText>Target Name</th></tr>
  </thead>  
  <div><div #IDShowMore .clShowMore type="submit"><dfn>View more messages</dfn></div></div>
  <tbody #IDTbodyLogsInfo>
<tr id="801"><td>2015-04-05 08:02</td><td>111111</td><td>decrypt</td><td>success</td><td>Axxxxxxxxx</td></tr>
<tr id="802"><td>2015-04-05 08:03</td><td>C:/test/test.txt</td><td>decrypt</td><td>success</td><td>Bxxxxxxxxx</td></tr>
<tr id="803"><td>2015-04-05 08:04</td><td>C:/test/test.txt</td><td>decrypt</td><td>success</td><td>Cxxxxxxxxx</td></tr>
.
.
.
.
<tr id="808"><td>2015-04-05 08:04</td><td>C:/test/test.txt</td><td>decrypt</td><td>success</td><td>Cxxxxxxxxx</td></tr>


CSS:
table use prototype:Grid url(../TIScript/grid.tis);

TIScript:
for(var item in $(#IDTbodyLogsInfo))
{	
if(item.@["id"]=="808")
{
stdout.println("id",item.@["id"]);
item.scrollToView(true,false);
self.$(#thetable).setCurrentRow(item);
}
}


i want to show table to be ID="808",but the above TIScript is not work,what am I wrong,and how can I realize my idea.
thanks!

Animation on a div/element (1 reply)

$
0
0
Hi,

Could you please explain me the .animate method of an element with a small example.

Thanks and Regrds,

how to make a good twinkle image (2 replies)

$
0
0
html:
<body>
	<div><button #IDBTNtwinkle>twinkle</button></div>
	<div #IDContainer>
		<div #IDDIVimg .clDIVimg Twinkle="0">
		<div>
		
	</div>
</body>


CSS:
<style>
	#IDContainer{
		overflow:hidden;
		height:100px;
		width:100px;
	}
	.clDIVimg{
		background-image:url(HeadImage_118.jpg);
		size:50px 50px;
		background-repeat: stretch;
	}
	.clDIVimg[Twinkle=0]{
		size:50px 50px;
	}
	.clDIVimg[Twinkle=1]{
		size:60px 60px;
	}
</style>


TIScript:
<script type="text/tiscript">
	include "q.tis";
	include "../samples/decorators.tis"
        //In the transformation between the two CSS,look like twinkle! 
	function twinkle()
	{
		var vTarget = $(#IDDIVimg);
		if(vTarget.@["Twinkle"] == 0)
		{
			vTarget.@["Twinkle"] = 1;
		}else if(vTarget.@["Twinkle"] == 1)
		{
			vTarget.@["Twinkle"] = 0;
		}
		q(twinkle)
	}

	$(#IDBTNtwinkle).onClick = function()
	{
		twinkle();
	}
</script>
I want to make a twinkle effect,So use "q" function to execuse twinkle(),then images is twinkling,but I don't know how to stop this twinkling..
Whether there is another way to make the image twinkleing?
need you suggest,thanks!

Animation problem. (1 reply)

$
0
0
Hi,

I am applying animation on a pop-up. Following is my markup and the TIScript code:

<div #pop1>
	<div #pHeader>
		<div #title>Pop-Up Title</div>
		<div #closePop>X</div>
	</div>
</div>

<script type="text/tiscript">
include "timeline/timeline.tis";
	$(button#open-pop).onClick = function() {
		$(div#pop1).style#display = "block";
		Timeline.on($(div#pop1))
			.from( $(div#pop1), { duration:1s, ease: #quadInOut },
                       { transform:translate(0px,400px) } )
			.play();
		this.style#display = "none";
	}
</script>

Here only "div #pop1" has animation effect. "div #pHeader" is within "div #pop1", but this part of the pop-up is not showing any animation effects.

Could you please help me out.

Regards,

Touch Support (and Windows 10) (1 reply)

$
0
0
Hi. One of the interesting features of Windows 10 is the store and universal apps. For successful apps, this requires that the app works well on touch devices as well as PC. Is Sciter ready for touch support? What changes and considerations one might need to properly support touch in a sciter application? Thanks
Viewing all 617 articles
Browse latest View live