注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

chunwaihome 的博客

 
 
 

日志

 
 

dialog Pluging  

2010-03-28 11:28:43|  分类: Powerpro Plugin |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

dialog.define

dialog.define(<X>, <Y>, <width>, <height>, <caption> [, <styles>    ;x,y,width,height參數是dialog的dimension

[, <script_to_call>[, <command_arg>[, <events>

[, <action_on_close> [, <icon_path> [, <icon_number>

[, <font_spec> [, <right_click_command>]]]]]]]]])

 

Dialog.define命令定義了Dialog特性和回返它的句柄值,此句柄值可用於往後的服務中。該句柄值不能被Chain,如果句柄值可以用 chain 功能, 它必須自動被刪除。

  • X參數

Horizontal position of upper left hand corner of dialog.If you specify the "centre" or  "centremouse" styles, this  parameter will be ignored

  • Y參數

  Vertical position of upper left hand corner of dialog, If you specify the "centre" or  "centremouse" styles, this  parameter will be ignored.

  • Width參數

 Width of dialog

  • Height參數

 Height of dialog

  • caption 參數

Required, but can be the null string: the dialog caption that will appear on its title bar. No length limit.

  • <styles>  Optional

:  Keywords or letters (see this table), or numerical values modifying the dialog’s styles.  For further details in Section 11.4 “Styles: the <styles> parameter”.

Dialog Styles

this tyle name

or this letter

#define’d symbol

means

sysmenu

s

WS_SYSMENU

add sysmenu box to dialog caption bar

minbox

n

WS_MAXIMIZEBOX

add maximize box to dialog caption bar

maxbox

x

WS_MINIMIZEBOX

add minimize box to dialog caption bar

centre

c

DS_CENTER

centre dialog on screen

centremouse

m

DS_CENTERMOUSE

centre dialog on mouse location

noborder

 

WS_BORDER

prevents border being applied

nodlgframe

 

~WS_DLGFRAME

prevents WS_DLGFRAME style being applied, which means no double border

thickframe

t

WS_THICKFRAME

creates a dialog with a thick frame that can be used to size it

3d

3

extended style
WS_EX_CLIENTEDGE

makes 3d effect

modalframe

-

extended style WS_EX_DLGMODALFRAME

 

hidden

h

~WS_VISIBLE

prevents WS_VISIBLE being applied, hiding dialog

  •  <script_to_call> Optional

. A PowerPro command to execute if an interesting event is fired by a control and that control doesn’t handle it itself.  

  • <command_arg> Optional

  An argument  passed to the above command if it’s invoked.  If present <script_to_call> must not be the null string. 

  • <events> Optional. 

A list of notifications accompanying a WM COMMAND message that may cause <script_to_call> to be executed. 

  • <action_on_close> Optional

 a PowerPro command that will run if you close a dialog by any means but clicking a button.

  • <icon_path> and <icon_number> Optiona

 Specify an icon for the dialog. 

  • <font_spec> Optional

 The dialog’s font.  If specified, all controls within the dialog use this font (otherwise they use the system font).  

  • <right_click_command>Optional

  If present, normally a command that causes a PowerPro menu to appear, thus simulating a context menu, e.g. using menu.show or cl.ShowMenu.  The script will be run if dialog user right clicks on any part of a dialog not containing a control.

define_control

dialog.define_control(<dialog_handle>, <X>, <Y>, <width>, <height>,
<control_type> [,<name>  [,<text_or_var> [, <styles>
[, <script_to_call> [, <command_arg> [, <events>
[, <foreground>, [ <background> [, <id>
[, <font_spec> [, <tooltip> [, <tooltip_style> [,<right_click_command>]]]]]]]]]]]]]) or

dialog.define_control() adds knowledge of a control and it's properties to an existing dialog.  It returns a handle to a control, which can be used in other services to indicate which control you want to operate on.  Other service calls cannot be chained to define_control (because services that return chainable handles require that that handle be automatically deleted, and you probably don’t want handles returned by define_control to disappear instantly).

Normally the drill is to invoke define_control (a lot) before a dialog is created or run.  However, you can call it after either created or run if you want to.  Most likely reason to do that would be that you create a dialog from a <dialog_definition_file>, then add to it using dialog.define_control.

Once a control has been defined, you can’t undefined or delete it from the dialog of which it is part.  On the other hand you can hide controls at any time using the dialog.show service, so they can seem to "disappear" as far as the dialog user is concerned.

 

control types

this control name

or this letter

details in Appendix

default WM_COMMAND notifications handled

other notifications that might be useful

styles:
in addition to
those applying to all controls

button

b

II.1

BN_CLICKED

BN_DBLCLK

see this table

group

g

II.2

none

 

see this table

checkbox

c

II.3

BN_CLICKED

 

see this table

3state

3

II.3

BN_CLICKED

 

see this table

radiobutton

r

II.3

BN_CLICKED

 

see this table

static

t

II.4

none

STN_CLICKED
"notify"

see this table

editbox

e

II.5

none

EN_CHANGE

see this table

listbox

l

II.6

none

LBN_SELCHANGE

see this table

combobox

o

II.7

none

CBN_SELCHANGE
CBN_EDITCHANGE

see this table

scrollbar

s

II.8

none; WM_HSCROLL, WM_VSCROLL always handled

 

see this table

spinner

u

II.9

none; WM_HSCROLL, WM_VSCROLL always handled

 

see this table

slider

r

II.10

none; WM_HSCROLL, WM_VSCROLL always handled

 

see this table

progress

p

II.11

none

 

see this table

datetime

d

II.12

none

 

see this table

monthcal

m

II.13

none

 

see this table

activeX

x

II.14

none

 

none

statusbar

-

II.15

none

 

see this table

tabcontrol

-

II.16

none

 

see this table

treeview

-

II.17

TVN_SELCHANGED

 

see this table

richedit

-

II.18

none

EN_CHANGE

see this table

scintilla

-

II.19

none

 

no special

listview

-

II.20

none

 

see this table

animation

-

II.21

none

 

see this table

 

run

dialog.run(<dialog_handle> [, <show_style> [, <modal_mode> [, <owner>]]])
<dialog_handle>

 (either this or <dialog_definition_file> is required):  A handle returned by dialog.define

<show_style>

Optional:  if present and non-null, may be any of the values appropriate as arguments of the show service appropriate for a dialog.

<modal_mode>

Optional:  Same meaning as for the create service (0 for absent for modeless, 1 for modal, etc).  If present, and you're running a previously created dialog; and this value's not the same as the <modal_mode> used in that invocation of the create service, you'll get an error message.  I’d strongly suggest that if you’re invoking dialog.run after a dialog.create, you omit this parameter.  It’s only there for situations where you’re running dialog.run without previous invoking create.

 <owner>

Optional:  a <dialog_handle> a <dialog_handle> for the a dialog created with this plugin; or a handle to any window. 

destroy

dialog.destroy([<dialog_handle> | <handle_to_control>])

aliases: release

Used in all sample scripts.

dialog.destroy() is used primarily to delete a dialog window and the data structure associated with  a <dialog_handle>.   Once you've destroyed a <dialog_handle>, you can't run it again later: the data structure's gone.

destroy_all

dialog.destroy_all()

dialog.destroy_all() tells the dialog plugin to let go of all issued dialog handles.

A dialog.unload has the same effect.

  评论这张
 
阅读(1367)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017