API 2.0 Support

Background

As of Xojo 2019R2, a lot of changes were made that have been branded “API 2.0”. This release, while making many desirable changes to the framework and language, also creates a plethora of issues for GraffitiSuite. For the time being, it is recommended that all users continue to implement GraffitiSuite classes and functionality in 2019R1.1 or before and use 2019R2 for testing and compilation.

Transition Timeline

While we have no concrete date set for transitioning GraffitiSuite Desktop from API 1.0 to API 2.0, there will be a wait of at least one major Xojo release before this work will even begin. This is to allow time for Xojo to work out any subsequently discovered issues, or perhaps alleviate some of the issues we're facing in the conversion process. That means, tentatively, work will not begin on a full transition until at least 2020R1, but more likely 2020R2 (assuming there are no further 2019 releases). This is in keeping with our plans when the “New Framework” was released a few years ago, and this wait proved overwhelmingly beneficial.

Support

GraffitiSuite is not being abandoned. All issues with API 2.0 will be addressed, and support will continue to be provided via the ticketing system.

Events

Adding new API 2.0 events to your control instances can cause errors and unexpected behavior. In particular, adding Opening and Closing events are the most problematic as they may cause controls to skip their initialization code or leave objects in memory that would otherwise have been disposed of. Below is a sample list of new API 2.0 events you should avoid with GraffitiSuite components until such time as GraffitiSuite is fully API 2.0 compatible:

Old Event New Event
Action Pressed
Activate Activated
Open Opening
CellClick CellPressed
CellTextChange CellTextChanged
CollapseRow RowCollapsed
Change SelectionChanged
Close Closing
Deactivated Activated
ExpandRow RowExpanded

New Classes

With 2019R2 there were new classes added, such as DateTime. While these are desirable, in order to maintain backward compatibility for all customers, GraffitiSuite will not immediately be migrating to using these new classes.

In the interim, you may use the following functions to convert between the Date class and the new DateTime class.

Public Function DateTimeToDate(dt as DateTime) as Date
  Return new Date( dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, dt.Timezone.SecondsFromGMT / 3600 )
End Function
Public Function DateToDateTime(d as Date) as DateTime
  return new DateTime( d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, d.GMTOffset * 3600 )
End Function