Здравствуйте, Коллеги.
sciter ver 1.0.4.24
Не приходит вызов из скрипта (handle_scripting_call ) =(.
Хотя уверенности что все правильно и до конца реализовано тоже нет...
Код:
using namespace sciter;
using namespace sciter::dom;
struct behavior_media : public event_handler
{
behavior_media() : event_handler()
{
debug_output_console dc;
dc.printf("behavior_media create\n");
}
virtual bool handle_event (HELEMENT he, BEHAVIOR_EVENT_PARAMS& params )
{
debug_output_console dc;
dc.printf("behavior_media handle_event\n");
return false;
}
virtual bool handle_key (HELEMENT he, KEY_PARAMS& params )
{
debug_output_console dc;
dc.printf("behavior_media handle_key\n");
return false;
}
virtual bool handle_mouse (HELEMENT he, KEY_PARAMS& params )
{
debug_output_console dc;
dc.printf("behavior_media handle_mouse\n");
return false;
}
virtual bool handle_method_call (HELEMENT he, METHOD_PARAMS& params )
{
debug_output_console dc;
dc.printf("behavior_media handle_method_call\n");
return false;
}
virtual bool handle_scripting_call (HELEMENT he, SCRIPTING_METHOD_PARAMS& params )
{
debug_output_console dc;
dc.printf("behavior_media handle_scripting_call\n");
return false;
}
virtual bool handle_draw (HELEMENT he, DRAW_PARAMS& params )
{
debug_output_console dc;
dc.printf("behavior_media handle_draw\n");
return false;
}
virtual void attached ( HELEMENT he )
{
debug_output_console dc;
dc.printf("behavior_media attached\n");
}
virtual void detached (HELEMENT he )
{
debug_output_console dc;
dc.printf("behavior_media detached\n");
delete this;
}
virtual void handle_size(HELEMENT he)
{
debug_output_console dc;
dc.printf("behavior_media handle_size\n");
}
};
struct behavior_media_factory : public behavior_factory
{
behavior_media_factory() : behavior_factory("media_video" )
{
}
virtual event_handler* create (HELEMENT he )
{
return new behavior_media();
}
};
behavior_media_factory media_instance;
Сам html:
<html>
<head>
<style>
#Video
{
overflow: auto;
width:100%%;
height:100%%;
prototype:Grid;
background-color:#000 #e9e8f3 #e9e8f3 #fff;
behavior: media_video;
}
#Status
{
prototype: Status;
background-color:#FFF #e9e8f3 #e9e8f3 #FFF;
}
</style>
<script src="sciter:lib/root-extender.tis" type="text/tiscript"/>
<script type="text/tiscript">
var video = self.select("#Video");
var status = self.select("#Status");
function self.onMouse(event)
{
switch(event.type)
{
case Event.MOUSE_UP:
if(!status) { stderr << "status is not found"; return true; }
status.text = "[1]";
status.update(false);
if(!video) { stderr << "video is not found"; return true; }
//===========================
video.show = true;
video.test();
//===========================
//video.postEvent( 300000 );
status.text = "[2]";
status.update(false);
return true;
}
return false;
}
</script>
</head>
<body>
<widget id = "Video">Video</widget>
<div id="Status">status</div>
</html>
Не прокидываються в behavior_media вызова:
//===========================
video.show = true;
video.test();
//===========================
sciter ver 1.0.4.24
Хотя video.postEvent( 300000 ); вызывается на ура.
Возможно что то до конца не прочувствовал в библиотеке =). Помогите