]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/dialoged/src/symbtabl.cpp
Corrected valtext.cpp for disabled controls; added Dialog Editor fixes
[wxWidgets.git] / utils / dialoged / src / symbtabl.cpp
index 65e038b3d22f4883f34881d5dc3ec5270f4691a8..110764e782c97372c6630d01a9ebdb1f46e36873 100644 (file)
@@ -70,7 +70,7 @@ bool wxResourceSymbolTable::ReadIncludeFile(const wxString& filename)
     str.UngetWriteBuf();
 
     // Look for #define occurrences
-    size_t pos = str.Find("#define");
+    int pos = str.Find("#define");
     while (pos != -1)
     {
         size_t len = str.Length();
@@ -121,12 +121,19 @@ bool wxResourceSymbolTable::WriteIncludeFile(const wxString& filename)
     if (!file.Open(filename, wxFile::write))
         return FALSE;
 
+    wxString fileOnly(wxFileNameFromPath(filename));
+    wxString line;
+    line.Printf("/*\n * %s\n * Window identifiers file written by Dialog Editor\n */\n\n",
+        (const char*) fileOnly);
+
+    file.Write(line, line.Length());
+
     m_hashTable.BeginFind();
 
     wxNode* node = m_hashTable.Next();
     while (node)
     {
-        char* str = node->key.string;
+        const char* str = node->GetKeyString();
         int id = (int) node->Data() ;
 
         if (!IsStandardSymbol(str))
@@ -174,7 +181,7 @@ wxString wxResourceSymbolTable::GetSymbolForId(int id)
     wxNode* node = m_hashTable.Next();
     while (node)
     {
-        char* str = node->key.string;
+        const char* str = node->GetKeyString();
         if (str && ( ((int) node->Data()) == id) )
             return wxString(str);
 
@@ -223,6 +230,10 @@ int wxResourceSymbolTable::FindHighestId()
 
         node = m_hashTable.Next();
     }
+
+    // Make sure we don't clash with future standard wxWindows ids
+    if (highest <= wxID_HIGHEST)
+        highest = wxID_HIGHEST + 1;
     return highest;
 }
 
@@ -238,12 +249,49 @@ struct wxStandardSymbolStruct
 
 static wxStandardSymbolStruct sg_StandardSymbols[] =
 {
-    { "wxID_OK", wxID_OK },
-    { "wxID_CANCEL", wxID_CANCEL },
-    { "wxID_APPLY", wxID_APPLY },
-//    { "wxID_STATIC", wxID_STATIC },
-    { "wxID_YES", wxID_YES },
-    { "wxID_NO", wxID_NO }
+    { "wxID_OK",            wxID_OK },
+    { "wxID_CANCEL",        wxID_CANCEL },
+    { "wxID_APPLY",         wxID_APPLY },
+    { "wxID_HELP",          wxID_HELP },
+    { "wxID_STATIC",        wxID_STATIC },
+    { "wxID_YES",           wxID_YES },
+    { "wxID_NO",            wxID_NO },
+
+    { "wxID_OPEN",          wxID_OPEN },
+    { "wxID_CLOSE",          wxID_CLOSE },
+    { "wxID_NEW",           wxID_NEW },
+    { "wxID_SAVE",          wxID_SAVE },
+    { "wxID_SAVEAS",        wxID_SAVEAS },
+    { "wxID_REVERT",        wxID_REVERT },
+    { "wxID_EXIT",          wxID_EXIT },
+    { "wxID_UNDO",          wxID_UNDO },
+    { "wxID_REDO",          wxID_REDO },
+    { "wxID_PRINT",         wxID_PRINT },
+    { "wxID_PRINT_SETUP",   wxID_PRINT_SETUP },
+    { "wxID_PREVIEW",       wxID_PREVIEW },
+    { "wxID_ABOUT",         wxID_ABOUT },
+    { "wxID_HELP_CONTENTS", wxID_HELP_CONTENTS },
+    { "wxID_HELP_COMMANDS", wxID_HELP_COMMANDS },
+    { "wxID_HELP_PROCEDURES", wxID_HELP_PROCEDURES },
+    { "wxID_HELP_CONTEXT",  wxID_HELP_CONTEXT },
+
+    { "wxID_CUT",           wxID_CUT },
+    { "wxID_COPY",          wxID_COPY },
+    { "wxID_PASTE",         wxID_PASTE },
+    { "wxID_CLEAR",         wxID_CLEAR },
+    { "wxID_FIND",          wxID_FIND },
+    { "wxID_DUPLICATE",     wxID_DUPLICATE },
+
+    { "wxID_FILE1",         wxID_FILE1 },
+    { "wxID_FILE2",         wxID_FILE2 },
+    { "wxID_FILE3",         wxID_FILE3 },
+    { "wxID_FILE4",         wxID_FILE4 },
+    { "wxID_FILE5",         wxID_FILE5 },
+    { "wxID_FILE6",         wxID_FILE6 },
+    { "wxID_FILE7",         wxID_FILE7 },
+    { "wxID_FILE8",         wxID_FILE8 },
+    { "wxID_FILE9",         wxID_FILE9 }
+
 };
 
 static int sg_StandardSymbolSize = (sizeof(sg_StandardSymbols)/sizeof(wxStandardSymbolStruct));
@@ -275,7 +323,7 @@ bool wxResourceSymbolTable::FillComboBox(wxComboBox* comboBox)
     wxNode* node = m_hashTable.Next();
     while (node)
     {
-        char* str = node->key.string;
+        const char* str = node->GetKeyString();
 
         comboBox->Append(str);
         node = m_hashTable.Next();