$PBExportHeader$w_button.srwforwardglobal type w_button from windowend typetype cb_11 from commandbutton within w_buttonend typetype cb_10 from commandbutton within w_buttonend typetype em_3 from editmask within w_buttonend typetype em_2 from editmask within w_buttonend typetype em_1 from editmask within w_buttonend typetype cb_9 from commandbutton within w_buttonend typetype cb_8 from commandbutton within w_buttonend typetype cb_7 from commandbutton within w_buttonend typetype cb_6 from commandbutton within w_buttonend typetype cb_5 from commandbutton within w_buttonend typetype cb_4 from commandbutton within w_buttonend typetype cb_3 from commandbutton within w_buttonend typetype cb_2 from commandbutton within w_buttonend typetype cb_1 from commandbutton within w_buttonend typetype st_1 from statictext within w_buttonend typetype ws_position from structure within w_buttonend typeend forwardtype ws_position from structure long xpos long yposend typeglobal type w_button from windowinteger width = 2400integer height = 1800boolean titlebar = truestring title = "特殊形状数据窗口演示"boolean controlmenu = trueboolean minbox = trueboolean maxbox = truelong backcolor = 17725690string icon = "AppIcon!"boolean center = truecb_11 cb_11cb_10 cb_10em_3 em_3em_2 em_2em_1 em_1cb_9 cb_9cb_8 cb_8cb_7 cb_7cb_6 cb_6cb_5 cb_5cb_4 cb_4cb_3 cb_3cb_2 cb_2cb_1 cb_1st_1 st_1end typeglobal w_button w_buttontype prototypesFUNCTION ulong CreateRoundRectRgn(Long x1, Long y1, Long x2, Long y2, Long x3, Long y3) library "gdi32"FUNCTION ulong CreatePolygonRgn (ref ws_position lppt[], int cPoints, int fnPolyFillMode ) Library "gdi32" FUNCTION ulong CreateEllipticRgn( Long x1, Long y1, Long x2, Long y2) library "gdi32"FUNCTION ulong SetWindowRgn(ulong hWnd,ulong hRgn,boolean bRedraw) LIBRARY "user32" FUNCTION ulong CombineRgn(Long hDestRgn, Long hSrcRgn1, Long hSrcRgn2, Long nCombineMode ) LIBRARY "gdi32"Function Long SetParent( Long hWndChild, Long hWndNewParent) library "user32"Subroutine keybd_event(long bVk, long bScan, long dwFlags, long dwExtraInfo) LIBRARY "user32.dll"end prototypesforward prototypespublic function integer of_set_oval (commandbutton acb_button)public function integer wf_set_color ()end prototypespublic function integer of_set_oval (commandbutton acb_button);//// //// 测试用数据(窗口多边形) //// ////long ll_x1, ll_x2, ll_x3long ll_y1, ll_y2, ll_y3long ll_handlell_x1 = 1ll_y1 = 1ll_x2 = UnitsToPixels(acb_button.width, xunitstopixels!)ll_y2 = UnitsToPixels(acb_button.height, yunitstopixels!)ll_x3 = 64ll_y3 = 64ll_handle = CreateRoundRectRgn(ll_x1, ll_y1, ll_x2, ll_y2, ll_x3, ll_y3)SetwindowRgn(handle(acb_button), ll_handle, true)return 1end functionpublic function integer wf_set_color ();long ll_red, ll_green, ll_bluelong ll_datall_red = long(em_1.text)ll_green = long(em_2.text)ll_blue = long(em_3.text)ll_data = rgb(ll_red, ll_green, ll_blue)this.backcolor = ll_dataem_1.backcolor = ll_dataem_2.backcolor = ll_dataem_3.backcolor = ll_datast_1.backcolor = ll_datareturn 1end functionon w_button.createthis.cb_11=create cb_11this.cb_10=create cb_10this.em_3=create em_3this.em_2=create em_2this.em_1=create em_1this.cb_9=create cb_9this.cb_8=create cb_8this.cb_7=create cb_7this.cb_6=create cb_6this.cb_5=create cb_5this.cb_4=create cb_4this.cb_3=create cb_3this.cb_2=create cb_2this.cb_1=create cb_1this.st_1=create st_1this.Control[]={this.cb_11,&this.cb_10,&this.em_3,&this.em_2,&this.em_1,&this.cb_9,&this.cb_8,&this.cb_7,&this.cb_6,&this.cb_5,&this.cb_4,&this.cb_3,&this.cb_2,&this.cb_1,&this.st_1}end onon w_button.destroydestroy(this.cb_11)destroy(this.cb_10)destroy(this.em_3)destroy(this.em_2)destroy(this.em_1)destroy(this.cb_9)destroy(this.cb_8)destroy(this.cb_7)destroy(this.cb_6)destroy(this.cb_5)destroy(this.cb_4)destroy(this.cb_3)destroy(this.cb_2)destroy(this.cb_1)destroy(this.st_1)end onevent mousemove;Send(handle(this), 274, 61458, 0)end eventtype cb_11 from commandbutton within w_buttoninteger x = 1216integer y = 1096integer width = 562integer height = 148integer taborder = 70integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "半圆形花边"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_handle, ll_dataws_position lws_pointapi[]long ll_xpos, ll_ypos, ll_width, ll_heightlong ll_xnum, ll_ynumlong ll_x, ll_y, ll_flower = 20long ll_i, ll_kll_xpos = 1ll_ypos = 1ll_width = UnitsToPixels(parent.width, xunitstopixels!)ll_height = UnitsToPixels(parent.height, yunitstopixels!)ll_xpos = ll_xpos + 5ll_ypos = ll_ypos + 25 + ll_flowerll_width = ll_width - 20ll_width = ll_width - mod(ll_width - ll_xpos, ll_flower)ll_xnum = (ll_width- ll_xpos) / ll_flowerll_height = ll_height - 20ll_height = ll_height - mod(ll_height - ll_ypos, ll_flower)ll_ynum = (ll_height - ll_ypos) / ll_flowerlws_pointapi[1].xpos = ll_xpos + ll_flower / 2lws_pointapi[1].ypos = ll_ypos - ll_flower / 2lws_pointapi[2].xpos = ll_width + ll_flower / 2lws_pointapi[2].ypos = ll_ypos - ll_flower / 2lws_pointapi[3].xpos = ll_width + ll_flower / 2lws_pointapi[3].ypos = ll_height + ll_flower /2lws_pointapi[4].xpos = ll_xpos + ll_flower - ll_flower / 2lws_pointapi[4].ypos = ll_height + ll_flower/2ll_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)nextfor 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)nextfor 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)nextfor 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)nextSetwindowRgn(handle(parent), ll_handle, true) end eventtype cb_10 from commandbutton within w_buttoninteger x = 1216integer y = 1096integer width = 562integer height = 148integer taborder = 60integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "关闭窗口"end typeevent clicked;close(parent)end eventtype em_3 from editmask within w_buttonevent editchanged pbm_enchangeinteger x = 1289integer y = 104integer width = 251integer height = 92integer taborder = 60integer textsize = -9integer weight = 400fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"long textcolor = 33554432long backcolor = 17725690string text = "14"alignment alignment = right!borderstyle borderstyle = stylelowered!string mask = "###"boolean autoskip = trueboolean spin = truedouble increment = 5string minmax = "0~~255"end typeevent editchanged;wf_set_color()end eventtype em_2 from editmask within w_buttonevent editchanged pbm_enchangeinteger x = 1024integer y = 104integer width = 251integer height = 92integer taborder = 60integer textsize = -9integer weight = 400fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"long textcolor = 33554432long backcolor = 17725690string text = "120"alignment alignment = right!borderstyle borderstyle = stylelowered!string mask = "###"boolean autoskip = trueboolean spin = truedouble increment = 5string minmax = "0~~255"end typeevent editchanged;wf_set_color()end eventtype em_1 from editmask within w_buttonevent editchanged pbm_enchangeinteger x = 759integer y = 104integer width = 251integer height = 92integer taborder = 60integer textsize = -9integer weight = 400fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"long textcolor = 33554432long backcolor = 17725690string text = "250"alignment alignment = right!borderstyle borderstyle = stylelowered!string mask = "###"boolean autoskip = trueboolean spin = truedouble increment = 5string minmax = "0~~255"end typeevent editchanged;wf_set_color()end eventtype cb_9 from commandbutton within w_buttoninteger x = 590integer y = 1096integer width = 562integer height = 148integer taborder = 50integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "圆形花边"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_handle, ll_dataws_position lws_pointapi[]long ll_xpos, ll_ypos, ll_width, ll_heightlong ll_xnum, ll_ynumlong ll_x, ll_y, ll_flower = 20long ll_i, ll_kll_xpos = 1ll_ypos = 1ll_width = UnitsToPixels(parent.width, xunitstopixels!)ll_height = UnitsToPixels(parent.height, yunitstopixels!)ll_xpos = ll_xpos + 5ll_ypos = ll_ypos + 25 + ll_flowerll_width = ll_width - 20ll_width = ll_width - mod(ll_width - ll_xpos, ll_flower)ll_xnum = (ll_width - ll_xpos) / ll_flowerll_height = ll_height - 20ll_height = ll_height - mod(ll_height - ll_ypos, ll_flower)ll_ynum = (ll_height - ll_ypos) / ll_flowerlws_pointapi[1].xpos = ll_xpos + ll_flowerlws_pointapi[1].ypos = ll_yposlws_pointapi[2].xpos = ll_widthlws_pointapi[2].ypos = ll_yposlws_pointapi[3].xpos = ll_widthlws_pointapi[3].ypos = ll_heightlws_pointapi[4].xpos = ll_xpos + ll_flowerlws_pointapi[4].ypos = ll_heightll_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)nextfor 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)nextfor 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)nextfor 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)nextSetwindowRgn(handle(parent), ll_handle, true) end eventtype cb_8 from commandbutton within w_buttoninteger x = 1216integer y = 628integer width = 562integer height = 148integer taborder = 30integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "圆形窗口"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_x1, ll_x2, ll_x3long ll_y1, ll_y2, ll_y3long ll_handlelong ll_datall_data = UnitsToPixels(parent.width, xunitstopixels!)ll_data = PixelsToUnits(ll_data, ypixelstounits!)parent.height = ll_datall_x1 = 10ll_y1 = 25ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 10ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 10ll_handle = CreateEllipticRgn(ll_x1, ll_y1, ll_x2, ll_y2)SetwindowRgn(handle(parent), ll_handle, true)return 1end eventtype cb_7 from commandbutton within w_buttoninteger x = 585integer y = 940integer width = 562integer height = 148integer taborder = 40integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "波浪花边"end typeevent clicked;long ll_xpos, ll_ypos, ll_width, ll_heightlong ll_x, ll_y, ll_flower = 80long ll_i, ll_k, ll_max = 40, ll_min = 35long ll_handle ws_position lws_pointapi[] ll_xpos = 1ll_ypos = 1ll_width = UnitsToPixels(parent.width, xunitstopixels!)ll_height = UnitsToPixels(parent.height, yunitstopixels!)ll_k = 1for 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 ++nextfor 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 ++nextfor 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 ++nextfor 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 ++nextll_handle = CreatePolygonRgn(lws_pointapi[], upperbound(lws_pointapi), 1) //其中第 1 个参数为多边形各个顶点坐标值的数组 //其中第 2 个参数为多边形边数,可修改,配合数组值 //其中第 3 个参数为填充模式 ALTERNATE /WINDING SetwindowRgn(handle(parent), ll_handle, true) end eventtype cb_6 from commandbutton within w_buttoninteger x = 585integer y = 784integer width = 562integer height = 148integer taborder = 30integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "八边形窗口"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_handlews_position lws_pointapi[]// 图形2int li_xpos, li_ypos, li_width, li_heightli_xpos = 12li_ypos = 1li_width = UnitsToPixels(parent.width, xunitstopixels!) - 32li_height = UnitsToPixels(parent.height, yunitstopixels!) - 32lws_pointapi[1].xpos = li_xposlws_pointapi[1].ypos = li_ypos + li_height / 3lws_pointapi[2].xpos = li_xpos + li_width / 3lws_pointapi[2].ypos = li_yposlws_pointapi[3].xpos = li_xpos + li_width * 2 / 3lws_pointapi[3].ypos = li_yposlws_pointapi[4].xpos = li_xpos + li_widthlws_pointapi[4].ypos = li_ypos + li_height / 3lws_pointapi[5].xpos = li_xpos + li_widthlws_pointapi[5].ypos = li_ypos + li_height * 2 / 3lws_pointapi[6].xpos = li_xpos + li_width * 2 / 3lws_pointapi[6].ypos = li_ypos + li_heightlws_pointapi[7].xpos = li_xpos + li_width / 3lws_pointapi[7].ypos = li_ypos + li_heightlws_pointapi[8].xpos = li_xposlws_pointapi[8].ypos = li_ypos + li_height * 2 / 3ll_handle = CreatePolygonRgn(lws_pointapi[], 8, 1)//其中第 1 个参数为多边形各个顶点坐标值的数组//其中第 2 个参数为多边形边数,可修改,配合数组值//其中第 3 个参数为填充模式 ALTERNATE /WINDING SetwindowRgn(handle(parent), ll_handle, true)return 1end eventtype cb_5 from commandbutton within w_buttoninteger x = 1216integer y = 940integer width = 562integer height = 148integer taborder = 20integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "还原窗口"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_handlews_position lws_pointapi[]// 图形2int li_xpos, li_ypos, li_width, li_heightli_xpos = 1li_ypos = 1li_width = UnitsToPixels(parent.width, xunitstopixels!)li_height = UnitsToPixels(parent.height, yunitstopixels!)lws_pointapi[1].xpos = li_xposlws_pointapi[1].ypos = li_yposlws_pointapi[2].xpos = li_xpos + li_widthlws_pointapi[2].ypos = li_yposlws_pointapi[3].xpos = li_xpos + li_widthlws_pointapi[3].ypos = li_ypos + li_heightlws_pointapi[4].xpos = li_xposlws_pointapi[4].ypos = li_ypos + li_heightll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)//其中第 1 个参数为多边形各个顶点坐标值的数组//其中第 2 个参数为多边形边数,可修改,配合数组值//其中第 3 个参数为填充模式 ALTERNATE /WINDING SetwindowRgn(handle(parent), ll_handle, true)return 1end eventtype cb_4 from commandbutton within w_buttoninteger x = 585integer y = 628integer width = 562integer height = 148integer taborder = 30integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "椭圆形窗口"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_x1, ll_x2, ll_x3long ll_y1, ll_y2, ll_y3long ll_handleparent.width = 2400parent.height = 1800ll_x1 = 10ll_y1 = 25ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 10ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 10ll_handle = CreateEllipticRgn(ll_x1, ll_y1, ll_x2, ll_y2)SetwindowRgn(handle(parent), ll_handle, true)return 1end eventtype cb_3 from commandbutton within w_buttoninteger x = 1216integer y = 472integer width = 562integer height = 148integer taborder = 20integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "菱形窗口"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_handlews_position lws_pointapi[]// 图形2int li_xpos, li_ypos, li_width, li_heightli_xpos = 1li_ypos = 1li_width = UnitsToPixels(parent.width, xunitstopixels!)li_height = UnitsToPixels(parent.height, yunitstopixels!)lws_pointapi[1].xpos = li_xposlws_pointapi[1].ypos = li_ypos + li_height / 2lws_pointapi[2].xpos = li_xpos + li_width / 2lws_pointapi[2].ypos = li_yposlws_pointapi[3].xpos = li_xpos + li_widthlws_pointapi[3].ypos = li_ypos + li_height / 2lws_pointapi[4].xpos = li_xpos + li_width / 2lws_pointapi[4].ypos = li_ypos + li_heightll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)//其中第 1 个参数为多边形各个顶点坐标值的数组//其中第 2 个参数为多边形边数,可修改,配合数组值//其中第 3 个参数为填充模式 ALTERNATE /WINDING SetwindowRgn(handle(parent), ll_handle, true)return 1end eventtype cb_2 from commandbutton within w_buttoninteger x = 585integer y = 472integer width = 562integer height = 148integer taborder = 20integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "圆角矩形按钮"end typeevent clicked;this.enabled = falseof_set_oval(this)end eventtype cb_1 from commandbutton within w_buttoninteger x = 1216integer y = 784integer width = 562integer height = 148integer taborder = 10integer textsize = -12integer weight = 700fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"string text = "圆角矩形窗口"end typeevent clicked;//// //// 测试用数据(窗口多边形) //// ////long ll_x1, ll_x2, ll_x3long ll_y1, ll_y2, ll_y3long ll_handlell_x1 = 4ll_y1 = 4ll_x2 = UnitsToPixels(parent.width, xunitstopixels!) - 4ll_y2 = UnitsToPixels(parent.height, yunitstopixels!) - 4ll_x3 = 250ll_y3 = 250ll_handle = CreateRoundRectRgn(ll_x1, ll_y1, ll_x2, ll_y2, ll_x3, ll_y3)SetwindowRgn(handle(parent), ll_handle, true)return 1end eventtype st_1 from statictext within w_buttoninteger x = 567integer y = 200integer width = 1207integer height = 264boolean bringtotop = trueinteger textsize = -8integer weight = 400fontcharset fontcharset = gb2312charset!fontpitch fontpitch = variable!string facename = "宋体"long textcolor = 33554432long backcolor = 17725690alignment alignment = center!boolean focusrectangle = falseend typeevent clicked;if this.width <= 1000 then this.resize(1586, 2164)else this.resize(986, 264)end ifend event