abracadabraPDF › Forums › PDF – Général › Créer une boite de dialogue › Répondre à : Créer une boite de dialogue
Salut tout le monde,
Je relance le sujet parce que j’aimerais modifier le code suivant mais je ne sais pas trop comment… :Ooops:
//Created by DialogDesigner from WindJack Solutions
var DocPrefs =
{
result: »cancel »,
DoDialog: function(){return app.execDialog(this);},
strGRP1: » »,
bChk1:false,
GetRadioSel:function(oRslts,aCtrls){
for(var strRtn=aCtrls[0];aCtrls.length>0;strRtn=aCtrls.pop()){
if(oRslts[strRtn] == true)
return strRtn;
}
return « »;
},
initialize: function(dialog)
{
var dlgInit =
{
« Chk1 »: this.bChk1,
};
dlgInit[this.strGRP1] = true;
dialog.load(dlgInit);
},
commit: function(dialog)
{
var oRslt = dialog.store();
this.strGRP1 = this.GetRadioSel(oRslt,[« Rad1″, »Rad2″, »Rad3″, »Rad4 »]);
this.bChk1 = oRslt[« Chk1 »];
},
description:
{
name: « Document Preferences »,
elements:
[
{
type: « view »,
elements:
[
{
type: « view »,
char_height: 10,
elements:
[
{
type: « static_text »,
item_id: « stat »,
name: « Please Select Configuration »,
char_width: 15,
alignment: « align_fill »,
font: « dialog »,
},
{
type: « cluster »,
item_id: « cls1 »,
name: « Form Target »,
char_width: 8,
char_height: 8,
elements:
[
{
type: « radio »,
item_id: « Rad1 »,
group_id: « GRP1 »,
name: « Departmental »,
},
{
type: « radio »,
item_id: « Rad2 »,
group_id: « GRP1 »,
name: « Corporate »,
},
]
},
{
type: « check_box »,
item_id: « Chk1 »,
name: « Include Section For Staff Info »,
width: 102,
height: 23,
},
{
type: « cluster »,
item_id: « cls2 »,
name: « Submission »,
char_width: 8,
char_height: 8,
elements:
[
{
type: « radio »,
item_id: « Rad3 »,
group_id: « GRP1 »,
name: « Company Server »,
},
{
type: « radio »,
item_id: « Rad4 »,
group_id: « GRP1 »,
name: « Email to Accounting »,
},
]
},
]
},
{
type: « ok_cancel »,
},
]
},
]
}
};
// Example Code
DocPrefs.strGRP1 = « »;
DocPrefs.bChk1 = false;
if(« ok » == DocPrefs.DoDialog())
{
console.println(« GRP1: » + DocPrefs.strGRP1);
console.println(« Chk1: » + DocPrefs.bChk1);
}
Ce code affiche une boîte de dialogue avec boutons radio (cf. capture en pj), moi j’aimerais à la place afficher une liste déroulante mais je ne sais pas comment la déclarer et l’appeler…
Quelqu’un aurait une idée ?
EDIT : Je viens de trouver un guide de Thom P. spécial Boîtes de dialogues!!! Si ça vous intéresse : http://www.windjack.com/DownLoads/AcroDialogsHelp.pdf
Je vais me lancer dans sa lecture voir si ça m’aide.
