Commit f3bdef18 authored by Diederik van Arkel's avatar Diederik van Arkel

use resources for bitmap and version;

parent 1a51e713
......@@ -30,5 +30,5 @@ srchBM :== "srchBM.bmp"
updtBM :== "updtBM.bmp"
urunBM :== "urunBM.bmp"
EXE_VERSION :== ""
EXE_VERSION :: String
helpItems :: !Id !Id !*(PSt .a) -> *PSt .a
......@@ -47,9 +47,15 @@ DefmodIcon :== 32515
CleanIcon :== 32512
AbcmodIcon :== 32514
import osbitmap
getAboutBitmap :: !*env -> (!Maybe Bitmap, !*env) | FileEnv env
getAboutBitmap env
= accFiles (openBitmap AboutBitmap) env
// = accFiles (openBitmap AboutBitmap) env
# (ok,osbm,tb) = osOpenBitmap 128 OSNewToolbox
| ok
= (Just (toBitmap osbm), env)
= (Nothing,env)
AboutBitmap :== applicationpath "bitmaps:aboutIDE.pict"
......@@ -65,3 +71,31 @@ urunBM :== "urunBM.bmp"
helpItems :: !Id !Id !*(PSt .a) -> *PSt .a
helpItems wId mId ps
= ps
//-- Get EXE_VERSION from 'vers' resource
import pointer, resources, structure
import StdTuple
EXE_VERSION :: String
EXE_VERSION
=: fst (read_vers_resource 42)
read_vers_resource :: *Int -> (!String, !*Int);
read_vers_resource t
# (handle,t) = Get1Resource "vers" 1 t
| handle==0
= ("no version resource", t);
# (ptr, t) = DereferenceHandle handle t;
# (size, t) = LoadByte (ptr+6) t;
# (vers, _, t) = LoadString 0 size (createArray size '@') (ptr+7) t;
= (vers, t);
LoadString :: Int Int *{#Char} Ptr *Toolbox -> (!*{#Char}, Ptr, !*Toolbox);
LoadString n size string ptr t
| n == size
= (string, ptr, t);
# (char, t)
= LoadByte (ptr+n) t;
= LoadString (n+1) size {string & [n] = toChar char} ptr t;
Markdown is supported
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