It is currently Tue Jun 27, 2017 5:14 am

News News of UI Development & Deployment

Site map of UI Development & Deployment » Forum : UI Development & Deployment

For discussing development & deployment issues

Show debug window programmatically

Show debug window

javascript code
if(typeof(require)=='function') require('nw.gui').Window.get().showDevTools();
Read more : Show debug window programmatically | Views : 3103 | Replies : 0 | Forum : CrossUI for Desktop Apps


close application programmatically

close application programmatically :

1-st way
javascript code
process.exit(code=0);


2-nd way
javascript code
var win=require('nw.gui').Window.get();
win.maximize();
win.show();

win.close();
Read more : close application programmatically | Views : 2117 | Replies : 0 | Forum : CrossUI for Desktop Apps


shell execute

shell execute:

javascript code
var childProcess = require('child_process');
childProcess.exec('wscript.exe C:\\test\\1.vbs',
function (error, stdout, stderr) {
xui.echo('stdout: ' + stdout);
xui.echo('stderr: ' + stderr);
if (error !== null) {
xui.echo('exec error: ' + error);
}
});
Read more : shell execute | Views : 2544 | Replies : 0 | Forum : CrossUI for Desktop Apps


Pop dialog outside of parent

Pop dialog outside of parent by creating new dialog

// The default code is a com class (inherited from xui.Com)
Class('App', 'xui.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not the com will be destroyed, when the first UI control be destroyed
this.autoDestroy = true;
// To initialize properties
this.properties = {};
}, ...
Read more : Pop dialog outside of parent | Views : 2089 | Replies : 0 | Forum : CrossUI for Web Apps


File read/write

As i understood Node.js can be used:

read:
javascript code
fs = require('fs');
fs.readFile('c:\\test.txt', 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
console.log(data);
});


write:
javascript code
var fs = require('fs');
fs.writeFile("c:\\test.txt", "Hey there!", function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
Read more : File read/write | Views : 2547 | Replies : 0 | Forum : CrossUI for Desktop Apps


Distributed UI Module function

Is it possible to call a function in a module that has been loaded using the distributed UI model.

I have a form loading as a module based on a previous selection and see how to interact between index.js and module1.js.

It is my lack of knowledge in JS causing the problem.

Also in CrossUI debug is it possible to get the PHP calls working. I can't find any useful help on debug

Thanks
Kevin
Read more : Distributed UI Module function | Views : 4471 | Replies : 5 | Forum : CrossUI for Web Apps


calc workflow, control-name-independent, available statuses

Example shows how to calculate available statuses for transition.

Enter status name into 'Input' control and press 'show'

Blue - is anavailable blocks
Yellow - current status
Green - available for transition

// The default code is a com class (inherited from xui.Com)
Class('App', 'xui.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not ...
Read more : calc workflow, control-name-independent, available statuses | Views : 2195 | Replies : 0 | Forum : CrossUI for Web Apps


draggable/movable SVG Rectangle

Can be used for dynamic workflow building/editing like in attlassian JIRA.

If you can improve this code please post here or email me.

// The default code is a com class (inherited from xui.Com)
Class('App', 'xui.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not the com will be destroyed, when the first UI ...
Read more : draggable/movable SVG Rectangle | Views : 3449 | Replies : 0 | Forum : CrossUI for Web Apps


Custom Widget

/!\ this widget cannot be used in UIBuilder

Add this script after XUI libs:
javascript code
<script type="text/javascript" src="newLabel.js"></script>


Widget "newLabel.js":
Class("xui.UI.newLabel", "xui.UI.Widget",{
Instance:{
MyCustomFunc:function(v){
var ns = this;

ns.each(function(o){
o.getSubNode('CAPTION').css('transform','rotate('+v*Math.floor(Math.random()*10+1)+'deg)');
o.getSubNode('CAPTION').css('font-size','22px');
o.getSubNode('AUTOT').html('<div style="background-color:white;border:1px solid black;"><ul><li>test</li><li>test1</li></ul></div>');
console.log('start');
});

if(!ns.$running){
ns.$running = true; //to prevent several op calls
_.asyRun(function(){
ns.each(function(o){
o.getSubNode('CAPTION').css('transform','rotate(0deg)');
o.getSubNode('CAPTION').css('font-size','12px');
o.getSubNode('AUTOT').html('');
console.log('stop');
ns.$running = false;
});
}, 3000, null, ns);
}

return ns;
}
},
Initialize:function(){
//modify default template from parent
var t = this.getTemplate();
_.merge(t.FRAME.BORDER,{ ...
Read more : Custom Widget | Views : 2224 | Replies : 0 | Forum : CrossUI for Web Apps


Input with autocomplete

Input with autocomplete

If you can improve this code please post here or send me email.

client code:
// The default code is a com class (inherited from xui.Com)
Class('App', 'xui.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not the com will be destroyed, when the first UI control be destroyed
this.autoDestroy = ...
Read more : Input with autocomplete | Views : 2211 | Replies : 0 | Forum : CrossUI for Web Apps


 

Login  •  Register


Statistics

Total posts 960 • Total topics 321 • Total members 35

cron