C++ Change enum access specifier from public to protected
Carsten Grohmann <[email protected]>
| Newsgroups | gmane.comp.python.wxglade |
|---|---|
| Message-ID | <[email protected]> |
Hi, wxGlade generates an enum for self defined ids like described in the manual in section "Common Properties" the part for "Id" (http://wxglade.sourceforge.net/manual/ch05s04.html#common.properties.section). Currently these enums are public. The attached example shows the currently generated code. I've got a suggestion to change the access specifier from public to protected. This means the enum would be accessible in the class that defines it and all inherited classes. I would implement the change, except anybody has concerns regarding their code / projects. Regards, Carsten ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ wxGlade-general mailing list wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/wxglade-general
bug186.cpp
(text/x-c++src, 2.7 KB)
// -*- C++ -*-
//
// generated by wxGlade 928d1e45e6a1+ on Tue May 24 06:45:47 2016
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#include "bug186.h"
// begin wxGlade: ::extracode
// end wxGlade
Frame186::Frame186(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxFrame(parent, id, title, pos, size, style)
{
// begin wxGlade: Frame186::Frame186
Bug186_Frame_menubar = new wxMenuBar();
wxMenu* File = new wxMenu();
File->Append(myMagicMenu, _("Magic"), wxEmptyString, wxITEM_NORMAL);
Bug186_Frame_menubar->Append(File, _("File"));
SetMenuBar(Bug186_Frame_menubar);
Bug186_Frame_toolbar = new wxToolBar(this, -1);
SetToolBar(Bug186_Frame_toolbar);
Bug186_Frame_toolbar->AddTool(myMagicTool, _("Magic"), wxBitmap(32, 32), wxNullBitmap, wxITEM_NORMAL, _("Do a MAGIC action"), _("It's really MAGIC"));
Bug186_Frame_toolbar->Realize();
text_ctrl_1 = new wxTextCtrl(this, wxID_ANY, _("Id: automatic (default behaviour)"));
text_ctrl_2 = new wxTextCtrl(this, 12123, _("Id: numeric value \"12123\""));
text_ctrl_3 = new wxTextCtrl(this, wxID_ANY, _("Id: predefined identify: \"wxID_ANY\""));
text_ctrl_4 = new wxTextCtrl(this, myButtonId, _("Id: variable assignment \"myButtonId=?\""));
set_properties();
do_layout();
// end wxGlade
}
void Frame186::set_properties()
{
// begin wxGlade: Frame186::set_properties
SetTitle(_("frame_1"));
SetSize(wxSize(300, 300));
// end wxGlade
}
void Frame186::do_layout()
{
// begin wxGlade: Frame186::do_layout
wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* sizer_2 = new wxBoxSizer(wxVERTICAL);
sizer_2->Add(text_ctrl_1, 1, wxALL|wxEXPAND, 5);
sizer_2->Add(text_ctrl_2, 1, wxALL|wxEXPAND, 5);
sizer_2->Add(text_ctrl_3, 1, wxALL|wxEXPAND, 5);
sizer_2->Add(text_ctrl_4, 1, wxALL|wxEXPAND, 5);
sizer_1->Add(sizer_2, 1, wxEXPAND, 0);
SetSizer(sizer_1);
Layout();
// end wxGlade
}
class MyApp: public wxApp {
public:
bool OnInit();
protected:
wxLocale m_locale; // locale we'll be using
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
m_locale.Init();
#ifdef APP_LOCALE_DIR
m_locale.AddCatalogLookupPathPrefix(wxT(APP_LOCALE_DIR));
#endif
m_locale.AddCatalog(wxT(APP_CATALOG));
wxInitAllImageHandlers();
Frame186* Bug186_Frame = new Frame186(NULL, wxID_ANY, wxEmptyString);
SetTopWindow(Bug186_Frame);
Bug186_Frame->Show();
return true;
}
bug186.h
(text/x-chdr, 1.5 KB)
// -*- C++ -*-
//
// generated by wxGlade 928d1e45e6a1+ on Tue May 24 06:45:47 2016
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#ifndef BUG186_H
#define BUG186_H
#include <wx/wx.h>
#include <wx/image.h>
#include <wx/intl.h>
#ifndef APP_CATALOG
#define APP_CATALOG "app" // replace with the appropriate catalog name
#endif
// begin wxGlade: ::dependencies
// end wxGlade
// begin wxGlade: ::extracode
// end wxGlade
class Frame186: public wxFrame {
public:
// begin wxGlade: Frame186::ids
enum {
myMagicMenu = wxID_HIGHEST + 1001,
myMagicTool = wxID_HIGHEST + 1004,
myButtonId = wxID_HIGHEST + 1007,
};
// end wxGlade
Frame186(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE);
private:
// begin wxGlade: Frame186::methods
void set_properties();
void do_layout();
// end wxGlade
protected:
// begin wxGlade: Frame186::attributes
wxMenuBar* Bug186_Frame_menubar;
wxToolBar* Bug186_Frame_toolbar;
wxTextCtrl* text_ctrl_1;
wxTextCtrl* text_ctrl_2;
wxTextCtrl* text_ctrl_3;
wxTextCtrl* text_ctrl_4;
// end wxGlade
}; // wxGlade: end class
#endif // BUG186_H