General information
Category:
Object Oriented Programming
Alô Lassala,
O problema ocorre em tempo de execução também.
Este código ( ThisForm.l1.Left = ThisForm.T.value ) está num CommandButton.
Estou mandando o código pra vc ver. Veja a confusão de chamadas que o
programa faz.
Até+
Marcus Rio Apa
**************************************************
*-- Class: list_teste (c:\a\a.vcx)
*-- ParentClass: listbox
*-- BaseClass: listbox
*-- Time Stamp: 01/31/02 03:22:12 PM
*
DEFINE CLASS list_teste AS listbox
Height = 170
Width = 100
Name = "l"
PROTECTED PROCEDURE this_access
Lparameters cMemberName
MessageBox("Método Access")
DO case
Case cMemberName = 'caption'
MessageBox("Acessou a propriedade caption")
Case cMemberName = 'listcount'
MessageBox("Acessou a propriedade ListCount")
Case cMemberName = 'left'
MessageBox("Acessou a propriedade Left")
Case cMemberName = 'width'
MessageBox("Acessou a propriedade Width")
OtherWise
MessageBox(Str(cMemberName))
EndCase
Return This
ENDPROC
PROCEDURE left_assign
LPARAMETERS vNewVal
MessageBox("Método Assign")
If vNewVal > 30
MessageBox("Maior que 30. Altera")
THIS.LEFT = m.vNewVal
Else
MessageBox("Menor que 30. Não altera")
return
EndIf
ENDPROC
ENDDEFINE
*
*-- EndDefine: list_teste
**************************************************
E agora, o código do form:
**************************************************
PUBLIC oform1
SET CLASSLIB TO c:\a\a.vcx ADDITIVE
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
**************************************************
*-- Form: form1 (c:\a\form2.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 01/31/02 03:24:03 PM
*
DEFINE CLASS form1 AS form
Top = 14
Left = 53
Height = 139
Width = 290
DoCreate = .T.
Caption = "Form1"
Name = "FORM1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 48, ;
Left = 144, ;
Height = 27, ;
Width = 84, ;
Caption = "Assign", ;
TabIndex = 1, ;
Name = "Command1"
ADD OBJECT t AS textbox WITH ;
Alignment = 3, ;
Value = 10, ;
Height = 23, ;
Left = 144, ;
TabIndex = 3, ;
Top = 12, ;
Width = 100, ;
Name = "t"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 84, ;
Left = 144, ;
Height = 27, ;
Width = 84, ;
Caption = "Access", ;
TabIndex = 2, ;
Name = "Command2"
ADD OBJECT l1 AS list_teste WITH ;
Height = 100, ;
Left = 36, ;
Top = 12, ;
Width = 96, ;
Name = "l1"
PROCEDURE this_access
LPARAMETER cMemberName && Object member name
IF cMemberName = 'caption'
? cMemberName && Display the object member name
ENDIF
RETURN THIS
ENDPROC
PROCEDURE this_assign
LPARAMETERS vNewVal
*To do: Modify this routine for the Assign method
THIS.This = m.vNewVal
ENDPROC
PROCEDURE width_access
*To do: Modify this routine for the Access method
Lparameters a
MessageBox("Acessou o Width",0,"Clientes IV")
If a > 500
MessageBox("> 500",0)
Return
Else
MessageBox("< 500",0)
RETURN THIS.WIDTH
EndIf
ENDPROC
PROCEDURE command1.Click
ThisForm.l1.Left = ThisForm.T.value
ENDPROC
PROCEDURE command2.Click
MessageBox(Str(Thisform.l1.Left))
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only