Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

wxHIDE_READONLY undeclared

(1/2) > >>

Jabber:
Hi all,

I have no idea if this is the right forum. Apologies if it's the wrong one.
Anyway, I got compilation errors on the current SVN because of wxHIDE_READONLY being undeclared. The wx docs say it's
deprecated and doesn't do anything in wx 2.6. If you don't compile wx in compatibility mode for 2.4 you'll get those errors. If I'm not mistaken wx 2.6 is the "official" branch being used with C::B, so wxHIDE_READONLY might as well be removed. I had to do this in order to compile, so here's the diff:

--- Code: ---Index: src/sdk/scripting/bindings/sc_io.cpp
===================================================================
--- src/sdk/scripting/bindings/sc_io.cpp (revision 2816)
+++ src/sdk/scripting/bindings/sc_io.cpp (working copy)
@@ -66,7 +66,7 @@
                             wxEmptyString,
                             Manager::Get()->GetMacrosManager()->ReplaceMacros(defaultFile),
                             filter,
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
             PlaceWindow(&dlg);
             if (dlg.ShowModal() == wxID_OK)
                 return dlg.GetPath();
Index: src/sdk/editpairdlg.cpp
===================================================================
--- src/sdk/editpairdlg.cpp (revision 2816)
+++ src/sdk/editpairdlg.cpp (working copy)
@@ -62,7 +62,7 @@
                             XRCCTRL(*this, "txtValue", wxTextCtrl)->GetValue(),
                             _T(""),
                             FileFilters::GetFilterAll(),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
             PlaceWindow(&dlg);
             if (dlg.ShowModal() == wxID_OK)
                 XRCCTRL(*this, "txtValue", wxTextCtrl)->SetValue(dlg.GetPath());
Index: src/sdk/selecttargetdlg.cpp
===================================================================
--- src/sdk/selecttargetdlg.cpp (revision 2816)
+++ src/sdk/selecttargetdlg.cpp (working copy)
@@ -118,7 +118,7 @@
                             #else
                             _("All files (*)|*"),
                             #endif
-                            wxOPEN | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                            wxOPEN | wxFILE_MUST_EXIST);
         dlg->SetFilterIndex(0);
         PlaceWindow(dlg);
         if (dlg->ShowModal() != wxID_OK)
Index: src/sdk/editarrayfiledlg.cpp
===================================================================
--- src/sdk/editarrayfiledlg.cpp (revision 2816)
+++ src/sdk/editarrayfiledlg.cpp (working copy)
@@ -84,7 +84,7 @@
                     m_BasePath,
                     _T(""),
                     FileFilters::GetFilterAll(),
-                    wxOPEN | wxHIDE_READONLY);
+                    wxOPEN);
 
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
@@ -104,7 +104,7 @@
                     m_BasePath,
                     list->GetStringSelection(),
                     FileFilters::GetFilterAll(),
-                    wxOPEN | wxHIDE_READONLY);
+                    wxOPEN);
 
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
Index: src/sdk/projectmanager.cpp
===================================================================
--- src/sdk/projectmanager.cpp (revision 2816)
+++ src/sdk/projectmanager.cpp (working copy)
@@ -1747,7 +1747,7 @@
                     prj->GetBasePath(),
                     wxEmptyString,
                     FileFilters::GetFilterString(),
-                    wxOPEN | wxMULTIPLE | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                    wxOPEN | wxMULTIPLE | wxFILE_MUST_EXIST);
     dlg.SetFilterIndex(FileFilters::GetIndexForFilterAll());
 
     PlaceWindow(&dlg);
Index: src/sdk/projectoptionsdlg.cpp
===================================================================
--- src/sdk/projectoptionsdlg.cpp (revision 2816)
+++ src/sdk/projectoptionsdlg.cpp (working copy)
@@ -781,7 +781,7 @@
                     fname.GetPath(),
                     fname.GetFullName(),
                     _("Script files (*.script)|*.script"),
-                    wxOPEN | wxHIDE_READONLY);
+                    wxOPEN);
 
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 2816)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -1651,7 +1651,7 @@
                                     _T(""),
                                     _T(""),
                                     _("Executables and libraries|*.exe;*.dll"),
-                                    wxOPEN | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                                    wxOPEN | wxFILE_MUST_EXIST);
     if (file.IsEmpty())
         return;
 //    Manager::Get()->GetMessageManager()->Log(m_PageIndex, _("Adding symbol file: %s"), file.c_str());
Index: src/plugins/debuggergdb/debuggertree.cpp
===================================================================
--- src/plugins/debuggergdb/debuggertree.cpp (revision 2816)
+++ src/plugins/debuggergdb/debuggertree.cpp (working copy)
@@ -627,7 +627,7 @@
                     _T(""),
                     _T(""),
                     _T("Watch files (*.watch)|*.watch|Any file (*)|*"),
-                    wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR | wxHIDE_READONLY);
+                    wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
         return;
Index: src/plugins/compilergcc/compileroptionsdlg.cpp
===================================================================
--- src/plugins/compilergcc/compileroptionsdlg.cpp (revision 2816)
+++ src/plugins/compilergcc/compileroptionsdlg.cpp (working copy)
@@ -1735,7 +1735,7 @@
                             #else
                             _("All files (*)|*"),
                             #endif
-                            wxOPEN | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                            wxOPEN | wxFILE_MUST_EXIST);
     dlg->SetFilterIndex(0);
 
     PlaceWindow(dlg);
Index: src/plugins/defaultmimehandler/editmimetypesdlg.cpp
===================================================================
--- src/plugins/defaultmimehandler/editmimetypesdlg.cpp (revision 2816)
+++ src/plugins/defaultmimehandler/editmimetypesdlg.cpp (working copy)
@@ -163,7 +163,7 @@
                             wxEmptyString,
                             XRCCTRL(*this, "txtProgram", wxTextCtrl)->GetValue(),
                             FileFilters::GetFilterAll(),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     PlaceWindow(dlg);
     if (dlg->ShowModal() == wxID_OK)
         XRCCTRL(*this, "txtProgram", wxTextCtrl)->SetValue(dlg->GetPath());
Index: src/plugins/defaultmimehandler/defaultmimehandler.cpp
===================================================================
--- src/plugins/defaultmimehandler/defaultmimehandler.cpp (revision 2816)
+++ src/plugins/defaultmimehandler/defaultmimehandler.cpp (working copy)
@@ -215,7 +215,7 @@
                             wxEmptyString,
                             wxEmptyString,
                             FileFilters::GetFilterAll(),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     PlaceWindow(dlg);
     if (dlg->ShowModal() == wxID_OK)
         return dlg->GetPath();
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 2816)
+++ src/src/main.cpp (working copy)
@@ -1101,7 +1101,7 @@
                             wxEmptyString,
                             wxEmptyString,
                             filter,
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     wxString sel;
     PlaceWindow(dlg);
     if (dlg->ShowModal() == wxID_OK)
@@ -1893,7 +1893,7 @@
                             Path,
                             wxEmptyString,
                             Filters,
-                            wxOPEN | wxMULTIPLE | wxHIDE_READONLY);
+                            wxOPEN | wxMULTIPLE);
     dlg->SetFilterIndex(StoredIndex);
 
     PlaceWindow(dlg);
Index: src/src/scriptconsole.cpp
===================================================================
--- src/src/scriptconsole.cpp (revision 2816)
+++ src/src/scriptconsole.cpp (working copy)
@@ -100,8 +100,8 @@
  txtConsole->ScrollLines(-1);
  Manager::ProcessPendingEvents();
 }
-
-void ScriptConsole::OnbtnExecuteClick(wxCommandEvent& event)
+
+void ScriptConsole::OnbtnExecuteClick(wxCommandEvent& event)
 {
     wxString cmd = txtCommand->GetValue();
     cmd.Trim(false);
@@ -117,10 +117,10 @@
         txtCommand->Clear();
     else
         txtConsole->AppendText(Manager::Get()->GetScriptingManager()->GetErrorString());
-}
-
-void ScriptConsole::OnbtnLoadClick(wxCommandEvent& event)
-{
+}
+
+void ScriptConsole::OnbtnLoadClick(wxCommandEvent& event)
+{
     ConfigManager* mgr = Manager::Get()->GetConfigManager(_T("app"));
     wxString path = mgr->Read(_T("/file_dialogs/file_run_script/directory"), wxEmptyString);
     wxFileDialog* dlg = new wxFileDialog(this,
@@ -128,7 +128,7 @@
                             path,
                             wxEmptyString,
                             _T("Script files (*.script)|*.script"),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     if (dlg->ShowModal() == wxID_OK)
     {
         mgr->Write(_T("/file_dialogs/file_run_script/directory"), dlg->GetDirectory());
@@ -143,9 +143,9 @@
         }
     }
     dlg->Destroy();
-}
-
-void ScriptConsole::OnbtnClearClick(wxCommandEvent& event)
+}
+
+void ScriptConsole::OnbtnClearClick(wxCommandEvent& event)
 {
-    txtConsole->Clear();
-}
+    txtConsole->Clear();
+}

--- End code ---

Jabber

sethjackson:

--- Quote from: Jabber on August 07, 2006, 11:33:23 pm ---Hi all,

I have no idea if this is the right forum. Apologies if it's the wrong one.
Anyway, I got compilation errors on the current SVN because of wxHIDE_READONLY being undeclared. The wx docs say it's
deprecated and doesn't do anything in wx 2.6. If you don't compile wx in compatibility mode for 2.4 you'll get those errors. If I'm not mistaken wx 2.6 is the "official" branch being used with C::B, so wxHIDE_READONLY might as well be removed. I had to do this in order to compile, so here's the diff:

--- Code: ---Index: src/sdk/scripting/bindings/sc_io.cpp
===================================================================
--- src/sdk/scripting/bindings/sc_io.cpp (revision 2816)
+++ src/sdk/scripting/bindings/sc_io.cpp (working copy)
@@ -66,7 +66,7 @@
                             wxEmptyString,
                             Manager::Get()->GetMacrosManager()->ReplaceMacros(defaultFile),
                             filter,
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
             PlaceWindow(&dlg);
             if (dlg.ShowModal() == wxID_OK)
                 return dlg.GetPath();
Index: src/sdk/editpairdlg.cpp
===================================================================
--- src/sdk/editpairdlg.cpp (revision 2816)
+++ src/sdk/editpairdlg.cpp (working copy)
@@ -62,7 +62,7 @@
                             XRCCTRL(*this, "txtValue", wxTextCtrl)->GetValue(),
                             _T(""),
                             FileFilters::GetFilterAll(),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
             PlaceWindow(&dlg);
             if (dlg.ShowModal() == wxID_OK)
                 XRCCTRL(*this, "txtValue", wxTextCtrl)->SetValue(dlg.GetPath());
Index: src/sdk/selecttargetdlg.cpp
===================================================================
--- src/sdk/selecttargetdlg.cpp (revision 2816)
+++ src/sdk/selecttargetdlg.cpp (working copy)
@@ -118,7 +118,7 @@
                             #else
                             _("All files (*)|*"),
                             #endif
-                            wxOPEN | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                            wxOPEN | wxFILE_MUST_EXIST);
         dlg->SetFilterIndex(0);
         PlaceWindow(dlg);
         if (dlg->ShowModal() != wxID_OK)
Index: src/sdk/editarrayfiledlg.cpp
===================================================================
--- src/sdk/editarrayfiledlg.cpp (revision 2816)
+++ src/sdk/editarrayfiledlg.cpp (working copy)
@@ -84,7 +84,7 @@
                     m_BasePath,
                     _T(""),
                     FileFilters::GetFilterAll(),
-                    wxOPEN | wxHIDE_READONLY);
+                    wxOPEN);
 
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
@@ -104,7 +104,7 @@
                     m_BasePath,
                     list->GetStringSelection(),
                     FileFilters::GetFilterAll(),
-                    wxOPEN | wxHIDE_READONLY);
+                    wxOPEN);
 
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
Index: src/sdk/projectmanager.cpp
===================================================================
--- src/sdk/projectmanager.cpp (revision 2816)
+++ src/sdk/projectmanager.cpp (working copy)
@@ -1747,7 +1747,7 @@
                     prj->GetBasePath(),
                     wxEmptyString,
                     FileFilters::GetFilterString(),
-                    wxOPEN | wxMULTIPLE | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                    wxOPEN | wxMULTIPLE | wxFILE_MUST_EXIST);
     dlg.SetFilterIndex(FileFilters::GetIndexForFilterAll());
 
     PlaceWindow(&dlg);
Index: src/sdk/projectoptionsdlg.cpp
===================================================================
--- src/sdk/projectoptionsdlg.cpp (revision 2816)
+++ src/sdk/projectoptionsdlg.cpp (working copy)
@@ -781,7 +781,7 @@
                     fname.GetPath(),
                     fname.GetFullName(),
                     _("Script files (*.script)|*.script"),
-                    wxOPEN | wxHIDE_READONLY);
+                    wxOPEN);
 
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 2816)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -1651,7 +1651,7 @@
                                     _T(""),
                                     _T(""),
                                     _("Executables and libraries|*.exe;*.dll"),
-                                    wxOPEN | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                                    wxOPEN | wxFILE_MUST_EXIST);
     if (file.IsEmpty())
         return;
 //    Manager::Get()->GetMessageManager()->Log(m_PageIndex, _("Adding symbol file: %s"), file.c_str());
Index: src/plugins/debuggergdb/debuggertree.cpp
===================================================================
--- src/plugins/debuggergdb/debuggertree.cpp (revision 2816)
+++ src/plugins/debuggergdb/debuggertree.cpp (working copy)
@@ -627,7 +627,7 @@
                     _T(""),
                     _T(""),
                     _T("Watch files (*.watch)|*.watch|Any file (*)|*"),
-                    wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR | wxHIDE_READONLY);
+                    wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
     PlaceWindow(&dlg);
     if (dlg.ShowModal() != wxID_OK)
         return;
Index: src/plugins/compilergcc/compileroptionsdlg.cpp
===================================================================
--- src/plugins/compilergcc/compileroptionsdlg.cpp (revision 2816)
+++ src/plugins/compilergcc/compileroptionsdlg.cpp (working copy)
@@ -1735,7 +1735,7 @@
                             #else
                             _("All files (*)|*"),
                             #endif
-                            wxOPEN | wxFILE_MUST_EXIST | wxHIDE_READONLY);
+                            wxOPEN | wxFILE_MUST_EXIST);
     dlg->SetFilterIndex(0);
 
     PlaceWindow(dlg);
Index: src/plugins/defaultmimehandler/editmimetypesdlg.cpp
===================================================================
--- src/plugins/defaultmimehandler/editmimetypesdlg.cpp (revision 2816)
+++ src/plugins/defaultmimehandler/editmimetypesdlg.cpp (working copy)
@@ -163,7 +163,7 @@
                             wxEmptyString,
                             XRCCTRL(*this, "txtProgram", wxTextCtrl)->GetValue(),
                             FileFilters::GetFilterAll(),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     PlaceWindow(dlg);
     if (dlg->ShowModal() == wxID_OK)
         XRCCTRL(*this, "txtProgram", wxTextCtrl)->SetValue(dlg->GetPath());
Index: src/plugins/defaultmimehandler/defaultmimehandler.cpp
===================================================================
--- src/plugins/defaultmimehandler/defaultmimehandler.cpp (revision 2816)
+++ src/plugins/defaultmimehandler/defaultmimehandler.cpp (working copy)
@@ -215,7 +215,7 @@
                             wxEmptyString,
                             wxEmptyString,
                             FileFilters::GetFilterAll(),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     PlaceWindow(dlg);
     if (dlg->ShowModal() == wxID_OK)
         return dlg->GetPath();
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 2816)
+++ src/src/main.cpp (working copy)
@@ -1101,7 +1101,7 @@
                             wxEmptyString,
                             wxEmptyString,
                             filter,
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     wxString sel;
     PlaceWindow(dlg);
     if (dlg->ShowModal() == wxID_OK)
@@ -1893,7 +1893,7 @@
                             Path,
                             wxEmptyString,
                             Filters,
-                            wxOPEN | wxMULTIPLE | wxHIDE_READONLY);
+                            wxOPEN | wxMULTIPLE);
     dlg->SetFilterIndex(StoredIndex);
 
     PlaceWindow(dlg);
Index: src/src/scriptconsole.cpp
===================================================================
--- src/src/scriptconsole.cpp (revision 2816)
+++ src/src/scriptconsole.cpp (working copy)
@@ -100,8 +100,8 @@
  txtConsole->ScrollLines(-1);
  Manager::ProcessPendingEvents();
 }
-
-void ScriptConsole::OnbtnExecuteClick(wxCommandEvent& event)
+
+void ScriptConsole::OnbtnExecuteClick(wxCommandEvent& event)
 {
     wxString cmd = txtCommand->GetValue();
     cmd.Trim(false);
@@ -117,10 +117,10 @@
         txtCommand->Clear();
     else
         txtConsole->AppendText(Manager::Get()->GetScriptingManager()->GetErrorString());
-}
-
-void ScriptConsole::OnbtnLoadClick(wxCommandEvent& event)
-{
+}
+
+void ScriptConsole::OnbtnLoadClick(wxCommandEvent& event)
+{
     ConfigManager* mgr = Manager::Get()->GetConfigManager(_T("app"));
     wxString path = mgr->Read(_T("/file_dialogs/file_run_script/directory"), wxEmptyString);
     wxFileDialog* dlg = new wxFileDialog(this,
@@ -128,7 +128,7 @@
                             path,
                             wxEmptyString,
                             _T("Script files (*.script)|*.script"),
-                            wxOPEN | wxHIDE_READONLY);
+                            wxOPEN);
     if (dlg->ShowModal() == wxID_OK)
     {
         mgr->Write(_T("/file_dialogs/file_run_script/directory"), dlg->GetDirectory());
@@ -143,9 +143,9 @@
         }
     }
     dlg->Destroy();
-}
-
-void ScriptConsole::OnbtnClearClick(wxCommandEvent& event)
+}
+
+void ScriptConsole::OnbtnClearClick(wxCommandEvent& event)
 {
-    txtConsole->Clear();
-}
+    txtConsole->Clear();
+}

--- End code ---

Jabber

--- End quote ---

Works fine here with wx 2.6.3p2 MSW. What version do you have? That flag is there for a reason. ;)

Jabber:
wxGTK 2.6.3. From filedlg.h:

--- Code: ---enum
{
    wxOPEN              = 0x0001,
    wxSAVE              = 0x0002,
    wxOVERWRITE_PROMPT  = 0x0004,
#if WXWIN_COMPATIBILITY_2_4
    wxHIDE_READONLY     = 0x0008,
#endif
    wxFILE_MUST_EXIST   = 0x0010,
    wxMULTIPLE          = 0x0020,
    wxCHANGE_DIR        = 0x0040
};

--- End code ---

What's the reason for using it anyway? According to the docs it shouldn't do anything...

sethjackson:

--- Quote from: Jabber on August 07, 2006, 11:42:50 pm ---wxGTK 2.6.3. From filedlg.h:

--- Code: ---enum
{
    wxOPEN              = 0x0001,
    wxSAVE              = 0x0002,
    wxOVERWRITE_PROMPT  = 0x0004,
#if WXWIN_COMPATIBILITY_2_4
    wxHIDE_READONLY     = 0x0008,
#endif
    wxFILE_MUST_EXIST   = 0x0010,
    wxMULTIPLE          = 0x0020,
    wxCHANGE_DIR        = 0x0040
};

--- End code ---

What's the reason for using it anyway? According to the docs it shouldn't do anything...


--- End quote ---

Umm there is a post on the board about it somewhere I thought.......

EDIT:

http://forums.codeblocks.org/index.php?topic=3474.0

Jabber:
Hm, sounds like a bug in wxMSW then. Did someone file a bug on their tracker?

Navigation

[0] Message Index

[#] Next page

Go to full version