View Single Post
Old 02-29-2012, 04:35 PM   #3478
quisvir
Addict
quisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animals
 
quisvir's Avatar
 
Posts: 238
Karma: 6875
Join Date: Feb 2009
Location: Netherlands
Device: Kindle PW2
JSWolf:
For the differences between 2.1 and 2.0, see the WhatsNewIn2_1_x wiki page.

Analogus:
To create a dialog on x50 models, you can use this code in a function:
Code:
var dialog = kbook.model.getConfirmationDialog();
dialog.onOk = function () {
	// what to do if Ok/Yes is pressed
}
dialog.onNo = function () {
	// what to do if No/Cancel is pressed
}
dialog.openDialog('Dialog text', 'As many lines as you want', 'three...', 'maybe four?', 0);
The last parameter given to openDialog determines the buttons (basically):

0 = Yes/No
1 = Ok
2 = no buttons, keys locked
3 = no buttons, keys working
4 = Cancel

There are more possibilities (see main.xml, search for CONFIRMATION_DIALOG_AREA), but these are the most useful. Dialogs have a few more properties and methods such as 'target' and 'closeDialog', but the above should cover most cases.
quisvir is offline   Reply With Quote