Commit 328918cb authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur 🏘
Browse files

added configurable right margin with different background colour

parent 7e569570
...@@ -39,6 +39,7 @@ from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr ...@@ -39,6 +39,7 @@ from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr
, tabSize :: !TabSize // logical in #chars , tabSize :: !TabSize // logical in #chars
// , tabWidth :: !NewTabSize // physical in #pixels // , tabWidth :: !NewTabSize // physical in #pixels
, charWidth :: !Int // physical in #pixels , charWidth :: !Int // physical in #pixels
, marginWidth :: !Int // logical in #chars
, autoTab :: !Bool , autoTab :: !Bool
, showTabs :: !Bool , showTabs :: !Bool
, showSyntax :: !Bool , showSyntax :: !Bool
...@@ -48,6 +49,7 @@ from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr ...@@ -48,6 +49,7 @@ from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr
:: SyntaxColours = :: SyntaxColours =
{ textColour :: !Colour { textColour :: !Colour
, backgroundColour :: !Colour , backgroundColour :: !Colour
, marginColour :: !Colour
, tabColour :: !Colour , tabColour :: !Colour
, commentColour :: !Colour , commentColour :: !Colour
, stringColour :: !Colour , stringColour :: !Colour
...@@ -87,7 +89,7 @@ instance toString UndoState ...@@ -87,7 +89,7 @@ instance toString UndoState
:: EditMonad env a :== StateM *(!EditState, env) a :: EditMonad env a :== StateM *(!EditState, env) a
initEditState :: !Id !Id !String !Font !(Int,Bool,Bool,Bool,Bool) !SyntaxColours !*(PSt .l) -> (EditState , *PSt .l) initEditState :: !Id !Id !String !Font !(Int,Bool,Bool,Bool,Bool) !Int !SyntaxColours !*(PSt .l) -> (EditState , *PSt .l)
appEnv :: (.env -> .env) -> EditMonad .env nothing appEnv :: (.env -> .env) -> EditMonad .env nothing
accEnv :: (.env -> (.a, .env)) -> EditMonad .env .a accEnv :: (.env -> (.a, .env)) -> EditMonad .env .a
noResult :: !(EditMonad .env a) *(EditState, .env) -> (EditState, .env) noResult :: !(EditMonad .env a) *(EditState, .env) -> (EditState, .env)
......
...@@ -76,6 +76,7 @@ trace_n` _ s :== s ...@@ -76,6 +76,7 @@ trace_n` _ s :== s
, tabSize :: !TabSize // logical tabsize , tabSize :: !TabSize // logical tabsize
// , tabWidth :: !NewTabSize // physical tabsize // , tabWidth :: !NewTabSize // physical tabsize
, charWidth :: !Int // physical in #pixels , charWidth :: !Int // physical in #pixels
, marginWidth :: !Int // logical in #chars
, autoTab :: !Bool , autoTab :: !Bool
, showTabs :: !Bool , showTabs :: !Bool
, showSyntax :: !Bool , showSyntax :: !Bool
...@@ -85,6 +86,7 @@ trace_n` _ s :== s ...@@ -85,6 +86,7 @@ trace_n` _ s :== s
:: SyntaxColours = :: SyntaxColours =
{ textColour :: !Colour { textColour :: !Colour
, backgroundColour :: !Colour , backgroundColour :: !Colour
, marginColour :: !Colour
, tabColour :: !Colour , tabColour :: !Colour
, commentColour :: !Colour , commentColour :: !Colour
, stringColour :: !Colour , stringColour :: !Colour
...@@ -156,10 +158,10 @@ where ...@@ -156,10 +158,10 @@ where
/* EXPORTED FUNCTIONS */ /* EXPORTED FUNCTIONS */
initEditState :: !Id !Id !String !Font !(Int,Bool,Bool,Bool,Bool) !SyntaxColours !*(PSt .l) -> (EditState, *PSt .l) initEditState :: !Id !Id !String !Font !(Int,Bool,Bool,Bool,Bool) !Int !SyntaxColours !*(PSt .l) -> (EditState, *PSt .l)
initEditState windowId eUndoId pathName font tabs=:(_,_,_,linenos,showSynCol) syncols pstate initEditState windowId eUndoId pathName font tabs=:(_,_,_,linenos,showSynCol) margin syncols pstate
# (tId,pstate) = openId pstate // P4 # (tId,pstate) = openId pstate // P4
# (fontInfo, pstate) = computeFontInfo font tabs syncols pstate # (fontInfo, pstate) = computeFontInfo font tabs margin syncols pstate
= ( { text = newText = ( { text = newText
, pathName = pathName , pathName = pathName
, windowId = windowId , windowId = windowId
...@@ -349,14 +351,14 @@ setFont :: Font -> EditMonad (PSt .l) nothing ...@@ -349,14 +351,14 @@ setFont :: Font -> EditMonad (PSt .l) nothing
setFont font = monad setFont font = monad
where where
monad (editState,pState) monad (editState,pState)
# ({tabSize,autoTab,showTabs,showSyntax,syntaxColours},(editState,pState)) # ({tabSize,autoTab,showTabs,showSyntax,marginWidth,syntaxColours},(editState,pState))
= getFontInfo (editState,pState) = getFontInfo (editState,pState)
# (linenos,(editState,pState)) # (linenos,(editState,pState))
= getLineNumbers (editState,pState) = getLineNumbers (editState,pState)
# tabs # tabs
= (tabSize,autoTab,showTabs,linenos,showSyntax) = (tabSize,autoTab,showTabs,linenos,showSyntax)
# (fontInfo,(editState,pState)) # (fontInfo,(editState,pState))
= accEnv (computeFontInfo font tabs syntaxColours) (editState,pState) = accEnv (computeFontInfo font tabs marginWidth syntaxColours) (editState,pState)
# (_,(editState,pState)) # (_,(editState,pState))
= updateEditState (update fontInfo) (editState,pState) = updateEditState (update fontInfo) (editState,pState)
# (_,(editState,pState)) # (_,(editState,pState))
...@@ -388,8 +390,8 @@ updateLook ...@@ -388,8 +390,8 @@ updateLook
// compute some properties of a font // compute some properties of a font
computeFontInfo :: !Font !(Int,Bool,Bool,Bool,Bool) !SyntaxColours !(PSt .l) -> (FontInfo, PSt .l) computeFontInfo :: !Font !(Int,Bool,Bool,Bool,Bool) !Int !SyntaxColours !(PSt .l) -> (FontInfo, PSt .l)
computeFontInfo font (tabSize,autoTab,showTabs,_,showSynCol) syncols pstate computeFontInfo font (tabSize,autoTab,showTabs,_,showSynCol) marginWidth syncols pstate
# (metrics, pstate) = accPIO (accScreenPicture (getFontMetrics font)) pstate # (metrics, pstate) = accPIO (accScreenPicture (getFontMetrics font)) pstate
lineHeight = metrics.fAscent + metrics.fDescent + metrics.fLeading lineHeight = metrics.fAscent + metrics.fDescent + metrics.fLeading
(charWidth,pstate) = accPIO (accScreenPicture (getFontStringWidth font "M")) pstate (charWidth,pstate) = accPIO (accScreenPicture (getFontStringWidth font "M")) pstate
...@@ -399,6 +401,7 @@ computeFontInfo font (tabSize,autoTab,showTabs,_,showSynCol) syncols pstate ...@@ -399,6 +401,7 @@ computeFontInfo font (tabSize,autoTab,showTabs,_,showSynCol) syncols pstate
, tabSize = tabSize , tabSize = tabSize
, autoTab = autoTab , autoTab = autoTab
, charWidth = charWidth , charWidth = charWidth
, marginWidth = marginWidth
, showTabs = showTabs , showTabs = showTabs
, showSyntax = showSynCol , showSyntax = showSynCol
, syntaxColours = syncols , syntaxColours = syncols
...@@ -411,6 +414,7 @@ DefaultSyntaxColours = ...@@ -411,6 +414,7 @@ DefaultSyntaxColours =
{ textColour = Black { textColour = Black
, tabColour = Red , tabColour = Red
, backgroundColour = White , backgroundColour = White
, marginColour = White
, commentColour = Blue , commentColour = Blue
, stringColour = Green , stringColour = Green
, charColour = Magenta , charColour = Magenta
......
...@@ -252,11 +252,18 @@ vDrawCursor show end cursorHeight text fontInfo = ...@@ -252,11 +252,18 @@ vDrawCursor show end cursorHeight text fontInfo =
{ x=x, y=y+cursorHeight - 1 } { x=x, y=y+cursorHeight - 1 }
])) ]))
(seq (seq
[ setPenColour (fontInfo.syntaxColours.backgroundColour) [ setPenColour (backcolour x fontInfo)
, drawLine { x=x, y=y } , drawLine { x=x, y=y }
{ x=x, y=y+cursorHeight - 1 } { x=x, y=y+cursorHeight - 1 }
]) ])
) )
where
backcolour :: Int FontInfo -> Colour
backcolour x {charWidth, marginWidth, syntaxColours}
| marginWidth > 0 && x >= charWidth * marginWidth
= syntaxColours.marginColour
// otherwise
= syntaxColours.backgroundColour
//--- Visual Selection Stuff //--- Visual Selection Stuff
vUpdateSelection :: !Selection FontInfo Text ViewFrame [Rectangle] -> (*Picture -> *Picture) vUpdateSelection :: !Selection FontInfo Text ViewFrame [Rectangle] -> (*Picture -> *Picture)
......
...@@ -151,6 +151,10 @@ vRemoveText selection=:{ start=start=:{ col=col1,row=row1 } ...@@ -151,6 +151,10 @@ vRemoveText selection=:{ start=start=:{ col=col1,row=row1 }
// updating a rectangle is done by first erasing it and then redrawing // updating a rectangle is done by first erasing it and then redrawing
// the lines contained in that rectangle // the lines contained in that rectangle
// FIXME: this code assumes that corner1 of the rectangle is the upper left
// and corner2 the lower right corner, which is not garantueed by the ObjectIO
// (although in practice it is)
//vUpdateRectangle :: Text FontInfo Rectangle *Picture -> *Picture//-> EditMonad *Picture nothing //vUpdateRectangle :: Text FontInfo Rectangle *Picture -> *Picture//-> EditMonad *Picture nothing
vUpdateRectangle text fontInfo=:{lineHeight,thefont,syntaxColours} rectangle=:{ corner1 = {x=x1,y=y1}, corner2 = {x=x2,y=y2} } //pict = vUpdateRectangle text fontInfo=:{lineHeight,thefont,syntaxColours} rectangle=:{ corner1 = {x=x1,y=y1}, corner2 = {x=x2,y=y2} } //pict =
// compute which lines were affected and retrieve them // compute which lines were affected and retrieve them
...@@ -163,12 +167,27 @@ where ...@@ -163,12 +167,27 @@ where
# region` = toRegion rectangle` # region` = toRegion rectangle`
# pict = appClipPicture region` (seq # pict = appClipPicture region` (seq
[ setPenFont thefont [ setPenFont thefont
, setPenBack syntaxColours.backgroundColour , drawBackground syntaxColours fontInfo rectangle`
, unfill rectangle`
, drawLines lineNr1 lineNr2 fontInfo text , drawLines lineNr1 lineNr2 fontInfo text
]) pict ]) pict
= pict = pict
// drawBackground colours the background
drawBackground colours {charWidth, marginWidth} r=:{ corner1 = {x=x1,y=y1}, corner2 = {x=x2,y=y2} }
| marginWidth <= 0
= seq [ setPenBack colours.backgroundColour
, unfill r
]
// otherwise
= seq [ setPenBack colours.backgroundColour
, unfill {r & corner2.x = margin}
, setPenBack colours.marginColour
, unfill {r & corner1.x = margin}
]
where
margin
= marginWidth * charWidth
// drawLines draws the lines in the range indicated by // drawLines draws the lines in the range indicated by
// the first two arguments, e.g. drawLines 0 3 draws the // the first two arguments, e.g. drawLines 0 3 draws the
// text lines 0, 1, 2, and 3. // text lines 0, 1, 2, and 3.
......
...@@ -19,6 +19,7 @@ openEditWindow :: ...@@ -19,6 +19,7 @@ openEditWindow ::
Text // initial text Text // initial text
!Font // initial font !Font // initial font
(Int,Bool,Bool,Bool,Bool) // tabs (Int,Bool,Bool,Bool,Bool) // tabs
Int // right margin (0 means no margin)
SyntaxColours // syntax colours SyntaxColours // syntax colours
Id // window id Id // window id
[.WindowAttribute *(EditState,*PSt *b)] // initial attributes [.WindowAttribute *(EditState,*PSt *b)] // initial attributes
......
...@@ -9,14 +9,14 @@ import ioutil ...@@ -9,14 +9,14 @@ import ioutil
//--- //---
openEditWindow :: Id .Title String Text !Font (Int,Bool,Bool,Bool,Bool) SyntaxColours Id [.WindowAttribute *(EditState,*PSt *b)] !*(PSt *b) -> *PSt *b | Editor b openEditWindow :: Id .Title String Text !Font (Int,Bool,Bool,Bool,Bool) Int SyntaxColours Id [.WindowAttribute *(EditState,*PSt *b)] !*(PSt *b) -> *PSt *b | Editor b
openEditWindow uId title pathName text font tabs syncols windowId atts ps openEditWindow uId title pathName text font tabs margin syncols windowId atts ps
# (editorState,ps) = getEditorState ps # (editorState,ps) = getEditorState ps
// generate a receiver identifier and store it in the editor state // generate a receiver identifier and store it in the editor state
# (editId, ps) = openEditId ps # (editId, ps) = openEditId ps
editorState = addReceiver windowId editId editorState editorState = addReceiver windowId editId editorState
// create the local state of the editor window // create the local state of the editor window
# (editState, ps) = initEditState windowId uId pathName font tabs syncols ps # (editState, ps) = initEditState windowId uId pathName font tabs margin syncols ps
(_, (editState, ps)) = setText text (editState, ps) (_, (editState, ps)) = setText text (editState, ps)
(fontInfo, (editState, ps)) = getFontInfo (editState, ps) (fontInfo, (editState, ps)) = getFontInfo (editState, ps)
// compute the view domain of the visual text // compute the view domain of the visual text
......
...@@ -29,6 +29,9 @@ msgGetFont :: EditAction .l Font ...@@ -29,6 +29,9 @@ msgGetFont :: EditAction .l Font
msgSetTabs :: !(Int,Bool,Bool) -> EditAction .l nothing msgSetTabs :: !(Int,Bool,Bool) -> EditAction .l nothing
msgGetTabs :: EditAction .l (Int,Bool,Bool) msgGetTabs :: EditAction .l (Int,Bool,Bool)
msgSetMargin :: !Int -> EditAction .l nothing
msgGetMargin :: EditAction .l Int
msgCopy :: EditAction .l nothing msgCopy :: EditAction .l nothing
msgCut :: EditAction General nothing msgCut :: EditAction General nothing
msgPaste :: EditAction General nothing msgPaste :: EditAction General nothing
......
...@@ -68,6 +68,18 @@ msgGetTabs ...@@ -68,6 +68,18 @@ msgGetTabs
= getFontInfo >>>= \{ tabSize,autoTab,showTabs } -> = getFontInfo >>>= \{ tabSize,autoTab,showTabs } ->
result (tabSize,autoTab,showTabs) result (tabSize,autoTab,showTabs)
msgSetMargin :: !Int -> EditAction .l nothing
msgSetMargin m =
getFontInfo >>>= \fontinfo ->
setFontInfo {fontinfo & marginWidth = m} >>>
setFont fontinfo.thefont >>>
skip
msgGetMargin :: EditAction .l Int
msgGetMargin
= getFontInfo >>>= \{ marginWidth } ->
result marginWidth
//-- //--
msgUndo :: EditAction General nothing msgUndo :: EditAction General nothing
......
...@@ -97,7 +97,7 @@ where ...@@ -97,7 +97,7 @@ where
// change menu... // change menu...
# ps = appPIO (setMenuElementTitles [(ci.clip_itemId,"Hide Clipboard")]) ps # ps = appPIO (setMenuElementTitles [(ci.clip_itemId,"Hide Clipboard")]) ps
# tbs = (4,False,False,False,False) # tbs = (4,False,False,False,False)
# ps = openEditWindow ci.clip_undoId "Clipboard" "" newText fnt tbs DefaultSyntaxColours ci.clip_clipId # ps = openEditWindow ci.clip_undoId "Clipboard" "" newText fnt tbs 0 DefaultSyntaxColours ci.clip_clipId
[WindowActivate (noLS activate) [WindowActivate (noLS activate)
,WindowDeactivate (noLS deactivate) ,WindowDeactivate (noLS deactivate)
,WindowClose (noLS showClip) ,WindowClose (noLS showClip)
......
...@@ -124,7 +124,7 @@ openConsoleWindow cwi text atts ps ...@@ -124,7 +124,7 @@ openConsoleWindow cwi text atts ps
# pathName = "" // dummy pathname # pathName = "" // dummy pathname
# title = "Console" # title = "Console"
# tabs = (4,True,False,False,True) # tabs = (4,True,False,False,True)
# (editState, ps) = initEditState windowId cwi.uId pathName cwi.tfnt tabs cwi.sync ps # (editState, ps) = initEditState windowId cwi.uId pathName cwi.tfnt tabs 0 cwi.sync ps
# (_, (editState, ps)) = setText text (editState, ps) # (_, (editState, ps)) = setText text (editState, ps)
# (fontInfo, (editState, ps)) = getFontInfo (editState, ps) # (fontInfo, (editState, ps)) = getFontInfo (editState, ps)
# (viewDomain, (editState, ps)) = computeViewDomain (editState, ps) # (viewDomain, (editState, ps)) = computeViewDomain (editState, ps)
......
...@@ -143,6 +143,7 @@ ed_open_cont pathName cont ps ...@@ -143,6 +143,7 @@ ed_open_cont pathName cont ps
# defaultFontdef= prefs.edwinfont # defaultFontdef= prefs.edwinfont
# fontdef = defaultFontdef # fontdef = defaultFontdef
# tabs = prefs.edwintabs # tabs = prefs.edwintabs
# margin = prefs.edwinmargin
// open a font and then the edit window // open a font and then the edit window
# (font,ps) = accScreenPicture (safeOpenFixedFont defaultFontdef) ps # (font,ps) = accScreenPicture (safeOpenFixedFont defaultFontdef) ps
// error checking op font doen...? // error checking op font doen...?
...@@ -154,7 +155,7 @@ ed_open_cont pathName cont ps ...@@ -154,7 +155,7 @@ ed_open_cont pathName cont ps
# windowIcon = if isDefMod DefmodIcon (if isImpMod ImpmodIcon CleanIcon) # windowIcon = if isDefMod DefmodIcon (if isImpMod ImpmodIcon CleanIcon)
# syncols = if isDefMod (prefs.defcols) (if isImpMod (prefs.impcols) (prefs.syncols)) # syncols = if isDefMod (prefs.defcols) (if isImpMod (prefs.impcols) (prefs.syncols))
// # (boom, ps) = readFileInTree ps // P4 // # (boom, ps) = readFileInTree ps // P4
# ps = openEditWindow mn_und (if readOnly title` title) pathName text font tabs syncols windowId ( # ps = openEditWindow mn_und (if readOnly title` title) pathName text font tabs margin syncols windowId (
[ WindowClose (noLS (ed_close windowId)) [ WindowClose (noLS (ed_close windowId))
, WindowKeyboard (\_ -> True) Able keyboardfun , WindowKeyboard (\_ -> True) Able keyboardfun
, WindowActivate (ed_activate title) , WindowActivate (ed_activate title)
...@@ -298,6 +299,7 @@ ed_new suffix ps ...@@ -298,6 +299,7 @@ ed_new suffix ps
(prefs,ps) = getPrefs ps (prefs,ps) = getPrefs ps
defaultFontdef = prefs.edwinfont defaultFontdef = prefs.edwinfont
defaultTabs = prefs.edwintabs defaultTabs = prefs.edwintabs
defaultMargin = prefs.edwinmargin
# isDefMod = IsDefPathname pathName # isDefMod = IsDefPathname pathName
# isImpMod = IsImpPathname pathName # isImpMod = IsImpPathname pathName
# defaultSync = if isDefMod (prefs.defcols) (if isImpMod (prefs.impcols) (prefs.syncols)) # defaultSync = if isDefMod (prefs.defcols) (if isImpMod (prefs.impcols) (prefs.syncols))
...@@ -305,7 +307,7 @@ ed_new suffix ps ...@@ -305,7 +307,7 @@ ed_new suffix ps
((_, defaultFont), ps) ((_, defaultFont), ps)
= accPIO (accScreenPicture (openFont defaultFontdef)) ps = accPIO (accScreenPicture (openFont defaultFontdef)) ps
// # (boom, ps) = readFileInTree ps // P4 // # (boom, ps) = readFileInTree ps // P4
# ps = openEditWindow mn_und title pathName text defaultFont defaultTabs defaultSync windowId # ps = openEditWindow mn_und title pathName text defaultFont defaultTabs defaultMargin defaultSync windowId
[ WindowClose (noLS (ed_close windowId)) [ WindowClose (noLS (ed_close windowId))
, WindowKeyboard (\_ -> True) Able (my_keyboard) , WindowKeyboard (\_ -> True) Able (my_keyboard)
, WindowActivate (ed_activate title) , WindowActivate (ed_activate title)
...@@ -508,6 +510,7 @@ where ...@@ -508,6 +510,7 @@ where
, stringColour = cols.stringColour , stringColour = cols.stringColour
, charColour = cols.charColour , charColour = cols.charColour
, backgroundColour = cols.backgroundColour , backgroundColour = cols.backgroundColour
, marginColour = cols.marginColour
, keywordColour = cols.keywordColour , keywordColour = cols.keywordColour
} }
} }
......
...@@ -42,7 +42,7 @@ editColours ps ...@@ -42,7 +42,7 @@ editColours ps
# (wId,ps) = openId ps # (wId,ps) = openId ps
# (okId,ps) = openId ps # (okId,ps) = openId ps
# (cancelId,ps) = openId ps # (cancelId,ps) = openId ps
# (ids,ps) = openIds 27 ps # (ids,ps) = openIds 30 ps
# cls = # cls =
[ prefs.syncols.textColour [ prefs.syncols.textColour
, prefs.defcols.textColour , prefs.defcols.textColour
...@@ -62,6 +62,9 @@ editColours ps ...@@ -62,6 +62,9 @@ editColours ps
, prefs.syncols.backgroundColour , prefs.syncols.backgroundColour
, prefs.defcols.backgroundColour , prefs.defcols.backgroundColour
, prefs.impcols.backgroundColour , prefs.impcols.backgroundColour
, prefs.syncols.marginColour
, prefs.defcols.marginColour
, prefs.impcols.marginColour
, prefs.syncols.keywordColour , prefs.syncols.keywordColour
, prefs.defcols.keywordColour , prefs.defcols.keywordColour
, prefs.impcols.keywordColour , prefs.impcols.keywordColour
...@@ -146,16 +149,21 @@ editColours ps ...@@ -146,16 +149,21 @@ editColours ps
:+: ColourBoxControl`` rgbid lsid cls ids 18 (Just (Left,zero)) :+: ColourBoxControl`` rgbid lsid cls ids 18 (Just (Left,zero))
:+: ColourBoxControl`` rgbid lsid cls ids 19 Nothing :+: ColourBoxControl`` rgbid lsid cls ids 19 Nothing
:+: ColourBoxControl`` rgbid lsid cls ids 20 Nothing :+: ColourBoxControl`` rgbid lsid cls ids 20 Nothing
:+: TextControl "Keywords" [] :+: TextControl "Right Margin" []
:+: ColourBoxControl`` rgbid lsid cls ids 21 (Just (Left,zero)) :+: ColourBoxControl`` rgbid lsid cls ids 21 (Just (Left,zero))
:+: ColourBoxControl`` rgbid lsid cls ids 22 Nothing :+: ColourBoxControl`` rgbid lsid cls ids 22 Nothing
:+: ColourBoxControl`` rgbid lsid cls ids 23 Nothing :+: ColourBoxControl`` rgbid lsid cls ids 23 Nothing
:+: TextControl "Typedefs" [] :+: TextControl "Keywords" []
:+: ColourBoxControl`` rgbid lsid cls ids 24 (Just (Left,zero)) :+: ColourBoxControl`` rgbid lsid cls ids 24 (Just (Left,zero))
:+: ColourBoxControl`` rgbid lsid cls ids 25 Nothing :+: ColourBoxControl`` rgbid lsid cls ids 25 Nothing
:+: ColourBoxControl`` rgbid lsid cls ids 26 Nothing :+: ColourBoxControl`` rgbid lsid cls ids 26 Nothing
:+: TextControl "Typedefs" []
:+: ColourBoxControl`` rgbid lsid cls ids 27 (Just (Left,zero))
:+: ColourBoxControl`` rgbid lsid cls ids 28 Nothing
:+: ColourBoxControl`` rgbid lsid cls ids 29 Nothing
:+: TextControl "Typedecls" [] :+: TextControl "Typedecls" []
:+: Receiver lsid lsfun [] :+: Receiver lsid lsfun []
...@@ -271,9 +279,10 @@ where ...@@ -271,9 +279,10 @@ where
, stringColour = cls!!9 , stringColour = cls!!9
, charColour = cls!!12 , charColour = cls!!12
, backgroundColour = cls!!15 , backgroundColour = cls!!15
, keywordColour = cls!!18 , marginColour = cls!!18
, typedefColour = cls!!21 , keywordColour = cls!!21
, typedeclColour = cls!!24 , typedefColour = cls!!24
, typedeclColour = cls!!27
} }
# defcols` = # defcols` =
{ prefs.defcols { prefs.defcols
...@@ -283,9 +292,10 @@ where ...@@ -283,9 +292,10 @@ where
, stringColour = cls!!10 , stringColour = cls!!10
, charColour = cls!!13 , charColour = cls!!13
, backgroundColour = cls!!16 , backgroundColour = cls!!16
, keywordColour = cls!!19 , marginColour = cls!!19
, typedefColour = cls!!22 , keywordColour = cls!!22
, typedeclColour = cls!!25 , typedefColour = cls!!25
, typedeclColour = cls!!28
} }
# impcols` = # impcols` =
{ prefs.impcols { prefs.impcols
...@@ -295,9 +305,10 @@ where ...@@ -295,9 +305,10 @@ where
, stringColour = cls!!11 , stringColour = cls!!11
, charColour = cls!!14 , charColour = cls!!14
, backgroundColour = cls!!17 , backgroundColour = cls!!17
, keywordColour = cls!!20 , marginColour = cls!!20
, typedefColour = cls!!23 , keywordColour = cls!!23
, typedeclColour = cls!!26 , typedefColour = cls!!26
, typedeclColour = cls!!29
} }
# prefs = {prefs & syncols = syncols`, defcols = defcols`, impcols = impcols`} # prefs = {prefs & syncols = syncols`, defcols = defcols`, impcols = impcols`}
# ps = setPrefs prefs ps # ps = setPrefs prefs ps
...@@ -333,6 +344,7 @@ where ...@@ -333,6 +344,7 @@ where
, stringColour = cols.stringColour , stringColour = cols.stringColour
, charColour = cols.charColour , charColour = cols.charColour
, backgroundColour = cols.backgroundColour , backgroundColour = cols.backgroundColour
, marginColour = cols.marginColour
, keywordColour = cols.keywordColour , keywordColour = cols.keywordColour
, typedefColour = cols.typedefColour , typedefColour = cols.typedefColour
, typedeclColour = cols.typedeclColour , typedeclColour = cols.typedeclColour
...@@ -352,9 +364,10 @@ defaultColours ps ...@@ -352,9 +364,10 @@ defaultColours ps
3 -> prefs.syncols.stringColour 3 -> prefs.syncols.stringColour
4 -> prefs.syncols.charColour 4 -> prefs.syncols.charColour
5 -> prefs.syncols.backgroundColour 5 -> prefs.syncols.backgroundColour
6 -> prefs.syncols.keywordColour 6 -> prefs.syncols.marginColour
7 -> prefs.syncols.typedefColour 7 -> prefs.syncols.keywordColour
8 -> prefs.syncols.typedeclColour 8 -> prefs.syncols.typedefColour
9 -> prefs.syncols.typedeclColour
_ -> abort "edoptions[defaultColours]: unknown ls" _ -> abort "edoptions[defaultColours]: unknown ls"
# (dback,ps) = GetDialogBackgroundColour ps # (dback,ps) = GetDialogBackgroundColour ps
# wdef = Dialog "Pick a colour" # wdef = Dialog "Pick a colour"
...@@ -391,9 +404,10 @@ where ...@@ -391,9 +404,10 @@ where
3 -> prefs.syncols.stringColour 3 -> prefs.syncols.stringColour
4 -> prefs.syncols.charColour 4 -> prefs.syncols.charColour
5 -> prefs.syncols.backgroundColour 5 -> prefs.syncols.backgroundColour
6 -> prefs.syncols.keywordColour 6 -> prefs.syncols.marginColour
7 -> prefs.syncols.typedefColour 7 -> prefs.syncols.keywordColour
8 -> prefs.