Apparently this is a bug.
[<https://xojo.com/issue/45416>](<https://xojo.com/issue/45416>)
What is particularly annoying is I cannot enter any text. Yes, I know a cursor would mean no text would be selected.
I have a search field that works fine on a Mac. The MouseUp has me.SelectAll as the only code and in both OS’s it fires. On my PC the selection it disappears, and it goes into CellBackGroundPaint. I have a couple of listboxes and I’d expect it to go into CellBackGroundPaint.
Suggestions for a workaround (besides #Target)?
Nope the bug is something else. I just did a test project with the TextField as the sole control and I got SelectAll. I don’t understand where it goes.
The Mac image showing the highligted field.
Do you expect us to guess, or all of us willing to help to create our own test project? Does that sound like an efficient use of our time to you?
If you want help then how about providing a sample project showing the problem? If you can’t be bothered to create one, then why should we?
1 Like
I tried working one up, but it’s either a problem of scale (sometimes not small projects cause errors), or it’s something that I couldn’t incorporate.
I have below a link to the whole project on Dropbox. The binary is 13mb
https://www.dropbox.com/s/njxvmb0uicxhf24/ReviewCards1.1.5.zip?dl=0
You also need some text files and here is a link
https://www.dropbox.com/s/2yrqojr8yf1lz0l/Korean%20Class.zip?dl=0
The section causing the problem above is my dictionary and the window is titled SrchDWin
It is more likely your code.
Why don’t you put that code into the GotFocus event?
Thanks for an idea.
I put the SelectAll in GotFocus, and I removed the mouse events, and it doesn’t work well.
It works unpredictably. If I click with the mouse, then I get a cursor. Then, if I shift the focus to a different window and back, I get SelectAll. If I click on a different control on the window, and then back, I get a cursor.
Have you removed the code from the mouse events before removing them? I’m never sure if it can’t stick around … it shouldn’t, but …
There could be some code interfering, eg if your textField is a subclass and some events have code attached to them in the super class. You should also search for the TextField and see if it is referred to anywhere else.
If that doesn’t solve the problem then something else might be going on.
I rarely restart my Mac. There are only two reasons for restarting:(1) a system update requires it, and (2) Xojo goes crazy on me. So my best guess is either Xojo went crazy on you and requires a restart of the computer (alternatively quit Xojo and empty the caches by hand), or your project might be corrupted (Arbed is your friend here - an essential tool for Xojo).
How does it work on corruption?
I checked all of my references to the SrchFld TextField, and they all after a search has started.
Also all of the controls on the window are their own class.
This is an basic summary project of this window. It doesn’t do search and it doesn’t have anything in the dictionary listbox. It is only to show the basic controls.
https://www.dropbox.com/s/0mrdgarul4gddld/SrchText.xojo_xml_project?dl=0
You need to return TRUE from the MouseDown event or MouseUp will not fire.
There are also a few unnecessary SelectAll in the code.
See the difference an example project makes
P.S. Basically the Select All works, but because you return False from the MouseDown event the system then processes the MouseUp and the selection disappears - which makes it look as if Select All doesn’t work.
But as I said, remove the Select Alls from the mouse events - they really are not necessary.
Unfortunately I cannot get it to work, so I’m going to call it a failure due scale.