|
|
jswinshell
jswinshell module
jswinshell module
home > JSLibs > jswinshell -![]()
Description
Static functions
- MessageBox( content [, caption [, style ] ] )
- ExtractIcon( fileName [, iconIndex ] )
- CreateProcess( applicationName , [ commandLine ], [ environment ], [ currentDirectory ] )
- FileOpenDialog( filters | undefined [, defaultFileName ] );
- string ExpandEnvironmentStrings( sourceString )
Example: CreateProcess( 'C:\\WINDOWS\\system32\\calc.exe', undefined, undefined, 'c:\\' );
Example: FileOpenDialog( 'executable files|*.exe;*.com;*.cmd;*.bat|all files|*.*' );
Static properties
- string clipboard
jswinshell::Console class
home > JSLibs > jswinshell > Console -![]()
Description
Functions
- constructor Console()
- string Read( amount )
- void Write( string )
- void Close()
Properties
- title
Examples
var cons = new Console();
cons.title = 'My console';
cons.Write('Hello world');jswinshell::Icon class
home > JSLibs > jswinshell > Icon -![]()
Description
Functions
- constructor Icon( <image | integer> )
- 0: IDI_APPLICATION
- 1: IDI_QUESTION
- 2: IDI_INFORMATION
- 3: IDI_WARNING
- 4: IDI_ERROR
Icon constructor accepts an Image object or a integer.The integer value can be one of:
Properties
jswinshell::Systray class
home > JSLibs > jswinshell > Systray -![]()
Description
Functions
- constructor Systray()
- void Close()
- bool ProcessEvents()
- void PopupMenu()
- void Focus()
Precess all pending events of the systray. The function returns true if at least one of the event function ( see Remarks below ) returns true.
Properties
- Icon | null icon write-only
- boolean visible write-only
- string text
- Object menu
- string | function menu.commandName.text
- bool | function menu.commandName.checked
- bool | function menu.commandName.grayed
- bool menu.commandName.separator
- bool menu.commandName.default
- Icon | function menu.commandName.icon
Example: tray.menu = { { text:"enable", checked:true }, { text:"delete", grayed:true }, { separator:true }, exit:"Exit" }
If the value of text, checked, grayed or icon is a function, it is called and the return value is used.
Example: `tray.menu = { { text:"enable", checked:function() { return isChecked } }, ...
Remarks
The following functions are called when you call ProcessEvents() according the events received by the tray icon.
- onfocus
- onblur
- onchar
- oncommand
- onmousemove
- onmousedown
- onmouseup
- onmousedblclick
Examples
var s = new Systray();
s.icon = new Icon(new Png(new File('calendar.png').Open(File.RDONLY)).Load());
s.text = "calendar";
s.menu = { exit_cmd:"exit" }
s.onmousedown = function(button) {
if ( button == 2 )
s.PopupMenu();
}
s.oncommand = function(id) {
if ( id == 'exit_cmd' )
exit = true;
}
while ( !exit ) {
s.ProcessEvents();
Sleep(100);
}
Sign in to add a comment

