openPush - XAML for portable Applications

Home | Dokumentation | Codesamples | Changelog | Bestellen | Download | FAQ | Impressum |

openPush :: XML und Object Reference



Jeder Dialog besteht aus einem Form Element. Innerhalb von Form sind beliebige Page Elemente zulässig. Alle anderen Elemente können innerhalb des Form oder Page Elementes genutzt werden. Jedes Form Element muss ein eindeutiges id property enthalten welches beim Start der Applikation als globales Objekt zur Verfügung steht
Die Applikation startet die XML-Datei moScript.xml
Beispiele finden Sie unter dem Link "Codesamples"

Document Type Definition

download moScript.dtd

valid XML Form Elements

Element Description
FORMDialog
PAGEPagegroup in Dialog
EDITEditcontrol
BUTTONButton ; ImageButton ; Checkbox ; Radiobutton
GRIDGridControl
TREETree Control
COMBOComboBox
SIGNUnterschriftsfeld
STATICIcon/Text/Button
DATEDate Picker
TIMEDate/Time Control
PGBARProgress Bar Control
SLIDERScollBar Control
WEBVIEWHTML Control
RICHRichText Control (win32 only)


valid Form Properties

property Description
id unique ID (set as global var in JScript)
onload Function execute after load form
imgbg Background Image
colg1 color gradient start color
colg2 color gradient stop color
h Resize height on X86 Version
w Resize weight on X86 Version


Gültige Properties für Elemente sind mit F oder O gekennzeichnet. O sind optionale Elemente. F müssen gesetzt werden

valid XML Control Properties

property Beschreibung EDIT BUTTON GRID PAGE STATIC DATE TIME FORM
id unique ID (set as global var in JScript) F F F F F F F F
label Label for Buttons;Defaulttext for Edits F F - - - - - -
group 1 to start new Group (Radiobuttons) - - - - - - - -
x X Position im Formular F F F O F F F -
y Y Position im Formular F F F O F F F -
h Height in Pixel F F F O F F F O
w Weight in Pixel F F F O F F F O
lx X Position Landscapemode O O O - O O O -
ly Y Position Landscapemode O O O - O O O -
lh Height Landscapemode O O O - O O O -
lw Weight Landscapemode O O O - O O O -
label Control Label (default id) - O - - O - - -
onclick EventHandle JScript O O O O O - - -
onchange EventHandle JScript O - - - - - - -
onfocus EventHandle JScript O - - - - - - -
onblur EventHandle JScript O - - - - - - -
onselect EventHandle JScript - O - - - - - -
onhold EventHandle JScript Tap&Hold - O - - - - - -
onload EventHandle load a dialog - - - - - - - O
imgsrc Datei BMP 265 Farben Background Image O - - - O - - O
bkcol Color Background #RRGGBB O O O - O O O -
txcol Color Text #RRGGBB O O O O O O O -
border border 0 or 1 O O O - O O O -
readonly readonly 0 or 1 O O O - O O O -
disabled disabled 0 or 1 O O O O O O O -
number number 0 or 1 O - - - - - - -
password password 0 or 1 O - - - - - - -
multiline multiline 0 or 1 O - - - - - - -
checkbox Button als Checkbox - O - - - - - -
radio Button als Radiobutton - O - - - - - -
vscroll Scrollbar vertical O - O - - - - -
hscroll Scrollbar Horizontal O - O - - - - -
format Datumsformat RegExp - - - - F F -
font fontname default TAHOMA O O O - O O O -
fontsize fontsize default 13 O O O - O O O -
fontweight fontweight default 500 O O O - O O O -
italic font italic style 0|1 default 0 O O O - O O O -
underline font underline style 0|1 default 0 O O O - O O O -




JScript db Object Reference sqlite

Das db Object handelt den gesamten Connect zur ClientDB ab als Engine wird sqlite 3.2.2 genutzt. Es ist zu beachten das die meisten PHP-Installationen noch sqlite 2.x beinhalten.

function description parameters Result Sample
Open Open Database File and Create File if not exist BSTR Filename VT_I4 dbid or -1 on Error var dbid = db.Open("\\testdb.db");
Close Close Database File VT_I4 dbid VT_BOOL = false on Error db.Close(dbid);
Drop Drop Database File BSTR Filename VT_BOOL = false on Error db.Drop("\\testdb.db");
Exec Exec SQL Query on DB VT_I4 dbid, BSTR sql_query VT_BOOL = false on Error db.Exec(dbid,"CREATE TABLE test (a1 int, a2 varchar(20) )");
Query SQL Query on DB VT_I4 dbid, BSTR sql_query VT_I4 Resultset or -1 on Error var rs = db.Query(dbid,"CREATE TABLE test (a1 int, a2 varchar(20) )");
QueryToSync SQL Query on DB and Add Datarows to Sync VT_I4 dbid, BSTR sql_query VT_BOOL = true or false db.QueryToSync(dbid,"SELECT * FROM motrade_debitor LIMIT 100");
Fetch Fetch next Row in Resultset from Query VT_I4 resultset
VT_I4 Position 1,2,3...
-1 Forward (default)
-2 Backward
-3 First Row
-4 Last Row
VT_BOOL = true or false on EOF while(db.Fetch(rs)) { ..... }
InsertID Get Last Insert ID from dbid VT_I4 dbid VT_I4 var myid=db.InsertID(dbid);
GetLastError GetLastError from DB VT_I4 dbid BSTR msg mo.alert(db.GetLastError(dbid));
FreeResult Free Resultset VT_I4 recordset VT_BOOL true db.FreeResult(rs);
NumRows Get Number of Rows from Resultset VT_I4 recordset VT_I4 count db.NumRows(rs);
NumCols Get Number of Columns from Resultset VT_I4 recordset VT_I4 count db.NumCols(rs);
GetColName Get Columnname from Resultset VT_I4 recordset, VT_I4 colid beginning with 0 BSTR String db.GetColName(rs,0);
GetValue GetValue from Resultset VT_I4 recordset,BSTR columnname or VT_I4 colnumber beginning with 0 BSTR String db.GetValue(rs,'a1');

JScript mo Object Reference

function description parameters Result Sample
Terminate Call JScript Uninit() and close Application - - mo.Terminate();
ShowKeyboard(); enable disable keyboard VT_BOOL - mo.ShowKeyboard(false);
PopupReset Clear Popupmenu and Create new - - mo.PopupReset();
PopupAdd Add Entry to PopupmenuList (id is later the Result off PopupShow and must numeric) VT_I4 id, BSTR itemtext VT_BOOL true mo.PopupAdd(815,"Hello 0815");
PopupShow Show Popup Menu at Cords x,y AND Return id from PopupAdd VT_I4 x, VT_I4 y VT_BOOL true mo.PopupShow(30,40);
PlaySound Play Wave Soundfile BSTR soundfile VT_BOOL true or false mo.PlaySound("\\windows\\alarm1.wav");
RegGet Get Key from Registry with default if not exist BSTR key, BSTR default BSTR value mo.RegGet("Port","443");
RegSet Set Registry Value BSTR key, BSTR value VT_BOOL true or false mo.RegSet("Port","443");
.title Member BSTR WindowTitle R/W mo.title="Setup";
ShowDoneButton enable/disable Dialog OK Button VT_BOOL - mo.ShowDoneButton(false);
LoadForm Load new Form by id Property (its casesensitiv !!!) BSTR formid only VT_BOOL true mo.LoadForm("Deb");
MessageBox Show HTML Notification Box BSTR html_content, BSTR title, VT_I4 timeout only VT_BOOL true mo.MessageBox("hier den html text","html_answer",10);
QuestionYesNo Show Dialog with YES or NO BSTR title, BSTR str only VT_BOOL true if pressed YES if(mo.QuestionYesNo("Sicherheitsabfrage","wirklich loeschen ???")) { .... }
GetSystem() Get System Info 0=Freier Speicher in Bytes
1=Freier Speicher in Prozent
2=OS Major Version
3=OS Minor Version
4=OS Build
5=OS CSDVersion
6=Appl Build Timestamp
7=Enum StorageCards (BSTR split by Pipe)
BSTR infotext xyz=GetSystem(2);
ScannerRead() Read current Barcode, you must define a callback function on_barcode() to handle barcode Events - BSTR barcode function on_barcode() {
   pos_suchean.text=mo.ScannerRead();
   pos_such_ean();
}
ScannerStart() Start BaracodaManager an connect to Device BSTR Barcaoda BT ID only VT_BOOL true mo.ScannerStart(mo.RegGet("btadr","00:00:00:00:00:00"));
ScannerStop() Stop the Scanner - - mo.ScannerStop();
DirectorySnapshot() Take a Filesystem Snapshot of all existing filesr VT_BOOL BSTR Directory mo.DirectorySnapshot("\My Documents");
GetChangeFile() Return new filesname since last DirectorySnapshot or empty string if not found BSTR Filename BSTR Directory mo.GetChangeFile("\My Documents");
vibrate() Play vibration motor x times (only WM5) VT_I4 count - mo.vibrate(2);
DialUp() Bring up GPRS Connection (true) or Hangup (false) - VT_BOOL mo.DialUp(true);
SyncInit() Initilize SyncEngine the Dialog must have Elements (sync_inf1,sync_inf2,sync_inf3,sync_bar1,sync_bar2,sync_bar3) - - mo.SyncInit();
Sync() Sync Data - - mo.Sync();
SyncSetData() Set Column Data - BSTR key, BSTR val mo.SyncSetData("col1","anydata");
SyncAddRow() Add all current Columns to Row and Empty last Data - BSTR key (len==1) mo.SyncAddRow("W");
SyncAddFile() Add Files to PostData - BSTR filename mo.SyncAddFile("\\Storage Card\\icon-sync.bmp");
SockOpen() Open TCP Socket (Receive over function function on_socket() {mo.alert(mo.GetSystem(8)); ) BSTR server,BSTR port VT_BOOL mo.SockOpen("www.google.de","80");
SockSend() Send over TCP Socket VT_BOOL mo.SockSend("

" + tx.text+ "

");
BSTR data
SockClose() Close current TCP Socket VT_BOOL mo.SockClose(); -
FileMkdir() Create Directory BSTR dirname VT_BOOL mo.FileMkdir("\\tester");
FileDelete() Remove File BSTR filename VT_BOOL mo.FileDelete("\\tester.txt");
FileCopy() Copy File BSTR src,BSTR dst VT_BOOL mo.FileCopy("\\tester.txt","\\tester2.txt");
FileMove() Rename File BSTR src,BSTR dst VT_BOOL mo.FileMove("\\tester.txt","\\tester2.txt");
FileOpen() Open File BSTR name,BSTR mode ("TRW") VT_I4 handle mo.FileOpen("\\tester.txt","TW"); // Truncate|Write
FileClose() Close File VT_I4 handle VT_BOOL mo.FileClose(handle); //
FileSeek() Seek PositionFile VT_I4 handle , VT_I4 position from FILE_BEGIN VT_BOOL mo.FileSeek(handle,100);
FileSize() get FileSize VT_I4 handle VT_I4 size mo.alert(mo.FileSize(handle));
FileWrite() FileWrite VT_I4 handle,BSTR data VT_I4 size mo.FileWrite(handle,"some Text");
FileRead() FileRead VT_I4 handle,VT_I4 len VT_BST data  
FileSelect() FileSelect Dialog VT_BST title, VT_BST file, VT_BST filter VT_BST filename  

JScript Control Object Reference

Remark: every Control create a new Object in ScriptSite named bei Control ID Property
function() description parameters Result Sample
AddProperty() Set XML Property in XML Tree with key= Value u can set WindowText BSTR key, BSTR val - field1.AddProperty("border","1");
GetProperty() Get Property from Control (styles,colors,value,etc) BSTR key BSTR val mo.alert(field1.GetProperty("x"));
AddString() Insert Item to COMBO,GRID data is the value-property on selecting. Insert on Grid is top position VT_I4 data, BSTR itemtext1 , BSTR itemtext2 ... ,BSTR itemtext10 - grid1.AddString(-1,0,"Hello 0815"); // Add Headline to Grid
AddColumn() Set Head of Grid BSTR itemtext1 , BSTR itemtext2 ... ,BSTR itemtext10 - grid1.AddColumn("Field1","Field2","Field3"); // Add Headline to Grid
Update() Redraw the control, need if u change cords,colors etc via AddProperty - - field1.Update();
Reset() Drop and Init Content in Grids,Combo and Tree - - grid1.Reset();
InsertItem() Insert Item into TreeView VT_I4 iData, BSTR iText, VT_I4 image1, VT_I4 image2, VT_I4 parent, BSTR on_select, BSTR on_getdata, BSTR on_hold VT_BOOL true tree1.InsertItem(1001,"Test 1001",10,10,0,"","","");
.type return control element typ (static,combo,grid,...) readonly BSTR mo.alert(myedit.type);
.text Member of Textcontent/Value R/W BSTR / BSTR mo.alert(myedit.text);
.currentItem Member of Current Item in GRID/TREE R/W BSTR / BSTR mo.alert(mygrid.currentItem);
.previousItem Member of Previous Selected Item in GRID/TREE R/W BSTR / BSTR mo.alert(mygrid.previousItem);
.px X Position from Last Mouseclick R VT_I4  
.py Y Position from Last Mouseclick R VT_I4  
SetWidth() Set Header Width in GRID Controls and Values for Slider VT_I4 width col1 / VT_I4 width col2 .....VT_I4 width col10 - liste1.SetWidth(30,60,40,40);
SetFocus() Set Focus on Control ()drop down if combo) - - liste1.SetFocus();
Show() Set visible status of control VT_BOOL - liste1.Show(true);
ActiveXObj() Get Interface of ActiveX Objects with UI on Statics BSTR CLSID VT_UNKNOWN Dispatcher Object movie=myflash.ActiveXObj("ShockwaveFlash.ShockwaveFlash");


Error Messages

#Number Description
#8100Could not start up connection manager.
#8101connection manager: no Response
#8103Could not map the request to a network identifier.
Es wurde keine valide Netzwerverbindung für den URL gefunden.
#8104Keine Netzwerkverbindung verfügbar. Deaktivieren Sie gegf. den Flugmodus
Es kann keine Netzwerkverbindung aufgebaut werden.
#8105connection aborted
Verbindungsaufbau wurde durch Benutzer oder System abgebrochen
#8106no sync while active phone call. Keine Netzwerkverbindung da aktives Telefonat (bei Smartphones)
#8107no network connection, error: %hx see conmgr.h
#8108Compress Error invalid Buffer lenght
#8109SendRequest Error malloc Buffer Liz
zu wenig Speicher
#8110SendRequest Error malloc Buffer Sync
zu wenig Speicher
#8111no access to network connections
#8112no connect to Syncserver, try backupserver
#8113no connect to Backupserver, Sync abort
#8114open request failed
#8115no NetworkConnection or Route to synchost: %ld
#8115Error server answer error: %ld
Hier wird der HTTP Errorcode vom Server ausgegeben z.B. 404 für Seite nicht gefunden. In diesem Fall Synchost,Company,Port prüfen
#8116Error InternetReadFile
#8118Error Recived num_bytes not match.
#8119Error UncompressData malloc buffer
#8120Buffer Overflow detected !!! Please contact your Administrator (32KB)
#8121%c/%ld unknown sync command. maybe need Update \n\n%s
#8122Die Serverantwort enthält weitere unbekannte Daten. Diese werden ignoriert. (CRLF im syncscript Prüfen)
Beim FTP Transfer auf das Dateiende der syncce500.php und der includes achten!
#8123Die Serverantwort war nicht vollständig oder fehlerhaft.\nBitte wiederholen Sie den Sync.
Passiert z. B. wenn die GPRS oder WLAN Verbindung abreisst.
#8124Error Open File.
Syncer kann eine Datei nicht schreiben
#8125Write Block faild.
z.B. bei Filesystemfull.