View previous topic :: View next topic |
Author |
Message |
hasan
Joined: 02 May 2005 Posts: 58
|
Posted: Fri Dec 05, 2008 6:00 am Post subject: usage? |
|
|
When I try to run build.bat in the examples I get many compile errors! I don't know if it's because of changes in the compiler since the last update to the code or something else.
Anyway, it would be nice if there was a short/quick-and-dirty getting-started guide. i.e. create an empty window for example, with pointers and hints about how to add stuff to it. |
|
Back to top |
|
|
bobef
Joined: 05 Jun 2005 Posts: 269
|
Posted: Wed Dec 24, 2008 12:14 pm Post subject: |
|
|
There are some old examples about htmlayout (see the wiki page). I am not maintaining htmlayout at the moment as I use sciter, so they won't compile. But the api is mostly the same and you will be able to get around if you study the examples and take a look at the sources. There is also a changelog.txt where I keep log of api changes. I don't have the time to write examples but if you make some effort yourself and have some specific questions/problems I will be happy to help. Just ask in the forum and PM me cause I don't check here often.
Note: Although the project is not actively maintained this is due to lack of interest. The project is still alive and I am developing it actively everyday. So if someone is using it and needs updates I can provide them from time to time. Just give me a note (pm in the forum). |
|
Back to top |
|
|
bobef
Joined: 05 Jun 2005 Posts: 269
|
Posted: Wed Dec 24, 2008 12:35 pm Post subject: |
|
|
I have just uploaded a new snapshot in the wiki page. By the way it is all very simple. Here is a small example to get you intersted. It won't actually compile (probably). It is striped down version of the app I'm working on just to give you a guideline where to look. Take a look at the old examples too. The api is mostly the same.
Code: |
import ti.util.skin; //you need this. the rest are probably not needed
import flowerd.app.Plugin;
import flowerd.prototype.Function;
import flowerd.Trace;
import flowerd.util.Hash;
import tango.sys.win32.Types;
import tango.io.File;
import tango.io.Buffer;
import tango.core.Thread;
import tango.net.Uri;
import docview.audio;
import docview.pdf;
import tango.sys.win32.CodePage;
import tango.net.http.HttpGet;
class MyForm : HSkinLayout
{
mixin TScriptingMethod;
//WS_EX_LAYERED,WS_POPUP
this(){super(WS_EX_APPWINDOW,WS_OVERLAPPEDWINDOW,0,0,1024,600);}
void main()
{
setOption(SCITER_FONT_SMOOTHING,3);
loadHTML("index.html");
window.center;
window.maximize;
super.main();
caption="Simple, ain't it?";
handleScriptingMethodsStatic(rootElement);
mixin(addScriptingMethod!("this.exit")); //you can call this function from script by calling self.xcall(#exit)
callnr("main"); //calls global script function called main
}
void exit(){
PostQuitMessage(0);
}
uint onLoadData(HLoadData p) {
auto uri = new tango.net.Uri.Uri(p.uri);
auto scheme = uri.getScheme;
void[] data;
bool r;
//do some custom data processing. this is just a stub to custom handle paths like this
//data:mydata or skin://current/images/test.png
if(scheme == "data") r = getData(data,uri.getPath);
else if(scheme == "skin") r = getSkin(data,uri.getHost,uri.getPath);
if(r) {
dataReady(p.uri,data);
delete data;
}
return LOAD_OK;
}
bool onCallbackHost(HCallbackHost p)
{
if(p.channel==1 || p.channel==2)
{
//show error messages in the console
tracennl(p.p1.toString);
return true;
}
else return false;
}
}
PluginHost host;
MyForm sciter;
void main(char[][] argv)
{
//host = new PluginHost(argv); //this is work in progress you can take a look though
//host.threadman.main.name = "main";
//host.dataman.handle("http",&MyHandler); //this is also new and interesting IMHO
//load sciter
loadSciter("sciter-x.dll");
//load documents
//docview.audio.registerPlugin(host);
//docview.pdf.registerPlugin(host);
//run
sciter=new MyForm;
sciter.run(argv);
}
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|