Bonjour,
Je suis en train de découvrir (quasi) l'utilisation de l'xtra MUI. Pourtant, j'ai quelques années de Lingo à mon actif mais ça m'avais toujours rebuté...et il y a de quoi, car c'est quand même pas si simple que ça.
J'avance donc, mais je bute sur une chose : je ne comprend pas comment je peux faire pour modifier une caractéristique d'un élément en fonction d'un autre.
J'ai une case à cocher qui , en fonction de son état , devrait faire passer une zone de saisie à Enabled ou Disabled.
Si une bonne âme pouvait m'éclairer !
Merci d'avance
Loïc
Nos formations à venir :
MUI pas simple
Débuté par loicremy, nov. 22 2010 05:38
#1
Posté 22 novembre 2010 - 05:38
#2
Posté 23 novembre 2010 - 08:47
Bonjour,
Pour créer ce type de case a cocher avec l'Xtra MUI, j'ai utilisé la méthode suivante :
j'ai récupéré sur un site (je ne sais plus lequel depuis) un fichier EasyDialog.dcr que j'ai placé dans mon dossier Xtras et que j'ouvre depuis le menu Xtra de director. Je crée ainsi mes elements cases a cocher, champs de saisies etc... je valide et cela me crée le script que je peux ensuite personaliser.
voici un exemple de script crée que j'ai adapté pour récuperer les cases cochées et la valeur du champs texte :
le placer dans un MovieScript et lancer: ShowDialog() depuis la fenetre de message pour voir les valeurs récupérées.
PS : vous devez créer un champ texte nommé "texte_boitiers" dans votre distribution
on ShowDialog
global oDialog, gUtilisation_boitiers, duree_inter_diapo, gBoitiers_PPT, gUtilisation_2eme_ecran
-- initialisation de mes globales et de mon champ texte
gUtilisation_boitiers = false
duree_inter_diapo = 10
gBoitiers_PPT = False
member("texte_boitiers").text = "Sans boîtiers"
gUtilisation_2eme_ecran = false
--
if not objectP(oDialog) then
set oDialog to new(xtra "mui")
initialize(oDialog, [#windowPropList: [#type: #normal, #name: "QUIZProject", #callback: "MiawBoitiers", #mode: #pixel, #xPosition: -1, #yPosition: -1, #width: 303, #height: 177, #modal: 1, #toolTips: 0, #closebox: 1, #canZoom: 0], #windowItemList: [[#value: 0, #type: #WindowBegin, #attributes: [], #title: "title", #tip: "tip", #locH: 25, #locV: 25, #width: 200, #height: 25, #enabled: 1], [#value: 0, #type: #pushButton, #attributes: [], #title: "OK", #tip: "tip", #locH: 92, #locV: 146, #width: 80, #height: 20, #enabled: 1], [#value: "Délai entre les diapositives (Projection en automatique)", #type: #label, #attributes: [#textSize: #normal], #title: "Push", #tip: "tip", #locH: 20, #locV: 20, #width: 268, #height: 14, #enabled: 1], [#value: "10", #type: #editText, #attributes: [#textSize: #normal], #title: "Push", #tip: "tip", #locH: 20, #locV: 43, #width: 30, #height: 20, #enabled: 1], [#value: "Seconde(s)", #type: #label, #attributes: [#textSize: #normal], #title: "Push", #tip: "tip", #locH: 63, #locV: 49, #width: 65, #height: 14, #enabled: 1], [#value: 0, #type: #checkBox, #attributes: [], #title: "Utilisation de boîtiers radio TELEDIS", #tip: "tip", #locH: 23, #locV: 70, #width: 0, #height: 0, #enabled: 1], [#value: 0, #type: #checkBox, #attributes: [], #title: "Utilisation d'un deuxieme écran", #tip: "tip", #locH: 23, #locV: 100, #width: 0, #height: 0, #enabled: 1],[#value: 0, #type: #WindowEnd, #attributes: [], #title: "title", #tip: "tip", #locH: 25, #locV: 25, #width: 200, #height: 25, #enabled: 1]]])
run(oDialog)
set oDialog to 0
end if
end
on MiawBoitiers WhatEvent, WhichWidget, PropertiesOfTheConcernedWidget
global oDialog , gUtilisation_boitiers, duree_inter_diapo, gBoitiers_PPT, gUtilisation_2eme_ecran
case WhatEvent of
#windowOpen :
nothing
#itemLosingFocus :
if the type of PropertiesOfTheConcernedWidget = #editText then
set duree_inter_diapo to the value of PropertiesOfTheConcernedWidget
put "duree_inter_diapo ="&duree_inter_diapo
end if
#itemChanged :
case WhichWidget of
2 : --pushButton
nothing
3 : --label
nothing
4 : --editText
if the type of PropertiesOfTheConcernedWidget = #editText then
set duree_inter_diapo to the value of PropertiesOfTheConcernedWidget
put "duree_inter_diapo ="&duree_inter_diapo
end if
5 : --label
nothing
6 : --checkBox
gUtilisation_boitiers = Not gUtilisation_boitiers
if gUtilisation_boitiers = 1 then
gBoitiers_PPT = true
member("texte_boitiers").text = "Avec boîtiers"
else
gBoitiers_PPT = False
member("texte_boitiers").text = "Sans boîtiers"
end if
put " gUtilisation_boitiers = "& gUtilisation_boitiers
put " gBoitiers_PPT = "& gBoitiers_PPT
7 : --checkBox
gUtilisation_2eme_ecran = Not gUtilisation_2eme_ecran
put " gUtilisation_2eme_ecran = "& gUtilisation_2eme_ecran
end case
#itemClicked :
case the type of PropertiesOfTheConcernedWidget of
#CheckBox :
gUtilisation_boitiers = Not gUtilisation_boitiers
if gUtilisation_boitiers = 1 then
gBoitiers_PPT = true
member("texte_boitiers").text = "Avec boîtiers"
else
gBoitiers_PPT = False
member("texte_boitiers").text = "Sans boîtiers"
end if
put " gUtilisation_boitiers = "& gUtilisation_boitiers
put " gBoitiers_PPT = "& gBoitiers_PPT
gUtilisation_2eme_ecran = Not gUtilisation_2eme_ecran
put " gUtilisation_2eme_ecran = "& gUtilisation_2eme_ecran
#radiobutton :
nothing
#IntegerSliderH :
nothing
#PushButton :
put " gUtilisation_boitiers = "& gUtilisation_boitiers
put "duree_inter_diapo ="&duree_inter_diapo
put " gBoitiers_PPT = "& gBoitiers_PPT
put " gUtilisation_2eme_ecran = "& gUtilisation_2eme_ecran
stop(oDialog, 0)
#defaultPushButton :
stop(oDialog, 1)
end case
#windowClosed :
nothing
otherwise : nothing
end case
end
en piéce jointe le fichier easydialog.dcr zippé
Pour créer ce type de case a cocher avec l'Xtra MUI, j'ai utilisé la méthode suivante :
j'ai récupéré sur un site (je ne sais plus lequel depuis) un fichier EasyDialog.dcr que j'ai placé dans mon dossier Xtras et que j'ouvre depuis le menu Xtra de director. Je crée ainsi mes elements cases a cocher, champs de saisies etc... je valide et cela me crée le script que je peux ensuite personaliser.
voici un exemple de script crée que j'ai adapté pour récuperer les cases cochées et la valeur du champs texte :
le placer dans un MovieScript et lancer: ShowDialog() depuis la fenetre de message pour voir les valeurs récupérées.
PS : vous devez créer un champ texte nommé "texte_boitiers" dans votre distribution
on ShowDialog
global oDialog, gUtilisation_boitiers, duree_inter_diapo, gBoitiers_PPT, gUtilisation_2eme_ecran
-- initialisation de mes globales et de mon champ texte
gUtilisation_boitiers = false
duree_inter_diapo = 10
gBoitiers_PPT = False
member("texte_boitiers").text = "Sans boîtiers"
gUtilisation_2eme_ecran = false
--
if not objectP(oDialog) then
set oDialog to new(xtra "mui")
initialize(oDialog, [#windowPropList: [#type: #normal, #name: "QUIZProject", #callback: "MiawBoitiers", #mode: #pixel, #xPosition: -1, #yPosition: -1, #width: 303, #height: 177, #modal: 1, #toolTips: 0, #closebox: 1, #canZoom: 0], #windowItemList: [[#value: 0, #type: #WindowBegin, #attributes: [], #title: "title", #tip: "tip", #locH: 25, #locV: 25, #width: 200, #height: 25, #enabled: 1], [#value: 0, #type: #pushButton, #attributes: [], #title: "OK", #tip: "tip", #locH: 92, #locV: 146, #width: 80, #height: 20, #enabled: 1], [#value: "Délai entre les diapositives (Projection en automatique)", #type: #label, #attributes: [#textSize: #normal], #title: "Push", #tip: "tip", #locH: 20, #locV: 20, #width: 268, #height: 14, #enabled: 1], [#value: "10", #type: #editText, #attributes: [#textSize: #normal], #title: "Push", #tip: "tip", #locH: 20, #locV: 43, #width: 30, #height: 20, #enabled: 1], [#value: "Seconde(s)", #type: #label, #attributes: [#textSize: #normal], #title: "Push", #tip: "tip", #locH: 63, #locV: 49, #width: 65, #height: 14, #enabled: 1], [#value: 0, #type: #checkBox, #attributes: [], #title: "Utilisation de boîtiers radio TELEDIS", #tip: "tip", #locH: 23, #locV: 70, #width: 0, #height: 0, #enabled: 1], [#value: 0, #type: #checkBox, #attributes: [], #title: "Utilisation d'un deuxieme écran", #tip: "tip", #locH: 23, #locV: 100, #width: 0, #height: 0, #enabled: 1],[#value: 0, #type: #WindowEnd, #attributes: [], #title: "title", #tip: "tip", #locH: 25, #locV: 25, #width: 200, #height: 25, #enabled: 1]]])
run(oDialog)
set oDialog to 0
end if
end
on MiawBoitiers WhatEvent, WhichWidget, PropertiesOfTheConcernedWidget
global oDialog , gUtilisation_boitiers, duree_inter_diapo, gBoitiers_PPT, gUtilisation_2eme_ecran
case WhatEvent of
#windowOpen :
nothing
#itemLosingFocus :
if the type of PropertiesOfTheConcernedWidget = #editText then
set duree_inter_diapo to the value of PropertiesOfTheConcernedWidget
put "duree_inter_diapo ="&duree_inter_diapo
end if
#itemChanged :
case WhichWidget of
2 : --pushButton
nothing
3 : --label
nothing
4 : --editText
if the type of PropertiesOfTheConcernedWidget = #editText then
set duree_inter_diapo to the value of PropertiesOfTheConcernedWidget
put "duree_inter_diapo ="&duree_inter_diapo
end if
5 : --label
nothing
6 : --checkBox
gUtilisation_boitiers = Not gUtilisation_boitiers
if gUtilisation_boitiers = 1 then
gBoitiers_PPT = true
member("texte_boitiers").text = "Avec boîtiers"
else
gBoitiers_PPT = False
member("texte_boitiers").text = "Sans boîtiers"
end if
put " gUtilisation_boitiers = "& gUtilisation_boitiers
put " gBoitiers_PPT = "& gBoitiers_PPT
7 : --checkBox
gUtilisation_2eme_ecran = Not gUtilisation_2eme_ecran
put " gUtilisation_2eme_ecran = "& gUtilisation_2eme_ecran
end case
#itemClicked :
case the type of PropertiesOfTheConcernedWidget of
#CheckBox :
gUtilisation_boitiers = Not gUtilisation_boitiers
if gUtilisation_boitiers = 1 then
gBoitiers_PPT = true
member("texte_boitiers").text = "Avec boîtiers"
else
gBoitiers_PPT = False
member("texte_boitiers").text = "Sans boîtiers"
end if
put " gUtilisation_boitiers = "& gUtilisation_boitiers
put " gBoitiers_PPT = "& gBoitiers_PPT
gUtilisation_2eme_ecran = Not gUtilisation_2eme_ecran
put " gUtilisation_2eme_ecran = "& gUtilisation_2eme_ecran
#radiobutton :
nothing
#IntegerSliderH :
nothing
#PushButton :
put " gUtilisation_boitiers = "& gUtilisation_boitiers
put "duree_inter_diapo ="&duree_inter_diapo
put " gBoitiers_PPT = "& gBoitiers_PPT
put " gUtilisation_2eme_ecran = "& gUtilisation_2eme_ecran
stop(oDialog, 0)
#defaultPushButton :
stop(oDialog, 1)
end case
#windowClosed :
nothing
otherwise : nothing
end case
end
en piéce jointe le fichier easydialog.dcr zippé
1 utilisateur(s) li(sen)t ce sujet
0 membre(s), 1 invité(s), 0 utilisateur(s) anonyme(s)









