RTTI(一) 枚举
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(一) 枚举的更多相关文章
- Delphi下的RTTI函数大全
http://ljz9425.blog.163.com/blog/static/369148572008111635253858/ Delphi下的RTTI(下) 2008-12-16 15:52:5 ...
- ABAP中的枚举对象
枚举对象是枚举类型的数据对象.枚举对象只能包含类型为枚举类型的枚举值.ABAP从版本7.51开始支持它们. 这是一种常见的模式.在ABAP 7.51之前,人们通常用如下方式实现类似的功能: CLASS ...
- RTTI D7
RTTI需要引用单元TypeInfo 至于RTTI的数据结构,大家可以参考TypeInfo单元的代码 看例子,先为大家介绍一下根据字符串找到属性,并且对其修改的例子 根据属性字符串找到属性,并修改属性 ...
- C/C++基础----特殊工具和技术 (重载new和delete,RTT,限定作用域的枚举类型,类成员指针,嵌套类,局部类,volatile,链接指示 extern “C”)
重载new和delete 1调用operator new( 或new[])标准库函数分配足够大的.原始的.未命名的内存空间以便存储特定类型的对象 2编译器运行相应地构造函数以构造这些对象,并为其传入初 ...
- Delphi 的RTTI机制浅探3(超长,很不错)
转自:http://blog.sina.com.cn/s/blog_53d1e9210100uke4.html 目录========================================== ...
- LLVM的RTTI特性
本文思路来源于http://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html,叙述有不同,望谅解,希望能从其他方面帮助大家了解C++语言的底层实现. 背景 在LLV ...
- rtti读取和设置属性
http://www.cnblogs.com/hnxxcxg/archive/2013/03/02/2940565.html rtti读取和设置属性 编辑器通过 Rtti 还能够调用一个类的方法, ...
- Swift enum(枚举)使用范例
//: Playground - noun: a place where people can play import UIKit var str = "Hello, playground& ...
- 编写高质量代码:改善Java程序的151个建议(第6章:枚举和注解___建议88~92)
建议88:用枚举实现工厂方法模式更简洁 工厂方法模式(Factory Method Pattern)是" 创建对象的接口,让子类决定实例化哪一个类,并使一个类的实例化延迟到其它子类" ...
随机推荐
- CF 148D D. Bag of mice (概率DP||数学期望)
The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests ...
- List集合学习
Java中常用的List子类主要有:ArrayList.LinkedList.Vector.有序(存储和取出的元素一致),可重复的. 三者比较 1:访问:ArrayList和Vector都实现了Ran ...
- 【2018.06.26NOIP模拟】T3节目parade 【支配树】*
[2018.06.26NOIP模拟]T3节目parade 题目描述 学校一年一度的学生艺术节开始啦!在这次的艺术节上总共有 N 个节目,并且总共也有 N 个舞台供大家表演.其中第 i 个节目的表演时间 ...
- cocos2dx ScrollView的用法
http://blog.csdn.net/u014096244/article/details/21525789 http://bbs.9ria.com/thread-199305-1-1.html ...
- Oracle 之 AIO (异步io)
Linux 异步 I/O (AIO)是 Linux 内核中提供的一个增强的功能.它是Linux 2.6 版本内核的一个标准特性,AIO 背后的基本思想是允许进程发起很多 I/O 操作,而不用阻塞或等 ...
- wordpress分享到微信无缩略图的问题
牛逼的老板想把他牛逼的艺术品分享给牛逼的画家和藏家简直苦逼了我这个程序狗,他想要的结果是这样的qq和微信上依次为 但是牛逼的微信越来越“抠”了现在不是微信开发者用不了他的分享接口不给你显示缩略 ...
- Win10系统WMIProviderHost进程占用CPU过高
“WMI Provider Host“占用了过多CPU资源导致系统卡顿,该如何解决这个问题呢? 解决方法: 可以尝试关闭Windows防火墙服务来解决这个问题. 1.按住win+R,输入service ...
- 嵌入式设备snmpd 移植和测试(78K为例)
一.源码目录项内容 agent:编译snmpd程序所需的文件,mibs源文件: apps:其他相关的程序:snmpwalk,snmptrap,snmptest,snmpget,snmpset: mib ...
- Nginx+jwPlay搭建流媒体服务器,记忆播放
1.具体的流媒体服务器的搭建参考博客: http://blog.chinaunix.net/uid-20639775-id-154556.html 具体可能编译的时候有个地方报错 /root/ngin ...
- android 网络连接判断
Android 网络判断类,用来判断网络状态 使用方法: (1)先初始化 //初始化网络状态检测类 NetworkStateManager.instance().init(this); (2)判断是否 ...