Recently, I have made a touch screen for PB. The project team requires a bit of dynamic effect when the window is displayed, so I wrote the following procedure for everyone to refer.
-------------------------------------------------- ----------------------------------- / / Implement the dynamic effect of the shutdown form // --- -------------------------------------------------- ---- // Function Name: GF_CloseQuery // Parameter Description: // Window Window Type, Name of Call Window // CloseType Integer Type, Window Close Way, Value = 0 ~ 10 / / -------------------------- ------------------------------------- / / State local variable int li_x, li_y, li_width, li_height, li_ceny, li_cenx, li_xminusy, li_wminushinteger li_gd
/ / Remove the coordinate value of the current window, large value Li_X = WINDOW.XLI_Y = WINDOW.YLI_WIDTH = WINDOW.WIDTHLI_HEIGHT = WINDOW.HEIGHT
/ / Set the animation effect before the form is closed // is to see which value changes - X, Y, H, Wchoose Case CloseType Case 0 // CloseType = 0, from bottom to top gradually disappear for Li_GD = li_height to 0 step -1 window.height = li_gd window.show () Next Case 1 // CloseType = 1, from top to bottom gradually disappear for Li_GD = li_y to li_height li_y step 1 window.y = li_gd window.height = li_height LI_Y - LI_GD WINDOW.SHOW () Next Case 2 // ClosType = 2, from right to left gradually disappear for Li_GD = li_width to 0 step -1 window.width = li_gd next case 3 // closetype = 3 Gradually disappear for Li_GD = li_x to li_x li_width step 1 window.x = li_gd window.width = li_x li_width - li_gd window.show () Next case 4 // clostype = 4, from the up and down intermediate squeezing gradually disappear LI_cenyy = LI_Y Li_HEIGHT / 2 for Li_GD = li_y to li_ceny step 1 window.y = li_gd window.height = li_height - 2 * (li_gd - li_y) Next Case 5 // CloseType = 5, from left and right squeezing gradually disappear Li_CENX = LI_X Li_Width / 2 for Li_GD = li_x to li_cenx step 1 window.x = li_gd window.width = li_width - 2 * (li_gd - li_x) Next Case 6 // CloseType = 6, from above-> for li_gd = li_y to li_height li_y step 1 window.y = li_gd window.height = li_height li_y - li_gd if window.x
li_height to 0 step -1 window.height = li_gd if window.width> 0 then window.width = li_width - (li_height - li_gd) else window.width = 0 end if next window.x = li_x window.y = li_y window. Width = 0 window.height = 0 window.show () case 8 // closetype = 8, from the upper right -> for Li_GD = li_y to li_height Li_Y Step 1 window.y = li_gd window.Height = li_height li_y - li_gd if window.width> 0 then window.width = li_width - (li_gd - li_y) else window.width = 0 end if next window.x = li_x window.y = li_height li_y window.width = 0 window.height = 0 window .show () case 9 // closetype = 9, from the upper left -> upper right for Li_GD = li_x to li_x li_width step 1 window.x = li_gd window.width = li_width li_x -li_gd if window.height> 0 THEN WINDOW. HEIGHT = li_height - (li_gd - li_x) Else window.Height = 0 end if next window.x = li_x li_width window.y = li_y window.width = 0 window.height = 0 window.show () case 10 // cloSetype = 10, from four sides to the middle li_ceny = li_ y li_height / 2 li_cenx = li_x li_width / 2 for li_gd = li_y to li_ceny step 1 window.y = li_gd window.height = li_height - 2 * (li_gd - li_y) if window.x