google-code-export / gambas

Automatically exported from code.google.com/p/gambas
1 stars 0 forks source link

Change the name of the control will lead to code error #328

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) Describe the problem.
Change the name of the control will lead to code error.

2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):

Version: 3.2
Revision:
Operating system: Linux
Distribution: Ubuntu
Architecture: x86
GUI component: QT4
Desktop used: xfce

3) Provide a little project that reproduces the bug or the crash.

4) If your project needs a database, try to provide it, or part of it.

5) Explain clearly how to reproduce the bug or the crash.
 A.insert two forms(e.g.:Form1,Form2). each form has a button, and have a same name(e.g.: Button1)
 B.write the code in Form1:
   Public Sub Button1_Click()
     Form2.Button1.Tag = "form2.button1"
   End
 C.Now, change the name of the button on Form1.(e.g.:Button2). 
 D.the code will auto change into:
   Public Sub Button2_Click()
     Form2.Button2.Tag = "form2.button1"
   End
 E.All of the "Button1" in the code change into "Button2". Attention:"Form2.Button1 >> Form2.Button2".

Original issue reported on code.google.com by jmx...@qq.com on 8 Sep 2012 at 3:50

GoogleCodeExporter commented 9 years ago
Is it better with revision #5143?

Original comment by benoit.m...@gmail.com on 8 Sep 2012 at 8:15

GoogleCodeExporter commented 9 years ago
I tried the new version 3.3 (sebikul's Gambas Daily Builds PPA, 
3.2.90-0+svn4039~precise1). When rename a control, just AutoCorrect the code of 
the form  which the control on, the code of other form can not be automatically 
corrected. 

e.g.:
 A. two forms(e.g.:Form1,Form2). Form1 has a button(e.g.: Button1)
 B. code in Form1:
   Public Sub Button1_Click()
     Me.Button1.Tag = "form1.button1"
   End
 C. code in Form2, reference to the Form1:
   Public Sub test()
     Form1.Button1.Tag = "form1.button1"
   End
 D. Now, change the name of the Button1 on Form1.(e.g.:Button1-1). 
 E.the code in Form1 will auto change:
   Public Sub Button1-1_Click()
     Me.Button1-1.Tag = "form1.button1"
   End
 F. But the code in Form2 remain as:
   Public Sub test()
     Form1.Button1.Tag = "form1.button1"
   End

Original comment by jmx...@qq.com on 9 Sep 2012 at 9:24

GoogleCodeExporter commented 9 years ago
Sorry, but the code renaming only works inside the current form. It will not 
browse the entire project.

Original comment by benoit.m...@gmail.com on 11 Sep 2012 at 5:41