Just updated to 2023R3.1 during the sale. I know that lots of changes have happened since my long suffering 2019 but this seems totally bizarre!
Very first action is to try to bring my ListBoxes up to date in my current project. I HAD a CellClicked event. I looked up in the new help system (will reserve comments on that until later). It tells me that the following are available:
CellPressed
DoublePressed
MouseDown
Any of these MIGHT be useful for the task I have (selecting a cell for editing). BUT, when I try to add an event, I ONLY get:
DoubleClick
What gives? Even the mismatch between DoublePressed and DoubleClick is cause for concern. A ListBox is a key control and there is such a huge difference between the documentation and the implementation? My first experience does not instill the Xojo/RB (since RB0.9) confidence I have previously experienced! Previous upgrades have been pretty painless but this is starting to look like a rewrite! Not thrilled, yet!
Should say MacOS Monterey on Intel silicon (iMac 19,1).
Old project! When I select the listbox name, it says super is ListBox. When I right click the control name and choose Add an Event, it does seem to give the old event list. But something is going wrong in populating a popup (from a database). Must be something else going on.
So, how do a get a language reference for the older API?
Also worth noting, on the coding tab of the preferences there is an option to have the autocomplete include the deprecated items along with the API2 ones, which may be of help. It generally does include them anyway on an older API1 project.
It executes just fine with the clicked ListBox cell selected. BUT if I add a breakpoint on either of those lines, the cell is no longer selected. This really hampers debugging!
It also fails if I add a method call and there is a breakpoint inside the called method.
It might have to do with the app being deactivated, because the IDE is brought to the front since the breakpoint is meant for that. Once deactivated, the app invalidates the focus.
There are rare times where breakpoints aren’t the best way to debug.
Also, remember you always have the option to convert your project to API2, if you wish.
Well, what do you expect? Your first step should be to change the Super of the listbox to DesktopListbox. Then you’ll see the new events. You can’t rename an event so you have to copy/paste the code from CellClicked into CellPressed. Then delete CellClicked. Tedious but doable.
You can try converting instead of changing the Super. Please backup first and test often. This way you don’t need to manually add the renamed events, copy your code and delete the old events:
You can also convert a whole window to API 2 by right clicking on the window and choosing convert. One warning though. You cannot have an API 1 menu on and API 2 window and vice versa. So you will have to duplicate the your menu and convert that, using that on the API windows.
Sometimes you can get around focus related issues by using remote debug, even on the same machine. Don’t know if that applies here, but it may be worth a try.
As others have said the deprecated controls are there for a very long time. The IDE would have to be converted before they’ll ever be removed. That would be a massive undertaking.
That said if you have found a bug in the API 1 control it is unlikely to be fixed at which point you would need a workaround or to change to API 2. Given how long the API 1 controls have been around it seems unlikely that they can’t be made to work correctly.