Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
技术板块灌水区
» 问一个题外话题,关于RemObject Pascal script
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: 问一个题外话题,关于RemObject Pascal script
rise
普通灌水员
UID 40734
Digest Posts 0
Credits 92
Posts 33
点点分 92
Reading Access 10
Registered 2008-8-4
Status Offline
#1
Post at 2009-3-25 12:35
Profile
|
Blog
|
P.M.
问一个题外话题,关于RemObject Pascal script
也是从cnpack的脚本专家中知道pascal script这东西,一用就开始上瘾了,遗憾是相关的文档、实例太少。
现在一个问题是,怎么在脚本中给组件的事件赋值呢?
比如Button的OnClick事件,在Delphi中赋值是这样:
Button.OnClick := ButtonClick;
如果在脚本中赋值呢?我试过好多方法,在脚本Compile的时候都没有通过,请懂的人关照一下吧!谢谢了
rarnu
(橙子)
灌水部部长
UID 2689
Digest Posts
11
Credits 648
Posts 209
点点分 648
Reading Access 10
Registered 2006-10-2
Status Offline
#2
Post at 2009-3-25 13:46
Profile
|
Site
|
Blog
|
P.M.
Button.OnClick := @ButtonClick;
Rarnu
CnPack Interfacer
rarnu@cnpack.org
rise
普通灌水员
UID 40734
Digest Posts 0
Credits 92
Posts 33
点点分 92
Reading Access 10
Registered 2008-8-4
Status Offline
#3
Post at 2009-3-25 13:58
Profile
|
Blog
|
P.M.
QUOTE:
原帖由
rarnu
于 2009-3-25 13:46 发表
Button.OnClick := @ButtonClick;
这样子可行吗?我有试用,但编译时告知“Unknown identifier ButtonClick“类似信息,这个ButtonClick我是在编译事件中, Sender.AddMethod(Self, @TForm1.ButtonClick, 'procedure ButtonClick(Sender: TObject);');这样加入的,请问还有什么地方没弄好吗?谢谢
zjy
管理员
UID 2
Digest Posts
6
Credits 2385
Posts 1543
点点分 2385
Reading Access 102
Registered 2002-12-16
Location China
Status Offline
#4
Post at 2009-3-26 12:12
Profile
|
Site
|
Blog
|
P.M.
看看CW带的Demo
FormDemo1.pas里面有事件的使用。
Zhou JingYu
CnPack Administrator
http://www.cnpack.org/
rise
普通灌水员
UID 40734
Digest Posts 0
Credits 92
Posts 33
点点分 92
Reading Access 10
Registered 2008-8-4
Status Offline
#5
Post at 2009-3-26 16:42
Profile
|
Blog
|
P.M.
谢谢。
有没有直接在delphi里头声明事件过程,往脚本添加后,在脚本编译时把这个过程当作事件传给控件的实例呢?
就是说事件过程在delphi中实现,在脚本中绑定那样。
rise
普通灌水员
UID 40734
Digest Posts 0
Credits 92
Posts 33
点点分 92
Reading Access 10
Registered 2008-8-4
Status Offline
#6
Post at 2009-3-26 16:47
Profile
|
Blog
|
P.M.
因为现在最主要是用于自己程序的界面控制。
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-22 01:54
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.008270 second(s), 7 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats