Commit 7e5709f0 authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

Assorted fixes

parent 4f23f9cb
......@@ -41,7 +41,6 @@ Global
Path: {Project}\BatchBuild
Path: {Application}\Directory
Path: {Application}\ArgEnvWindows
Path: {Application}\SetReturnCode
Path: {Project}\Pm
Path: {Project}\Util
Path: {Project}\Win
......
......@@ -12,10 +12,6 @@ import StrictList, ioutil
import EdActionType
import Platform
/*2.0
returnKey :== enterKey // temp hack for OIO20+uniqueness
0.2*/
//--
/*
helpKey :== HelpKey
......@@ -354,7 +350,7 @@ where
buttonsControl
= ButtonControl "Open..." [ControlPos (Left, zero), ControlFunction openkm]
:+: ButtonControl "Save..." [ControlFunction savekm]
:+: ButtonControl "Bind" [ControlFunction bindKey]
:+: ButtonControl "Bind" [ControlFunction bindKey]
:+: ButtonControl "Remove binding" [ ControlFunction removeBinding ]
:+: ButtonControl "Cancel" [ ControlFunction (noLS (closeWindow dialogId)) ]
:+: ButtonControl "Ok" [ ControlId okId
......@@ -470,7 +466,7 @@ where
// removeBinding removes the selected key bindings
removeBinding :: (KeyMappingDialogState, PSt *l) -> (KeyMappingDialogState, PSt *l)
removeBinding :: (u:KeyMappingDialogState, PSt *l) -> (u:KeyMappingDialogState, PSt *l)
removeBinding (dialogState=:{ keyMapping}, pstate)
# (wstate, pstate) = accPIO (getWindow dialogId) pstate
| isNothing wstate = (dialogState,pstate)
......@@ -500,7 +496,7 @@ where
// bindKey adds a binding to the key mapping table. It binds the
// currently selected action to the selected key (including modifiers).
bindKey :: (KeyMappingDialogState, PSt *l) -> (KeyMappingDialogState, PSt *l)
bindKey :: (u:KeyMappingDialogState, PSt *l) -> (u:KeyMappingDialogState, PSt *l)
bindKey (dialogState=:{ keyMapping}, pstate)
# (wstate, pstate) = accPIO (getWindow dialogId) pstate
| isNothing wstate = (dialogState,pstate)
......
......@@ -92,7 +92,7 @@ where
2 // silly DOS
1 // mac
newline
=: PlatformDependant
= PlatformDependant
"\xd\xa" // windows
"\xd" // mac
......
......@@ -15,7 +15,8 @@ from StdString import String
from StdPSt import PSt, IOSt
import EdMonad
editWindowLook :: EditState -> (EditState, SelectState !UpdateState -> (!*Picture -> *Picture))
//editWindowLook :: EditState -> (EditState, SelectState !UpdateState -> (!*Picture -> *Picture))
editWindowLook :: EditState SelectState !UpdateState -> (!*Picture -> *Picture)
// editWindowLook: defines the look of the editor window. This function
// is used to handle update events.
......
......@@ -15,12 +15,16 @@ trace_n _ f :== f
// editWindowLook: updating the affected areas is done by updating
// each of the rectangles.
editWindowLook :: EditState -> (EditState, SelectState !UpdateState -> (!*Picture -> *Picture))
editWindowLook editState
= (editState`,editWindowLook`)
//editWindowLook :: EditState -> (EditState, SelectState !UpdateState -> (!*Picture -> *Picture))
editWindowLook :: EditState SelectState !UpdateState -> (!*Picture -> *Picture)
editWindowLook editState selectState updateState=:{ updArea, newFrame, oldFrame }
= editWindowLook`
//editWindowLook editState
// = (editState`,editWindowLook`)
where
// editWindowLook` :: !*Picture -> *Picture
editWindowLook` selectState updateState=:{ updArea, newFrame, oldFrame } picture
editWindowLook` picture
// editWindowLook` selectState updateState=:{ updArea, newFrame, oldFrame } picture
// # picture = traceUpdate updArea picture
# updArea = cleanUpdate updArea // hack around object i/o bug...
// # picture = traceUpdate updArea picture
......
......@@ -7,7 +7,7 @@ definition module EdMessage
from StdId import Id,RId,Ids
from StdPSt import PSt, IOSt
from StdReceiver import Receiver2, R2Id, Receiver2Function, ReceiverAttribute
from EdMonad import EditState, EditMonad
from EdMonad import EditState, EditMonad, StateM
:: EditId
:: Message
......
......@@ -49,7 +49,7 @@ appEditState :: !EditId !.(EditAction *l .r) !*(PSt *l) -> *(.r,*PSt *l)
appEditState editId monad pState
# (editState, pState) = getEditState editId pState
# (x, (editState, pState)) = monad (editState, pState)
# pState = setEditState editId editState pState
#! pState = setEditState editId editState pState
= (x, pState)
// getEditState
......
......@@ -382,10 +382,11 @@ updateLook :: EditMonad (PSt *l) nothing
updateLook
= getWindowId >>>= \windowId ->
getEditState >>>= \editState ->
let
(editState,editLook) = editWindowLook editState
in
appEnv (appPIO (setWindowLook windowId False (True,editLook)))
// let
// (editState,editLook) = editWindowLook editState
// in
// appEnv (appPIO (setWindowLook windowId False (True,editLook)))
appEnv (appPIO (setWindowLook windowId False (True,editWindowLook editState)))
// compute some properties of a font
......
......@@ -156,7 +156,7 @@ where
| s.[i] == x = True
= isStringMember x (dec i) s
funnyChars =: "~@#$%^?!+-*<>\\/|&=:."
funnyChars = "~@#$%^?!+-*<>\\/|&=:."
funnySize = 20
dL :: !.Int !.Int !*Picture -> !(!.CommentLevel,!*Picture)
......
......@@ -24,7 +24,8 @@ openEditWindow uId title pathName text font tabs syncols windowId atts ps
// compute the view domain of the visual text
(viewDomain, (editState, ps)) = computeViewDomain (editState, ps)
// setup the window attributes
(editState,editLook) = editWindowLook editState
// (editState,editLook) = editWindowLook editState
editLook = editWindowLook editState
windowAttrs = atts ++ // in this order so that new attributes override default atts
[ WindowViewSize { w = 800, h = fontInfo.FontInfo.lineHeight * 40 }
, WindowHMargin 0 0
......
......@@ -25,7 +25,7 @@ where
| c == x = True
= isStringMember x (dec i) s
funnyChars =: "~@#$%^?!+-*<>\\/|&=:."
funnyChars = "~@#$%^?!+-*<>\\/|&=:."
funnySize = 20 // =: size funnyChars?
line_size = size line
......
......@@ -3,9 +3,9 @@ definition module EdClient
import EdMonad, EdState, EdCommon
from EdMessage import EditAction
sendToActiveWindow :: .(*(EditState,*PSt *b) -> *(.c,*(.EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
sendToActiveWindow :: .(*(EditState,*PSt *b) -> *(.c,*(EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
message :: !.Id !.(*(EditState,*PSt *b) -> *(.c,*(.EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b;
message :: !Id !.(*(EditState,*PSt *b) -> *(.c,*(EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b;
// Messages
......
......@@ -10,7 +10,7 @@ import EdCommon
import ExtNotice, StrictList
//sendToActiveWindow :: (EditAction .l .p a) (EditorState,(PSt .l)) -> (Maybe a, (EditorState,(PSt .l)))
sendToActiveWindow :: .(*(EditState,*PSt *b) -> *(.c,*(.EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
sendToActiveWindow :: .(*(EditState,*PSt *b) -> *(.c,*(EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
sendToActiveWindow editAction pState
# (maybeId, pState) = accPIO getActiveWindow pState
| isNothing maybeId
......@@ -23,7 +23,7 @@ sendToActiveWindow editAction pState
= message windowId editAction pState
//message :: Id (EditAction .l .p a) (EditorState,(PSt .l)) -> (Maybe a, (EditorState,(PSt .l)))
message :: !.Id !.(*(EditState,*PSt *b) -> *(.c,*(.EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b;
message :: !Id !.(*(EditState,*PSt *b) -> *(.c,*(EditState,*PSt *b))) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b;
message windowId monad pState
# (editorState, pState) = getEditorState pState
# (maybeEditId, editorState) = findReceiver windowId editorState
......
......@@ -2,14 +2,14 @@ definition module EdCommon
from StdPSt import PSt, IOSt
from EdState import Editor, EditorState
from EdMonad import EditMonad, EditState
from EdMonad import EditMonad, StateM, EditState
from EdSelection import Selection, Position, ColumnNr, LineNr
:: *PLocState :== MyEditorState
:: *MyEditorState = MES EditorState
:: MyEditorState = MES EditorState
instance Editor MyEditorState
mRemoveSelection :: EditMonad (PSt *MyEditorState) nothing
mChangeSelectionTo :: Selection -> EditMonad (PSt *MyEditorState) nothing
controlDoubleClick :: !.Bool !.Position -> .(!*(.EditState,*PSt PLocState) -> *(a,*(EditState,*PSt PLocState)));
controlDoubleClick :: !.Bool !.Position -> .(!*(EditState,*PSt PLocState) -> *(a,*(EditState,*PSt PLocState)));
......@@ -73,6 +73,6 @@ where
]))
*/
controlDoubleClick :: !.Bool !.Position -> .(!*(.EditState,*PSt PLocState) -> *(a,*(EditState,*PSt PLocState)));
controlDoubleClick :: !.Bool !.Position -> .(!*(EditState,*PSt PLocState) -> *(a,*(EditState,*PSt PLocState)));
controlDoubleClick shiftDown position =
skip
\ No newline at end of file
......@@ -8,7 +8,7 @@ definition module Help
//
// **************************************************************************************************
from StdString import String
import StdString
from StdPSt import PSt, IOSt
showAbout :: String String (PSt .l) -> PSt .l
......
......@@ -798,7 +798,7 @@ msgPrint printSetup
myPrintText :: !PrintSetup !String !Text !FontInfo !Bool !*env -> (PrintSetup,*env) | PrintEnvironments env
myPrintText printsetup path text info linenos env
# fdef = getFontDef info.thefont
((_,printsetup),env) = printText2 path "page " True RightJustify
((_,printsetup),env) = printText2 path "page " True LeftJustify//RightJustify
fdef
info.tabSize
textstream
......
......@@ -1033,6 +1033,6 @@ where
wAbort message world
# stderr = fwrites message stderr
// # (_,world) = fclose stderr world
# world = set_return_code /* _world */ (-1) world
# world = set_return_code_world (-1) world
= world
......@@ -485,7 +485,7 @@ setPrefix s ps = appPLoc (\p=:{prefix}->{p & prefix = removeDup [s:prefix]}) ps
//-- batch build support
from StdProcess import closeProcess
from StdPStClass import FileSystem
import logfile
import logfile, set_return_code
getInteract :: !*(PSt *General) -> (!Bool,!*PSt *General)
getInteract ps = accPLoc (\p=:{interact}->(interact,p)) ps
......@@ -507,7 +507,7 @@ abortLog flag message ps
# (ok,ps) = closeLogfile lf ps
// | not ok ...
# ps = case flag of
True -> ps // FIXME set_return_code_pst (-1) ps
True -> set_return_code_pst (-1) ps
_ -> ps
= closeProcess ps
......
......@@ -4,7 +4,7 @@ import StdArray, StdFunc, StdMisc, StdTuple
import StdFileSelect,StdPStClass,StdWindow
import PmTypes, PmProject, PmPath, UtilStrictLists
import tabcontrol, ExtListBox, ioutil, IdeState
import ExtNotice
import ExtNotice, UtilIO
import Platform
//import dodebug
......
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