Another IUP demo.
#define IUP_TITLE "TITLE"
%IUP_CLOSE = -3
%IUP_ERROR = 1
enum { IUP_DRAW_FILL, IUP_DRAW_STROKE, IUP_DRAW_STROKE_DASH }
typedef struct Ihandle_ {}
Ihandle_ Ihandle
typedef int (*Icallback)(Ihandle*)
typedef struct _IdrawCanvas {}
_IdrawCanvas IdrawCanvas
extern Lib"iup.dll" 'cdecl
! IupOpen (sys argc,argv) as sys
! IupCreate (string cname) as sys
! IupSetAttributes (sys ih,string strz) as sys
! IupAppend (sys ih, child) as sys
! IupRefresh (sys ih)
! IupSetCallback (sys ih,string sname, sys func) as sys
! IupShow (sys ih) as sys
! IupShowXY (Ihandle *ih, sys x, sys y) as sys
! IupSetFocus (sys ih) as sys
! IupRecordInput (string *filename, sys mode) as sys
! IupPlayInput (string *filename) as sys
! IupMainLoop () as sys
! IupImageLibOpen () as sys
! IupLoopStep () as sys
! IupLoopStepWait () as sys
! IupMainLoopLevel () as sys
! IupClose () as sys
! IupFlush () as sys
! IupExitLoop () as sys
! IupUpdate (Ihandle *ih)
! IupUpdateChildren (Ihandle *ih)
! IupRedraw (Ihandle *ih, sys children)
! IupRefresh (Ihandle *ih)
! IupRefreshChildren (Ihandle *ih)
! IupMapFont (string *iupfont) as string
! IupUnMapFont (string *driverfont) as string
! IupHelp (string url) as sys
! IupLoad (string *filename) as string
! IupLoadBuffer (string *buffer) as string
! IupVersion () as string
! IupVersionDate () as string
! IupVersionNumber () as sys
! IupSetLanguage (string *lng)
! IupGetLanguage () as string
! iupDrawCreateCanvas (Ihandle *ih) as sys
! iupDrawKillCanvas (sys *dc)
! iupDrawFlush (sys *dc)
! iupDrawUpdateSize (sys *dc)
! iupDrawGetSize (sys *dc, *w, *h)
! iupDrawLine (sys *dc, x1, y1, x2, y2, byte r, g, b, sys style)
! iupDrawRectangle (sys *dc, x1, y1, x2, y2, byte r, g, b, sys style)
! iupDrawArc (sys *dc, x1, y1, x2, y2, double a1, a2, byte r, g, b, sys style)
! iupDrawPolygon (sys *dc, *points, count, byte r, g, b, sys style)
! iupDrawText (sys *dc, char *text, sys len, x, y, byte r, g, b, char *font)
! iupDrawImage (sys *dc, char *name, sys make_inactive, x, y, *img_w, *img_h)
! iupDrawSetClipRect (sys *dc, x1, y1, x2, y2)
! iupDrawResetClip (sys *dc)
! iupDrawRectangleInvert (sys *dc, x1, y1, x2, y2)
! iupDrawParentBackground (sys *dc)
end extern
'variables
sys canvas, width, height,w=128
'mainsetting
IupOpen(0,0)
win=iupCreate "dialog"
IupSetAttributes win,"TITLE= NATURAL-SCIENCE, SIZE=320x240"
iupShow win
canvas=IupDrawCreateCanvas *win
iupDrawGetSize *canvas, *width, *height
iupDrawRectangle *canvas, 0, 0, 640, 480, 255, 255, 255, 0
iupDrawRectangle *canvas, 10, 10, 40, 40, 255, 0, 0, 0
iupDrawRectangle *canvas, 50, 10, 90, 40, 0,0,0, 1
iupDrawRectangle *canvas, 100,10, 140,40, 255,0,255, 2
iupDrawLine *canvas, 0, 100, &width, 100, 0,255,200, 2
iupDrawText *canvas, "HUHU", 4, 50,50, 0,0,0, "arial"
iupDrawImage *canvas, "alarm1.bmp",1,120,120, &w, &w
iupDrawFlush *canvas
iupMainLoop
iupDrawKillCanvas *canvas
iupClose
X