Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
First Release
  • Loading branch information
Fernando 'Brujo' Benavides committed Jan 22, 2010
1 parent dab746f commit 5066370
Show file tree
Hide file tree
Showing 13 changed files with 465 additions and 7 deletions.
Binary file added res/images/close.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/copy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/cut.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/find.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/open.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/paste.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/saveas.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/Main.hs
Expand Up @@ -11,6 +11,7 @@ import Step2
import Step3
import Step4
import Step5
import Step6

-- | The application entry point
main :: IO ()
Expand All @@ -35,8 +36,7 @@ gui =
menuItem mnuSteps [on command := step3, text := "Step &3 - Undo / Redo...\tCtrl-3"]
menuItem mnuSteps [on command := step4, text := "Step &4 - Cut / Copy / Paste...\tCtrl-4"]
menuItem mnuSteps [on command := step5, text := "Step &5 - Find / Replace...\tCtrl-5"]
menuItem mnuSteps [text := "Step &5\tCtrl-6", on command := say "Step 6" "Toolbar / Statusbar / Context Menus"]
menuItem mnuSteps [text := "Step &6\tCtrl-7", on command := say "Step 7" "Preferences..."]
menuItem mnuSteps [on command := step6, text := "Step &6 - Toolbar / Statusbar / Context Menus\tCtrl-6"]
menuQuit mnuSteps [on command := wxcAppExit]

-- the simplest about page...
Expand Down
5 changes: 2 additions & 3 deletions src/Step5.hs
Expand Up @@ -295,7 +295,7 @@ findNextButton guiCtx@GUICtx{guiEditor= editor,
Just ip -> -- If there's a match, we select that text
do
textCtrlSetInsertionPoint editor ip
textCtrlSetSelection editor (length s + ip) ip
textCtrlSetSelection editor ip (length s + ip)


findReplaceButton guiCtx@GUICtx{guiEditor = editor,
Expand All @@ -318,7 +318,7 @@ findReplaceButton guiCtx@GUICtx{guiEditor = editor,
textCtrlReplace editor ip (length s + ip) r
-- select the result
textCtrlSetInsertionPoint editor ip
textCtrlSetSelection editor (length r + ip) ip
textCtrlSetSelection editor ip (length r + ip)
-- and finally update the history
updatePast guiCtx

Expand Down Expand Up @@ -373,7 +373,6 @@ findMatch query flags editor =
(mip, wrapped) = funct substring string
-- if it had to wrap around and that was 'forbbiden', then the match didn't happen
-- otherwise, the result is valid
putStrLn . show $ ("findMatch", query, flags, txt, ip, mip, wrapped)
return $ if (not $ frfWrapSearch flags) && wrapped
then Nothing
else mip
Expand Down
456 changes: 456 additions & 0 deletions src/Step6.hs

Large diffs are not rendered by default.

Binary file modified wxhnotepad.smultronProject
Binary file not shown.
7 changes: 5 additions & 2 deletions wxnotepad.cabal
@@ -1,5 +1,5 @@
name: wxhnotepad
version: 0.0.1
version: 1.0.0
cabal-version: >=1.6
build-type: Custom
license: BSD3
Expand All @@ -11,11 +11,14 @@ homepage: http://github.com/elbrujohalcon/wxhnotepad
package-url: http://code.haskell.org/wxhnotepad
bug-reports: http://github.com/elbrujohalcon/wxhnotepad/issues
synopsis: An example of how to implement a basic notepad with wxHaskell
description: A program to learn how to implement basic text editing functionality with wxHaskell. It's not useful itself, the point is to read the code and learn from it ;)
description: A program to learn how to implement basic text editing functionality with wxHaskell.
It's not useful itself, the point is to read the code and learn from it ;)
The program is divided in 6 steps, each one corresponding to a window and a haskell module. Each step includes what was learnt in the previous one, so Step6 is an almost complete basic text editor.
category: Development, Education, IDE, Editor
author: Fernando "Brujo" Benavides
tested-with: GHC ==6.10.3, GHC ==6.10.4
data-files: LICENSE README
res/images/*.png
data-dir: ""
extra-source-files: Setup.hs
extra-tmp-files:
Expand Down

0 comments on commit 5066370

Please sign in to comment.