283 views
in GUI Development by
Hello,
I want to define ENUM inside embedded wizard and to know how to use the ENUM in native function.

1 Answer

0 votes
by

Hello,

the C type definition representing enum is XEnum in native code. The enum items are C identifiers composed of the unit name, enum name and item name. For example, if you have an enum State defined within the unit Application and the enum contains an items named Disabled and Protected then following native code demonstrates the usage of the enums in C code:

var Application::State state = ...

native ( state )
{
   XEnum state_in_c = state;

  if ( state_in_c == ApplicationStetDisabled )
    state_in_c = ApplicationStateProtected;

  state = state_in_c;
}

trace state;

Generally, if you have doubts how to implement some native code as glue code between GUI and the device, the simplest is to analyze the generated code.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...