Skip to main content
Jesper Ronnholm
Associate III
Jan 11, 2019 8:37 AM UTC
Question

Is it possible to write code that will be generated along with new classes?

When coupling the view and presenter classes with third-party, low-level code, you currently need to write new functions on every new class generated by the designer.

I'm not sure if it's possible through ATs, but is it possible to add those functions any other way so that the designer will add my code to every newly generated view class?

This topic has been closed for replies.

2 replies

Martin KJELDSEN
Principal III
Jan 11, 2019 8:59 AM UTC

Hi @Jesper Rönnholm​,

There's currently no way to do what you're asking: To append pre-written code to generated classes. Have you considered creating a base-view/presenter from which all these views that share common functionality inherit?

Best regards,

Martin

Jesper Ronnholm
Associate III
Jan 11, 2019 12:18 PM UTC

Yes, that was actually the original idea.

We tried to access the "handleKeyEvent" method in the ScreenViewBase class, but it's only defined if the screen in question actually have any interactions with the "Hardware button is clicked"-trigger.

Again, this is ultimately about abusing the "handleKeyEvent" to generate events in the designer. :grinning_face_with_sweat:

-Jesper