How to make special shape data windows or buttons in PB
Author: LZP_LRP
Responsible Editor: LZP_LRP
The following is all source code, interested friends can import the source code of the entire window to try it in PBL.
$ PBEXPORTHEADER $ W_BUTTON.SRW
Forward
Global Type W_Button from Window
End Type
TYPE CB_11 from CommandButton within w_button
End Type
TYPE CB_10 from CommandButton Within W_Button
End Type
TYPE EM_3 from EditMask Withnin W_Button
End Type
Type EM_2 from EditMask Withnin W_Button
End Type
TYPE EM_1 from EditMask Withnin W_Button
End Type
TYPE CB_9 from CommandButton Within W_Button
End Type
Type CB_8 from CommandButton within w_button
End Type
TYPE CB_7 from CommandButton Within W_Button
End Type
TYPE CB_6 from CommandButton within w_button
End Type
TYPE CB_5 from CommandButton Within W_Button
End Type
TYPE CB_4 from CommandButton within W_Button
End Type
TYPE CB_3 from CommandButton Within W_Button
End Type
TYPE CB_2 from CommandButton Within W_Button
End Type
TYPE CB_1 from CommandButton within w_button
End Type
TYPE ST_1 from StaticText Withnin W_Button
End Type
Type ws_position from structure within w_button
End Type
End forward
Type WS_Position from Structure
Long XPOS
Long Ypos
End Type
Global Type W_Button from Window
Integer width = 2400
Integer height = 1800
Boolean Titlebar = TRUE
String Title = "Special Shape Data Window Demo"
Boolean ControlMenu = True
Boolean minBox = true
Boolean maxbox = true
Long backcolor = 17725690
String icon = "appicon!"
Boolean center = true
CB_11 CB_11
CB_10 CB_10
EM_3 EM_3
EM_2 EM_2
EM_1 EM_1
CB_9 CB_9
CB_8 CB_8
CB_7 CB_7
CB_6 CB_6
CB_5 CB_5
CB_4 CB_4
CB_3 CB_3
CB_2 CB_2
CB_1 CB_1
ST_1 ST_1
End Type
Global W_Button W_Button
Type Prototypes
FUNCTION 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 NCONEMODE) 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 protoypes
Forward Prototypes
Public Function Integer of_set_oval (CommandButton ACB_Button)
Public Function Integer Wf_set_color ()
End protoypes
Public Function Integer of_set_oval (CommandButton ACB_Button); //
///
// Test data (window polygon) //
///
//
Long LL_X1, LL_X2, LL_X3
Long ll_y1, ll_y2, ll_y3
Long Ll_Handle
LL_X1 = 1
LL_Y1 = 1
LL_X2 = UnitStopixels (ACB_Button.width, XUnitStopixels!)
LL_Y2 = UnitStopixels (acb_button.height, yunitstopixels!)
LL_X3 = 64
LL_Y3 = 64
LL_Handle = CreateroundRectrGN (ll_x1, ll_y1, ll_x2, ll_y2, ll_x3, ll_y3)
SetwindowRgn (Handle (ACB_BUTTON), LL_HANDLE, TRUE
Return 1
END FUNCTION
Public Function Integer Wf_set_color (); long ll_red, ll_green, ll_blue
Long Ll_Data
LL_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_DATA
EM_1.BACKCOLOR = LL_DATA
EM_2.BACKCOLOR = LL_DATA
EM_3.BACKCOLOR = LL_DATA
ST_1.BackColor = LL_DATA
Return 1
END FUNCTION
ON w_button.create
this.cb_11 = crete CB_11
this.cb_10 = crete CB_10
THIS.EM_3 = CREATE EM_3
THIS.EM_2 = CREATE EM_2
THIS.EM_1 = CREATE EM_1
this.cb_9 = CREATE CB_9
this.cb_8 = CREATE CB_8
THIS.CB_7 = CREATE CB_7
this.cb_6 = crete CB_6
this.cb_5 = CREATE CB_5
this.cb_4 = crete CB_4
this.cb_3 = crete CB_3
THIS.CB_2 = CREATE CB_2
this.cb_1 = crete CB_1
this.st_1 = CREATE ST_1
this.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 on
ON w_button.destroy
DESTROY (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 on
Event Mousemove; Send (Handle (THIS), 274, 61458, 0)
End Event
TYPE CB_11 from CommandButton within w_button
Integer x = 1216
Integer y = 1096
Integer width = 562
Integer height = 148
Integer Taborder = 70
Integer Textsize = -12
Integer Weight = 700
Fontcharset Fontcharset = GB2312Charset!
Fontpitch fontpitch = variable!
String FacenaMe = "Song"
String text = "Semi-circular lace"
End Type
Event clicked; //// //
// Test data (window polygon) //
///
//
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 / 2
LWS_POINTAPI [1]. Ypos = LL_YPOS - LL_FLOWER / 2
LWS_POINTAPI [2] .XPOS = LL_WIDTH LL_FLOWER / 2
LWS_POINTAPI [2]. Ypos = LL_YPOS - LL_FLOWER / 2
LWS_POINTAPI [3] .XPOS = LL_WIDTH LL_FLOWER / 2
LWS_POINTAPI [3]. ypos = ll_height ll_flower / 2
LWS_POINTAPI [4] .XPOS = LL_XPOS LL_FLOWER - LL_FLOWER / 2
LWS_POINTAPI [4]. Ypos = ll_height ll_flower / 2
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 = CreatellipticRGN (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 = CreatellipticRGN (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 = CreatellipticRGN (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 = CreatellipticRGN (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_10 from CommandButton Within W_Button
Integer x = 1216
Integer y = 1096
Integer width = 562
Integer height = 148
Integer Taborder = 60
Integer Textsize = -12
Integer Weight = 700
Fontcharset Fontcharset = GB2312Charset!
Fontpitch fontpitch = variable!
String FacenaMe = "Song"
String text = "Close Window"
End Type
Event Clicked; Close (PARENT)
End Event
TYPE EM_3 from EditMask Withnin W_Button
Event Editchanged PBM_ENCHANGE
Integer x = 1289
INTEGER Y = 104
Integer width = 251
Integer height = 92
Integer Taborder = 60
Integer Textsize = -9
Integer weight = 400
Fontcharset Fontcharset = GB2312Charset!
Fontpitch fontpitch = variable!
String FacenaMe = "Song"
Long TextColor = 33554432
Long backcolor = 17725690
String text = "14"
Alignment Alignment = Right! BorderStyle Border = Stylelowered!
String mask = "###"
Boolean Autoskip = TRUE
Boolean spin = true
Double increment = 5
String minmax = "0 ~~ 255"
End Type
Event editchanged; wf_set_color ()
End Event
Type EM_2 from EditMask Withnin W_Button
Event Editchanged PBM_ENCHANGE
Integer x = 1024
INTEGER Y = 104
Integer width = 251
Integer height = 92
Integer Taborder = 60
Integer Textsize = -9
Integer weight = 400
Fontcharset Fontcharset = GB2312Charset!
Fontpitch fontpitch = variable!
String FacenaMe = "Song"
Long TextColor = 33554432
Long backcolor = 17725690
String text = "120"
Alignment Alignment = Right!
BorderStyle BorderStyle = Stylelowered!
String mask = "###"
Boolean Autoskip = TRUE
Boolean spin = true
Double increment = 5
String minmax = "0 ~~ 255"
End Type
Event editchanged; wf_set_color ()
End Event
TYPE EM_1 from EditMask Withnin W_Button
Event Editchanged PBM_ENCHANGE
Integer x = 759
INTEGER Y = 104
Integer width = 251
Integer height = 92
Integer Taborder = 60
Integer Textsize = -9
Integer weight = 400
Fontcharset Fontcharset = GB2312Charset!
Fontpitch fontpitch = variable!
String FacenaMe = "Song"
Long TextColor = 33554432
Long backcolor = 17725690
String text = "250"
Alignment Alignment = Right!
BorderStyle BorderStyle = Stylelowered!
String mask = "###"
Boolean Autoskip = TRUE
Boolean spin = true
Double increment = 5
String minmax = "0 ~~ 255"
End Type
Event Editchanged; WF_SET_COLOR () end Event
TYPE CB_9 from CommandButton Within W_Button
Integer x = 590
Integer y = 1096
Integer width = 562
Integer height = 148
Integer Taborder = 50
Integer Textsize = -12
Integer Weight = 700
Fontcharset Fontcharset = GB2312Charset!
Fontpitch fontpitch = variable!
String FacenaMe = "Song"
String text = "Round lace"
End Type
Event Click; //
///
// Test data (window polygon) //
///
//
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 1LL_Y = LL_YPOS - LL_FLOWER
LL_X = LL_XPOS LL_FLOWER * (LL_I - 1)
LL_DATA = CreatellipticRGN (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 = CreatellipticRGN (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 = CreatellipticRGN (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 = CreatellipticRGN (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 = "Song"
String text = "round window"
End Type
Event Click; //
///
// Test data (window polygon) //
/////
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 = CreatellipticRGN (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 = "Song"
String text = "Wave lace"
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 - 5END 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)
// wherein the first parameter is an array of various vertex coordinate values of the polygon.
// The second parameter is the number of polygon, modified, with array value
// The third parameter is a fill mode 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 = "Song"
String text = "Baby Window"
End Type
Event Click; //
///
// Test data (window polygon) //
///
//
Long Ll_Handle
WS_Position LWS_POINTAPI []
// Graphics 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)
// wherein the first parameter is an array of various vertex coordinate values of the polygon.
// The second parameter is the number of polygon, modified, with array value
// The third parameter is a fill mode 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 = "Song"
String text = "Restore Window"
End Type
Event Click; //
///
// Test data (window polygon) //// //
//
Long Ll_Handle
WS_Position LWS_POINTAPI []
// Graphics 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)
// wherein the first parameter is an array of various vertex coordinate values of the polygon.
// The second parameter is the number of polygon, modified, with array value
// The third parameter is a fill mode 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 = "Song"
String text = "Elliptical window"
End Type
Event Click; //
///
// Test data (window polygon) //
///
//
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!) - 10LL_Y2 = UnitStopixels (Parent.Height, YunitStopixels!) - 10
LL_HANDLE = CreatellipticRGN (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 = "Song"
String text = "diamond window"
End Type
Event Click; //
///
// Test data (window polygon) //
///
//
Long Ll_Handle
WS_Position LWS_POINTAPI []
// Graphics 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)
// wherein the first parameter is an array of various vertex coordinate values of the polygon.
// The second parameter is the number of polygon, modified, with array value
// The third parameter is a fill mode alternate / winding
SetwindowRgn (Handle (Parent), LL_Handle, True)
Return 1
End EventType 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 = "Song"
String text = "Rounded Rectangular Button"
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 = "Song"
String text = "Rounded Rectangular Window"
End Type
Event Click; //
///
// Test data (window polygon) //
///
//
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 Withnin 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 = "Song"
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