idehelp.icl 1.7 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
48
	where
		bitmapLook _ {newFrame} p
49
50
51
52
53
54
			# p					= draw bmap p
			# (font,p)			= openDefaultFont p
			# ((ok,font`),p)	= openFont {SerifFontDef & fSize = 14} p
			# font``			= if ok font` font
			# p					= setPenFont font`` p
			# p					= drawAt {x=newFrame.corner1.x+10,y=newFrame.corner2.y-20} IDE_VERSION p
Diederik van Arkel's avatar
Diederik van Arkel committed
55
			= p
56
57
58
59
60
61
62
63

IDE_VERSION
	:==  BUILD_VERSION
	// want link(?) date/time to be automatically entered...
	+++. PLATFORM
	+++. CLEAN_VERSION
	+++. EXE_VERSION

Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
64
BUILD_VERSION	:== "v2.0 build 2003-10-17 "
65
66
67
68
69
70
71
72
73
74
75
76
77
78

PLATFORM
	= case toInt '\n' of
		13	-> "Mac "
		10	-> "Win "
		_	-> "??? "
		
CLEAN_VERSION
	# clean	= "(1.3) "

// 2.0 only...
/*
// /*
*/
John van Groningen's avatar
John van Groningen committed
79
	# clean = "(2.1) "
80
81
82
// */

	= clean