diff --git a/Makefile.in b/Makefile.in index 4f47fe99fc..ff4c99286b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4006,6 +4006,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/propgrid/propgridiface.h \ wx/propgrid/propgridpagestate.h \ wx/propgrid/props.h \ + wx/propgrid/private.h \ wx/ribbon/art.h \ wx/ribbon/art_internal.h \ wx/ribbon/bar.h \ diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 073d5366bb..11f4df436e 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -3054,6 +3054,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/propgrid/propgridiface.h wx/propgrid/propgridpagestate.h wx/propgrid/props.h + wx/propgrid/private.h diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index ce67bff793..5803997115 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -2839,6 +2839,7 @@ set(PROPGRID_HDR wx/propgrid/propgridiface.h wx/propgrid/propgridpagestate.h wx/propgrid/props.h + wx/propgrid/private.h ) set(RICHTEXT_SRC diff --git a/build/files b/build/files index 09b965eaa0..6a1333ca6b 100644 --- a/build/files +++ b/build/files @@ -2775,6 +2775,7 @@ PROPGRID_HDR = wx/propgrid/propgridiface.h wx/propgrid/propgridpagestate.h wx/propgrid/props.h + wx/propgrid/private.h # wxRichTextCtrl diff --git a/build/msw/wx_propgrid.vcxproj b/build/msw/wx_propgrid.vcxproj index 3a85235d5f..ea4c7ed3bb 100644 --- a/build/msw/wx_propgrid.vcxproj +++ b/build/msw/wx_propgrid.vcxproj @@ -503,6 +503,7 @@ + diff --git a/build/msw/wx_propgrid.vcxproj.filters b/build/msw/wx_propgrid.vcxproj.filters index d3384bb682..1ed0f5f8eb 100644 --- a/build/msw/wx_propgrid.vcxproj.filters +++ b/build/msw/wx_propgrid.vcxproj.filters @@ -83,6 +83,9 @@ Common Headers + + Common Headers + diff --git a/include/wx/propgrid/private.h b/include/wx/propgrid/private.h new file mode 100644 index 0000000000..5254959b55 --- /dev/null +++ b/include/wx/propgrid/private.h @@ -0,0 +1,194 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/propgrid/private.h +// Purpose: Private wxPropertyGrid declarations +// Author: Artur Wieczorek, Jaakko Salli +// Created: 2023-03-10 +// Copyright: (c) 2023 wxWidgets development team +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_PROPGRID_PRIVATE_H_ +#define _WX_PROPGRID_PRIVATE_H_ + +#include "wx/defs.h" + +// ----------------------------------------------------------------------- + +// space between vertical sides of a custom image +#define wxPG_CUSTOM_IMAGE_SPACINGY 1 + +// space between caption and selection rectangle, +#define wxPG_CAPRECTXMARGIN 2 + +// horizontally and vertically +#define wxPG_CAPRECTYMARGIN 1 + +// ----------------------------------------------------------------------- + +// +// Here are some platform dependent defines +// NOTE: More in propertygrid.cpp +// +// NB: Only define wxPG_TEXTCTRLXADJUST for platforms that do not +// (yet) support wxTextEntry::SetMargins() for the left margin. + +#if defined(__WXMSW__) + + // space between vertical line and value text + #define wxPG_XBEFORETEXT 4 + // space between vertical line and value editor control + #define wxPG_XBEFOREWIDGET 1 + + // left margin can be set with wxTextEntry::SetMargins() + #undef wxPG_TEXTCTRLXADJUST + + // comment to use bitmap buttons + #define wxPG_ICON_WIDTH 9 + // 1 if wxRendererNative should be employed + #define wxPG_USE_RENDERER_NATIVE 1 + + // width of optional bitmap/image in front of property + #define wxPG_CUSTOM_IMAGE_WIDTH 20 + + // 1 if splitter drag detect margin and control cannot overlap + #define wxPG_NO_CHILD_EVT_MOTION 0 + + #define wxPG_NAT_BUTTON_BORDER_ANY 1 + #define wxPG_NAT_BUTTON_BORDER_X 1 + #define wxPG_NAT_BUTTON_BORDER_Y 1 + + // If 1 then controls are refreshed explicitly in a few places + #define wxPG_REFRESH_CONTROLS 0 + +#elif defined(__WXGTK__) + + // space between vertical line and value text + #define wxPG_XBEFORETEXT 5 + // space between vertical line and value editor control + #define wxPG_XBEFOREWIDGET 1 + + // x position adjustment for wxTextCtrl (and like) + // left margin can be set with wxTextEntry::SetMargins() + #undef wxPG_TEXTCTRLXADJUST + + // comment to use bitmap buttons + #define wxPG_ICON_WIDTH 9 + // 1 if wxRendererNative should be employed + #define wxPG_USE_RENDERER_NATIVE 1 + + // width of optional bitmap/image in front of property + #define wxPG_CUSTOM_IMAGE_WIDTH 20 + + // 1 if splitter drag detect margin and control cannot overlap + #define wxPG_NO_CHILD_EVT_MOTION 1 + + #define wxPG_NAT_BUTTON_BORDER_ANY 1 + #define wxPG_NAT_BUTTON_BORDER_X 1 + #define wxPG_NAT_BUTTON_BORDER_Y 1 + + // If 1 then controls are refreshed after selected was drawn. + #define wxPG_REFRESH_CONTROLS 1 + +#elif defined(__WXMAC__) + + // space between vertical line and value text + #define wxPG_XBEFORETEXT 4 + // space between vertical line and value editor widget + #define wxPG_XBEFOREWIDGET 1 + + // x position adjustment for wxTextCtrl (and like) + // left margin cannot be set with wxTextEntry::SetMargins() + #define wxPG_TEXTCTRLXADJUST 1 + + // comment to use bitmap buttons + #define wxPG_ICON_WIDTH 11 + // 1 if wxRendererNative should be employed + #define wxPG_USE_RENDERER_NATIVE 1 + + // width of optional bitmap/image in front of property + #define wxPG_CUSTOM_IMAGE_WIDTH 20 + + // 1 if splitter drag detect margin and control cannot overlap + #define wxPG_NO_CHILD_EVT_MOTION 0 + + #define wxPG_NAT_BUTTON_BORDER_ANY 0 + #define wxPG_NAT_BUTTON_BORDER_X 0 + #define wxPG_NAT_BUTTON_BORDER_Y 0 + + // If 1 then controls are refreshed after selected was drawn. + #define wxPG_REFRESH_CONTROLS 0 + +#else // defaults + + // space between vertical line and value text + #define wxPG_XBEFORETEXT 5 + // space between vertical line and value editor widget + #define wxPG_XBEFOREWIDGET 1 + + // x position adjustment for wxTextCtrl (and like) + // left margin cannot be set with wxTextEntry::SetMargins() + #define wxPG_TEXTCTRLXADJUST 3 + + // comment to use bitmap buttons + #define wxPG_ICON_WIDTH 9 + // 1 if wxRendererNative should be employed + #define wxPG_USE_RENDERER_NATIVE 0 + + // width of optional bitmap/image in front of property + #define wxPG_CUSTOM_IMAGE_WIDTH 20 + + // 1 if splitter drag detect margin and control cannot overlap + #define wxPG_NO_CHILD_EVT_MOTION 1 + + #define wxPG_NAT_BUTTON_BORDER_ANY 0 + #define wxPG_NAT_BUTTON_BORDER_X 0 + #define wxPG_NAT_BUTTON_BORDER_Y 0 + + // If 1 then controls are refreshed after selected was drawn. + #define wxPG_REFRESH_CONTROLS 0 +#endif // platform + + +#define wxPG_CONTROL_MARGIN 0 // space between splitter and control + +#define wxCC_CUSTOM_IMAGE_MARGIN1 4 // before image +#define wxCC_CUSTOM_IMAGE_MARGIN2 5 // after image + +#define DEFAULT_IMAGE_OFFSET_INCREMENT \ + (wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2) + +#define wxPG_DRAG_MARGIN 30 + +#if wxPG_NO_CHILD_EVT_MOTION + #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left + #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right +#else + #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left + #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right +#endif + +// Use this macro to generate standard custom image height from +#define wxPG_STD_CUST_IMAGE_HEIGHT(LINEHEIGHT) ((LINEHEIGHT)-3) + +// Undefine wxPG_ICON_WIDTH to use supplied xpm bitmaps instead +// (for tree buttons) +//#undef wxPG_ICON_WIDTH + +// ----------------------------------------------------------------------- + +// Events used only internally +wxDECLARE_EVENT(wxEVT_PG_HSCROLL, wxPropertyGridEvent); +wxDECLARE_EVENT(wxEVT_PG_COLS_RESIZED, wxPropertyGridEvent); + +// ----------------------------------------------------------------------- + +// Flags used only internally + +// wxBoolProperty, wxFlagsProperty specific flags +constexpr wxPGPropertyFlags wxPG_PROP_USE_CHECKBOX = wxPG_PROP_CLASS_SPECIFIC_1; +// DCC = Double Click Cycles +constexpr wxPGPropertyFlags wxPG_PROP_USE_DCC = wxPG_PROP_CLASS_SPECIFIC_2; + +// wxStringProperty flag +constexpr wxPGPropertyFlags wxPG_PROP_PASSWORD = wxPG_PROP_CLASS_SPECIFIC_2; + +#endif // _WX_PROPGRID_PRIVATE_H_ diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 5f84b80dcb..59a64549b0 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -48,16 +48,6 @@ struct wxPGPaintData }; -// space between vertical sides of a custom image -#define wxPG_CUSTOM_IMAGE_SPACINGY 1 - -// space between caption and selection rectangle, -#define wxPG_CAPRECTXMARGIN 2 - -// horizontally and vertically -#define wxPG_CAPRECTYMARGIN 1 - - // Base class for wxPropertyGrid cell renderers. class WXDLLIMPEXP_PROPGRID wxPGCellRenderer : public wxObjectRefData { diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 92db45c0b2..d0c41348f6 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -468,11 +468,6 @@ enum wxPG_KEYBOARD_ACTIONS // ----------------------------------------------------------------------- -#if !defined(__wxPG_SOURCE_FILE__) - // Reduce compile time, but still include in user app - #include "wx/propgrid/props.h" -#endif - // ----------------------------------------------------------------------- // wxPropertyGrid is a specialized grid for editing properties @@ -1393,10 +1388,6 @@ protected: virtual wxSize DoGetBestSize() const override; virtual void DoEnable(bool enable) override; -#ifndef wxPG_ICON_WIDTH - wxBitmap m_expandbmp, m_collbmp; -#endif - wxCursor m_cursorSizeWE; // wxWindow pointers to editor control(s). @@ -1449,12 +1440,9 @@ protected: // This is also calculated in the gutter int m_iconWidth; -#ifndef wxPG_ICON_WIDTH - // The image height of the [+] icon. // This is calculated as minimal size and to align int m_iconHeight; -#endif // Current cursor id. int m_curcursor; @@ -1875,9 +1863,6 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_COL_DRAGGING, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_COL_END_DRAG, wxPropertyGridEvent ); -// Events used only internally -wxDECLARE_EVENT(wxEVT_PG_HSCROLL, wxPropertyGridEvent); -wxDECLARE_EVENT(wxEVT_PG_COLS_RESIZED, wxPropertyGridEvent); #else enum { diff --git a/include/wx/propgrid/propgriddefs.h b/include/wx/propgrid/propgriddefs.h index 0104113b79..98cfcc74c7 100644 --- a/include/wx/propgrid/propgriddefs.h +++ b/include/wx/propgrid/propgriddefs.h @@ -29,155 +29,6 @@ class WXDLLIMPEXP_FWD_CORE wxFont; // ----------------------------------------------------------------------- -// -// Here are some platform dependent defines -// NOTE: More in propertygrid.cpp -// -// NB: Only define wxPG_TEXTCTRLXADJUST for platforms that do not -// (yet) support wxTextEntry::SetMargins() for the left margin. - -#if defined(__WXMSW__) - - // space between vertical line and value text - #define wxPG_XBEFORETEXT 4 - // space between vertical line and value editor control - #define wxPG_XBEFOREWIDGET 1 - - // left margin can be set with wxTextEntry::SetMargins() - #undef wxPG_TEXTCTRLXADJUST - - // comment to use bitmap buttons - #define wxPG_ICON_WIDTH 9 - // 1 if wxRendererNative should be employed - #define wxPG_USE_RENDERER_NATIVE 1 - - // width of optional bitmap/image in front of property - #define wxPG_CUSTOM_IMAGE_WIDTH 20 - - // 1 if splitter drag detect margin and control cannot overlap - #define wxPG_NO_CHILD_EVT_MOTION 0 - - #define wxPG_NAT_BUTTON_BORDER_ANY 1 - #define wxPG_NAT_BUTTON_BORDER_X 1 - #define wxPG_NAT_BUTTON_BORDER_Y 1 - - // If 1 then controls are refreshed explicitly in a few places - #define wxPG_REFRESH_CONTROLS 0 - -#elif defined(__WXGTK__) - - // space between vertical line and value text - #define wxPG_XBEFORETEXT 5 - // space between vertical line and value editor control - #define wxPG_XBEFOREWIDGET 1 - - // x position adjustment for wxTextCtrl (and like) - // left margin can be set with wxTextEntry::SetMargins() - #undef wxPG_TEXTCTRLXADJUST - - // comment to use bitmap buttons - #define wxPG_ICON_WIDTH 9 - // 1 if wxRendererNative should be employed - #define wxPG_USE_RENDERER_NATIVE 1 - - // width of optional bitmap/image in front of property - #define wxPG_CUSTOM_IMAGE_WIDTH 20 - - // 1 if splitter drag detect margin and control cannot overlap - #define wxPG_NO_CHILD_EVT_MOTION 1 - - #define wxPG_NAT_BUTTON_BORDER_ANY 1 - #define wxPG_NAT_BUTTON_BORDER_X 1 - #define wxPG_NAT_BUTTON_BORDER_Y 1 - - // If 1 then controls are refreshed after selected was drawn. - #define wxPG_REFRESH_CONTROLS 1 - -#elif defined(__WXMAC__) - - // space between vertical line and value text - #define wxPG_XBEFORETEXT 4 - // space between vertical line and value editor widget - #define wxPG_XBEFOREWIDGET 1 - - // x position adjustment for wxTextCtrl (and like) - // left margin cannot be set with wxTextEntry::SetMargins() - #define wxPG_TEXTCTRLXADJUST 1 - - // comment to use bitmap buttons - #define wxPG_ICON_WIDTH 11 - // 1 if wxRendererNative should be employed - #define wxPG_USE_RENDERER_NATIVE 1 - - // width of optional bitmap/image in front of property - #define wxPG_CUSTOM_IMAGE_WIDTH 20 - - // 1 if splitter drag detect margin and control cannot overlap - #define wxPG_NO_CHILD_EVT_MOTION 0 - - #define wxPG_NAT_BUTTON_BORDER_ANY 0 - #define wxPG_NAT_BUTTON_BORDER_X 0 - #define wxPG_NAT_BUTTON_BORDER_Y 0 - - // If 1 then controls are refreshed after selected was drawn. - #define wxPG_REFRESH_CONTROLS 0 - -#else // defaults - - // space between vertical line and value text - #define wxPG_XBEFORETEXT 5 - // space between vertical line and value editor widget - #define wxPG_XBEFOREWIDGET 1 - - // x position adjustment for wxTextCtrl (and like) - // left margin cannot be set with wxTextEntry::SetMargins() - #define wxPG_TEXTCTRLXADJUST 3 - - // comment to use bitmap buttons - #define wxPG_ICON_WIDTH 9 - // 1 if wxRendererNative should be employed - #define wxPG_USE_RENDERER_NATIVE 0 - - // width of optional bitmap/image in front of property - #define wxPG_CUSTOM_IMAGE_WIDTH 20 - - // 1 if splitter drag detect margin and control cannot overlap - #define wxPG_NO_CHILD_EVT_MOTION 1 - - #define wxPG_NAT_BUTTON_BORDER_ANY 0 - #define wxPG_NAT_BUTTON_BORDER_X 0 - #define wxPG_NAT_BUTTON_BORDER_Y 0 - - // If 1 then controls are refreshed after selected was drawn. - #define wxPG_REFRESH_CONTROLS 0 -#endif // platform - - -#define wxPG_CONTROL_MARGIN 0 // space between splitter and control - -#define wxCC_CUSTOM_IMAGE_MARGIN1 4 // before image -#define wxCC_CUSTOM_IMAGE_MARGIN2 5 // after image - -#define DEFAULT_IMAGE_OFFSET_INCREMENT \ - (wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2) - -#define wxPG_DRAG_MARGIN 30 - -#if wxPG_NO_CHILD_EVT_MOTION - #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left - #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right -#else - #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left - #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right -#endif - -// Use this macro to generate standard custom image height from -#define wxPG_STD_CUST_IMAGE_HEIGHT(LINEHEIGHT) ((LINEHEIGHT)-3) - -// Undefine wxPG_ICON_WIDTH to use supplied xpm bitmaps instead -// (for tree buttons) -//#undef wxPG_ICON_WIDTH - // Set 1 to include advanced properties (wxFontProperty, wxColourProperty, etc.) #ifndef wxPG_INCLUDE_ADVPROPS #define wxPG_INCLUDE_ADVPROPS 1 diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 71656bf653..dfa8285716 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -88,8 +88,6 @@ private: // Property classes // ----------------------------------------------------------------------- -constexpr wxPGPropertyFlags wxPG_PROP_PASSWORD = wxPG_PROP_CLASS_SPECIFIC_2; - // Basic property with string value. // If value "" is set, then actual value is formed (or composed) // from values of child properties. @@ -682,14 +680,6 @@ protected: virtual bool DisplayEditorDialog(wxPropertyGrid* pg, wxVariant& value) override; }; -// ----------------------------------------------------------------------- - -// wxBoolProperty, wxFlagsProperty specific flags -constexpr wxPGPropertyFlags wxPG_PROP_USE_CHECKBOX = wxPG_PROP_CLASS_SPECIFIC_1; -// DCC = Double Click Cycles -constexpr wxPGPropertyFlags wxPG_PROP_USE_DCC = wxPG_PROP_CLASS_SPECIFIC_2; - - // ----------------------------------------------------------------------- // Property that manages a list of strings. diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index e95280bccf..a0c35bcb1e 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -21,8 +21,6 @@ #include "wx/wxcrtvararg.h" #endif -#define __wxPG_SOURCE_FILE__ - #include "wx/propgrid/propgrid.h" #if wxPG_INCLUDE_ADVPROPS diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 0991467b18..d20b25704d 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -22,12 +22,10 @@ #include "wx/dcbuffer.h" #include "wx/odcombo.h" -// This define is necessary to prevent macro clearing -#define __wxPG_SOURCE_FILE__ - #include "wx/propgrid/propgrid.h" #include "wx/propgrid/editors.h" #include "wx/propgrid/props.h" +#include "wx/propgrid/private.h" #if wxPG_USE_RENDERER_NATIVE #include "wx/renderer.h" diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 747638a0b2..72b5a3f4d1 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -24,10 +24,8 @@ #include "wx/dcbuffer.h" // for wxALWAYS_NATIVE_DOUBLE_BUFFER #include "wx/headerctrl.h" // for wxPGHeaderCtrl -// This define is necessary to prevent macro clearing -#define __wxPG_SOURCE_FILE__ - #include "wx/propgrid/manager.h" +#include "wx/propgrid/private.h" #define wxPG_MAN_ALTERNATE_BASE_ID 11249 // Needed for wxID_ANY madness diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 0f5a25b5d9..208731d629 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -19,13 +19,11 @@ #include "wx/log.h" #endif -// This define is necessary to prevent macro clearing -#define __wxPG_SOURCE_FILE__ - #include "wx/propgrid/propgrid.h" #include "wx/propgrid/property.h" #include "wx/propgrid/props.h" #include "wx/propgrid/editors.h" +#include "wx/propgrid/private.h" #if wxPG_USE_RENDERER_NATIVE #include "wx/renderer.h" diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index e12b97618e..f39750723f 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -46,12 +46,9 @@ #include "wx/settings.h" #endif - -// This define is necessary to prevent macro clearing -#define __wxPG_SOURCE_FILE__ - #include "wx/propgrid/propgrid.h" #include "wx/propgrid/editors.h" +#include "wx/propgrid/private.h" #if wxPG_USE_RENDERER_NATIVE #include "wx/renderer.h" @@ -69,7 +66,7 @@ // recommended to use either custom or native rendering). // If you want them, get wxTreeMultiCtrl by Jorgen Bodde, // and copy xpm files from archive to wxPropertyGrid src directory -// (and also comment/undef wxPG_ICON_WIDTH in propGrid.h +// (and also comment/undef wxPG_ICON_WIDTH in private.h // and set wxPG_USE_RENDERER_NATIVE to 0). #ifndef wxPG_ICON_WIDTH #if defined(__WXMAC__) @@ -93,10 +90,6 @@ #define wxPG_DEFAULT_CURSOR wxNullCursor #define wxPG_PIXELS_PER_UNIT m_lineHeight -#ifdef wxPG_ICON_WIDTH - #define m_iconHeight m_iconWidth -#endif - //#define wxPG_TOOLTIP_DELAY 1000 // This is the number of pixels the expander button inside @@ -253,6 +246,15 @@ void wxPropertyGridInitGlobalsIfNeeded() // wxPropertyGrid // ----------------------------------------------------------------------- +#ifndef wxPG_ICON_WIDTH +namespace +{ + // create two bitmap nodes for drawing + static wxBitmap s_expandbmp(expand_xpm); + static wxBitmap s_collbmp(collapse_xpm); +} +#endif + wxIMPLEMENT_DYNAMIC_CLASS(wxPropertyGrid, wxControl); wxBEGIN_EVENT_TABLE(wxPropertyGrid, wxControl) @@ -387,6 +389,7 @@ void wxPropertyGrid::Init1() m_iconHeight = 11; #else m_iconWidth = wxPG_ICON_WIDTH; + m_iconHeight = wxPG_ICON_WIDTH; #endif m_gutterWidth = wxPG_GUTTER_MIN; @@ -444,14 +447,10 @@ void wxPropertyGrid::Init2() GetClientSize(&m_width,&m_height); #ifndef wxPG_ICON_WIDTH - // create two bitmap nodes for drawing - m_expandbmp = wxBitmap(expand_xpm); - m_collbmp = wxBitmap(collapse_xpm); - // calculate average font height for bitmap centering - m_iconWidth = m_expandbmp.GetWidth(); - m_iconHeight = m_expandbmp.GetHeight(); + m_iconWidth = s_expandbmp.GetWidth(); + m_iconHeight = s_expandbmp.GetHeight(); #endif m_curcursor = wxCURSOR_ARROW; @@ -1961,7 +1960,7 @@ void wxPropertyGrid::DrawExpanderButton( wxDC& dc, const wxRect& rect, #elif wxPG_ICON_WIDTH // #else - bmp = m_collbmp; + bmp = s_collbmp; #endif } @@ -1978,7 +1977,7 @@ void wxPropertyGrid::DrawExpanderButton( wxDC& dc, const wxRect& rect, int _x = r.x+(m_iconWidth/2); dc.DrawLine(_x,r.y+2,_x,r.y+m_iconWidth-2); #else - bmp = m_expandbmp; + bmp = s_expandbmp; #endif } diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index ad9e98e78e..3bcd3ede33 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -19,6 +19,7 @@ #include "wx/colour.h" #include "wx/font.h" #include "wx/log.h" + #include "wx/textctrl.h" #include "wx/validate.h" #endif diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index b15df5290c..c9a148ff20 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -25,11 +25,9 @@ #include "wx/validate.h" #endif -// This define is necessary to prevent macro clearing -#define __wxPG_SOURCE_FILE__ - #include "wx/propgrid/propgridpagestate.h" #include "wx/propgrid/propgrid.h" +#include "wx/propgrid/private.h" #include diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index a82825ef03..17f74f0293 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -26,6 +26,8 @@ #include "wx/propgrid/propgrid.h" #include "wx/propgrid/editors.h" +#include "wx/propgrid/props.h" +#include "wx/propgrid/private.h" #include