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)是" 创建对象的接口,让子类决定实例化哪一个类,并使一个类的实例化延迟到其它子类" ...
随机推荐
- 自定义requestAnimationFrame帧频
requestAnimationFrame(callback)触发的callback方法会接受一个时间戳参数,所以如果不想直接跟随浏览器系统帧频的话, 就可以利用这个时间戳参数来做到自定义帧频,做法就 ...
- Servlet传统配置方式和Servlet3.0使用注解的方式
一.Servlet的传统配置方式 在JavaWeb开发中, 每次编写一个Servlet都需要在web.xml文件中进行配置,如下所示: <servlet> <servlet-name ...
- BZOJ2038 2009国家集训队 小Z的袜子(hose) 【莫队】
BZOJ2038 2009国家集训队 小Z的袜子(hose) Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿.终于有一天,小Z再也无法忍受这恼 ...
- LOJ3044. 「ZJOI2019」Minimax 搜索
LOJ3044. 「ZJOI2019」Minimax 搜索 https://loj.ac/problem/3044 分析: 假设\(w(1)=W\),那么使得这个值变化只会有两三种可能,比\(W\)小 ...
- Ecel 粘贴图片并调整大小,移到底层
Sub Click() ActiveSheet.Pictures.Paste.Select Selection.ShapeRange.ScaleWidth 1.4, msoTrueSelection. ...
- UVA11137 Ingenuous Cubrency
题意 PDF 分析 考虑dp. 用\(d(i,j)\)表示用不超过i的立方凑成j的方案数. \(d(i,j)=d(i-1,j)+d(i,j-i^3)\) 时间复杂度\(O(IN+T)\) 代码 #in ...
- goreman 多进程管理工具
Linux下多进程管理工具对开发和运维都很有用,常见的功能全面的主流工具主要有monit.supervisor.不过开发中使用则推荐轻量级小工具goreman 举个例子:coreos的etcd就是使用 ...
- phpstrom主题
http://phpstorm-themes.com/ 安装方法 JAR文件 导航->file->Import Settings->然后选择你刚才下载的JAR文件->点击确认- ...
- socket编程 —— 非阻塞socket (转)---例子已上传至文件中
在上一篇文章 <socket编程——一个简单的例子> http://blog.csdn.net/wind19/archive/2011/01/21/6156339.aspx 中写了一个简单 ...
- 选择排序算法-python实现
#-*- coding: UTF-8 -*- import numpy as np def SelectSort(a): for i in xrange(0,a.size): min = a[i] p ...