📄 propgrid.h
字号:
/////////////////////////////////////////////////////////////////////////////
// Name: propgrid.h
// Purpose: wxPropertyGrid
// Author: Jaakko Salli
// Modified by:
// Created: Sep-25-2004
// RCS-ID: $Id:
// Copyright: (c) Jaakko Salli
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_PROPGRID_PROPGRID_H__
#define __WX_PROPGRID_PROPGRID_H__
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "propgrid.cpp"
#endif
#include <wx/dynarray.h>
#include <wx/hashmap.h>
#include <wx/variant.h>
#include <wx/longlong.h>
#include <wx/tooltip.h>
#include <wx/datetime.h>
// NB: Do *NOT * remove this.
#if defined(SWIG) || defined(SWIG_TYPE_TABLE)
#ifndef __WXPYTHON__
#define __WXPYTHON__
#endif
#endif
//
// In case DOXYGEN was not specified...
#if !defined(DOXYGEN) && !defined(_WX_WINDOW_H_BASE_) && !defined(SWIG)
// I've tried to get this auto-defined in Doxygen config, but have not
// succeeded thus far... so using a hack here.
#define DOXYGEN
#endif
// Doxygen special includes
#ifdef DOXYGEN
#include "pg_dox_mainpage.h"
#include "propdev.h"
#endif
//
// Need to define some things for DOXYGEN
#ifdef DOXYGEN
#define wxUSE_VALIDATORS 1
#define wxUSE_DATETIME 1
#define wxUSE_TOOLTIPS 1
#define wxUSE_SPINBTN 1
#define wxUSE_DATEPICKCTRL 1
#endif
//
// Check some wxUSE_FOOs
#ifndef wxUSE_VALIDATORS
#error "wxUSE_VALIDATORS not defined"
#endif
#ifndef wxUSE_DATETIME
#error "wxUSE_DATETIME not defined"
#endif
#ifndef wxUSE_DATEPICKCTRL
#error "wxUSE_DATEPICKCTRL not defined"
#endif
// Uncomment next line to allow wxAdv linkage (required for DatePickerCtrl editor)
// #define wxPG_ALLOW_WXADV
#if defined(__WXPYTHON__)
#include <python.h>
#undef wxPG_ALLOW_WXADV
#define wxPG_ALLOW_WXADV
#endif
//
// wxPropertyGrid version macro
//
// Formula:
// Major Version * 1000
// + Minor Version * 100
// + Release * 10
// + Subrelease (zero for actual releases, some number for consequtive snapshots)
//
// NB: Subrelease does not necessarily get updated at every snapshot.
// In fact, it will more likely be updated once a week or so
// (less often when releases are made more sparsely).
//
#define wxPG_VERSION 1270
// -----------------------------------------------------------------------
//
// Here are some platform dependent defines
// NOTE: More in propertygrid.cpp
//
#ifndef SWIG
#if defined(__WXMSW__)
// tested
#define wxPG_XBEFORETEXT 5 // space between vertical line and value text
#define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor control
#define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like)
#define wxPG_ICON_WIDTH 9 // comment to use bitmap buttons
#define wxPG_USE_RENDERER_NATIVE 0 // 1 if wxRendererNative should be employed
#define wxPG_DOUBLE_BUFFER 1 // 1 to use double-buffer that guarantees flicker-free painting
#define wxPG_HEAVY_GFX 1 // 1 for prettier appearance
#define wxPG_SUPPORT_TOOLTIPS 1 // Enable tooltips
#elif defined(__WXGTK__)
// tested
#define wxPG_XBEFORETEXT 6 // space between vertical line and value text
#define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor control
#define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like)
#define wxPG_ICON_WIDTH 9 // comment to use bitmap buttons
#define wxPG_USE_RENDERER_NATIVE 0 // 1 if wxRendererNative should be employed
#define wxPG_DOUBLE_BUFFER 1 // 1 to use double-buffer that guarantees flicker-free painting
#define wxPG_HEAVY_GFX 1 // 1 for prettier appearance
#define wxPG_SUPPORT_TOOLTIPS 1 // Enable tooltips
#elif defined(__WXMAC__)
// *not* tested
#define wxPG_XBEFORETEXT 5 // space between vertical line and value text
#define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor widget
#define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like)
#define wxPG_ICON_WIDTH 11 // comment to use bitmap buttons
#define wxPG_USE_RENDERER_NATIVE 1 // 1 if wxRendererNative should be employed
#define wxPG_DOUBLE_BUFFER 0 // 1 to use double-buffer that guarantees flicker-free painting
#define wxPG_HEAVY_GFX 1 // 1 for prettier appearance
#define wxPG_SUPPORT_TOOLTIPS 1 // Enable tooltips
#else
// defaults
// tested on: none.
#define wxPG_XBEFORETEXT 6 // space between vertical line and value text
#define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor widget
#define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like)
#define wxPG_ICON_WIDTH 9 // comment to use bitmap buttons
#define wxPG_USE_RENDERER_NATIVE 0 // 1 if wxRendererNative should be employed
#define wxPG_DOUBLE_BUFFER 0 // 1 to use double-buffer that guarantees flicker-free painting
#define wxPG_HEAVY_GFX 0 // 1 for prettier appearance
#define wxPG_SUPPORT_TOOLTIPS 0 // Enable tooltips
#endif // #if defined(__WXMSW__)
#if defined(__WXWINCE__)
#define wxPG_SMALL_SCREEN 1
#undef wxPG_DOUBLE_BUFFER
#define wxPG_DOUBLE_BUFFER 0
#else
#define wxPG_SMALL_SCREEN 0
#endif
#endif // #ifndef SWIG
// Undefine wxPG_ICON_WIDTH to use supplied xpm bitmaps instead
// (for tree buttons)
//#undef wxPG_ICON_WIDTH
// Need to force disable tooltips?
#if !wxUSE_TOOLTIPS
#undef wxPG_SUPPORT_TOOLTIPS
#define wxPG_SUPPORT_TOOLTIPS 0
#endif
// Set 1 to include basic properties ( ~48k in 0.9.9.2 )
#define wxPG_INCLUDE_BASICPROPS 1
// Set 1 to include advanced properties (wxFontProperty, wxColourProperty, etc.) ( ~32k in 0.9.9.2 )
#define wxPG_INCLUDE_ADVPROPS 1
// Set 1 include wxPropertyGridManager ( ~36k in 0.9.9.1 )
//#define wxPG_INCLUDE_MANAGER 1
// Set 1 to include checkbox editor class ( ~4k in 0.9.9.1 )
#define wxPG_INCLUDE_CHECKBOX 1
// 1 to allow user data for each property
#define wxPG_USE_CLIENT_DATA 1
// NOTE: This is not supported as 1.
#define wxPG_INCLUDE_WXOBJECT 0
// -----------------------------------------------------------------------
#ifdef wxPG_COMPATIBILITY_1_0_0
#define wxRECURSE wxPG_RECURSE
#define wxKEEP_STRUCTURE wxPG_KEEP_STRUCTURE
#define wxPGConstants wxPGChoices
#define wxPG_EX_CLASSIC_SPACING 0
#define wxPGCtrlClass wxWindow
#define wxCCustomTextCtrl wxTextCtrl
#define wxCCustomComboBox wxPGOwnerDrawnComboBox
#define wxCCustomButton wxButton
#endif // #ifdef wxPG_COMPATIBILITY_1_0_0
#ifdef __WXPYTHON__
#define wxPG_PGVARIANT_IS_VARIANT 1 // 1
#define wxPG_VALUETYPE_IS_STRING 0 // 1
#else
#define wxPG_PGVARIANT_IS_VARIANT 0
#define wxPG_VALUETYPE_IS_STRING 0
#endif
#ifndef SWIG
#if !wxCHECK_VERSION(2,9,0)
#if !defined(wxUniChar)
#define wxUniChar wxChar
#endif
//#define wxPGGetIterChar(str, i) str[i]
#define wxPGGetIterChar(str, i) *i
#else
#define wxPGGetIterChar(str, i) *i
#endif
#endif
// -----------------------------------------------------------------------
//
// wxPython special considerations
//
// TODO: Using wxPG_GETVALUE_CONST yields some ugly function
// names, so might as well make those GetPropertyValueAsXXX non-static
// for regular C++ build as well.s
//
#if !wxPG_VALUETYPE_IS_STRING
#define wxPG_VALUETYPE_MSGVAL const wxPGValueType*
#else
#define wxPG_VALUETYPE_MSGVAL wxString
#endif
#ifndef __WXPYTHON__
// Some Strings are returned as const wxChar* in C++, and as wxString in wxPython
// (using just wxString for everything would've been better, but the current scheme
// is necessary for better backwards compatibility).
#define wxPG_CONST_WXCHAR_PTR const wxChar*
#define wxPG_CONST_WXCHAR_DEFVAL ((const wxChar*)NULL)
#define wxPG_TO_WXCHAR_PTR(A) A
#define wxPG_PYTHON_STATIC static
#define wxPG_GETVALUE_CONST
// In C++ we can stick with overloaded methods
#define SetPropertyValueLong SetPropertyValue
#define SetPropertyValueDouble SetPropertyValue
#define SetPropertyValueBool SetPropertyValue
#define SetPropertyValueString SetPropertyValue
#define SetPropertyValueWxObjectPtr SetPropertyValue
#define SetPropertyValuePoint SetPropertyValue
#define SetPropertyValueSize SetPropertyValue
#define SetPropertyValueArrint2 SetPropertyValue
#define SetPropertyValueArrstr2 SetPropertyValue
#define SetPropertyValueDatetime SetPropertyValue
#define SetPropertyValueLongLong SetPropertyValue
#define SetPropertyValueULongLong SetPropertyValue
#else
// Some Strings are returned as const wxChar* in C++, and as wxString in wxPython
// (using just wxString for everything would've been better, but the current scheme
// is necessary for better backwards compatibility).
#define wxPG_CONST_WXCHAR_PTR wxString
#define wxPG_CONST_WXCHAR_DEFVAL wxEmptyString
#define wxPG_TO_WXCHAR_PTR(A) (A.c_str())
// Declaring GetValues as static will yield problems
#define wxPG_PYTHON_STATIC
#define wxPG_GETVALUE_CONST const
// Because SWIG has problems combining overloaded functions and
// Python object-to-wxXXX conversion, we need to use Python proxy
// functions for these value setters.
#define SetPropertyValueArrstr2 _SetPropertyValueArrstr
#define SetPropertyValueArrint2 _SetPropertyValueArrint
#endif
// wxPG_CHECK_FOO_DBG - on Release and wxPython builds, show wxLogWarning instead
// (so that the program flow is not interrupted, but the message can still be seen).
#if !defined(__WXDEBUG__) || defined(__WXPYTHON__)
#define wxPG_CHECK_RET_DBG(A,B) \
if ( !(A) ) { wxLogWarning(B); return; }
#define wxPG_CHECK_MSG_DBG(A,B,C) \
if ( !(A) ) { wxLogWarning(C); return B; }
#else
#define wxPG_CHECK_RET_DBG(A,B) wxCHECK_RET(A,B)
#define wxPG_CHECK_MSG_DBG(A,B,C) wxCHECK_MSG(A,B,C)
#endif
// -----------------------------------------------------------------------
// Our very custom dynamic object macros. Should only be used
// directly in an abstract (typeless etc.) base property classes.
#if wxPG_INCLUDE_WXOBJECT
#error "wxPG_INCLUDE_WXOBJECT is not currently supported (as of 1.0.0b)."
#define WX_PG_DECLARE_GETCLASSNAME
#define WX_PG_DECLARE_GETCLASSINFO
#else
#define WX_PG_DECLARE_GETCLASSNAME virtual wxPG_CONST_WXCHAR_PTR GetClassName() const;
#define WX_PG_DECLARE_GETCLASSINFO virtual const wxPGPropertyClassInfo* GetClassInfo() const;
#endif
// -----------------------------------------------------------------------
#if defined(__WXMSW__) && defined(WXUSINGDLL) // O.C. > wxPropertyGrid is built-in SAGA
#define WXMAKINGLIB_PROPGRID
#endif
#ifdef WXMAKINGLIB_PROPGRID #define WXDLLIMPEXP_PG#elif defined(WXMAKINGDLL_PROPGRID) #define WXDLLIMPEXP_PG WXEXPORT
#elif defined(WXUSINGDLL)
#define WXDLLIMPEXP_PG WXIMPORT
#else // not making nor using DLL
#define WXDLLIMPEXP_PG
#endif
// -----------------------------------------------------------------------
#if wxPG_PGVARIANT_IS_VARIANT
#define wxPGVariant wxVariant
#else
class WXDLLIMPEXP_PG wxPGVariant;
#endif
#ifndef SWIG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -