- ·上一篇内容:PB8.0应用程序编译发布技术研究
- ·下一篇内容:PB和EAServer共筑多层应用架构
在PB中制作特殊形状数据窗口和按钮
event clicked;//////////////////////////////////////////////////
// //
// 测试用数据(窗口多边形) //
// //
//////////////////////////////////////////////////
long ll_handle
ws_position lws_pointapi[]
// 图形2
int li_xpos, li_ypos, li_width, li_height
li_xpos = 12
li_ypos = 1
li_width = UnitsToPixels(parent.width, xunitstopixels!) - 32
li_height = UnitsToPixels(parent.height, yunitstopixels!) - 32
lws_pointapi[1].xpos = li_xpos
lws_pointapi[1].ypos = li_ypos + li_height / 3
lws_pointapi[2].xpos = li_xpos + li_width / 3
lws_pointapi[2].ypos = li_ypos
lws_pointapi[3].xpos = li_xpos + li_width * 2 / 3
lws_pointapi[3].ypos = li_ypos
lws_pointapi[4].xpos = li_xpos + li_width
lws_pointapi[4].ypos = li_ypos + li_height / 3
lws_pointapi[5].xpos = li_xpos + li_width
lws_pointapi[5].ypos = li_ypos + li_height * 2 / 3
lws_pointapi[6].xpos = li_xpos + li_width * 2 / 3
lws_pointapi[6].ypos = li_ypos + li_height
lws_pointapi[7].xpos = li_xpos + li_width / 3
lws_pointapi[7].ypos = li_ypos + li_height
lws_pointapi[8].xpos = li_xpos
lws_pointapi[8].ypos = li_ypos + li_height * 2 / 3
ll_handle = CreatePolygonRgn(lws_pointapi[], 8, 1)
//其中第 1 个参数为多边形各个顶点坐标值的数组
//其中第 2 个参数为多边形边数,可修改,配合数组值
//其中第 3 个参数为填充模式 ALTERNATE /WINDING
SetwindowRgn(handle(parent), ll_handle, true)
return 1
end event
type cb_5 from commandbutton within w_button
integer x = 1216
integer y = 940
integer width = 562
integer height = 148
integer taborder = 20
integer textsize = -12
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "还原窗口"
end type
event clicked;//////////////////////////////////////////////////
// //
// 测试用数据(窗口多边形) //
// //
//////////////////////////////////////////////////
long ll_handle
ws_position lws_pointapi[]
// 图形2
int li_xpos, li_ypos, li_width, li_height
li_xpos = 1
li_ypos = 1
li_width = UnitsToPixels(parent.width, xunitstopixels!)
li_height = UnitsToPixels(parent.height, yunitstopixels!)
lws_pointapi[1].xpos = li_xpos
lws_pointapi[1].ypos = li_ypos
lws_pointapi[2].xpos = li_xpos + li_width
lws_pointapi[2].ypos = li_ypos
lws_pointapi[3].xpos = li_xpos + li_width
lws_pointapi[3].ypos = li_ypos + li_height
lws_pointapi[4].xpos = li_xpos
lws_pointapi[4].ypos = li_ypos + li_height
ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)
//其中第 1 个参数为多边形各个顶点坐标值的数组
//其中第 2 个参数为多边形边数,可修改,配合数组值
//其中第 3 个参数为填充模式 ALTERNATE /WINDING
SetwindowRgn(handle(parent), ll_handle, true)
return 1
end event
type cb_4 from commandbutton within w_button
integer x = 585
integer y = 628
integer width = 562
integer height = 148
integer taborder = 30
integer textsize = -12
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "椭圆形窗口"
end type
event clicked;//////////////////////////////////////////////////
// //
// 测试用数据(窗口多边形) //
// //
//////////////////////////////////////////////////
long ll_x1, ll_x2, ll_x3
long ll_y1, ll_y2, ll_y3
long ll_handle
parent.width = 2400
parent.height = 1800
ll_x1 = 10
ll_y1 = 25
ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 10
ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 10
ll_handle = CreateEllipticRgn(ll_x1, ll_y1, ll_x2, ll_y2)
SetwindowRgn(handle(parent), ll_handle, true)
return 1
end event
type cb_3 from commandbutton within w_button
integer x = 1216
integer y = 472
integer width = 562
integer height = 148
integer taborder = 20
integer textsize = -12
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "菱形窗口"
end type
event clicked;//////////////////////////////////////////////////
// //
// 测试用数据(窗口多边形) //
// //
//////////////////////////////////////////////////
long ll_handle
ws_position lws_pointapi[]
// 图形2
int li_xpos, li_ypos, li_width, li_height
li_xpos = 1
li_ypos = 1
li_width = UnitsToPixels(parent.width, xunitstopixels!)
li_height = UnitsToPixels(parent.height, yunitstopixels!)
lws_pointapi[1].xpos = li_xpos
lws_pointapi[1].ypos = li_ypos + li_height / 2
lws_pointapi[2].xpos = li_xpos + li_width / 2
lws_pointapi[2].ypos = li_ypos
lws_pointapi[3].xpos = li_xpos + li_width
lws_pointapi[3].ypos = li_ypos + li_height / 2
lws_pointapi[4].xpos = li_xpos + li_width / 2
lws_pointapi[4].ypos = li_ypos + li_height
ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)
//其中第 1 个参数为多边形各个顶点坐标值的数组
//其中第 2 个参数为多边形边数,可修改,配合数组值
//其中第 3 个参数为填充模式 ALTERNATE /WINDING
SetwindowRgn(handle(parent), ll_handle, true)
return 1
end event
type cb_2 from commandbutton within w_button
integer x = 585
integer y = 472
integer width = 562
integer height = 148
integer taborder = 20
integer textsize = -12
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "圆角矩形按钮"
end type
event clicked;this.enabled = false
of_set_oval(this)
end event
type cb_1 from commandbutton within w_button
integer x = 1216
integer y = 784
integer width = 562
integer height = 148
integer taborder = 10
integer textsize = -12
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "圆角矩形窗口"
end type
event clicked;//////////////////////////////////////////////////
// //
// 测试用数据(窗口多边形) //
// //
//////////////////////////////////////////////////
long ll_x1, ll_x2, ll_x3
long ll_y1, ll_y2, ll_y3
long ll_handle
ll_x1 = 4
ll_y1 = 4
ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 4
ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 4
ll_x3 = 250
ll_y3 = 250
ll_handle = CreateRoundRectRgn(ll_x1, ll_y1, ll_x2, ll_y2, ll_x3, ll_y3)
SetwindowRgn(handle(parent), ll_handle, true)
return 1
end event
type st_1 from statictext within w_button
integer x = 567
integer y = 200
integer width = 1207
integer height = 264
boolean bringtotop = true
integer textsize = -8
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 17725690
alignment alignment = center!
boolean focusrectangle = false
end type
event clicked;if this.width <= 1000 then
this.resize(1586, 2164)
else
this.resize(986, 264)
end if
end event
翔宇亭IT乐园提醒您:本文来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。(www.biye5u.com)