lun. 03 septembre 2018, 12h02
eddymaue
atoutfox.public.association
Re: petit souci
[vfp]
*voilà j'avais oublié ce truc
Wait Window EmInputBox("Exemple : MaVariable = 5","Local as
string",'ll')
*
/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
EmInputBox
* / Eddy Maue a+ -- Créer le : 2018-09-03
Procedure EmInputBox
Lparameters tcTitre,tcCaption, tcDefaultValue
Private gcRetVal
m.gcRetVal = ""
Local loFrm As Form
loFrm = Createobject("clssEMInputBox",tcTitre,tcCaption,
tcDefaultValue)
loFrm.Show(1)
Return gcRetVal
Endproc && EmInputBox
*If Not Empty(lo.cRetValue)
**************************************************
*-- Auteur : Eddy Maue
*-- Form: form1 (c:\vfp\dev\test_EmInputBox.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 09/02/18 06:36:02 PM
*
Define Class clssEMInputBox As Form
AutoCenter= .T.
WindowType= 1 && modal
Top = -1
Left = 0
Height = 108
Width = 289
DoCreate = .T.
Caption = "EmInputBox : cDialogCaption"
cTitre = ""
cCaption = ""
cRetvalue = ""
Name = "Form1"
*
--------------------------------------------------------------------------------
Add Object lblPromptInput As Label With ;
AutoSize = .T., ;
Caption = "cInputPrompt ", ;
Height = 17, ;
Left = 5, ;
Top = 12, ;
Width = 78, ;
Name = "lblPromptInput "
*
--------------------------------------------------------------------------------
Add Object btnAccept As CommandButton With ;
Top = 72, ;
Left = 107, ;
Height = 27, ;
Width = 84, ;
Anchor = 12, ;
Caption = "Accepter", ;
Default = .T., ;
Name = "btnAccept"
*
--------------------------------------------------------------------------------
Add Object btnAnnuler As CommandButton With ;
Top = 72, ;
Left = 197, ;
Height = 27, ;
Width = 84, ;
Anchor = 12, ;
Cancel = .T., ;
Caption = "Annuler", ;
Name = "btnAnnuler"
*
--------------------------------------------------------------------------------
Add Object edit1 As EditBox With ;
Anchor = 15, ;
Height = 24, ;
Left = 5, ;
ScrollBars = 0, ;
Top = 36, ;
Width = 276, ;
Name = "Edit1"
*
--------------------------------------------------------------------------------
*
--------------------------------------------------------------------------------
Procedure ccaption_assign
Lparameters tcCaption
Store m.tcCaption To This.cCaption, This.Caption
Endproc
*
--------------------------------------------------------------------------------
*
--------------------------------------------------------------------------------
Procedure ctitre_assign
Lparameters tcTitre
This.cTitre = tcTitre
This.label1.Caption = tcTitre
Endproc
*
--------------------------------------------------------------------------------
*
--------------------------------------------------------------------------------
Procedure mAccept
Thisform.cRetvalue = Thisform.edit1.Text
Thisform.Release()
Endproc
Procedure Release
m.gcRetVal = This.cRetvalue
Endproc
Procedure Unload
Endproc
*
--------------------------------------------------------------------------------
*
--------------------------------------------------------------------------------
*
--------------------------------------------------------------------------------
Procedure Init
Lparameters tcTitre,tcCaption, tcDefaultValue
Local lsDefault As String
lsDefault = Transform(m.tcDefaultValue)
If Vartype(m.tcCaption)=="C" And Not Empty(m.tcCaption)
This.Caption = m.tcCaption
Endif
If Vartype(m.tcTitre)=="C" And Not Empty(m.tcTitre)
This.lblPromptInput.Caption = m.tcTitre
Endif
If Vartype(m.lsDefault)=="C" And Not Empty(m.lsDefault)
This.edit1.Value = Transform(m.lsDefault)
EndIf
this.edit1.setfocus()
this.edit1.selstart = 3000
Endproc
Procedure mAnnuler()
Thisform.Release()
Endproc
Procedure btnAccept.Click
Thisform.mAccept()
Endproc
Procedure btnAnnuler.Click()
Thisform.cRetvalue = ""
Thisform.Release()
Endproc
Procedure QueryUnload()
Thisform.cRetvalue = ""
Thisform.Release
Endproc
Enddefine
*
*-- EndDefine: form1
**************************************************
[vfp/]
--
a+ Eddy
Merci de partager avec moi votre immense savoir que je me ferai plaisir
d'absorber... il va de soi que je vais vous en laisser un peu
Politesse et savoir vivre oblige ;0)
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000019181