Copy link to clipboard
Copied
Is it possible to control where on the screen an small confirm pop-up window will appear?
I want not to appear in the middle but next to the right screen side.
Do I need to build it and not use the default confirm window?
No problem...
...var w = new Window('dialog','Confirm');
w.orientation="row";
var tmp =$.screens.toString().split('-');
var screenSize=tmp[1].toString().split(':');
var windowWidth = 270; //adjust to suit
w.frameLocation=[Number(screenSize[0])-windowWidth,Number(screenSize[1])/2];
w.bu1 = w.add('button',undefined,'Ok');
w.bu1.preferredSize=[100,100];
w.bu2 = w.add('button',undefined,'Cancel');
w.bu2.preferredSize=[100,100];
w.bu1.onClick=function(){
w.close(1);
}
var Result = w.show();
if(Result == 1){
alert("
Copy link to clipboard
Copied
You would need to create your own window, as an example...
var w = new Window('dialog','Test');
var tmp =$.screens.toString().split('-');
var screenSize=tmp[1].toString().split(':');
var windowWidth = 300; //adjust to suit
w.frameLocation=[Number(screenSize[0])-windowWidth,Number(screenSize[1])/2];
w.t1 = w.add('statictext',undefined,"This is a test");
w.bu1 = w.add('button',undefined,'Cancel');
w.show();
This will create a window with the top of the window half way down the sceen, and to the right of the screen. The only problem is you have to enter a fixed number for the width of the window (var windowWidth = 300;)
Copy link to clipboard
Copied
Great!
Is it possible to add to big buttons (as UI or as image) ?
In this case, 2 square buttons - OK and Cancel - width 100 and H 100
Copy link to clipboard
Copied
No problem...
var w = new Window('dialog','Confirm');
w.orientation="row";
var tmp =$.screens.toString().split('-');
var screenSize=tmp[1].toString().split(':');
var windowWidth = 270; //adjust to suit
w.frameLocation=[Number(screenSize[0])-windowWidth,Number(screenSize[1])/2];
w.bu1 = w.add('button',undefined,'Ok');
w.bu1.preferredSize=[100,100];
w.bu2 = w.add('button',undefined,'Cancel');
w.bu2.preferredSize=[100,100];
w.bu1.onClick=function(){
w.close(1);
}
var Result = w.show();
if(Result == 1){
alert("Ok")
}else{
alert("Cancel");
}