Strange behavior in v2.71

realblue

Member
Licensed User
Longtime User
Hi Erel;

Starting with version 2.71 I'am having difficulty in the development environment.

Please test this :

Open any source code having more than 100 lines.
Click on the first line
With mouse wheel scroll down lets say line 70 but don't click anywhere.
As soon as the mouse wheel is release you will jump the first line where the cursor was.

This also happens when inline help pops.
 

realblue

Member
Licensed User
Longtime User
Hi Erel,

That answer doesn't answer my question though describes the same problem.
 

realblue

Member
Licensed User
Longtime User
I am really sorry but "the answer" does not solve my problem.

If you like to try here is my code :

B4X:
#Region  Project Attributes 
   #ApplicationLabel: cityFortis
   #VersionCode: 1
   #VersionName: 
   'SupportedOrientations possible values: unspecified, landscape or portrait.
   #SupportedOrientations: unspecified
   #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
   #FullScreen: False
   #IncludeTitle: True
#End Region

Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

   Dim FTP As FTP
   
   Type t_connections (DatabaseType As Int, _
                       DataSource As String, _
                  Catalog As String, _
                  Provider As String, _
                  ConnType As String, _
                  WebServisUrl As String, _
                  UserName As String, _
                  Password As String, _
                  Name As String)
   Dim connections(16) As t_connections

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
        FTP.Initialize("FTP", "XXXX", 21, "XXXX", "XXXX")
      FTP.DownloadFile("/NF_UPDATE/mobilconnections.xml", False, File.DirDefaultExternal, "connections.xml")
    End If
   'Do not forget to load the layout file created with the visual designer. For example:
   'Activity.LoadLayout("lyLogin")
End Sub

Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
   If Success = True Then
       'Dim bufstr As String
       'bufstr=File.ReadString(File.DirDefaultExternal, "connections.xml")
      Dim XOMBuilder1 As XOMBuilder
       XOMBuilder1.Initialize("XOMBuilder1")
      'XOMBuilder1.BuildFromString(bufstr, "", Null)
      XOMBuilder1.BuildFromFile(File.DirDefaultExternal & "/connections.xml",Null)
   End If
End Sub

Sub XOMBuilder1_BuildDone(XOMDocument1 As XOMDocument, Tag As Object)
    If XOMDocument1=Null Then
        '    XOMDocument1 will be Null if an error has occurred
        Log("An error has occured and the XOMDocument has NOT been created")
      Log(LastException)
    Else
        Log("XOMDocument is NOT Null")
        Dim RootElement As XOMElement
      Dim ConnectionElements As XOMElements
      Dim ConnectionValues As XOMElements
      
        RootElement=XOMDocument1.RootElement
        ConnectionElements=RootElement.GetChildElements
      
      For i=0 To ConnectionElements.Size-1
         
         ConnectionValues = ConnectionElements.GetElement(i).GetChildElements
         
         For j=0 To ConnectionValues.Size-1
            Select Case ConnectionValues.GetElement(j).LocalName
               Case "DatabaseType"
               connections(i).DatabaseType=ConnectionValues.GetElement(j).Value
                   Case "DataSource"
               connections(i).DataSource=ConnectionValues.GetElement(j).Value
               Case "Catalog"
               connections(i).Catalog=ConnectionValues.GetElement(j).Value
               Case "Provider"
               connections(i).Provider =ConnectionValues.GetElement(j).Value
               Case "ConnType"
               connections(i).ConnType=ConnectionValues.GetElement(j).Value
               Case "WebServisUrl"
               connections(i).WebServisUrl=ConnectionValues.GetElement(j).Value
               Case "UserName"
               connections(i).UserName=ConnectionValues.GetElement(j).Value
               Case "Password"
               connections(i).Password=ConnectionValues.GetElement(j).Value
               Case "Name"
               connections(i).name=ConnectionValues.GetElement(j).Value
               Log(connections(i).name)
            End Select            
         Next 
      Next
      Activity.LoadLayout("lyLogin")
    End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Copy and paste it.

Click on the first row
Scroll down with mouse wheel
and release it
you will see that IDE will jump the first line

Lets say that source code is not OK. In any way an IDE should not behave like this.

Hope Erel fixes this bug soon.

Thanks
 

realblue

Member
Licensed User
Longtime User
Am I the only one who is having this problem?

I am using vb2008, eclipse and b4a at the same time in the same system. I don't think anything is wrong with my mouse or operating system.

I think that something is wrong with scrolling in the b4a editor.

Anyway I just hope that It will be fixed soon.

Thanks
 

realblue

Member
Licensed User
Longtime User
Hi Erel;

I found something that might help finding this bug.

The problem I described doesn't happen in the source code that were created before v2.71.
 

IanMc

Well-Known Member
Licensed User
Longtime User
I can't reproduce the problem.

I added a new activity module, pasted your code in it, named it Test and saved it.

I tried left-clicking at the top to the left of #Region Project Attributes
and started 'selecting' by holding the left mouse button and dragging then while the left mouse button was still held down I used the scroll wheel to continue selecting down the page then when everything was selected I released the left mouse button, no problem, the code remains selected.

I also tried holding the scroll wheel down but that doesn't let me select anything.

I couldn't get it to jump back up again, i have Win7 64bit.

I don't know if this will help but as I mentioned in another thread, you might try saving your code, uninstall B4a and re-install it.

added: I notice that you have the line Dim FTP as FTP

Try just to see if it helps, doing DIM FTP1 as FTP
 
Last edited:

realblue

Member
Licensed User
Longtime User
Thank you for trying to reproduce it.

Just click the first line so the cursor is there

either with middle mouse wheel or editor's scroll bar just scroll down and don't select anything

when the cursor disappears release the mouse.

Now in my case the editor jumps back to the first line doesn't stay where I released the mouse.
 

IanMc

Well-Known Member
Licensed User
Longtime User
I don't understand what bit of the mouse you're 'releasing'

I click at top left then I'm not holding any part of the mouse, then I use the scroll wheel to scroll down to the bottom of the code, then I hold the shift button down and I left click with the mouse while pointing to the end of the code, the entire block of code turns blue, is selected.

am I missing something?
 

agraham

Expert
Licensed User
Longtime User
Now in my case the editor jumps back to the first line doesn't stay where I released the mouse.
No, it behaves as expected for me for both the scrollbar and middle button. Is what you posted the entirety of your project with no other modules?

I don't understand what bit of the mouse you're 'releasing'.
...
am I missing something?
Press the middle button, which is separate on my mouse but on some mice it is part of the scroll wheel. A circle with an up and a down arrowhead inside appears. Holding down the middle button move the mouse above or below the circle. Another up or down arrow head appears as the mouse cursor and the text scrolls appropriately.
 

IanMc

Well-Known Member
Licensed User
Longtime User
Ah, ok, I understand now.

Some people don't have a scroll wheel or they use the pressing of the scroll wheel to scroll down which is quicker than using the wheel.

Ok, did some more tests.

left click to place the caret at top left, it is sitting there flashing away merrily.

Press and hold the scroll wheel, I get a grey symbol with an up arrow, a dot and a down arrow, that symbol appears and stays wherever it was that I first depressed the wheel, now as I move the mouse down while holding this pressed I briefly get a another black version of the symbol which moves with the mouse and then if I'm moving the mouse down it turns into just a dot with a down arrow (if I move the mouse above the existing grey symbol it turns into a dot and an up arrow) this symbol is still black.

Then when I can see the bottom line I release the mouse wheel. Incidentally at this point if I press the mouse wheel again and go back up there is my caret still flashing away where I left it and I can if I wish release the mouse button and as long as I'm careful to click on the scroll bar I can drag that down without disturbing the position of the caret.

Either way when I then hold down the shift key and left click at the end of the text the whole lot gets highlighted, I don't get any jumping back up no-matter what I try.
 

realblue

Member
Licensed User
Longtime User
Hi everybody and Erel;

Finally I located the problem. As long as I don't include "String Utils v1.02" library everything works fine. But if I include this library scrolling goes crazy in the development environment.

For those who would like to try to reproduce the bug please repeat these steps:

Open any project
Include String Utils library
Click on the first line so the cursor blinks there
Scroll down using scroll bar (with its tiny down arrow) until the first line disappears and go little further
You will see that editor jumps back to first line

Erel if you want I can send you a video recording too.

Thanks and happy programming.

PS : This will be my last post in this topic, I know you got annoyed.
 

realblue

Member
Licensed User
Longtime User
Hımm, thanks a lot.

As you sad I removed HttpUtils2 library and the problem is solved.

But don't you think that in any way an IDE shouldn't behave like this.
 
Top