Author Topic: new feature of wxSmith in r13522  (Read 51 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5927
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
new feature of wxSmith in r13522
« on: Today at 08:51:38 am »
[r13522]

Some new feature is added.

If no ID field is set, the generated code will use "wxID_ANY".

Another good feature is the "Use Items array" option. If this option is set, the wxChoice will use an array like below:


Code
    const wxString Choice_choices[] = {
    _("AAA"),
    _("BBB"),
    };
    Choice = new wxChoice(Panel, wxID_ANY, wxDefaultPosition, wxSize(280,-1), 2, Choice_choices, 0, wxDefaultValidator);



instead of the statement like:

Code
    Choice = new wxChoice(Panel, ID_CHOICE10, wxDefaultPosition, wxSize(280,-1), 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE10"));
    Choice->Append(_("AAA"));
    Choice->Append(_("BBB"));

So, the array can be used by other code.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.