idehelp.icl 1.08 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
3
4
5
implementation module idehelp

import StdFunc, StdMisc
import StdMenu, StdPStClass, StdSystem
import ExtNotice
Diederik van Arkel's avatar
Diederik van Arkel committed
6
import ioutil, UtilIO, IdePlatform
Diederik van Arkel's avatar
Diederik van Arkel committed
7
8
9

//-- export

10
initHelpMenu :: !Id !*(PSt .b) -> *PSt .b
Diederik van Arkel's avatar
Diederik van Arkel committed
11
initHelpMenu wId ps
12
13
14
	# (mId,ps)	= openId ps
	# (_,ps)	= openMenu Void (helpMenu wId mId) ps
	# ps		= helpItems wId mId ps
Diederik van Arkel's avatar
Diederik van Arkel committed
15
16
17
18
	= ps

//-- local

19
helpMenu wId mId
Diederik van Arkel's avatar
Diederik van Arkel committed
20
21
	= Menu "&Help"
		(	MenuItem "&About..." [MenuFunction (noLS (about wId))]
22
		:+:	SubMenu "&Help" NilLS [MenuId mId]
Diederik van Arkel's avatar
Diederik van Arkel committed
23
24
25
26
27
28
		)
		[
		]

about wId ps
	# (wId,ps)	= openId ps
29
	# (bmap,ps)	= getAboutBitmap ps
Diederik van Arkel's avatar
Diederik van Arkel committed
30
	| isNothing bmap
31
		= openNotice (Notice ["AboutIDE bitmap unavailable."] (NoticeButton "OK" id) []) ps
Diederik van Arkel's avatar
Diederik van Arkel committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	# bmap		= fromJust bmap
	# (cId,ps)	= openId ps
	# (_,ps)	= openModalDialog dloc (ddef bmap cId wId) ps
	= ps
where
	dloc = 0
	ddef bmap cId wId
		# bitmapSize = 	getBitmapSize bmap
		= Dialog "About the Clean IDE"
						( CustomControl bitmapSize bitmapLook [ControlId cId])
						[ WindowClose (noLS (closeWindow wId))
						, WindowId wId
						, WindowHMargin 0 0
						, WindowVMargin 0 0
						]
Diederik van Arkel's avatar
Diederik van Arkel committed
47
	where
48
49
		bitmapLook _ _ p
			= draw bmap p