/usr/include/wxsmith/properties/wxspropertygridmanager.h is in libwxsmithlib-dev 10.05-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | /*
* This file is part of wxSmith plugin for Code::Blocks Studio
* Copyright (C) 2006-2007 Bartlomiej Swiecki
*
* wxSmith is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wxSmith is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
*
* $Revision: 5796 $
* $Id: wxspropertygridmanager.h 5796 2009-09-16 12:09:22Z mortenmacfly $
* $HeadURL: svn+ssh://jenslody@svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.h $
*/
#ifndef WXSPROPERTYGRIDMANAGER_H
#define WXSPROPERTYGRIDMANAGER_H
#include <wx/scrolwin.h>
#include <wx/toolbar.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/hashset.h>
#include <wx/dcclient.h>
#include <wx/propgrid/propgrid.h>
#include <wx/propgrid/manager.h>
#if wxCHECK_VERSION(2, 9, 0)
#define wxPGId wxPGProperty*
#endif
class wxsPropertyContainer;
class wxsProperty;
/** \brief Custom property grid manager
*
* This class was added to handle OnChange event from property window
* because parent event handler rather won't be accessible.
* This object is singleton and always one and not more than one should
* be created at one time.
*/
class wxsPropertyGridManager: public wxPropertyGridManager
{
DECLARE_CLASS(wxsPropertyGridManager)
public:
/** \brief Ctor */
wxsPropertyGridManager(
wxWindow* parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxPGMAN_DEFAULT_STYLE,
#if wxCHECK_VERSION(2, 9, 0)
const char* name = wxPropertyGridManagerNameStr);
#else
const wxChar* name = wxPropertyGridManagerNameStr);
#endif
/** \brief Dctor */
virtual ~wxsPropertyGridManager();
/** \brief Getting singleton object */
static inline wxsPropertyGridManager* Get() { return Singleton; }
/** \brief Getting main container
*
* Returned container is the one which was activated using
* ShowInPropertyGrid() method.
*/
inline wxsPropertyContainer* GetContainer() { return MainContainer; }
protected:
/** \brief Function notifying about change of main wxsPropertyContainer
*
* \param NewContainer new container associated with this manager,
* if 0, container has been unbinded and manager must be cleared.
*/
virtual void OnContainerChanged(wxsPropertyContainer* NewContainer) {}
private:
/** \brief Function clearing current content of property grid */
void UnbindAll();
/** \brief Function unbinding given container
*
* This function destroys all property enteries using given container.
* It's automatically called in container's destructor but it may
* be used in other places too.
*
* \param PC pointer to property container
*/
void UnbindPropertyContainer(wxsPropertyContainer* PC);
/** \brief Function updating content of property grid
* \param PC container which changed it's content, if 0, content
* will always be updated, no matter if it's shown in grid
*/
void Update(wxsPropertyContainer* PC);
/** \brief Function used when adding new property to grid
*
* It should be called from wxsProperty::PGRegister() only !!!
*/
long Register(wxsPropertyContainer* Container,wxsProperty* Property,wxPGId Id,long Index);
/** \brief Starting enumeration of properties for new property container */
void NewPropertyContainerStart();
/** \brief Adding new property into temporary list of properties */
void NewPropertyContainerAddProperty(wxsProperty* Property,wxsPropertyContainer* Container);
/** \brief Finish enumeration of properties for new property container */
void NewPropertyContainerFinish(wxsPropertyContainer* Container);
/** \brief Deleting temporary list used while changing container */
void DeleteTemporaryPropertiesList();
/** \brief Changing main property container */
void SetNewMainContainer(wxsPropertyContainer* NewMain);
/** \brief Handler for roporting change event */
void OnChange(wxPropertyGridEvent& event);
/** \brief Data of selected property */
struct SelectionData
{
int m_PageIndex;
wxString m_PropertyName;
};
/** \brief Storing currently selected property
*
* \param Data place where selection should be stored, if NULL,
* selection will be stored in internal variable
*/
void StoreSelected(SelectionData* Data=0);
/** \brief Restoring selected property
*
* \param Data structure containing selection data, if NULL,
* selection will be resotred from internal variable
*/
void RestoreSelected(const SelectionData* Data=0);
/** \brief Singleton object */
static wxsPropertyGridManager* Singleton;
struct TemporaryPropertiesList
{
wxsProperty* Property;
wxsPropertyContainer* Container;
int Priority;
TemporaryPropertiesList* Next;
};
WX_DEFINE_ARRAY(wxPGId,wxArrayPGId);
WX_DEFINE_ARRAY(wxsProperty*,wxArrayProps);
WX_DEFINE_ARRAY(wxsPropertyContainer*,wxArrayCont);
WX_DECLARE_HASH_SET(wxsPropertyContainer*,wxPointerHash,wxPointerEqual,wxSetCont);
wxArrayPGId PGIDs; ///< \brief Array of property identifiers
wxArrayProps PGEnteries; ///< \brief Array mapping enteries in grid to properties
wxArrayLong PGIndexes; ///< \brief Array of internal property indexes used inside wxsProperty
wxArrayCont PGContainers; ///< \brief Array of container objects associated with properties
wxSetCont PGContainersSet; ///< \brief Set of used containers, will be used to quickly determine if given container is used in manager
wxsProperty* PreviousProperty; ///< \brief Previous property used in Register()
long PreviousIndex; ///< \brief Previous index used when automatically calculating property indexes
wxsPropertyContainer* MainContainer; ///< \brief Main container
TemporaryPropertiesList* PropertiesList; ///< \brief List used while generating sorted properties list
SelectionData LastSelection; ///< \brief Internal selection structure used to restore selected property
DECLARE_EVENT_TABLE()
friend class wxsProperty;
friend class wxsPropertyContainer;
};
/** \brief Macro for easy acces to property grid manager */
#define wxsPGRID() wxsPropertyGridManager::Get()
#endif
|