Guidance
指路人
g.yi.org
Software / Reginald / Examples / showpic.rex

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
/*
GUIBEGIN
WINDOW , 0, 0, 400, 200, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , Picture Viewer
	FONT 8, 400, MS Shell Dlg
	MENU
DEND

MENU
	HEADING File
		ITEM Load picture..., PICTURE
	<
DEND
GUIEND
*/

LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1

/* FUNCDEF some OS functions we need for handling a PAINT event */
paintstruct = "32u, 32u, 32, 32, 32, 32, 32u, 32u, char[32]"
FUNCDEF("BeginPaint", "32u, void, struct PAINTSTRUCT stor", "user32")
FUNCDEF("EndPaint", "32, void, struct PAINTSTRUCT", "user32")

guicreatewindow('NORMAL')

again:
DO FOREVER
	guigetmsg()
	CATCH SYNTAX
			CONDITION('M')
			SIGNAL again
	CATCH HALT
	FINALLY
		guidestroywindow()

		/* Free any PicObject we got */
		DROP picobject
END
RETURN

/* Called when the "Load picture..." menu item is selected. */
picture:
	/* Get the picture filename */
	fn = ''
	err = guifile('FN', , 'This is the title')
	IF err == '' THEN DO

		/* Free any PicObject we previously got */
		DROP picobject

		/* Load the new PicObject */
		guipicture("PicObject", fn)

		/* Redraw the window */
		guirefresh(, 1)

	END
	RETURN

/* Called when the window needs to be redrawn. */
wm_paint:

	/* Erase the background and get a device context */
	hdc = beginpaint(guiwindow, ps)

	DO

		/* Draw the picture object at an XY position of (0, 0) */
		IF EXISTS("PicObject") THEN guipicture("PicObject", hdc, 0, 0)

		FINALLY
			/* End paint */
			endpaint(guiwindow, ps)
	END

	/* Don't let Rexx Gui process this event. */
	RETURN ""
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sun 2017-11-19  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-07-16 20:45:33