InfoPane::InfoPane(wxWindow* parent) : cbAuiNotebook(parent, idNB, wxDefaultPosition, wxDefaultSize, infopane_flags), baseID(wxNewId()) { defaultBitmap = cbLoadBitmap(ConfigManager::GetDataFolder() + _T("/images/edit_16x16.png"), wxBITMAP_TYPE_PNG); if (Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/infopane_tabs_bottom"), false)) SetWindowStyleFlag(GetWindowStyleFlag() | wxAUI_NB_BOTTOM); wxRegisterId(baseID + num_pages); for(int i = 0; i < num_pages; ++i) { page[i] = Page(); } }
bool wxDiagram::LoadFile(const wxString& filename) { wxBeginBusyCursor(); wxExprDatabase database(wxExprInteger, _T("id")); if (!database.Read(filename)) { wxEndBusyCursor(); return false; } DeleteAllShapes(); database.BeginFind(); wxExpr *header = database.FindClauseByFunctor(_T("diagram")); if (header) OnHeaderLoad(database, *header); // Scan through all clauses and register the ids wxNode *node = database.GetFirst(); while (node) { wxExpr *clause = (wxExpr *)node->GetData(); long id = -1; clause->GetAttributeValue(_T("id"), id); wxRegisterId(id); node = node->GetNext(); } ReadNodes(database); ReadContainerGeometry(database); ReadLines(database); OnDatabaseLoad(database); wxEndBusyCursor(); return true; }
/*static*/ void wxSTEditorOptions::RegisterIds() { wxRegisterId(ID_STE__LAST); // TODO: how to do this right? }
static int WXMNewID(int begin, size_t count) { for (size_t i=1; i<count; ++i) wxRegisterId(int(begin + i)); return int(begin + count - 1); }
static long MadNewIDRange(long begin, size_t count) { for (size_t i = 1; i<count; ++i) wxRegisterId(begin + i); return begin + count - 1; }
// needed for initialization of variables inline int editorbase_RegisterId(int id) { wxRegisterId(id); return id; }