From d1e418eaea09da4d74cc0d2b9d6bb1f9decbfa49 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 13 Jan 2000 13:17:19 +0000 Subject: [PATCH] Set RADIOBTN_PARENT_IS_RADIOBOX to 0 (sorry, but...); fixed a Dialog Editor crash problem; made wxStaticBitmap movable again git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/generic.rsp | 3 +++ distrib/msw/makefile.rsp | 12 ++++++---- docs/msw/install.txt | 10 ++++---- include/wx/msw/statbmp.h | 2 +- src/common/resource.cpp | 8 ++++++- src/msw/radiobox.cpp | 2 +- src/msw/statbmp.cpp | 4 +++- utils/dialoged/src/reseditr.cpp | 23 ++++++++++++++++-- utils/dialoged/src/reseditr.h | 2 +- utils/projgen/makeproj.cpp | 42 +++++++++++++++++---------------- 10 files changed, 72 insertions(+), 36 deletions(-) diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index 968c227926..be8de8a803 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -19,6 +19,9 @@ wx-config.in makefile.unx.in wxinstall Makefile +descrip.mms +setup.h_vms +src/common/descrip.mms distrib/msw/*.rsp distrib/msw/*.bat diff --git a/distrib/msw/makefile.rsp b/distrib/msw/makefile.rsp index 4293b1f919..059a8f9199 100644 --- a/distrib/msw/makefile.rsp +++ b/distrib/msw/makefile.rsp @@ -2,7 +2,6 @@ Makefile.in src/Makefile locale/Makefile samples/Makefile.in -samples/bombs/Makefile.in samples/caret/Makefile.in samples/checklst/Makefile.in samples/config/Makefile.in @@ -43,14 +42,17 @@ samples/treectrl/Makefile.in samples/typetest/Makefile.in samples/validate/Makefile.in samples/wizard/Makefile.in -samples/wxpoem/Makefile.in -samples/wxsocket/Makefile.in -samples/nettest/Makefile.in +samples/socket/Makefile.in +samples/dialup/Makefile.in samples/font/Makefile.in samples/menu/Makefile.in samples/console/Makefile.in -samples/life/Makefile.in samples/calendar/Makefile.in +demos/bombs/Makefile.in +demos/forty/Makefile.in +demos/fractal/Makefile.in +demos/poem/Makefile.in +demos/life/Makefile.in utils/glcanvas/motif/Makefile.in utils/Makefile.in utils/wxMMedia2/Makefile.in diff --git a/docs/msw/install.txt b/docs/msw/install.txt index a12338bef1..3a5e7d719a 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -48,6 +48,7 @@ wx2_x_y_vc.zip MS VC++ 5.0 project files wx2_x_y_cw.zip Metrowerks CodeWarrior project files wx2_x_y_bc.zip BC++ 5 project files jpeg.zip Use this to allow wxImage to read and write JPEG files +tiff.zip Use this to allow wxImage to read and write TIFF files Unarchive the required files plus any optional documentation files into a suitable directory such as c:\wx. @@ -100,7 +101,11 @@ Using project files: Using makefiles: 1. Make sure your WXWIN variable is set. -2. Change directory to wx\src\msw. Type: +2. If you do NOT have the TIFF or JPEG source code, please remove + the tiff and jpeg targets from the 'all' target in + src\msw\makefile.vc. Also ensure the settings in + include\wx\msw\setup.h specify not to use JPEG or TIFF. +3. Change directory to wx\src\msw. Type: 'nmake -f makefile.vc' @@ -111,9 +116,6 @@ Using makefiles: to make the wxWindows core library without debug information (wx\lib\wx.lib). -3. If you wish to use JPEG in your applications, do the same - procedure in src\jpeg but add the 'all' target to the - command line. 4. Change directory to wx\samples and type 'nmake -f makefile.vc' to make all the samples. You can also make them individually. diff --git a/include/wx/msw/statbmp.h b/include/wx/msw/statbmp.h index 85308a7d13..3715b09f7c 100644 --- a/include/wx/msw/statbmp.h +++ b/include/wx/msw/statbmp.h @@ -67,8 +67,8 @@ public: // IMPLEMENTATION #ifdef __WIN16__ virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); - virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); #endif // __WIN16__ + virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); protected: virtual wxSize DoGetBestSize() const; diff --git a/src/common/resource.cpp b/src/common/resource.cpp index cd930265e0..19ffdaef1b 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -347,7 +347,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c else if (itemType == wxString(wxT("wxMessage")) || itemType == wxString(wxT("wxStaticText")) || itemType == wxString(wxT("wxStaticBitmap"))) { - if (childResource->GetValue4() != wxT("")) + if (childResource->GetValue4() != wxT("") || itemType == wxString(wxT("wxStaticBitmap")) ) { // Bitmap message wxBitmap bitmap = childResource->GetBitmap(); @@ -357,6 +357,12 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c ((wxItemResource*) childResource)->SetBitmap(bitmap); } #if wxUSE_BITMAP_MESSAGE +#ifdef __WXMSW__ + // Use a default bitmap + if (!bitmap.Ok()) + bitmap.LoadFile("cross_bmp", wxBITMAP_TYPE_BMP_RESOURCE); +#endif + if (bitmap.Ok()) control = new wxStaticBitmap(parent, id, bitmap, pos, size, childResource->GetStyle(), childResource->GetName()); diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 7aaff04b21..26868c3ec0 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -56,7 +56,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) // reason to revert to the backward compatible behaviour - but I still // leave this possibility just in case. -#define RADIOBTN_PARENT_IS_RADIOBOX 1 +#define RADIOBTN_PARENT_IS_RADIOBOX 0 // --------------------------------------------------------------------------- // private functions diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index da32aead68..0b47d28c65 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -216,7 +216,9 @@ bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item) return TRUE; } +#endif // Win16 +// We need this or the control can never be moved e.g. in Dialog Editor. long wxStaticBitmap::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) @@ -228,4 +230,4 @@ long wxStaticBitmap::MSWWindowProc(WXUINT nMsg, return wxWindow::MSWWindowProc(nMsg, wParam, lParam); } -#endif // Win16 + diff --git a/utils/dialoged/src/reseditr.cpp b/utils/dialoged/src/reseditr.cpp index 6ec0f160a3..5d68f37e81 100644 --- a/utils/dialoged/src/reseditr.cpp +++ b/utils/dialoged/src/reseditr.cpp @@ -427,7 +427,7 @@ bool wxResourceManager::New(bool loadFromFile, const wxString& filename) return FALSE; } - if (!m_resourceTable.ParseResourceFile(WXSTRINGCAST str)) + if (!m_resourceTable.ParseResourceFile(str)) { wxMessageBox("Could not read file.", "Resource file load error", wxOK | wxICON_EXCLAMATION); return FALSE; @@ -1486,12 +1486,15 @@ bool wxResourceManager::DeleteResource(wxItemResource *res) bool wxResourceManager::DeleteResource(wxWindow *win) { - if (win->IsKindOf(CLASSINFO(wxControl))) + if (win->IsKindOf(CLASSINFO(wxControl)) && (win->GetEventHandler() != win)) { // Deselect and refresh window in case we leave selection // handles behind wxControl *item = (wxControl *)win; wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler(); + + wxASSERT_MSG( win->GetEventHandler()->IsKindOf(CLASSINFO(wxResourceEditorControlHandler)), "Wrong kind of handler in DeleteResource" ); + if (childHandler->IsSelected()) { RemoveSelection(item); @@ -2241,6 +2244,22 @@ void ObjectMenuProc(wxMenu *menu, wxCommandEvent& event) } case OBJECT_MENU_DELETE: { + if (data->IsKindOf(CLASSINFO(wxControl)) && (data->GetEventHandler() != data)) + { + // Deselect and refresh window in case we leave selection + // handles behind + wxControl *item = (wxControl *)data; + wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler(); + if (childHandler->IsSelected()) + { + wxResourceManager::GetCurrentResourceManager()->RemoveSelection(item); + childHandler->SelectItem(FALSE); +#ifndef __WXGTK__ + item->GetParent()->Refresh(); +#endif + } + } + wxResourceManager::GetCurrentResourceManager()->SaveInfoAndDeleteHandler(data); wxResourceManager::GetCurrentResourceManager()->DeleteResource(data); wxResourceManager::GetCurrentResourceManager()->DeleteWindow(data); diff --git a/utils/dialoged/src/reseditr.h b/utils/dialoged/src/reseditr.h index c0b2c6840b..00e57587cb 100644 --- a/utils/dialoged/src/reseditr.h +++ b/utils/dialoged/src/reseditr.h @@ -12,7 +12,7 @@ #ifndef _RESEDITR_H_ #define _RESEDITR_H_ -#define wxDIALOG_EDITOR_VERSION 1.6 +#define wxDIALOG_EDITOR_VERSION 1.7 #ifdef __GNUG__ #pragma interface "reseditr.h" diff --git a/utils/projgen/makeproj.cpp b/utils/projgen/makeproj.cpp index 4b7fcda40f..15a63fc233 100644 --- a/utils/projgen/makeproj.cpp +++ b/utils/projgen/makeproj.cpp @@ -311,8 +311,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../include", 0)); project.SetResourceIncludeDirs(wxStringList("../../../include", 0)); project.SetLibDirs(wxStringList("../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../src/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../src/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../tiff/Release", 0)); project.SetProjectName("DialogEdVC"); project.SetTargetName("dialoged"); @@ -333,8 +333,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../include", 0)); project.SetResourceIncludeDirs(wxStringList("../../../include", 0)); project.SetLibDirs(wxStringList("../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../src/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../src/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../tiff/Release", 0)); project.SetProjectName("Tex2RTFVC"); project.SetTargetName("tex2rtf"); @@ -354,8 +354,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../include", 0)); project.SetResourceIncludeDirs(wxStringList("../../../include", 0)); project.SetLibDirs(wxStringList("../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../src/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../src/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../tiff/Release", 0)); project.SetProjectName("HelpGenVC"); project.SetTargetName("helpgen"); @@ -376,8 +376,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../include", 0)); project.SetResourceIncludeDirs(wxStringList("../../include", 0)); project.SetLibDirs(wxStringList("../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../src/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../src/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../src/Debug", "../../src/jpeg/Debug", "../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../src/Release", "../../src/jpeg/Release", "../../tiff/Release", 0)); project.SetProjectName("ProjGenVC"); project.SetTargetName("makeproj"); @@ -395,8 +395,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../include", 0)); project.SetResourceIncludeDirs(wxStringList("../../../include", 0)); project.SetLibDirs(wxStringList("../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../src/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../src/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../tiff/Release", 0)); project.SetProjectName("TreeSampleVC"); project.SetTargetName("test"); @@ -414,8 +414,9 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0)); project.SetResourceIncludeDirs(wxStringList("../../../../include", 0)); project.SetLibDirs(wxStringList("../../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", "../../../../src/jpeg/Release", "../../../../tiff/Release", 0)); + project.SetExtraLibs(wxStringList("ogl.lib", 0)); project.SetProjectName("OGLEditVC"); @@ -436,8 +437,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0)); project.SetResourceIncludeDirs(wxStringList("../../../../include", 0)); project.SetLibDirs(wxStringList("../../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", "../../../../src/jpeg/Release", "../../../../tiff/Release", 0)); project.SetExtraLibs(wxStringList("ogl.lib", 0)); project.SetProjectName("StudioVC"); @@ -460,8 +461,9 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0)); project.SetResourceIncludeDirs(wxStringList("../../../../include", 0)); project.SetLibDirs(wxStringList("../../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../tiff/Release", 0)); + project.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0)); project.SetProjectName("CubeVC"); @@ -481,8 +483,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0)); project.SetResourceIncludeDirs(wxStringList("../../../../include", 0)); project.SetLibDirs(wxStringList("../../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../tiff/Release", 0)); project.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0)); project.SetProjectName("IsoSurfVC"); @@ -502,8 +504,8 @@ void MyApp::GenerateSamples(const wxString& dir) project.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0)); project.SetResourceIncludeDirs(wxStringList("../../../../include", 0)); project.SetLibDirs(wxStringList("../../../../lib", 0)); - project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0)); - project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0)); + project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0)); + project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../tiff/Release", 0)); project.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0)); project.SetProjectName("PenguinVC");