Problem upgrading to API 2

I am upgrading an app written in API 1 to API 2 to take advantage of the new DateTime and PDF capabilities. In adding some new features, I find I need to use new ContainerControls on an existing API 1 window. Right clicking on a control on the new container selects the container, not the control. That’s OK as long as I just want to copy, duplicate or delete the control because I can use the Edit menu. Adding an event to a control is a problem. I tried copying the container to a new project using 2019r1.1, but it would not paste or allow me to drag it there. Please don’t tell me I have to convert everything to a DesktopWindow.

I created Feedback 73094 regarding this, but I really need a work-around.

I’ve no idea under what conditions a mixed API1/API2 setup may work. Personally I went through a careful complete conversion, see below:

I was not able to reproduce this on Mac. Do you use Windows? or maybe I missed a step?

Do you select the control first (left click) then do the right click?

Can you right click on the left side (navigator?):

I am using Windows and added a project that shows this to my feedback (73094).

I select the control with left click, then right click and it pops up the navigator for the container, not the control. Very aggravating.

But I came up with a work around. Open an old API 1 version of Xojo and start a project. Add controls to a window along with any events you might need. They don’t need any code in them. Then copy and paste from there to the new version. Sort of like using the old version as a library for the new API. The stubs for the events come along with the control and can be used in the new API.

2 weeks ago I decided to convert ‘old’ apps, created with Xojo 2016.3, to 2023.1

I asked the forum how to make the application (DeskTop) ready for 2023.1 ( Are charts only available for apple in xojo 2023.1? )

I needed the build-in charts desperately, to get rid of plugins. I overlooked the options in the 'Project" menu, but @Wayne_Golding pointed me on the missed option: Convert to API 2.0

After having done this the charts did appear in my library and my complete application was converted to API 2.0.

Besides adjusting the code (control names, property names & behaviors of controls were changed) I did not had to change anything else. My lay-out was the same, my container controls (I have about 9) were the same and after adjusting the code (took me about 3 hours, inclusive sorting out the new property syntax) the applications do run seamlessly under Xojo 2023.1

(I am using Windows 10 & 11 on different PC’s and no problems encountered on any of them)

1 Like

I can see buying them being prohibitive in many situations, but out of curiosity, if you have the plugins already, why do you need to desperately get rid of them?

For example if you have the MBS ChartDirector plugin, it is much more capable than the new built in charting, even if more complex to use.

  • Karen

I used MBS, but not bought, just trial from mbs and I used cully’s. MBS is indeed “even if more complex to use.” I need only simple charts and the DeskTopChart fulfill my needs and is included. That’s why.

No idea what is happening on my primary computer, but I am unable to reproduce the problem on another computer.

1 Like