More explanation about my patch for wxSmith:Then current wxSmith, we can't use the same ID in different Controls. Even this ID is "wxID_ANY", or the IDs pre-defined by wxWidgets library such as wxID_FILE or wxID_OPEN or wxID_ABOUT.
If the ID is not a class member, the value of the ID perhaps is useless for the programmer. But the code generated by wxSmith contains some snippets to declaration, definition and initialization of these IDs.
For example, in the CodeCompletion plugins source code, there are code statement like below:
In Header:
//(*Identifiers(CCDebugInfo)
static const long ID_NOTEBOOK1;
//*)
In Source:
//(*IdInit(CCDebugInfo)
const long CCDebugInfo::ID_NOTEBOOK1 = wxNewId();
//*)
As you know, if you have many different IDs, then there are many different unused static const variables, all these variables will take the memory space in the final executable files.For example, in the source file: src\plugins\codecompletion\ccdebuginfo.h There are 61 different ununsed IDs.
//(*Identifiers(CCDebugInfo)
static const long ID_STATICTEXT29;
static const long ID_TEXTCTRL1;
static const long ID_BUTTON1;
static const long ID_STATICLINE1;
static const long ID_STATICTEXT17;
static const long ID_STATICTEXT18;
static const long ID_STATICTEXT1;
static const long ID_STATICTEXT2;
static const long ID_STATICTEXT9;
static const long ID_STATICTEXT10;
static const long ID_STATICTEXT11;
static const long ID_STATICTEXT12;
static const long ID_STATICTEXT3;
static const long ID_STATICTEXT4;
static const long ID_STATICTEXT5;
static const long ID_STATICTEXT6;
static const long ID_STATICTEXT7;
static const long ID_STATICTEXT8;
static const long ID_STATICTEXT36;
static const long ID_STATICTEXT37;
static const long ID_STATICTEXT40;
static const long ID_STATICTEXT41;
static const long ID_STATICTEXT13;
static const long ID_STATICTEXT14;
static const long ID_STATICTEXT15;
static const long ID_STATICTEXT16;
static const long ID_STATICTEXT32;
static const long ID_STATICTEXT33;
static const long ID_STATICTEXT38;
static const long ID_STATICTEXT39;
static const long ID_STATICTEXT19;
static const long ID_STATICTEXT20;
static const long ID_STATICTEXT22;
static const long ID_STATICTEXT24;
static const long ID_BUTTON4;
static const long ID_STATICTEXT30;
static const long ID_COMBOBOX3;
static const long ID_BUTTON5;
static const long ID_STATICTEXT21;
static const long ID_COMBOBOX2;
static const long ID_BUTTON3;
static const long ID_STATICTEXT23;
static const long ID_COMBOBOX1;
static const long ID_BUTTON2;
static const long ID_STATICTEXT25;
static const long ID_STATICTEXT26;
static const long ID_STATICTEXT27;
static const long ID_STATICTEXT28;
static const long ID_STATICTEXT34;
static const long ID_STATICTEXT35;
static const long ID_PANEL1;
static const long ID_LISTBOX1;
static const long ID_PANEL2;
static const long ID_LISTBOX2;
static const long ID_PANEL3;
static const long ID_NOTEBOOK1;
static const long ID_STATICTEXT31;
static const long ID_BUTTON6;
static const long ID_STATICLINE2;
//*)
When applied my patch, you can merge all the different IDs to only one wxID_ANY, and there are no side effect.In my previous post, I have attached a CCDebugInfo.7z, and you can see the new generated ccdebuginfo.h and ccdebuginfo.cpp, they are more clean and beautiful.
//(*Identifiers(CCDebugInfo)
static const long ID_NOTEBOOK1;
//*)
the rebuild CC works as before.
[attachment deleted by admin]