From 90825e2392b2d70e43c7a25b8a3752299a933894 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kjsembed/docs/examples/multipart/multipart.js | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 kjsembed/docs/examples/multipart/multipart.js (limited to 'kjsembed/docs/examples/multipart') diff --git a/kjsembed/docs/examples/multipart/multipart.js b/kjsembed/docs/examples/multipart/multipart.js new file mode 100644 index 00000000..89402f79 --- /dev/null +++ b/kjsembed/docs/examples/multipart/multipart.js @@ -0,0 +1,56 @@ +#!/usr/bin/env kjscmd + +// +// Example of loading several parts from a script +// + +// +// Main +// +var qd = new QDir(); + +var dir = 'file://' + qd.path() + '/../'; +var file = dir + 'index.html'; + +// Create the UI +var mw = new KParts_MainWindow(); +var ac = mw.actionCollection(); + +var split = new QSplitter( mw ); +mw.setCentralWidget( split ); + +// +// Load the sidebar +// +var side = Factory.createROPart( "inode/directory", split, "sidebar" ); + +// +// Load the views +// +var views = new QSplitter( split ); +views.orientation = 1; + +var top = Factory.createROPart( "text/html", views, "html" ); + +var bottom = Factory.createROPart( "text/plain", views, "source" ); + +// +// Glue it together +// +top.connect(side.child(0), 'openURLRequest(const KURL&,const KParts::URLArgs&)', 'openURL(const KURL&)' ) +bottom.connect(side.child(0), 'openURLRequest(const KURL&,const KParts::URLArgs&)', 'openURL(const KURL&)' ) + +side.openURL( dir ); +top.openURL( file ); +bottom.openURL( file ); + +// +// Activate XMLGUI and show the window +// +StdAction.quit( mw, 'close()', mw.actionCollection() ); + +mw.resize( 700, 500 ); +split.child(1).maximumWidth = 200; + +mw.show(); +application.exec(); -- cgit v1.2.1