$include "windowssdk.inc"
$include "Commctrl.inc"
WINDOW main
int x,y,w,h
OPENWINDOW main,0,0,400,300,@SIZE|@MINBOX|@MAXBOX|@CAPTION|@SYSMENU,0,"Form1",&main_handler
CONTROL main,@BUTTON,"Button 1",0,25,60,25,@CTLBTNBITMAP,10
CONTROL main,@RGNBUTTON,"RgnBtn 1",100,25,60,25,0,20
SETWINDOWCOLOR main, RGB(255,255,255)
sETCONTROLTEXT main,10,GETSTARTPATH() + "bug.bmp"
int RGNBUTTON_hrgn = RGNFROMBITMAP(GETSTARTPATH() + "rgn_bmp2.bmp")
SETBUTTONRGN main,20,COPYRGN(RGNBUTTON_hrgn)
SETBUTTONBITMAPS main,20,LOADIMAGE(GETSTARTPATH() + "button_bmp_hot2.bmp",@IMGBITMAP),0,0
SETHTCOLOR main,20,RGB(128,128,128)
SETBUTTONBORDER main,20,2
CENTERWINDOW main
MODIFYEXSTYLE main, @TOPMOST,0, 10
starttimer main, 500
x=0:y=25:w=60:h=25
WAITUNTIL ISWINDOWCLOSED(main)
end
SUB main_handler(),INT
SELECT @MESSAGE
case @IDTIMER
x++
setsize main,x+1,y,w,h,10
InvalidateRect(getcontrolhandle(main,10), NULL, FALSE)
case @IDCLOSEWINDOW
CLOSEWINDOW main
ENDSELECT
RETURN FALSE
ENDSUB
$include "windowssdk.inc"
$include "Commctrl.inc"
CONST main_BUTTON1 = 0x101
CONST main_RGNBUTTON1 = 0x102
WINDOW main
int x,y,w,h
OpenMainWindow()
'openconsole
ProcessAll()
END
SUB OpenMainWindow()
OPENWINDOW main,0,0,400,300,@SIZE|@MINBOX|@MAXBOX|@CAPTION|@SYSMENU,0,"Form1",&main_handler
CONTROL main,@BUTTON,"Button 1",0,25,60,25,@CTLBTNBITMAP,main_BUTTON1
CONTROL main,@RGNBUTTON,"RgnBtn 1",100,25,60,25,0,main_RGNBUTTON1
SETWINDOWCOLOR main, RGB(255,255,255)
sETCONTROLTEXT main,main_BUTTON1,GETSTARTPATH() + "bug.bmp"
int main_RGNBUTTON1_hrgn = RGNFROMBITMAP(GETSTARTPATH() + "rgn_bmp2.bmp")
SETBUTTONRGN main,main_RGNBUTTON1,COPYRGN(main_RGNBUTTON1_hrgn)
SETBUTTONBITMAPS main,main_RGNBUTTON1,LOADIMAGE(GETSTARTPATH() + "button_bmp_hot2.bmp",@IMGBITMAP),0,0
SETHTCOLOR main,main_RGNBUTTON1,RGB(128,128,128)
SETBUTTONBORDER main,main_RGNBUTTON1,2
CENTERWINDOW main
MODIFYEXSTYLE main, @TOPMOST,0, main_BUTTON1
starttimer main, 500
x=0:y=25:w=60:h=25
ONMESSAGE main,@IDCLOSEWINDOW,&OnMainClose
ENDSUB
SUB main_handler(),INT
SELECT @MESSAGE
case @IDTIMER
x++
setsize main,x+1,y,w,h,main_BUTTON1
InvalidateRect(getcontrolhandle(main,main_BUTTON1), NULL, FALSE)
ENDSELECT
RETURN FALSE
ENDSUB
SUB ProcessAll()
WAITUNTIL ISWINDOWCLOSED(main)
ENDSUB
SUB OnMainClose(),INT
CLOSEWINDOW main
RETURN FALSE
ENDSUB
bmp.zip$INCLUDE "windowssdk.inc"
WINDOW win
OpenWindow win,0,0,400,425,@MINBOX|@MAXBOX|@SIZE|@CAPTION|@SYSMENU,0,"Test",&win_handler
DrawArc(win, 110,110, 95, 90,0, 1, rgb(255,0,0), TRUE)
DrawArc(win, 110,110, 100, 90,90, 1, rgb(255,0,0))
DrawArc(win, 110,110, 95, 180,-90, 1, rgb(255,0,0))
WAITUNTIL ISWINDOWCLOSED(win)
END
SUB win_handler(), INT
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW win
/* Initialize any controls here */
CASE @IDCLOSEWINDOW
CLOSEWINDOW win
ENDSELECT
RETURN 0
END SUB
sub DrawArc(window w1, int cx, int cy, int radius, float start_angle, float sweep_angle, int arc_width, uint arc_color, Opt int MoveToStart = FALSE, opt uint backcolor = rgb(255,255,255)), int
int hdc = gethdc(w1) ' get the hdc of the window
if MoveToStart
MoveToEx(hdc, cx,cy, 0) 'move point to center of arc
SelectObject(hdc, GetStockObject(NULL_PEN)) 'this draws a line (transparent) from center to starting point of the arc))
AngleArc(hdc, cx,cy, radius, start_angle, 0) 'move to starting point of arc
endif
SelectObject(hdc, CreatePen(PS_SOLID,arc_width,arc_color)) 'set the pen color
AngleArc(hdc, cx,cy, radius, start_angle, sweep_angle) 'draws the arc
releasehdc w1, hdc 'release the hdc
return 0
endsub
circle w1, 650,350,200, RGB(255,0,0), RGB(219,219,219) 'Radius 200
circle w1, 650,350,190, RGB(255,0,0), RGB(0,0,0) 'Radius 190 (smaller)