窗口上放一个分隔条,随着分隔条的左右移动,左右两边控件的宽度随着变化,PB中怎么实现啊
发布时间:2011-06-29 20:31:30 文章来源:www.iduyao.cn 采编人员:星星草
窗口上放一个分隔条,随着分隔条的左右移动,左右两边控件的宽度随着变化,PB中如何实现啊?
问题如标题,论坛里出现过相关的帖子,但是没看明白。是否可以直接提供源码,万分感谢!!
------解决方案--------------------
[code=C]$PBExportHeader$lht_vo_splitter.sru
$PBExportComments$分割条
forward
global type lht_vo_splitter from uo_statictext
end type
end forward
global type lht_vo_splitter from uo_statictext
integer width = 82
integer height = 240
integer textsize = -8
fontcharset fontcharset = ansi!
fontfamily fontfamily = roman!
string facename = "Times New Roman"
boolean focusrectangle = false
integer i_uid = 0
integer tipicon = 0
boolean havefocusrect = true
rowfocusind tooltiptype = hand!
boolean 透明 = false
event ue_lbuttondown pbm_lbuttondown
event ue_lbuttonup pbm_lbuttonup
event ue_drag ( long oldx, long oldy )
event ue_rbuttonup pbm_rbuttonup
end type
global lht_vo_splitter lht_vo_splitter
type prototypes
function ulong SetCapture(ulong hwnd)library "user32.dll"
function ulong ReleaseCapture() library "user32.dll"
end prototypes
type variables
long il_distance = 6
boolean ib_live = true
protected:
userobject iuo_1, iuo_2
boolean ib_vertical = true
boolean mousedown = false
long oldxpos,oldypos
end variables
forward prototypes
public subroutine of_setpointer ()
public subroutine of_setleftright (readonly graphicobject ago_l, readonly graphicobject ago_r)
public subroutine of_setupdown (readonly graphicobject ago_u, readonly graphicobject ago_d)
public subroutine of_resize ()
public subroutine of_resize (integer ai)
public subroutine of_setleftright (readonly graphicobject ago_l, readonly graphicobject ago_r, integer ai)
public subroutine of_setupdown (readonly graphicobject ago_u, readonly graphicobject ago_d, integer ai)
end prototypes
event ue_lbuttondown;ulong hnd
mousedown = true
oldxpos = unitstopixels( xpos, xunitstopixels! )
oldypos = unitstopixels( ypos, yunitstopixels! )
this.bringtotop = true
this.border = false
hnd = handle(this)
SetCapture(hnd)
if not ib_live then
this.backcolor = f_invert_color(this.backcolor)
end if
end event
event ue_lbuttonup;mousedown = false
ReleaseCapture()
if not ib_live then
this.backcolor = f_invert_color(this.backcolor)
this.post event ue_drag( iuo_1.x, iuo_1.y )
//iuo_2.setredraw( false )
if ib_vertical then
iuo_1.width = this.x - iuo_1.x
iuo_2.width = iuo_2.x + iuo_2.width - this.x - this.width
iuo_2.x = this.x + this.width
else
iuo_1.height = this.y - iuo_1.y
iuo_2.height = iuo_2.y + iuo_2.height - this.y - this.height
iuo_2.y = this.y + this.height
end if
iuo_1.triggerevent("ue_aftersize")
//iuo_2.setredraw( true )
end if
end event
event ue_rbuttonup;//
end event
public subroutine of_setpointer ();if isvalid( iuo_1 ) or isvalid( iuo_2 ) then
if ib_vertical then
this.pointer = "SizeWE!"
else
this.pointer = "SizeNS!"
end if
else
this.pointer = "Arrow!"
end if
end subroutine
public subroutine of_setleftright (readonly graphicobject ago_l, readonly graphicobject ago_r);of_setleftright(ago_l, ago_r, 2)
end subroutine
public subroutine of_setupdown (readonly graphicobject ago_u, readonly graphicobject ago_d);of_setupdown(ago_u, ago_d, 2)
end subroutine
public subroutine of_resize ();//默认为以右边或下方的控件为基准
of_resize(2)
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
pb里关于数据窗口继承的问题
我的pb里设了一个母数据窗口,规定了样式,颜色,怎么让其他数据窗口都继承这个母dw,不用重复设颜色,样式呢
...
-
如何制作PB中查找的窗口,可以变透明的,而且还始终在最上面的窗口?
如何制作PB中查找的窗口,可以变透明的,而且还始终在最上面的窗口?
-...
-
powerbuilder 控件句柄转换,求教!!
问题:
比如我通过handle取得了一个button的句柄。
那么我能否根据这个句柄的值,又反操作还原这...
-
TAB控件能不能设置成不是3D的?
就类似于多行编辑控件的Border设置为false,变成平面的效果。找不到在哪里设置
------解决方案-----...
-
???新增按钮的问题
设置一个window窗口有个“新增”按钮,如何做出点击新增按钮,编号(varchar2类型)自动+1,点一下变成2,然后录完信息,再打开...
-
如何用回车键enter获得焦点
一个数据录入窗口,如何输完一个数据,按回车键跳到下一个要输入数据的地方 就和tab一样
------解决方案...
-
ole控件 Microsoft Web Browser
我用Microsoft Web Browser这个控件写了一个浏览器 但是不能运行脚本 对于那些需要在本地运行...
-
PB如何做透明的文本
我现在工作空间,应用程序,窗口都创建好了。也加了文本“用户名”,从网上看了要创建可视用户对象,粘贴了代码。但...
-
mdi窗口的sheet从normal变为max时闪烁
我的mdi的sheet默认打开后最大化,在sheet的resize事件中构造着把所有控件按比例伸缩,但每次...
-
如何使getfileopenname函数打开的窗口居中?
如何使getfileopenname函数打开的窗口居中?谢谢
------解决方案--------------------
...