wxUiEditor icon indicating copy to clipboard operation
wxUiEditor copied to clipboard

Support C++ private: class members with getter() functions

Open KeyWorksRW opened this issue 5 months ago • 0 comments

Description:

Ideally, a Base class should have private: rather than protected: class members, with a protected or even public function used as an accessor. This is particularly true for generated classes where the class members are normally pointers that a derived class can get() but should not set().

Right now there isn't any way to do this because there is no private: option in the class access drop-down list. There is a way for a dev to add their own getter function, but without the private: option, it's useless as a getter function.

Design change

  1. Add private: to the drop-down list. Note that this isn't required for non-derived classes which have the option of converting all protected: members to `private:' but it would avoid potential confusion.
  2. Add a getter() function below the class access that is disabled unless class access is set to private:'. The getter() function would be added as a protected:` function. Note that we would need to verify uniqueness of the function name across the entire form, including any class methods the dev may have added to the form.

KeyWorksRW avatar Aug 17 '25 14:08 KeyWorksRW