SetEnumProp
void __fastcall TForm2::Button1Click(TObject *Sender)
{
//Getting the current color of the workspace
String currentPropColor = GetEnumProp(this,"Color");
int currentColorInt = StrToInt(currentPropColor); //Getting the first button align enum and, if different,
//setting it to alLeft
String currentAlignProp = GetEnumProp(Button1, "Align");
if (currentAlignProp != "alLeft")
{
SetEnumProp(Button1, "Align", "alLeft");
} //Checking if the form background color was set.
if(currentColorInt < )
{
currentColorInt = GetSysColor(COLOR_APPWORKSPACE);
} //Setting the form background color as the negative value
//of the current background color
SetEnumProp(this, "Color",
IntToStr((int)(clWhite - currentColorInt)));
} void __fastcall TForm2::Button2Click(TObject *Sender)
{
int p[] = {clYellow, clGreen, clRed, clBlue, clBlack};
SetEnumProp(this, "Color", IntToStr(p[random()])); //Getting the second button align enum and, if different,
//setting it to alRight
String currentAlignProp = GetEnumProp(Button2, "Align");
if (currentAlignProp != "alRight")
{
SetEnumProp(Button2, "Align", "alRight");
}
}

RTTI(一) 枚举的更多相关文章

  1. Delphi下的RTTI函数大全

    http://ljz9425.blog.163.com/blog/static/369148572008111635253858/ Delphi下的RTTI(下) 2008-12-16 15:52:5 ...

  2. ABAP中的枚举对象

    枚举对象是枚举类型的数据对象.枚举对象只能包含类型为枚举类型的枚举值.ABAP从版本7.51开始支持它们. 这是一种常见的模式.在ABAP 7.51之前,人们通常用如下方式实现类似的功能: CLASS ...

  3. RTTI D7

    RTTI需要引用单元TypeInfo 至于RTTI的数据结构,大家可以参考TypeInfo单元的代码 看例子,先为大家介绍一下根据字符串找到属性,并且对其修改的例子 根据属性字符串找到属性,并修改属性 ...

  4. C/C++基础----特殊工具和技术 (重载new和delete,RTT,限定作用域的枚举类型,类成员指针,嵌套类,局部类,volatile,链接指示 extern “C”)

    重载new和delete 1调用operator new( 或new[])标准库函数分配足够大的.原始的.未命名的内存空间以便存储特定类型的对象 2编译器运行相应地构造函数以构造这些对象,并为其传入初 ...

  5. Delphi 的RTTI机制浅探3(超长,很不错)

    转自:http://blog.sina.com.cn/s/blog_53d1e9210100uke4.html 目录========================================== ...

  6. LLVM的RTTI特性

    本文思路来源于http://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html,叙述有不同,望谅解,希望能从其他方面帮助大家了解C++语言的底层实现. 背景 在LLV ...

  7. rtti读取和设置属性

    http://www.cnblogs.com/hnxxcxg/archive/2013/03/02/2940565.html rtti读取和设置属性   编辑器通过 Rtti 还能够调用一个类的方法, ...

  8. Swift enum(枚举)使用范例

    //: Playground - noun: a place where people can play import UIKit var str = "Hello, playground& ...

  9. 编写高质量代码:改善Java程序的151个建议(第6章:枚举和注解___建议88~92)

    建议88:用枚举实现工厂方法模式更简洁 工厂方法模式(Factory Method Pattern)是" 创建对象的接口,让子类决定实例化哪一个类,并使一个类的实例化延迟到其它子类" ...

随机推荐

  1. NGUI动态给EventDelegate加参数

    示例代码如下: 响应的函数声明为: void OnChange(UIToggle toggle) { if(toggle.value) { // do something } }   添加响应的代码如 ...

  2. Jmeter-JDBC Connection Configuration和JDBC Request注释

    1.JDBC Connection Configuration Variable Name--变量名,唯一值不可重复,给JDBC Request确定使用哪个配置 Max Number of Conne ...

  3. spring事务传播机制的测试结果

    /**     * @Component是个一般性的注解,使用此注解修饰的POJO类,有value属性,指定bean的id.也可不写.默认值是类名首字母小写     * @Resource是控制依赖注 ...

  4. gradle multiproject && docker build

    备注:   环境准备 : docker , gradle(使用wrapper,或者全局安装),测试环境使用mac 1. gradle 安装 brew install gradle   2. docke ...

  5. sysbench fileio 压力测试

    备注:   使用的是yum 安装   1. 安装 yum install -y sysbench 2. 命令 fileio options: --file-num=N number of files ...

  6. quick3.3rc1导入工程到ADT

    1.libcocos2dx  路径到/quick-3.3rc1/cocos/platform/android/java这一层 2.quick项目 路径到D:\codeide\test11\framew ...

  7. Ant入门使用说明

    一.概述 ant 是一个将软件编译.测试.部署等步骤联系在一起加以自动化的一个工具,大多用于Java环境中的软件开发.在实际软件开发中,有很多地方可以用到ant. 开发环境: 复制代码 代码如下: S ...

  8. 【转】Eclipse的启动问题【an error has occurred see the log file】

    原文网址:http://coderlin.blog.51cto.com/7386328/1275215 方法1: 今天打开Eclipse的时候出现来了一个问题,导致了Eclipse打不开 错误的提示是 ...

  9. xml获取属性值的方法

    sSqlstr += string.Format(@" and businessattr.value('(/Arch/Field[@Name=""发文单位$$" ...

  10. C/S模式与B/

    网络程序开发的两种计算模式--C/S模式与B/S模式.两种各有千秋,用于不同场合. C/S适用于专人使用,安全性要求较高的系统: B/S适用于交互性比较频繁的场合,容易被人们所接受,倍受用户和软件开发 ...