首 页IT知识库翔宇问吧收藏本站
当前位置:翔宇亭IT乐园IT知识库编程技术其它编程

在PB中制作特殊形状数据窗口和按钮

减小字体 增大字体 作者:LZP_LRP  来源:转载  发布时间:2010-05-18 09:22:00

event clicked;//////////////////////////////////////////////////

//                                                                         //

//                 测试用数据(窗口多边形)             //

//                                                                         //

//////////////////////////////////////////////////



long ll_handle, ll_data

ws_position lws_pointapi[]

long ll_xpos, ll_ypos, ll_width, ll_height

long ll_xnum, ll_ynum

long ll_x, ll_y, ll_flower = 20

long ll_i, ll_k



ll_xpos = 1

ll_ypos = 1

ll_width = UnitsToPixels(parent.width, xunitstopixels!)

ll_height = UnitsToPixels(parent.height, yunitstopixels!)



ll_xpos = ll_xpos + 5

ll_ypos = ll_ypos + 25 + ll_flower



ll_width = ll_width - 20

ll_width = ll_width - mod(ll_width - ll_xpos, ll_flower)

ll_xnum = (ll_width - ll_xpos) / ll_flower



ll_height = ll_height - 20

ll_height = ll_height - mod(ll_height - ll_ypos, ll_flower)

ll_ynum = (ll_height - ll_ypos) / ll_flower


lws_pointapi[1].xpos = ll_xpos + ll_flower

lws_pointapi[1].ypos = ll_ypos


lws_pointapi[2].xpos = ll_width

lws_pointapi[2].ypos = ll_ypos



lws_pointapi[3].xpos = ll_width

lws_pointapi[3].ypos = ll_height


lws_pointapi[4].xpos = ll_xpos + ll_flower

lws_pointapi[4].ypos = ll_height


ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)


for ll_i = 1 to ll_xnum + 1

     ll_y = ll_ypos - ll_flower

     ll_x = ll_xpos + ll_flower * ( ll_i - 1 )

     ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)

     CombineRgn(ll_handle, ll_handle, ll_data, 2)

next



for ll_i = 1 to ll_ynum + 1

     ll_y = ll_ypos + ll_flower * ( ll_i - 1 )

     ll_x = ll_xpos + ll_flower * ll_xnum

     ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)

     CombineRgn(ll_handle, ll_handle, ll_data, 2)

next



for ll_i = 1 to ll_xnum + 1

     ll_y = ll_ypos + ll_flower * ll_ynum

     ll_x = ll_xpos + ll_flower * (ll_xnum - ll_i + 1)

     ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)

     CombineRgn(ll_handle, ll_handle, ll_data, 2)

next



for ll_i = 1 to ll_ynum + 1

     ll_y = ll_ypos + ll_flower * (ll_ynum - ll_i + 1)

     ll_x = ll_xpos

     ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)

     CombineRgn(ll_handle, ll_handle, ll_data, 2)

next


SetwindowRgn(handle(parent),  ll_handle,  true)  

end event


type cb_8 from commandbutton within w_button

integer x = 1216

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

long ll_data



ll_data = UnitsToPixels(parent.width, xunitstopixels!)

ll_data = PixelsToUnits(ll_data, ypixelstounits!)

parent.height = ll_data

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_7 from commandbutton within w_button

integer x = 585

integer y = 940

integer width = 562

integer height = 148

integer taborder = 40

integer textsize = -12

integer weight = 700

fontcharset fontcharset = gb2312charset!

fontpitch fontpitch = variable!

string facename = "宋体"

string text = "波浪花边"

end type



event clicked;long ll_xpos, ll_ypos, ll_width, ll_height

long ll_x, ll_y, ll_flower = 80

long ll_i, ll_k, ll_max = 40, ll_min = 35

long  ll_handle  

ws_position  lws_pointapi[]  





ll_xpos = 1

ll_ypos = 1

ll_width = UnitsToPixels(parent.width, xunitstopixels!)

ll_height = UnitsToPixels(parent.height, yunitstopixels!)



ll_k = 1

for ll_i = 1 to ll_flower

     if mod(ll_i, 2) = 0 then

         ll_y = ll_ypos + ll_max

     else

         ll_y = ll_ypos + ll_min

     end if

     ll_x = ll_xpos + ll_width / ll_flower * ll_i

     lws_pointapi[ll_k].xpos = ll_x

     lws_pointapi[ll_k].ypos = ll_y

     ll_k ++

next



for ll_i = 1 to ll_flower

     if mod(ll_i, 2) = 0 then

         ll_x = ll_width - 5

     else

         ll_x = ll_width - ll_max + ll_min - 5

     end if

     ll_y = ll_ypos + ll_height / ll_flower * ll_i + ll_min

     lws_pointapi[ll_k].xpos = ll_x

     lws_pointapi[ll_k].ypos = ll_y

     ll_k ++

next



for ll_i = 1 to ll_flower

     if mod(ll_i, 2) = 1 then

         ll_y = ll_height - 5

     else

         ll_y = ll_height - ll_max + ll_min - 5

     end if

     ll_x = ll_width - ll_width / ll_flower * ll_i - 5

     lws_pointapi[ll_k].xpos = ll_x

     lws_pointapi[ll_k].ypos = ll_y

     ll_k ++

next



for ll_i = 1 to ll_flower

     if mod(ll_i, 2) = 1 then

         ll_x = ll_xpos + 5

     else

         ll_x = ll_xpos + ll_max - ll_min + 5

     end if

     ll_y = ll_height - ll_height / ll_flower * ll_i + ll_min

     lws_pointapi[ll_k].xpos = ll_x

     lws_pointapi[ll_k].ypos = ll_y

     ll_k ++

next



ll_handle  =  CreatePolygonRgn(lws_pointapi[],  upperbound(lws_pointapi),  1)  

//其中第  1  个参数为多边形各个顶点坐标值的数组  

//其中第  2  个参数为多边形边数,可修改,配合数组值  

//其中第  3  个参数为填充模式  ALTERNATE  /WINDING    

SetwindowRgn(handle(parent),  ll_handle,  true)  



end event



type cb_6 from commandbutton within w_button

integer x = 585

integer y = 784

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
 

上一页  [1] [2] [3]  下一页

知识评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 1分

内 容:

            请注意用语文明且合法,不要发布带有攻击性、侮辱性的言论,谢谢合作!

         通知管理员 验证码:

关于本站 | 网站帮助 | 广告合作 | 网站声明 | 友情连接 | 网站地图 | 用户守则 | 联系我们 |
本站大多数内容来自互联网或网站会员发布,如有侵权,请来信告之,谢谢!
Copyright © 2007-2017 biye5u.com. All Rights Reserved.
网站备案号:黑ICP备13005378号-3