IDL学习


pro文件名与
pro文件中的程序名称要一致,否则无法执行

pro firstIDL
print,'first IDL'
tmp = dialog_Message('first idl',/information)
end


IDL如何注释

使用分号(;)  分号右边的任何字符都会被注释


IDL不区分大小写

$符号为续行符


!感叹号后面加变量名称,为系统预定义的变量

比如圆周率为!pi


&为multiple command character(from IDL programming techniques)

&中文翻译成了同行符号(引用自ESRI-2010 idl培训资料)

使用了同行符相当于两行代码写在一行之中

IDL> a = 3 & b =5
;相当于
IDL> a = 3
IDL> b =5

跟其他语言比如C不一样,IDL下的变量无需事先申明,也就是可以通过赋值语句来进行变量、数组定义的


IDL在运行过程中能随时修改变量的数据类型和组织结构

创建2行3列的数组
数组的索引从0开始
 array=[[1,2,3],[4,5,6]]
比如访问第2行第1列的元素可用下面方式
array[0,1]
这个索引方式与fortran相同,先列的下标,再行的下标,与c,c++,java等不同
下标先列号,后行号(参见IDL programming techniques,2nd edition)
column-row下标方式最初是为了处理天文图像数据的需要。
 多维数组可以用一维下标的形式访问

访问数组元素既可以用方括号[],也可以用小括号(),方括号在IDL 5.0及以上版本支持。
比如a(2)与a[2]是等价的
使用方括号可以更好地区别是访问数组还是函数。

IDL读取文件:
文件的路径可以通过FILE_PATH指定,比如访问D:/file/output/2.txt
filename = Filepath('2.txt',ROOT_DIR='D:',SUBDIRECTORY=['file','output'])
比如读取d盘下的test.txt文件
  print,file_lines('D:/test.txt')
file_lines返回该文件中的行数

OPENR (OPEN Read) opens an existing file for input only.

OPENW (OPEN Write) opens a new file for input and output. If the file exists, it is truncated and its old contents are destroyed. 
OPENU (OPEN Update) opens an existing file for input and output.

GET_LUN(来自idl帮助文件)
Set this keyword to use the GET_LUN procedure to set the value of Unit before the file is opened. Instead of using the two statements:

使用GET_LUN procedure在文件打开前设置单元号

GET_LUN, Unit
OPENR, Unit, 'data.dat'
GET_LUN, Unit
OPENR, Unit, 'data.dat'

you can use the single statement:

OPENR, Unit, 'data.dat', /GET_LUN

READ, [Prompt,] Var1, ..., Varn
READF, [Prompt,] Unit, Var1, ..., Varn

readf从指定的unit中读取内容,比read多了一个参数unit

比如从D盘的test1.txt下读取文件,并存到一个3行5列的数组中
 openr,lun,'D:/test1.txt',/get_lun
  arr=fltarr(5,3)
  readf,lun,arr
  print,arr
  close,lun


Reading and Writing FORTRAN Data

参见http://www.exelisvis.com/docs/Reading_and_Writing_FORT.html


若是fortran写的是real类型的,这种方法是有效的。若fortran文件写入的文件是integer类型,在IDL中读取的时候似乎原来每个integer之后都要用0填充??这点保留疑问,有待查证,至少目前测试结果是这样的,难道是IDL一个整数是2个byte,而fortran中是4个byte??

fortran中integer如果用kind=2,方法就不会出现问题


READU函数

The READU procedure reads unformatted binary data from a file into IDL variables. READU transfers data directly with no processing of any kind performed on the data.



如何移动到指定的位置进行读写:

比如你期望读取输入文件的第100个到第200个数,可以使用point_lun procedure。(这样避免读取整个文件,然后再truncate处理)

IDL提供了point_lun  procedure

以下内容摘自IDL help文件

Syntax
POINT_LUN, Unit, Position

Position

If Unit is positive, Position gives the byte offset into the file at which the file pointer should be set. For example, to rewind the file to the beginning, specify 0.

If Unit is negative, Position must be a named variable into which the current file position will be stored. The returned type will be a longword signed integer if the position is small enough to fit, and a 64-bit longword integer otherwise.


Position指定文件指针在文件中的字节偏移量


IDL运算符

运算符的优先级可以参考

http://www.physics.nyu.edu/grierlab/idl_html_help/expressions5.html

>号与<在IDL中的功能与其他编程语言不一样,可不是关系/比较运算符。>(maximum operator)返回两个操作数的较大值,<(minimum operator)返回两个操作数的较小值。所以刚开始不清楚功能的情况下可能会比较奇怪。

IDL中的关系运算符与fortran类似。提供了LT,LE,EQ,GE,GT,NE6种relational operator。

以下选自http://www.physics.nyu.edu/grierlab/idl_html_help/expressions4.html

Minimum and Maximum Operators

The IDL minimum and maximum operators return the smaller or larger of their operands, as described below. Note that negated values must be enclosed in parentheses in order for IDL to interpret them correctly.

The Minimum Operator

The "less than" sign (<) is the IDL minimum operator. The value of "A < B" is equal to the smaller of A or B. For example:

;Set A equal to 3.  
A = 5 < 3 
 
;Set A equal to -6.  
A = 5 < (-6) 
 
;Syntax Error. IDL attempts to perform a subtraction operation if  
;the "-6" is not enclosed in parentheses. 
A = 5 < -6 
 
;Set all points in array ARR that are larger than 100 to 100. 
ARR = ARR < 100 
 
;Set X to the smallest of the three operands. 
X = X0 < X1 < X2 
 

For complex numbers the absolute value (or modulus) is used to determine which value is smaller. If both values have the same magnitude then the first value is returned.

For example:

; Set A equal to 1+2i, since ABS(1+2i) is less than ABS(2-4i) 
A = COMPLEX(1,2) < COMPLEX(2,-4) 
 
; Set A equal to 1-2i, since ABS(1-2i) equals ABS(-2+i) 
A = COMPLEX(1,-2) < COMPLEX(-2,1) 
The Maximum Operator

The "greater than" sign (>) is the IDL maximum operator. "A > B" is equal to the larger of A or B. For example:

;'>' is used to avoid taking the log of zero or negative numbers. 
C = ALOG(D > 1E - 6) 
 
;Plot positive points only. Negative points are plotted as zero. 
PLOT, ARR > 0 
 

For complex numbers the absolute value (or modulus) is used to determine which value is larger. If both values have the same magnitude then the first value is returned. For example:

 
; Set A equal to 2-4i, since ABS(2-4i) is greater than ABS(1+2i) 
A = COMPLEX(1,2) > COMPLEX(2,-4) 
 
; Set A equal to 1-2i, since ABS(1-2i) equals ABS(-2+i) 
A = COMPLEX(1,-2) > COMPLEX(-2,1) 


IDL绘图

set plot之后的绘图操作均在set _plot procedure指定的device上进行,除非是set_plot,windows,否则不会显示在屏幕上

当调用device,/close之后,若需之后的绘制显示在屏幕上,需调用set_plot,windows

set_plot,'ps'
device,xsize=8,ysize=6,/inches
device,color=1,Bits_Per_Pixel=8,FILENAME='D:\test.ps'
plot,[1,3],[4,6]
oplot,[1,2],[4,7]
device,/close

若要在device绘制的图中添加注释,可以使用xyouts procedure

比如XYOUTS, 100, 100, 'This is text', /DEVICE 

100,100为相应的设备中的坐标位置,若不指定/device选项,则为plot绘制的图中相应的坐标位置

Print an array of strings with each element of the array printed at a different location. Use larger text than in the previous example:

XYOUTS, [0, 200, 250], [200, 50, 100], $
   ['This', 'is', 'text'], CHARSIZE = 3, /DEVICE

再比如在图中的(1,4),(3,5)处输出hello与hi

xyouts,[1,3],[4,5],['hello','hi']



绘制轮廓图/等值线

可以使用contour procedure

以下来自IDL help file

下面中文部分仅供参考,感觉可能理解存在偏差。

A one- or two-dimensional array containing the values that make up the contour surface. If arguments X and Y are provided, the contour is plotted as a function of the (X, Y) locations specified by their contents. Otherwise, the contour is generated as a function of the two-dimensional array index of each element of Z.

If the IRREGULAR keyword is set, X, Y, Z are all required, and are treated as vectors. Each point has a value of Z[i] and a location of (X[i], Y[i]).

如果x与y均提供的话,contour被绘制成(x,y)处所存储的数(即数组z中相应元素)的函数

。否则contour绘制成二维数组索引的函数,该函数的自变量/输入变量为z中的元素。即该函数是z中每个元素的映射


Using CONTOUR

The basic call to CONTOUR is as follows:

CONTOUR, Z

where Z is a two-dimensional array. This call labels the x- andy-axes with the subscript along each dimension. For example, when contouring a 10 ∞ 20 array, thex-axis ranges from 0 to 9, and they-axis ranges from 0 to 19.

You can explicitly specify the x and y locations of each cell as follows:

CONTOUR, Z, X, Y

where the X and Y arrays can be either vectors or two-dimensional arrays of the same size asZ. If they are vectors, the elementzi,j has a coordinate location of (xi,yj). Otherwise, if thex andy arrays are two-dimensional, the elementzi,j has the location (xi,j,yi,j). Thus, vectors should be used if thex location of zi,j does not depend uponj and they location ofzi,j does not depend uponi.

Dimensions must be compatible. In the one-dimensional case, X must have a dimension equal to the number of columns inZ, andY must have a dimension equal to the number of rows inZ. In the two- dimensional case, all three arrays must have the same dimensions.

IDL uses linear interpolation to determine the x and y locations of the contour lines that pass between grid elements. The cells must be regular in that thex andy arrays must be monotonic over rows and columns, respectively. The lines describing the quadrilateral enclosing each cell and whose vertices are (xi,j,yi,j), (xi+1,j,yi+1,j), (xi+1,j+1,yi+1,j+1), and (xi,j+1,yi,j+1) must intersect only at the four corners and the quadrilateral must not contain other nodes


IDL格式化输出

关于此的内容可以参考IDL help file中的Formatting IO(搜索formatting IO即可)下的format code about中的章节

比如浮点数是如下格式

[n]F[+][-][w][.d]

[n]D[+][-][w][.d]

[n]E[+][-][w][.d][Ee]

[n]G[+][-][w][.d][Ee]

例子:

s= 56.89755
format='f5.2'
print,s,format='(f5.2)'

w指定输出数字的总长度(含小数点,比如要输出56.90即指定f5.2),d小数点后输出的位数,当宽度不足以表示该数时,即w<(d+1+小数点前的位数)则输出星号,跟fortran一样的


strpos函数

摘自IDL help file

Syntax

Result = STRPOS( Expression, Search_String[, Pos] [, /REVERSE_OFFSET] [, /REVERSE_SEARCH] )

Return Value

If Search_String occurs in Expression, STRPOS returns the character position of the match, otherwise it returns -1.


需要注意的是指定了/REVERSE_SEARCH选项后从字符串的最末尾开始找第一个与search string匹配的字符串,但是函数返回的位置仍然是从字符串起始位置开始算起的位置。

提供的例子中

sentence = 'IDL is fun.'
sentence = STRUPCASE(sentence)
lasti = STRPOS(sentence, 'I', /REVERSE_SEARCH)
PRINT, lasti

This results in:

4


Converting variables to string type often results in undesirable leading blanks

IDL把整数转换为字符串时,该字符串的最前面会有空格字符

比如

s =23.0587
s = string(s)
help,s

输出的是

S               STRING    = '      23.0587'

出现了6个空格,可以用strtrim函数除去,比如

s =23.0587
s = string(s)
help,s
s = strtrim(s,1)
help,s

这样字符串前面便没有空格了


IDL嵌套式if语句

选取字IDL help file

Nesting IF Statements

IF statements can be nested in the following manner:

IF P1 THEN S1 ELSE $

IF P2 THEN S2 ELSE $

   ...

IF PN THEN SN ELSE SX

If condition P1 is true, only statement S1 is executed; if condition P2 is true, only statement S2 is executed, etc. If none of the conditions are true, statement SX will be executed. Conditions are tested in the order they are written. The construction above is similar to the CASE statement except that the conditions are not necessarily related.



需要注意的地方:

问题1

数据类型不当导致结果不对,当时申请了一个很大的数组,结果一直不对,后来发现是表示精度不够导致表达式结果不正确。

输入一个数值很大的表达式:比如120*120*120*5,直接打印的话

比如print,120*120*120*5,打印输出结果为0

可以在数字后面加L或者LL等,L代表该数字为32位有符号整数(比如6LL),LL代表该数字为64位有符号整数(比如128LL)。这样表示的精度就足够了

print,120L*120L*120L*5L,就会输出想要的结果。这一点需要谨慎啊



问题2

当前pro文件调用其他pro文件中的procedure或者函数时,若被调用procedure或函数所在的pro文件未编译,则会提示如下错误

Attempt to call undefined procedure/function: '*****************'.,*星号指代的是调用的procedure或函数名



目录 第一章 起步篇................................................................................................................. 9 本章概述................................................................................................................... 9 撰写本书的背景................................................................................................. 9 如何使用本书..................................................................................................... 9 IDL 所需的版本............................................................................................... 10 IDL 运行期间所需颜色的数量.......................................................................... 10 少于 150 种颜色该怎样?.......................................................................... 10 多于 256 种颜色该怎样?.......................................................................... 10 创建 IDL 的启动文件................................................................................................11 本书的风格习惯.......................................................................................................11 大写..................................................................................................................11 注释................................................................................................................. 12 续行符............................................................................................................. 12 本书中所用的 IDL 程序和数据文件.......................................................................... 13 安装程序和数据文件........................................................................................ 13 下载本书所用的程序和数据文件....................................................................... 13 拷贝数据文件................................................................................................... 14 获取更多的帮助............................................................................................... 14 使用 IDL 命令......................................................................................................... 14 IDL 命令解析................................................................................................... 15 位置参数................................................................................................... 15 关键字参数............................................................................................... 15 IDL 过程和函数........................................................................................ 16 用 IDL 命令帮助........................................................................................ 16 创建命令日志............................................................................................ 17 创建变量.......................................................................................................... 17 动态改变变量的属性................................................................................. 18 注意整型变量............................................................................................ 19 使用矢量和数组...................................................................................................... 20 创建矢量.......................................................................................................... 20 数组下标的应用............................................................................................... 21 数组的建立...................................................................................................... 21 使用 IDL 图形窗口.................................................................................................. 22 图形窗口的建立............................................................................................... 22 确定当前图形窗口............................................................................................ 23 删除图形窗口................................................................................................... 23 图形窗口的位置和尺寸..................................................................................... 24 将图形窗口设置到显示器最前面....................................................................... 24 第二章 简单的图形显示............................................................................................... 25 本章概述................................................................................................................. 25 IDL 中简单的图形显示............................................................................................ 25 3 创建线画图............................................................................................................. 25 定制线画图............................................................................................................. 28 改变线条的线型和粗细..................................................................................... 28 用符号代替线条表示数据................................................................................. 29 用线条和符号来显示数据.......................................................................... 30 创建自己的图形符号................................................................................. 30 用不同的颜色绘制线画图................................................................................. 31 限定线画图的范围............................................................................................ 31 改变线画图的风格............................................................................................ 32 在线画图上绘出多种数据集..................................................................................... 34 第三章 图像数据处理.................................................................................................... 35 本章概要................................................................................................................. 35 图像处理................................................................................................................. 35 显示图像.......................................................................................................... 36 用颜色表分段表示图像.............................................................................. 38 在 24 位显示器上用不同的颜色表显示图像................................................ 39 控制图像显示顺序..................................................................................... 41 改变图像尺寸............................................................................................ 41 在显示窗口中定位图像.............................................................................. 42 用归一化的坐标来定位图像....................................................................... 43 从显示器中读取图像................................................................................. 45 在 24 位显示器上抓屏............................................................................... 45 IDL 中基本的图像处理..................................................................................... 46 直方图均衡化............................................................................................ 46 平滑图像................................................................................................... 47 消除图像噪声............................................................................................ 49 增强图像边缘............................................................................................ 49 图像的频域滤波........................................................................................ 50 第四章 图形显示技术.................................................................................................... 52 本章概要................................................................................................................. 52 IDL 的颜色运用...................................................................................................... 53 使用索引颜色模式和 RGB颜色模式................................................................. 53 静态与动态颜色视觉........................................................................................ 54 在 8 位显示器上指定颜色................................................................................. 54 在 24 位显示器上指定分解后的颜色................................................................. 55 在 24 位显示设备上指定没有分解过的颜色....................................................... 56 决定颜色分解的开与关..................................................................................... 56 在 24 位显示设备上装载颜色表........................................................................ 57 获得颜色表的拷贝............................................................................................ 57 修改和创建颜色表............................................................................................ 58 创建自己的轴标注................................................................................................... 60 调整轴刻度间隔............................................................................................... 60 格式化轴的标注............................................................................................... 61 编写刻度格式函数............................................................................................ 62 4 用 IDL 处理残缺的数据.................................................................................... 64 用 IDL 建立三维坐标系.................................................................................... 66 建立三维散点图........................................................................................ 66 从图形原点定位 3D 坐标轴........................................................................ 68 组合简单图形显示............................................................................................ 69 第五章 图形显示技巧................................................................................................... 71 本章概要................................................................................................................. 71 将光标用于图形显示............................................................................................... 72 什么时候返回的光标位置?.............................................................................. 72 哪一个鼠标键和光标共同作用呢?................................................................... 73 用光标标注图形输出........................................................................................ 73 在图像上使用 Cursor 命令......................................................................... 74 在循环中使用 Cursor 命令......................................................................... 76 从显示中删除注释................................................................................................... 76 删除注释的异或法............................................................................................ 76 删除注释的设备拷贝法..................................................................................... 78 画一个橡皮筋方框................................................................................................... 80 图形窗口的滚动............................................................................................... 81 Z图形缓冲区中的图形显示技巧.............................................................................. 82 Z图形缓冲区的实现......................................................................................... 82 一个 Z图形缓冲区实例:两个曲面................................................................... 83 使 Z图形缓冲区成为当前设备................................................................... 83 配置 Z图形缓冲区.................................................................................... 83 将物体装入到 Z图形缓冲区中................................................................... 83 对投影面进行拍照..................................................................................... 84 在显示设备上显示结果.............................................................................. 84 Z图形缓冲区的一些奇怪特点........................................................................... 84 用 Z图形缓冲区使图像变形............................................................................. 85 Z图形缓冲区中的透明效果.............................................................................. 87 将 Z图形缓冲区效果与体数据着色相结合........................................................ 87 第六章 在IDL 中读写数据............................................................................................. 88 本章概要................................................................................................................. 88 打开文件进行读写................................................................................................... 89 查找和选择数据文件............................................................................................... 89 选择文件名...................................................................................................... 89 选择目录名...................................................................................................... 90 寻找文件.......................................................................................................... 90 构造文件名...................................................................................................... 91 获取逻辑设备号...................................................................................................... 91 直接使用逻辑设备号........................................................................................ 91 让 IDL 管理逻辑设备号.................................................................................... 92 判断哪些文件和哪些逻辑设备号相连................................................................ 92 读写格式化数据........................................................................................ 92 写自由格式文件........................................................................................ 92 5 读自由格式文件........................................................................................ 93 读取自由格式文件的规则.......................................................................... 93 读写自由格式文件的实例.......................................................................... 95 用确定的文件格式写入.............................................................................. 99 从字符串中读取格式数据.........................................................................100 读写二进制数据.....................................................................................................100 读取二进制图像数据文件................................................................................101 写二进制图像数据文件....................................................................................102 读取带有文件头的二进制数据文件..................................................................102 二进制数据文件的一些问题.............................................................................103 用关联变量存取二进制数据文件......................................................................104 关联变量的一些优点................................................................................104 定义关联变量...........................................................................................104 读写常用文件格式的文件................................................................................106 创建彩色 GIF 文件...................................................................................106 写 GIF 文件..............................................................................................106 读 GIF 文件..............................................................................................107 创建彩色 JPEG 文件.................................................................................107 写 JPEG 文件...........................................................................................108 读取 JPEG 文件........................................................................................108 查询图像文件信息....................................................................................109 第七章 图形硬拷贝输出................................................................................................110 本章概要................................................................................................................110 选择图形硬拷贝输出设备.......................................................................................110 配置图形硬拷贝输出设备....................................................................................... 111 测定当前的设备配置....................................................................................... 111 常用的 Device命令关键字...............................................................................112 创建 PostScript 文件........................................................................................113 将图形送到硬拷贝设备中.......................................................................................113 在运行 MacOS 系统的计算机上打印 PostScript 文件.........................................115 在 Windows 计算机上打印PostScript 文件........................................................115 生成封装的 PostScript 文件输出..............................................................................116 封装 PostScript 图形的预览..............................................................................116 生成彩色的 PostScript 输出..............................................................................116 PostScript 中的彩色图像与灰度图像........................................................................117 真彩图像.........................................................................................................117 在 PostScript 设备上创建高质量的输出...................................................................118 显示设备和 PostScript 设备之间的相同点.........................................................118 第八章 IDL 编程基础....................................................................................................129 本章概述................................................................................................................129 编写 IDL 批处理文件..............................................................................................129 编写 IDL 主程序.....................................................................................................130 编写 IDL 过程........................................................................................................131 过程和与函数中变量的作用范围......................................................................132 6 创建位置参数..................................................................................................132 定义可选的或必须的位置参数.........................................................................133 定义关键字.....................................................................................................134 使用缩写关键字..............................................................................................134 定义可选择的关键字.......................................................................................135 处理具有双重属性的关键字.............................................................................136 创建输出型参数..............................................................................................137 用引用和传值的方法传递信息.........................................................................137 参数存在吗.....................................................................................................139 编写 IDL 函数........................................................................................................140 方括号和函数的调用.......................................................................................142 用 Forward_Function 命令保留函数名...............................................................142 使用程序控制语句...........................................................................................142 IDL 中表达式的真和假....................................................................................142 将多个语句处理成单个语句.............................................................................143 If…Then…Else 控制语句.................................................................................144 FOR 循环控制语句..........................................................................................145 WHILE 循环控制语句 .....................................................................................145 REPEAT...UNTIL 循环控制语句......................................................................146 CASE控制语句...............................................................................................146 GOTO控制语句..............................................................................................147 错误处理控制语句...........................................................................................147 ON_Error 控制语句.........................................................................................147 Catch 控制语句...............................................................................................148 错误处理语句的优先级....................................................................................149 编译和执行 IDL 程序模块................................................................................149 程序编译规则...........................................................................................150 程序编译和自动运行规则.........................................................................150 特殊编译命令...........................................................................................150 用打印设备定位图形.......................................................................................151 用打印设备输出图像.......................................................................................152 第九章 编写 IDL 程序.................................................................................................153 本章概述................................................................................................................153 基本的 ImageBar 程序.............................................................................................153 向 ImageBar 程序增颜色敏感功能.................................................................156 给 ImageBar 中的命令传递关键字....................................................................158 使用关键字继承.......................................................................................158 根据窗口大小改变字符大小.............................................................................160 程序 ImageBar 的最终代码...............................................................................161 在图形用户界面中包装 ImageBar .....................................................................162 第十章 编写简单的组件程序.........................................................................................163 本章概述................................................................................................................163 组件程序的结构.....................................................................................................163 组件程序如何对事件作出反应.........................................................................164 7 编写组件定义模块...........................................................................................164 定义和创建程序组件.......................................................................................165 创建顶层 base组件..........................................................................................165 创建菜单栏按钮..............................................................................................166 为程序创建图形窗口.......................................................................................166 在屏幕上实现组件....................................................................................166 使绘图组件成为当前图形窗口..................................................................167 在绘图组件窗口上显示图形......................................................................167 保存程序运行时所需要的信息.........................................................................167 使用组件用户值保存程序信息..................................................................168 创建事件循环和注册程序.........................................................................168 运行程序.........................................................................................................168 创建无阻塞组件程序................................................................................169 第十一章 组件编程技巧................................................................................................175 本章概述................................................................................................................175 改变颜色表............................................................................................................176 保护公共块............................................................................................................176 一个可选择颜色表的工具.......................................................................................177 一个关键字继承的问题...........................................................................................177 给组件程序增 Group Leader.................................................................................180 在 24 位显示器上改变颜色表..................................................................................181 创建事件并将事件传递给其它程序.........................................................................181 在组件程序中使用指针...........................................................................................183 使用 Cleanup 过程防止内存泄露.............................................................................185 使用伪事件进行程序通信.......................................................................................186 创建一个具有“ 记忆功能” 的程序.............................................................................187 保护组件程序的颜色..............................................................................................189 通过组件跟踪事件来保护颜色................................................................................190 通过绘图组件事件来保护颜色................................................................................191 保存或者发布程序的图形.......................................................................................192 第十二章 对话框程序...................................................................................................195 本章概述................................................................................................................195 创建模式对话框.....................................................................................................195 阻塞的组件程序..............................................................................................195 模式组件程序..................................................................................................196 编写模式对话框的定义模块.............................................................................196 定义一个顶级的模式 base.........................................................................197 定义其他组件...........................................................................................198 在模式对话框中保存信息.........................................................................198 创建 Info 结构..........................................................................................199 创建一个阻塞组件....................................................................................199 从阻塞中返回...........................................................................................199 编写模式对话框的事件处理模块......................................................................200 测试模式对话框程序.......................................................................................201 8 创建非模式的对话框..............................................................................................201 编写非模式对话框程序....................................................................................202 通报程序事件的组件.......................................................................................203 编写非模式对话框的事件处理模块..................................................................204 将事件发送给其他组件.............................................................................204 测试非模态对话程序.......................................................................................205 附录 A 组件的事件结构................................................................................................206 事件结构的定义.....................................................................................................206 公共字段的定义.....................................................................................................206 基本组件的事件结构..............................................................................................207 base组件.........................................................................................................207 按钮组件.........................................................................................................207 绘图组件.........................................................................................................207 下拉式列表组件..............................................................................................207 标签组件.........................................................................................................208 列表组件.........................................................................................................208 滑动条组件.....................................................................................................208 表单组件.........................................................................................................208 插入单个字符事件....................................................................................208 插入字符串事件.......................................................................................208 删除字符串事件.......................................................................................208 选择文本事件...........................................................................................209 选择单元事件...........................................................................................209 改变行高事件...........................................................................................209 改变列宽事件...........................................................................................209 无效数据事件...........................................................................................209 文本组件.........................................................................................................210 插入字符事件...........................................................................................210 插入字符串事件.......................................................................................210 删除字符串事件.......................................................................................210 文本选择事件...........................................................................................210 复合组件的事件结构................................................................................210 组件程序的事件结构................................................................................211 其他组件的事件结构................................................................................212
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值