📄 eccpropertyhandler.h
字号:
/* ==========================================================================
Ecc - Erik's Code Collection
Copyright (C) 2003 - Erik Dienske
This file is part of Ecc.
Ecc 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 2 of the License, or
(at your option) any later version.
Ecc 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 Ecc; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
===========================================================================*/
//---------------------------------------------------------------------------
#ifndef EccPropertyHandlerH
#define EccPropertyHandlerH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <typinfo.hpp>
/* typinfo.hpp can be found in $(BCB)\Include\Vcl.
Also see <typinfo.pas> in $(BCB)\Source\Vcl. */
//---------------------------------------------------------------------------
#ifdef _DEBUG
#define PROPERTYHANDLER_SHOW_WARNINGS
#endif
#ifdef PROPERTYHANDLER_SHOW_WARNINGS
#include <Dialogs.hpp> // Necessary for ShowMessage().
#endif
//---------------------------------------------------------------------------
//===========================================================================
namespace ecc {
//===========================================================================
class TPropertyHandler
{
private:
TComponent* FDefaultComponent; // Default Component for easier function-calls.
bool DefaultComponentExists();
String BuildNameValue(TComponent* comp, String prName);
String GetClassNamesValues(TComponent* comp, String prName);
public:
// ~TPropertyHandler(void);
/* Functions for any Component: */
TPropertyHandler(); // Any component constructor.
int PropertyCount(TComponent* comp);
bool PropertyExists(TComponent* comp, String prName);
bool IsClass(TComponent* comp, String prName);
String GetName(TComponent* comp);
Variant GetValue(TComponent* comp, String prName);
String GetNameValue(TComponent* comp, String prName);
String GetNamesValues(TComponent* comp, String prNames);
String GetAllNamesValues(TComponent* comp);
void SetValue(TComponent* comp, String prName, Variant prValue);
void SetNameValue(TComponent* comp, String prName_Value);
void SetNamesValues(TComponent* comp, String prNames_Values);
TComponent* GetSubComponent(TComponent* comp, String prName);
/* Functions using FDefaultComponent: */
TPropertyHandler(TComponent* comp); // Default component constructor.
int PropertyCount();
bool PropertyExists(String prName);
bool IsClass(String prName);
String GetName();
Variant GetValue(String prName);
String GetNameValue(String prName);
String GetNamesValues(String prNames);
String GetAllNamesValues();
void SetValue(String prName, Variant prValue);
void SetNameValue(String prName_Value);
void SetNamesValues(String prNames_Values);
TComponent* GetSubComponent(String prName);
};
//===========================================================================
} // namespace ecc;
//===========================================================================
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -