经典实例---带底图的MDI窗口
来源:互联网 发布:seo软文例子 编辑:程序博客网 时间:2024/06/10 19:02
一、创建主菜单m_main。
二、创建主窗口w_main,并将其属性Window Type设置为mdihelp!,将MenuName属性设置为m_main。
三、创建图片窗口w_pic,并在该窗口中放置picture控件,起名为p_1;设置w_pic的属性,把Window Type的属性设置为popup!,选择visible,其它属性全部取消。
四、编写w_pic代码:
⑴、定义实例变量(instance variables)
boolean isfullscreen
integer oldwidth,oldheight
⑵、编写open()事件:
isfullscreen=true
oldwidth=p_1.width
oldheight=p_1.height
⑶、编写resize()事件
if isfullscreen then
p_1.x=0
p_1.y=0
p_1.resize(newwidth,newheight)
else
p_1.resize(oldwidth,odlheight)
integer ax,ay
ax=(newwidth-oldwidth)/2
if ax<0 then ax=0
ay=(newheight-oldheight)/2
if ay<0 then ay=0
p_1.x=ax
p_1.y=ay
end if
⑷、定义function: init(string as_picture,boolean as_isfullscreen) return (none)
参数:
access:public return type:none function name:init
pass by:value argument type:string argument name:as_picture
pass by:value argument type:boolean argument name:as_isfullscreen
代码:
p_1.originalsize=ture
p_1.picturename=as_picture
oldheight=p_1.height
oldwidth=p_1.width
p_1.originalsize=false
this.resize(this.width,this.height)
五、编写w_main代码:
⑴、定义实例变量(instance variables)
w_pic mdipicture
string mdipicturename
boolean mdiisfullscreen
⑵、定义function: setpicture()
参数:
access:public return type:(none) function name:setpicture
pass by:value argument type:string argument name:as_picture
pass by:value argument type:boolean argument name:as_isfullscreent
代码:
mdipicturename=as_picture
mdiisfullscreen=as_isfullscreen
if isvalid(mdipicture) then
mdipicture.init(mdipicturename,mdiisfullscreen)
mdipicture.resize(this.width,this.height)
end if
⑶、编写resize()事件:
if isvalid(mdipicture) = false then
opensheet(mdipicture,this)
mdipicture.init(mdipicturename,mdiisfullscreen)
mdipicture.x=0
mdipicture.y=0
end if
mdipicture.resize(newwidth,newheight)
六、编写application的open()事件
open(w_main)
w_main.setpicture("back.bmp",true)
图1:最小化窗口
图2:最大化窗口
- 经典实例---带底图的MDI窗口
- FLEX- MDI窗口开发实例
- FLEX- MDI窗口开发实例
- MDI窗口的笔记
- MDI窗口的笔记
- MDI应用中的单实例(singleton)窗口
- C# 限制MDI窗口只能调用单实例子窗口
- MDI窗口
- 发送给MDI客户窗口的消息MDI消息WM_MDICASCADE
- 平铺与拉伸MDI窗口的背景图 ~!~
- 控制MDI窗口的,最大化.最小化按钮!
- 如何设计MDI的窗口样式
- MDI 关闭窗口 我的例子
- 修改MDI主窗口的标题栏
- 平铺与拉伸MDI窗口的背景图 ~!~
- MDI 不生成默认的子窗口
- MDI子窗口间的数据共享
- Teddy改进的网页MDI窗口效果
- 关于在struts2中使用java注解报异常 java.lang.reflect.InvocationTargetException
- Eclipse常用插件地址收藏
- AS3中root,this,stage关系
- C# override overload overwrite
- 揭开Web开发者最初的困惑
- 经典实例---带底图的MDI窗口
- Oracle
- caosir
- 一起学习 一起进步
- Android--AT9G45开发板移植
- 慢慢学,好好活
- 浅析有关用户定义事件中ID的含义
- linux下检查网卡是否连线
- 在用SWT进行socket编程中遇到的一些问题的总结