RectControl properties randomly stop working

  1. last week

    Frank S

    Nov 5 Australia

    Hi,

    I was wondering if anyone has had any similar problems to me. In my project - using Xojo 2019r2 on Mac, and this also happened with 2019r1 - once in a while certain controls, which were previously functioning as expected, just stop working properly. These include:

    Listbox
    1. Me.AcceptFileDrop(MRFileTypes.Any) in Open event
    Listbox stops accepting file drops
    2. Me.AllowRowReordering = true in Open event
    Listbox stops allowing row reorder

    UpDownArrows
    Tooltip is set but does not display

    These problems occur both running in debug mode and in building the app. The workaround I have is that if I duplicate the problematic control, delete the original control and replace it with the duplicate (renamed to the original name), then it will work again as expected. Until a month or so later when it stops working again!

    Very frustrating! I couldn't find any reports of this type of problem in the forum or in the Feedback. Would anyone have any suggestions on how to isolate the issue or ideally fix the recurrent problem? I will open a case in Feedback, but I think that it will just be labelled as issue not reproduceable.

    Thanks.

  2. Emile S

    Nov 6 Europe (France, Strasbourg)

    Have you always enough available RAM to run your application ?

    When writing, building and testing a project / application, be sure to quit nearly all other application to let room available for Xojo/ your application.

  3. Rick A

    Nov 6 Pre-Release Testers (Brazil. GMT-3:00)

    Nothing he describes seems related to insufficient memory. He needs give us more data, like which OS. The best way of showing/solving it is sending us a sample of the code with the alleged problems, and video showing it.

    Sometimes it is just some mistake, with things going out of scope.

  4. Rick A

    Nov 6 Pre-Release Testers (Brazil. GMT-3:00)
    Edited last week

    Or he is affected by things done in previous versions moved to 2019r2 and losing properties and having new events. He needs to show the case.

  5. Markus R

    Nov 6 Pre-Release Testers, Xojo Pro Europe / Germany

    @Frank S The workaround I have is that if I duplicate the problematic control, delete the original control and replace it with the duplicate (renamed to the original name), then it will work again as expected.

    at the issue i would "save as" the project into xml and compare.
    at the issue a ide restart help?
    other window ui elements are responding at runtime?
    the issue also happens if you start the binary executable without ide (closed)?
    you have other apps running that are not OS conform?
    your os try doing updates in background?

  6. 7 days ago

    Beatrix W

    Nov 6 Pre-Release Testers, Third Party Store Europe (Germany)

    As nobody else is having similar problems it must be special to you. Sorry, I know that sucks.

    As Markus has said as comparison of the xml would be good.

    Where is your project saved? iCloud or Dropbox?

  7. 6 days ago

    Frank S

    Nov 7 Australia

    Thanks for your interest and input

    @Markus R at the issue a ide restart help?

    Quitting and restarting the Xojo IDE does not fix the problems. The problems also occur if I build the app

    @Markus R other window ui elements are responding at runtime?

    Yes, apart from these few problems, everything else responds as expected

    @Markus R the issue also happens if you start the binary executable without ide (closed)?

    Sorry, I'm not quite sure what you mean by that. If Xojo is closed and I double click on my binary project, it opens the IDE then I have to click run to compile the app. Is there another way to do it?

    @Markus R you have other apps running that are not OS conform?
    your os try doing updates in background?

    No, not that I can see

    @Markus R at the issue i would "save as" the project into xml and compare.

    @Beatrix W As Markus has said as comparison of the xml would be good.
    Where is your project saved? iCloud or Dropbox?

    I have no experience with XML unfortunately, so I would not really know what to look for - I am what I believe is called a citizen developer :P. I did save my project in text format though and looked at the problematic controls and to my untrained eye, the code that should allow file drop, row reordering and tooltips were there. If you would be interested and willing to have a look at my project, I could upload it to Dropbox. Should I share the link on this forum or is there a way to private message you?

    Thanks for your help!

  8. Markus R

    Nov 7 Pre-Release Testers, Xojo Pro Europe / Germany

    i not meant the binary project file, the meant if you make a build you create a .exe file at windows, this you can open and test.
    there are free tools for compare text files like "beyond compare" or "WinDiff"

  9. Beatrix W

    Nov 7 Pre-Release Testers, Third Party Store Europe (Germany)

    There is an app called "DiffMerge" to show differences between 2 files. Do a 2 way diff, then select 2 files and you will be able to see the differences.

  10. Frank S

    Nov 7 Australia

    Ok, here are some interesting results...

    I downloaded DiffMerge by SourceGear. I saved my project into XML format. I made a copy of the project, and fixed my listbox problem by duplicating the control then replacing the original. I did a 2 way diff on the two files and there were a LOT of differences, none of which I knew how to interpret.

    So I started again, trying eliminate any differences between the original and after duplicating the listbox. In the original I moved the listbox to the front, using "order front" - it was 14th from the front before - as I noticed that when I create the duplicate, it was placed at the front.

    When I ran 2 way diff again, this time there were only 5 differences identified, which were all <partID> numbers, which to me suggested that everything should be functionally the same, which is when I discovered that the in the original, non-working version, that row reordering now worked!

    After doing more testing, moving the the listbox from the front backwards, I discovered that row reordering worked if the list box is one of the 3 frontmost controls and would not work if it is the 4th or greater.

    Moving my other listbox to the front also fixed the accept file drop problem too (they are on different page panels).

    Is this expected behaviour? To be honest, I haven't paid any attention to the control order before as I don't overlap any controls. And it explains why the problem reoccurs every few months for me, as I keep tinkering with the layout and adding new controls and pushing the older ones back in the order!

    The issue of the tooltips not working, I haven't figured out yet. My duplication trick didn't work to fix that. Thanks for pointing me in the right direction. This was driving me crazy. Still don't really understand the cause of the problems, but at least now I know how to avoid it.

    Cheers.

  11. Markus R

    Nov 7 Pre-Release Testers, Xojo Pro Europe / Germany

    have this window a default button?
    maybe write a system.debuglog at all focus changes for each control.
    if you can strip down to the issue u can add a example project in the feedback app.

  12. 5 days ago

    Frank S

    Nov 7 Australia

    @Markus R have this window a default button?
    maybe write a system.debuglog at all focus changes for each control.
    if you can strip down to the issue u can add a example project in the feedback app.

    There are no buttons that are set as default on the window.
    What would I be looking for by logging the focus changes? I set up system.debuglog for the gotfocus and lostfocus events of one of the problematic listboxes. The events get appropriately logged regardless of whether it is at Order front (and row reordering works) or it is further back (and row reordering doesn't work)

    Is there any documentation on the importance of control order? I can't find anything apart from the UserGuide: layout editor section that merely says "The Ordering buttons (Order Forward, Order Front, Order Backward and Order Back) are used to change the ordering of the controls on the layout."

    My main window has a pagepanel with 16 pages and hundreds of controls in total, and it seems that the order applies to all controls, not just controls on an individual page. Is there a way to view the order of all the controls, eg like viewing the tab order? It's hard to try to work out why the control order affects my listbox function, without being able to know the order of controls.

  13. Frank S

    Nov 7 Australia

    I've made some progress with the tooltips that aren't working. Controls whose parent is the pagepanel, the tooltip works. Controls whose parent is a canvas that is placed on the pagepanel, the tooltip does not work.

    Is this expected behaviour? And if so, is there a workaround. I am using the canvas to draw a gradient background behind the controls.

  14. Sam R

    Nov 7 Pre-Release Testers, Xojo Pro, Third Party Store Hengchun, Pingtung, Taiwan

    @Frank S 1. Me.AcceptFileDrop(MRFileTypes.Any) in Open event
    Listbox stops accepting file drops
    2. Me.AllowRowReordering = true in Open event
    Listbox stops allowing row reorder

    1. Try "????" as the file type and filter in the Drop Event.
    2. Set this in the property inspector of the IDE and not in code. Some options are like that (only settable at design time).

    @Frank S Is this expected behaviour? And if so, is there a workaround. I am using the canvas to draw a gradient background behind the controls.

    3. Use the paint event of the window to draw your gradients, cutting out the canvas.

    @Frank S My main window has a pagepanel with 16 pages and hundreds of controls in total, and it seems that the order applies to all controls, not just controls on an individual page. Is there a way to view the order of all the controls, eg like viewing the tab order? It's hard to try to work out why the control order affects my listbox function, without being able to know the order of controls.

    In the future when you refactor your code, consider using container control for the pages. I too have a complex interface on one window, and I hate changing it because there's so many controls it all bogs downs.

    It took a lot of work, but refactoring these into separate container control and dynamically instigating them when needed has improved working in the IDE and now because a page isn't initialized until the user first brings it forwards, that window opens up much quicker in the application.

  15. Frank S

    Nov 7 Australia

    I just found a workaround for the tooltip issue which has previously been reported Feedback Case 31888 on this forum post https://forum.xojo.com/50628-failure-of-tooltips-helptags-under-os-x/0 . So at least that particular issue is sorted :)

    @Sam R 1. Try "????" as the file type and filter in the Drop Event.

    Currently in my list DropObject event, I have

    If obj.FolderItemAvailable Then
      Do
        Dim f As FolderItem
        f = obj.FolderItem
        Dim topicid As Integer = Val(CurrentSelectedTopicId)
        MyResourcesAddNew(topicid, f)
      Loop Until obj.NextItem = False
    End If

    How would I implement your suggestion? I thought the file type filtering was done by
    Me.AcceptFileDrop(MRFileTypes.Any)
    which is in the listbox Open event. MRFileTypes is a File Type Set that I have created and added the common file type "special/any" and called it "Any"

    @Sam R 2. Set this in the property inspector of the IDE and not in code. Some options are like that (only settable at design time).

    I currently have Allow Row Reordering set to true in the IDE, but unfortunately whether it works or not is still dependent on the listbox's z-order

    @Sam R In the future when you refactor your code, consider using container control for the pages. I too have a complex interface on one window, and I hate changing it because there's so many controls it all bogs downs.

    It took a lot of work, but refactoring these into separate container control and dynamically instigating them when needed has improved working in the IDE and now because a page isn't initialized until the user first brings it forwards, that window opens up much quicker in the application.

    I may have to consider doing that. When I switched from Filemaker, pagepanels seemed to be the best equivalent of Filemaker's GoToLayout, but in hindsight, container controls may have been better.

    Thanks for your help

  16. Sam R

    Nov 8 Pre-Release Testers, Xojo Pro, Third Party Store Hengchun, Pingtung, Taiwan
    Me.AcceptFileDrop( "????" )

    If how you use it, sorry for not being clear before.

    @Frank Sun If obj.FolderItemAvailable Then
    Do
    Dim f As FolderItem
    f = obj.FolderItem
    Dim topicid As Integer = Val(CurrentSelectedTopicId)
    MyResourcesAddNew(topicid, f)
    Loop Until obj.NextItem = False
    End If

    This could be improved as such.

    Do
        if obj.folderItem.available then MyResourcesAddNew( Val( CurrentSelectedTopicId ), obj.folderitem )
    loop until obj.nextItem = false

or Sign Up to reply!