RectControl properties randomly stop working

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.

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.

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.

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.

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?

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?

Thanks for your interest and input

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

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

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?

[quote=462014:@Markus Rauch]you have other apps running that are not OS conform?
your os try doing updates in background?[/quote]
No, not that I can see

[quote=462020:@Beatrix Willius]As Markus has said as comparison of the xml would be good.
Where is your project saved? iCloud or Dropbox?[/quote]
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!

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”

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.

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 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.

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.

[quote=462261:@Markus Rauch]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.[/quote]

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.

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.

[quote=461974:@Frank Sun]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[/quote]

  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).
  1. Use the paint event of the window to draw your gradients, cutting out the canvas.

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 just found a workaround for the tooltip issue which has previously been reported (https://xojo.com/issue/31888)]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 :slight_smile:

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”

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

[quote=462342:@Sam Rowlands]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.[/quote]
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

Me.AcceptFileDrop( "????" )

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

[quote=462343:@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[/quote]

This could be improved as such.

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