Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Jabber on August 07, 2006, 11:33:23 pm

Title: wxHIDE_READONLY undeclared
Post by: 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 (http://www.wxwindows.org/manuals/2.6.3/wx_wxfiledialog.html). 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();
+}

Jabber
Title: Re: wxHIDE_READONLY undeclared
Post by: sethjackson on August 07, 2006, 11:35:10 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 (http://www.wxwindows.org/manuals/2.6.3/wx_wxfiledialog.html). 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();
+}

Jabber

Works fine here with wx 2.6.3p2 MSW. What version do you have? That flag is there for a reason. ;)
Title: Re: wxHIDE_READONLY undeclared
Post by: 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
};

What's the reason for using it anyway? According to the docs it shouldn't do anything...
Title: Re: wxHIDE_READONLY undeclared
Post by: sethjackson on August 08, 2006, 12:01:34 am
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
};

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


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

EDIT:

http://forums.codeblocks.org/index.php?topic=3474.0
Title: Re: wxHIDE_READONLY undeclared
Post by: Jabber on August 08, 2006, 12:07:07 am
Hm, sounds like a bug in wxMSW then. Did someone file a bug on their tracker?
Title: Re: wxHIDE_READONLY undeclared
Post by: MortenMacFly on August 08, 2006, 08:35:21 am
Hm, sounds like a bug in wxMSW then. Did someone file a bug on their tracker?
No, not yet. Will you do this?
BTW: I'm using wxGTK on SuSE, too but I don't receive this erros and in fact since these changes have been done (and many linux builds later) you are the first one complaining. What does wx-config --cflags output on your machine? Do you use this at all?
With regards, Morten
Title: Re: wxHIDE_READONLY undeclared
Post by: Jabber on August 08, 2006, 09:48:33 am
Quote
No, not yet. Will you do this?
I'd prefer that someone who actually has seen this bug would do it.  :D

And perhaps I wasn't clear enough about this, but I'm compiling wx with --disable-compat24. Doing so leads to WXWIN_COMPATIBILITY_2_4 being 0, and therefore wxHIDE_READONLY being undefined. I'm doing this to keep my own software ready for the next wx branch. I guess you guys know the policy; in 2.7 and the future 2.8 all occurences in WXWIN_COMPATIBILITY_2_4 guards are automatically removed from the wx sources.

A way around this would be to move all occurences of wxHIDE_READONLY in #if guards, like
Code
                            wxEmptyString,
                            Manager::Get()->GetMacrosManager()->ReplaceMacros(defaultFile),
                            filter,
                            wxOPEN
                            #if WXWIN_COMPATIBILITY_2_4
                            | wxHIDE_READONLY
                            #endif
                            );
             PlaceWindow(&dlg);

A bit ugly, but would work, I guess...

Jabber