Commit 2eeb4259 authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

mac help menu;

parent a9f735f8
......@@ -7,6 +7,8 @@ import PmCleanSystem
import errwin
from IdeState import :: General
import Platform
import Directory,StdMenu,StdBool,files,StdPStClass,memory
toolIconFun :: !String !(Maybe String) !(IdFun .st) ![(ToolbarItem .st)] !*env -> (![(ToolbarItem .st)],!*env) | FileSystem env
toolIconFun bitmapname tooltip toolfun itemlist world
......@@ -70,7 +72,60 @@ urunBM :== "urunBM.bmp"
helpItems :: !Id !Id !*(PSt .a) -> *PSt .a
helpItems wId mId ps
| not onOSX
= ps
# path = applicationpath "Help"
# ((ok,path`),ps) = pd_StringToPath path ps
| not ok = ps
# ((err,dir),ps) = getDirectoryContents path` ps
| err <> NoDirError = ps
# items = map getinfo dir
= to_menu_items (path+++.{dirseparator}) items mId ps
where
getinfo {fileName,fileInfo=fi=:{pi_fileInfo=dummyname=:{isDirectory}}}
= (isDirectory,fileName)
to_menu_items path [] mId ps = ps
to_menu_items path [(is_dir,filename):rest] mId ps
| not is_dir
# item = MenuItem filename [MenuFunction (noLS (help path filename wId))]
# (err,ps) = openSubMenuElements mId 32000 Void item ps
= to_menu_items path rest mId ps
| filename == "." || filename == ".."
= to_menu_items path rest mId ps
# ((ok,path`),ps) = pd_StringToPath (path+++.filename) ps
| not ok
= to_menu_items path rest mId ps
# ((err,dir),ps) = getDirectoryContents path` ps
| err <> NoDirError
= to_menu_items path rest mId ps
# items = map getinfo dir // only need common fileinfo...
# (mId`,ps) = openId ps
# item = SubMenu filename NilLS [MenuId mId`]
# (err,ps) = openSubMenuElements mId 32000 Void item ps
# ps = to_menu_items (path+++.filename+++.{dirseparator}) items mId` ps
= to_menu_items path rest mId ps
help path file wId ps
# path = path +++. file
# (error_n,pathSpec,tb) = FSMakeFSSpec path OSNewToolbox
| error_n <> 0 = ps
# (pathRef,error_n,tb) = NewPtr 80 tb
| error_n <> 0 = ps
# (error_n,tb) = FSpMakeFSRef pathSpec pathRef tb
| error_n <> 0 = ps
# (error_n,tb) = LSOpenFSRef pathRef 0 tb
| error_n <> 0 = ps
= ps
where
FSpMakeFSRef :: !{#Char} !Int !*OSToolbox -> (!Int,!*OSToolbox)
FSpMakeFSRef _ _ _ = code {
ccall FSpMakeFSRef "sI:I:I"
}
LSOpenFSRef :: !Int !Int !*OSToolbox -> (!Int,!*OSToolbox)
LSOpenFSRef _ _ _ = code {
ccall LSOpenFSRef "II:I:I"
}
//-- Get EXE_VERSION from 'vers' resource
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment