[转帖]如何在PB中制作特殊形状数据窗口或按钮
<P>作者:LZP_LRP </P><P>以下是全部源码,感兴趣的朋友可以整个窗口的源代码导入到PBL里自己运行一下试试。</P>
<P>$PBExportHeader$w_button.srw</P>
<P>forward</P>
<P>global type w_button from window</P>
<P>end type</P>
<P>type cb_11 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_10 from commandbutton within w_button</P>
<P>end type</P>
<P>type em_3 from editmask within w_button</P>
<P>end type</P>
<P>type em_2 from editmask within w_button</P>
<P>end type</P>
<P>type em_1 from editmask within w_button</P>
<P>end type</P>
<P>type cb_9 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_8 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_7 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_6 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_5 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_4 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_3 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_2 from commandbutton within w_button</P>
<P>end type</P>
<P>type cb_1 from commandbutton within w_button</P>
<P>end type</P>
<P>type st_1 from statictext within w_button</P>
<P>end type</P>
<P>type ws_position from structure within w_button</P>
<P>end type</P>
<P>end forward</P>
<P>type ws_position from structure</P>
<P> long xpos</P>
<P> long ypos</P>
<P>end type</P>
<P>global type w_button from window</P>
<P>integer width = 2400</P>
<P>integer height = 1800</P>
<P>boolean titlebar = true</P>
<P>string title = "特殊形状数据窗口演示"</P>
<P>boolean controlmenu = true</P>
<P>boolean minbox = true</P>
<P>boolean maxbox = true</P>
<P>long backcolor = 17725690</P>
<P>string icon = "AppIcon!"</P>
<P>boolean center = true</P>
<P>cb_11 cb_11</P>
<P>cb_10 cb_10</P>
<P>em_3 em_3</P>
<P>em_2 em_2</P>
<P>em_1 em_1</P>
<P>cb_9 cb_9</P>
<P>cb_8 cb_8</P>
<P>cb_7 cb_7</P>
<P>cb_6 cb_6</P>
<P>cb_5 cb_5</P>
<P>cb_4 cb_4</P>
<P>cb_3 cb_3</P>
<P>cb_2 cb_2</P>
<P>cb_1 cb_1</P>
<P>st_1 st_1</P>
<P>end type</P>
<P>global w_button w_button</P>
<P>type prototypes</P>
<P>FUNCTION ulong CreateRoundRectRgn(Long x1, Long y1, Long x2, Long y2, Long x3, Long y3) library "gdi32"</P>
<P>FUNCTION ulong CreatePolygonRgn (ref ws_position lppt[], int cPoints, int fnPolyFillMode ) Library "gdi32" </P>
<P>FUNCTION ulong CreateEllipticRgn( Long x1, Long y1, Long x2, Long y2) library "gdi32"</P>
<P>FUNCTION ulong SetWindowRgn(ulong hWnd,ulong hRgn,boolean bRedraw) LIBRARY "user32" </P>
<P>FUNCTION ulong CombineRgn(Long hDestRgn, Long hSrcRgn1, Long hSrcRgn2, Long nCombineMode ) LIBRARY "gdi32"</P>
<P>Function Long SetParent( Long hWndChild, Long hWndNewParent) library "user32"</P>
<P>Subroutine keybd_event(long bVk, long bScan, long dwFlags, long dwExtraInfo) LIBRARY "user32.dll"</P>
<P>end prototypes</P>
<P>forward prototypes</P>
<P>public function integer of_set_oval (commandbutton acb_button)</P>
<P>public function integer wf_set_color ()</P>
<P>end prototypes</P>
<P>public function integer of_set_oval (commandbutton acb_button);//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_x1, ll_x2, ll_x3</P>
<P>long ll_y1, ll_y2, ll_y3</P>
<P>long ll_handle</P>
<P>ll_x1 = 1</P>
<P>ll_y1 = 1</P>
<P>ll_x2 = UnitsToPixels(acb_button.width, xunitstopixels!)</P>
<P>ll_y2 = UnitsToPixels(acb_button.height, yunitstopixels!)</P>
<P>ll_x3 = 64</P>
<P>ll_y3 = 64</P>
<P>ll_handle = CreateRoundRectRgn(ll_x1, ll_y1, ll_x2, ll_y2, ll_x3, ll_y3)</P>
<P>SetwindowRgn(handle(acb_button), ll_handle, true)</P>
<P>return 1</P>
<P>end function</P>
<P>public function integer wf_set_color ();long ll_red, ll_green, ll_blue</P>
<P>long ll_data</P>
<P>ll_red = long(em_1.text)</P>
<P>ll_green = long(em_2.text)</P>
<P>ll_blue = long(em_3.text)</P>
<P>ll_data = rgb(ll_red, ll_green, ll_blue)</P>
<P>this.backcolor = ll_data</P>
<P>em_1.backcolor = ll_data</P>
<P>em_2.backcolor = ll_data</P>
<P>em_3.backcolor = ll_data</P>
<P>st_1.backcolor = ll_data</P>
<P>return 1</P>
<P>end function</P>
<P>on w_button.create</P>
<P>this.cb_11=create cb_11</P>
<P>this.cb_10=create cb_10</P>
<P>this.em_3=create em_3</P>
<P>this.em_2=create em_2</P>
<P>this.em_1=create em_1</P>
<P>this.cb_9=create cb_9</P>
<P>this.cb_8=create cb_8</P>
<P>this.cb_7=create cb_7</P>
<P>this.cb_6=create cb_6</P>
<P>this.cb_5=create cb_5</P>
<P>this.cb_4=create cb_4</P>
<P>this.cb_3=create cb_3</P>
<P>this.cb_2=create cb_2</P>
<P>this.cb_1=create cb_1</P>
<P>this.st_1=create st_1</P>
<P>this.Control[]={this.cb_11,&</P>
<P>this.cb_10,&</P>
<P>this.em_3,&</P>
<P>this.em_2,&</P>
<P>this.em_1,&</P>
<P>this.cb_9,&</P>
<P>this.cb_8,&</P>
<P>this.cb_7,&</P>
<P>this.cb_6,&</P>
<P>this.cb_5,&</P>
<P>this.cb_4,&</P>
<P>this.cb_3,&</P>
<P>this.cb_2,&</P>
<P>this.cb_1,&</P>
<P>this.st_1}</P>
<P>end on</P>
<P>on w_button.destroy</P>
<P>destroy(this.cb_11)</P>
<P>destroy(this.cb_10)</P>
<P>destroy(this.em_3)</P>
<P>destroy(this.em_2)</P>
<P>destroy(this.em_1)</P>
<P>destroy(this.cb_9)</P>
<P>destroy(this.cb_8)</P>
<P>destroy(this.cb_7)</P>
<P>destroy(this.cb_6)</P>
<P>destroy(this.cb_5)</P>
<P>destroy(this.cb_4)</P>
<P>destroy(this.cb_3)</P>
<P>destroy(this.cb_2)</P>
<P>destroy(this.cb_1)</P>
<P>destroy(this.st_1)</P>
<P>end on</P>
<P>event mousemove;Send(handle(this), 274, 61458, 0)</P>
<P>end event</P>
<P>type cb_11 from commandbutton within w_button</P>
<P>integer x = 1216</P>
<P>integer y = 1096</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 70</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "半圆形花边"</P>
<P>end type</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_handle, ll_data</P>
<P>ws_position lws_pointapi[]</P>
<P>long ll_xpos, ll_ypos, ll_width, ll_height</P>
<P>long ll_xnum, ll_ynum</P>
<P>long ll_x, ll_y, ll_flower = 20</P>
<P>long ll_i, ll_k</P>
<P>ll_xpos = 1</P>
<P>ll_ypos = 1</P>
<P>ll_width = UnitsToPixels(parent.width, xunitstopixels!)</P>
<P>ll_height = UnitsToPixels(parent.height, yunitstopixels!)</P>
<P>ll_xpos = ll_xpos + 5</P>
<P>ll_ypos = ll_ypos + 25 + ll_flower</P>
<P>ll_width = ll_width - 20</P>
<P>ll_width = ll_width - mod(ll_width - ll_xpos, ll_flower)</P>
<P>ll_xnum = (ll_width - ll_xpos) / ll_flower</P>
<P>ll_height = ll_height - 20</P>
<P>ll_height = ll_height - mod(ll_height - ll_ypos, ll_flower)</P>
<P>ll_ynum = (ll_height - ll_ypos) / ll_flower</P>
<P>lws_pointapi.xpos = ll_xpos + ll_flower / 2</P>
<P>lws_pointapi.ypos = ll_ypos - ll_flower / 2</P>
<P>lws_pointapi.xpos = ll_width + ll_flower / 2</P>
<P>lws_pointapi.ypos = ll_ypos - ll_flower / 2</P>
<P>lws_pointapi.xpos = ll_width + ll_flower / 2</P>
<P>lws_pointapi.ypos = ll_height + ll_flower /2</P>
<P>lws_pointapi.xpos = ll_xpos + ll_flower - ll_flower / 2</P>
<P>lws_pointapi.ypos = ll_height + ll_flower/2</P>
<P>ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)</P>
<P>for ll_i = 1 to ll_xnum + 1</P>
<P> ll_y = ll_ypos - ll_flower</P>
<P> ll_x = ll_xpos + ll_flower * ( ll_i - 1 )</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>for ll_i = 1 to ll_ynum + 1</P>
<P> ll_y = ll_ypos + ll_flower * ( ll_i - 1 )</P>
<P> ll_x = ll_xpos + ll_flower * ll_xnum</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>for ll_i = 1 to ll_xnum + 1</P>
<P> ll_y = ll_ypos + ll_flower * ll_ynum</P>
<P> ll_x = ll_xpos + ll_flower * (ll_xnum - ll_i + 1)</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>for ll_i = 1 to ll_ynum + 1</P>
<P> ll_y = ll_ypos + ll_flower * (ll_ynum - ll_i + 1)</P>
<P> ll_x = ll_xpos</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>SetwindowRgn(handle(parent),ll_handle,true)</P>
<P>end event</P>
<P>type cb_10 from commandbutton within w_button</P>
<P>integer x = 1216</P>
<P>integer y = 1096</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 60</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "关闭窗口"</P>
<P>end type</P>
<P>event clicked;close(parent)</P>
<P>end event</P>
<P>type em_3 from editmask within w_button</P>
<P>event editchanged pbm_enchange</P>
<P>integer x = 1289</P>
<P>integer y = 104</P>
<P>integer width = 251</P>
<P>integer height = 92</P>
<P>integer taborder = 60</P>
<P>integer textsize = -9</P>
<P>integer weight = 400</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>long textcolor = 33554432</P>
<P>long backcolor = 17725690</P>
<P>string text = "14"</P>
<P>alignment alignment = right!</P>
<P>borderstyle borderstyle = stylelowered!</P>
<P>string mask = "###"</P>
<P>boolean autoskip = true</P>
<P>boolean spin = true</P>
<P>double increment = 5</P>
<P>string minmax = "0~~255"</P>
<P>end type</P>
<P>event editchanged;wf_set_color()</P>
<P>end event</P>
<P>type em_2 from editmask within w_button</P>
<P>event editchanged pbm_enchange</P>
<P>integer x = 1024</P>
<P>integer y = 104</P>
<P>integer width = 251</P>
<P>integer height = 92</P>
<P>integer taborder = 60</P>
<P>integer textsize = -9</P>
<P>integer weight = 400</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>long textcolor = 33554432</P>
<P>long backcolor = 17725690</P>
<P>string text = "120"</P>
<P>alignment alignment = right!</P>
<P>borderstyle borderstyle = stylelowered!</P>
<P>string mask = "###"</P>
<P>boolean autoskip = true</P>
<P>boolean spin = true</P>
<P>double increment = 5</P>
<P>string minmax = "0~~255"</P>
<P>end type</P>
<P>event editchanged;wf_set_color()</P>
<P>end event</P>
<P>type em_1 from editmask within w_button</P>
<P>event editchanged pbm_enchange</P>
<P>integer x = 759</P>
<P>integer y = 104</P>
<P>integer width = 251</P>
<P>integer height = 92</P>
<P>integer taborder = 60</P>
<P>integer textsize = -9</P>
<P>integer weight = 400</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>long textcolor = 33554432</P>
<P>long backcolor = 17725690</P>
<P>string text = "250"</P>
<P>alignment alignment = right!</P>
<P>borderstyle borderstyle = stylelowered!</P>
<P>string mask = "###"</P>
<P>boolean autoskip = true</P>
<P>boolean spin = true</P>
<P>double increment = 5</P>
<P>string minmax = "0~~255"</P>
<P>end type</P>
<P>event editchanged;wf_set_color()</P>
<P>end event</P>
<P>type cb_9 from commandbutton within w_button</P>
<P>integer x = 590</P>
<P>integer y = 1096</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 50</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "圆形花边"</P>
<P>end type</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_handle, ll_data</P>
<P>ws_position lws_pointapi[]</P>
<P>long ll_xpos, ll_ypos, ll_width, ll_height</P>
<P>long ll_xnum, ll_ynum</P>
<P>long ll_x, ll_y, ll_flower = 20</P>
<P>long ll_i, ll_k</P>
<P>ll_xpos = 1</P>
<P>ll_ypos = 1</P>
<P>ll_width = UnitsToPixels(parent.width, xunitstopixels!)</P>
<P>ll_height = UnitsToPixels(parent.height, yunitstopixels!)</P>
<P>ll_xpos = ll_xpos + 5</P>
<P>ll_ypos = ll_ypos + 25 + ll_flower</P>
<P>ll_width = ll_width - 20</P>
<P>ll_width = ll_width - mod(ll_width - ll_xpos, ll_flower)</P>
<P>ll_xnum = (ll_width - ll_xpos) / ll_flower</P>
<P>ll_height = ll_height - 20</P>
<P>ll_height = ll_height - mod(ll_height - ll_ypos, ll_flower)</P>
<P>ll_ynum = (ll_height - ll_ypos) / ll_flower</P>
<P>lws_pointapi.xpos = ll_xpos + ll_flower</P>
<P>lws_pointapi.ypos = ll_ypos</P>
<P>lws_pointapi.xpos = ll_width</P>
<P>lws_pointapi.ypos = ll_ypos</P>
<P>lws_pointapi.xpos = ll_width</P>
<P>lws_pointapi.ypos = ll_height</P>
<P>lws_pointapi.xpos = ll_xpos + ll_flower</P>
<P>lws_pointapi.ypos = ll_height</P>
<P>ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)</P>
<P>for ll_i = 1 to ll_xnum + 1</P>
<P> ll_y = ll_ypos - ll_flower</P>
<P> ll_x = ll_xpos + ll_flower * ( ll_i - 1 )</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>for ll_i = 1 to ll_ynum + 1</P>
<P> ll_y = ll_ypos + ll_flower * ( ll_i - 1 )</P>
<P> ll_x = ll_xpos + ll_flower * ll_xnum</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>for ll_i = 1 to ll_xnum + 1</P>
<P> ll_y = ll_ypos + ll_flower * ll_ynum</P>
<P> ll_x = ll_xpos + ll_flower * (ll_xnum - ll_i + 1)</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>for ll_i = 1 to ll_ynum + 1</P>
<P> ll_y = ll_ypos + ll_flower * (ll_ynum - ll_i + 1)</P>
<P> ll_x = ll_xpos</P>
<P> ll_data = CreateEllipticRgn(ll_x, ll_y, ll_x + ll_flower, ll_y + ll_flower)</P>
<P> CombineRgn(ll_handle, ll_handle, ll_data, 2)</P>
<P>next</P>
<P>SetwindowRgn(handle(parent),ll_handle,true)</P>
<P>end event</P>
<P>type cb_8 from commandbutton within w_button</P>
<P>integer x = 1216</P>
<P>integer y = 628</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 30</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "圆形窗口"</P>
<P>end type</P>
<P>下接楼下</P> <P>上接楼上</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_x1, ll_x2, ll_x3</P>
<P>long ll_y1, ll_y2, ll_y3</P>
<P>long ll_handle</P>
<P>long ll_data</P>
<P>ll_data = UnitsToPixels(parent.width, xunitstopixels!)</P>
<P>ll_data = PixelsToUnits(ll_data, ypixelstounits!)</P>
<P>parent.height = ll_data</P>
<P>ll_x1 = 10</P>
<P>ll_y1 = 25</P>
<P>ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 10</P>
<P>ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 10</P>
<P>ll_handle = CreateEllipticRgn(ll_x1, ll_y1, ll_x2, ll_y2)</P>
<P>SetwindowRgn(handle(parent), ll_handle, true)</P>
<P>return 1</P>
<P>end event</P>
<P>type cb_7 from commandbutton within w_button</P>
<P>integer x = 585</P>
<P>integer y = 940</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 40</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "波浪花边"</P>
<P>end type</P>
<P>event clicked;long ll_xpos, ll_ypos, ll_width, ll_height</P>
<P>long ll_x, ll_y, ll_flower = 80</P>
<P>long ll_i, ll_k, ll_max = 40, ll_min = 35</P>
<P>longll_handle</P>
<P>ws_positionlws_pointapi[]</P>
<P>ll_xpos = 1</P>
<P>ll_ypos = 1</P>
<P>ll_width = UnitsToPixels(parent.width, xunitstopixels!)</P>
<P>ll_height = UnitsToPixels(parent.height, yunitstopixels!)</P>
<P>ll_k = 1</P>
<P>for ll_i = 1 to ll_flower</P>
<P> if mod(ll_i, 2) = 0 then</P>
<P> ll_y = ll_ypos + ll_max</P>
<P> else</P>
<P> ll_y = ll_ypos + ll_min</P>
<P> end if</P>
<P> ll_x = ll_xpos + ll_width / ll_flower * ll_i</P>
<P> lws_pointapi.xpos = ll_x</P>
<P> lws_pointapi.ypos = ll_y </P>
<P> ll_k ++</P>
<P>next</P>
<P>for ll_i = 1 to ll_flower</P>
<P> if mod(ll_i, 2) = 0 then</P>
<P> ll_x = ll_width - 5</P>
<P> else</P>
<P> ll_x = ll_width - ll_max + ll_min - 5</P>
<P> end if</P>
<P> ll_y = ll_ypos + ll_height / ll_flower * ll_i + ll_min</P>
<P> lws_pointapi.xpos = ll_x</P>
<P> lws_pointapi.ypos = ll_y </P>
<P> ll_k ++</P>
<P>next</P>
<P>for ll_i = 1 to ll_flower</P>
<P> if mod(ll_i, 2) = 1 then</P>
<P> ll_y = ll_height - 5</P>
<P> else</P>
<P> ll_y = ll_height - ll_max + ll_min - 5</P>
<P> end if</P>
<P> ll_x = ll_width - ll_width / ll_flower * ll_i - 5</P>
<P> lws_pointapi.xpos = ll_x</P>
<P> lws_pointapi.ypos = ll_y </P>
<P> ll_k ++</P>
<P>next</P>
<P>for ll_i = 1 to ll_flower</P>
<P> if mod(ll_i, 2) = 1 then</P>
<P> ll_x = ll_xpos + 5</P>
<P> else</P>
<P> ll_x = ll_xpos + ll_max - ll_min + 5 </P>
<P> end if</P>
<P> ll_y = ll_height - ll_height / ll_flower * ll_i + ll_min</P>
<P> lws_pointapi.xpos = ll_x</P>
<P> lws_pointapi.ypos = ll_y </P>
<P> ll_k ++</P>
<P>next</P>
<P>ll_handle=CreatePolygonRgn(lws_pointapi[],upperbound(lws_pointapi),1)</P>
<P>//其中第1个参数为多边形各个顶点坐标值的数组</P>
<P>//其中第2个参数为多边形边数,可修改,配合数组值</P>
<P>//其中第3个参数为填充模式ALTERNATE/WINDING </P>
<P>SetwindowRgn(handle(parent),ll_handle,true)</P>
<P>end event</P>
<P>type cb_6 from commandbutton within w_button</P>
<P>integer x = 585</P>
<P>integer y = 784</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 30</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "八边形窗口"</P>
<P>end type</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_handle</P>
<P>ws_position lws_pointapi[]</P>
<P>// 图形2</P>
<P>int li_xpos, li_ypos, li_width, li_height</P>
<P>li_xpos = 12</P>
<P>li_ypos = 1</P>
<P>li_width = UnitsToPixels(parent.width, xunitstopixels!) - 32</P>
<P>li_height = UnitsToPixels(parent.height, yunitstopixels!) - 32</P>
<P>lws_pointapi.xpos = li_xpos</P>
<P>lws_pointapi.ypos = li_ypos + li_height / 3</P>
<P>lws_pointapi.xpos = li_xpos + li_width / 3</P>
<P>lws_pointapi.ypos = li_ypos</P>
<P>lws_pointapi.xpos = li_xpos + li_width * 2 / 3</P>
<P>lws_pointapi.ypos = li_ypos</P>
<P>lws_pointapi.xpos = li_xpos + li_width</P>
<P>lws_pointapi.ypos = li_ypos + li_height / 3</P>
<P>lws_pointapi.xpos = li_xpos + li_width</P>
<P>lws_pointapi.ypos = li_ypos + li_height * 2 / 3</P>
<P>lws_pointapi.xpos = li_xpos + li_width * 2 / 3</P>
<P>lws_pointapi.ypos = li_ypos + li_height</P>
<P>lws_pointapi.xpos = li_xpos + li_width / 3</P>
<P>lws_pointapi.ypos = li_ypos + li_height</P>
<P>lws_pointapi.xpos = li_xpos</P>
<P>lws_pointapi.ypos = li_ypos + li_height * 2 / 3</P>
<P>ll_handle = CreatePolygonRgn(lws_pointapi[], 8, 1)</P>
<P>//其中第 1 个参数为多边形各个顶点坐标值的数组</P>
<P>//其中第 2 个参数为多边形边数,可修改,配合数组值</P>
<P>//其中第 3 个参数为填充模式 ALTERNATE /WINDING </P>
<P>SetwindowRgn(handle(parent), ll_handle, true)</P>
<P>return 1</P>
<P>end event</P>
<P>type cb_5 from commandbutton within w_button</P>
<P>integer x = 1216</P>
<P>integer y = 940</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 20</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "还原窗口"</P>
<P>end type</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_handle</P>
<P>ws_position lws_pointapi[]</P>
<P>// 图形2</P>
<P>int li_xpos, li_ypos, li_width, li_height</P>
<P>li_xpos = 1</P>
<P>li_ypos = 1</P>
<P>li_width = UnitsToPixels(parent.width, xunitstopixels!)</P>
<P>li_height = UnitsToPixels(parent.height, yunitstopixels!)</P>
<P>lws_pointapi.xpos = li_xpos</P>
<P>lws_pointapi.ypos = li_ypos</P>
<P>lws_pointapi.xpos = li_xpos + li_width</P>
<P>lws_pointapi.ypos = li_ypos</P>
<P>lws_pointapi.xpos = li_xpos + li_width</P>
<P>lws_pointapi.ypos = li_ypos + li_height</P>
<P>lws_pointapi.xpos = li_xpos</P>
<P>lws_pointapi.ypos = li_ypos + li_height</P>
<P>ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)</P>
<P>//其中第 1 个参数为多边形各个顶点坐标值的数组</P>
<P>//其中第 2 个参数为多边形边数,可修改,配合数组值</P>
<P>//其中第 3 个参数为填充模式 ALTERNATE /WINDING </P>
<P>SetwindowRgn(handle(parent), ll_handle, true)</P>
<P>return 1</P>
<P>end event</P>
<P>type cb_4 from commandbutton within w_button</P>
<P>integer x = 585</P>
<P>integer y = 628</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 30</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "椭圆形窗口"</P>
<P>end type</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_x1, ll_x2, ll_x3</P>
<P>long ll_y1, ll_y2, ll_y3</P>
<P>long ll_handle</P>
<P>parent.width = 2400</P>
<P>parent.height = 1800</P>
<P>ll_x1 = 10</P>
<P>ll_y1 = 25</P>
<P>ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 10</P>
<P>ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 10</P>
<P>ll_handle = CreateEllipticRgn(ll_x1, ll_y1, ll_x2, ll_y2)</P>
<P>SetwindowRgn(handle(parent), ll_handle, true)</P>
<P>return 1</P>
<P>end event</P>
<P>type cb_3 from commandbutton within w_button</P>
<P>integer x = 1216</P>
<P>integer y = 472</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 20</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "菱形窗口"</P>
<P>end type</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_handle</P>
<P>ws_position lws_pointapi[]</P>
<P>// 图形2</P>
<P>int li_xpos, li_ypos, li_width, li_height</P>
<P>li_xpos = 1</P>
<P>li_ypos = 1</P>
<P>li_width = UnitsToPixels(parent.width, xunitstopixels!)</P>
<P>li_height = UnitsToPixels(parent.height, yunitstopixels!)</P>
<P>lws_pointapi.xpos = li_xpos</P>
<P>lws_pointapi.ypos = li_ypos + li_height / 2</P>
<P>lws_pointapi.xpos = li_xpos + li_width / 2</P>
<P>lws_pointapi.ypos = li_ypos</P>
<P>lws_pointapi.xpos = li_xpos + li_width</P>
<P>lws_pointapi.ypos = li_ypos + li_height / 2</P>
<P>lws_pointapi.xpos = li_xpos + li_width / 2</P>
<P>lws_pointapi.ypos = li_ypos + li_height</P>
<P>ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)</P>
<P>//其中第 1 个参数为多边形各个顶点坐标值的数组</P>
<P>//其中第 2 个参数为多边形边数,可修改,配合数组值</P>
<P>//其中第 3 个参数为填充模式 ALTERNATE /WINDING </P>
<P>SetwindowRgn(handle(parent), ll_handle, true)</P>
<P>return 1</P>
<P>end event</P>
<P>type cb_2 from commandbutton within w_button</P>
<P>integer x = 585</P>
<P>integer y = 472</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 20</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "圆角矩形按钮"</P>
<P>end type</P>
<P>event clicked;this.enabled = false</P>
<P>of_set_oval(this)</P>
<P>end event</P>
<P>type cb_1 from commandbutton within w_button</P>
<P>integer x = 1216</P>
<P>integer y = 784</P>
<P>integer width = 562</P>
<P>integer height = 148</P>
<P>integer taborder = 10</P>
<P>integer textsize = -12</P>
<P>integer weight = 700</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>string text = "圆角矩形窗口"</P>
<P>end type</P>
<P>event clicked;//////////////////////////////////////////////////</P>
<P>// //</P>
<P>// 测试用数据(窗口多边形) //</P>
<P>// //</P>
<P>//////////////////////////////////////////////////</P>
<P>long ll_x1, ll_x2, ll_x3</P>
<P>long ll_y1, ll_y2, ll_y3</P>
<P>long ll_handle</P>
<P>ll_x1 = 4</P>
<P>ll_y1 = 4</P>
<P>ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 4</P>
<P>ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 4</P>
<P>ll_x3 = 250</P>
<P>ll_y3 = 250</P>
<P>ll_handle = CreateRoundRectRgn(ll_x1, ll_y1, ll_x2, ll_y2, ll_x3, ll_y3)</P>
<P>SetwindowRgn(handle(parent), ll_handle, true)</P>
<P>return 1</P>
<P>end event</P>
<P>type st_1 from statictext within w_button</P>
<P>integer x = 567</P>
<P>integer y = 200</P>
<P>integer width = 1207</P>
<P>integer height = 264</P>
<P>boolean bringtotop = true</P>
<P>integer textsize = -8</P>
<P>integer weight = 400</P>
<P>fontcharset fontcharset = gb2312charset!</P>
<P>fontpitch fontpitch = variable!</P>
<P>string facename = "宋体"</P>
<P>long textcolor = 33554432</P>
<P>long backcolor = 17725690</P>
<P>alignment alignment = center!</P>
<P>boolean focusrectangle = false</P>
<P>end type</P>
<P>event clicked;if this.width <= 1000 then</P>
<P> this.resize(1586, 2164)</P>
<P>else</P>
<P> this.resize(986, 264)</P>
<P>end if</P>
<P>end event<BR> <BR></P> 谢谢~~以后有类似的可以打包成RAR之类的发附件,比较省事 OK!
页:
[1]