cancel
Showing results for 
Search instead for 
Did you mean: 

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

Jesper Ronnholm
Associate III

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?

2 REPLIES 2
Martin KJELDSEN
Chief III

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

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