packages feed

hpage 0.5.6 → 0.6.0

raw patch · 2 files changed

+29/−7 lines, 2 files

Files

hpage.cabal view
@@ -1,5 +1,5 @@ name: hpage-version: 0.5.6+version: 0.6.0 cabal-version: >=1.6 build-type: Custom license: BSD3
src/HPage/GUI/FreeTextWindow.hs view
@@ -154,7 +154,7 @@         set btnInterpret [on command := onCmd "interpret" interpret]                  set lstPages [on select := onCmd "pageChange" pageChange]-        set txtCode [on keyboard := \_ -> onCmd "restartTimer" restartTimer >> propagateEvent,+        set txtCode [on keyboard := onCmd "key" . keyEvent,                      on mouse :=  \e -> case e of                                             MouseLeftUp _ _ -> onCmd "mouseEvent" restartTimer >> propagateEvent                                             MouseLeftDClick _ _ -> onCmd "mouseEvent" restartTimer >> propagateEvent@@ -290,6 +290,7 @@         refreshPage model guiCtx         onCmd "start" openHelpPage         set win [visible := True]+        set txtCode [font := fontFixed] -- again just to be sure         focusOn txtCode  -- PROCESSES -------------------------------------------------------------------@@ -379,6 +380,20 @@                     return bottomChar  -- EVENT HANDLERS --------------------------------------------------------------+keyEvent :: EventKey -> HPS.ServerHandle -> GUIContext -> IO ()+keyEvent eventKey model guiCtx@GUICtx{guiCode = txtCode} =+    do+        case keyKey eventKey of+            KeyTab ->+                if isNoneDown (keyModifiers eventKey)+                    then+                        textCtrlWriteText txtCode "\t" >> restartTimer model guiCtx+                    else+                        return ()+            _ ->+                restartTimer model guiCtx+        propagateEvent+     refreshPage, savePageAs, savePage, openPage,     pageChange, copy, copyResult, copyType, cut, paste,     justFind, justFindNext, justFindPrev, findReplace,@@ -551,6 +566,7 @@  savePageAs model guiCtx@GUICtx{guiWin = win, guiStatus = status} =     do+        refreshExpr model guiCtx         fileName <- fileSaveDialog win True True "Save file..." [("Haskells",["*.hs"]),                                                                  ("Any file",["*.*"])] "" ""         case fileName of@@ -563,6 +579,7 @@  savePage model guiCtx@GUICtx{guiWin = win} =     do+        refreshExpr model guiCtx         maybePath <- tryIn' model HP.getPagePath         case maybePath of             Left err ->@@ -710,7 +727,8 @@     do         f <- helpFile         txt <- readFile f-        set txtCode [text := txt]+        set txtCode [font := fontFixed,+                     text := txt]         -- Refresh the current expression box         refreshExpr model guiCtx @@ -766,7 +784,8 @@                     varSet varModsSel $ -1                                          -- Refresh the current text-                    set txtCode [text := t]+                    set txtCode [text := t,+                                 font := fontFixed]                                          -- Clean the status bar                     set status [text := ""]@@ -893,6 +912,7 @@                                 guiWin = win,                                 guiTimer = refreshTimer} =    do+        set txtCode [font := fontFixed] -- Just to be sure         txt <- get txtCode text         ip <- textCtrlGetInsertionPoint txtCode         @@ -971,8 +991,9 @@                 infoDialog win "Find Results" $ s ++ " not found."             Just ip ->                 do-                    textCtrlSetSelection txtCode (length s + ip) ip+                    textCtrlSetInsertionPoint txtCode ip                     refreshExpr model guiCtx +                    textCtrlSetSelection txtCode ip (length s + ip)  findReplaceButton model guiCtx@GUICtx{guiCode = txtCode,                                       guiWin = win,@@ -989,8 +1010,9 @@             Just ip ->                 do                     textCtrlReplace txtCode ip (length s + ip) r-                    textCtrlSetSelection txtCode (length r + ip) ip-                    refreshExpr model guiCtx+                    textCtrlSetInsertionPoint txtCode ip+                    refreshExpr model guiCtx +                    textCtrlSetSelection txtCode ip (length r + ip)          findReplaceAllButton _model GUICtx{guiCode = txtCode,                                    guiSearch = search} =