Permalink
Browse files

Version 0.8.0

  • Loading branch information...
Fernando 'Brujo' Benavides
Fernando 'Brujo' Benavides committed May 6, 2010
1 parent 24c349a commit 2e05521e09ad70815113494e1558dae5f52aafef
Showing with 71 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +2 −1 hpage.cabal
  3. +44 −0 res/help/about.html
  4. +12 −5 src/HPage/GUI/Dialogs.hs
  5. +12 −1 src/HPage/GUI/FreeTextWindow.hs
View
@@ -1,6 +1,7 @@
.DS_Store
.directory
.project
+.settings
out
bin
bin/hPage.app/Contents/MacOS/hPage
View
@@ -1,5 +1,5 @@
name: hpage
-version: 0.7.6
+version: 0.8.0
cabal-version: >=1.6
build-type: Custom
license: BSD3
@@ -21,6 +21,7 @@ data-files: LICENSE README
res/images/icon/hpage.icns
res/images/icon/hpage.tif
res/help/helpPage.hs
+ res/help/about.html
res/test/*.hs
data-dir: ""
extra-source-files: Setup.hs
View
@@ -0,0 +1,44 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-EN" lang="en-EN">
+<body bgcolor="rgb(33, 34, 38)">
+<font color="white">
+ <!-- Modal for Copyright -->
+ <div id="copyright" border="1">
+ <div color="white">
+ <dl>
+ <h3>&#955;Page is a thesis project by</h3>
+ <blockquote>
+ Fernando "Brujo" Benavides
+ <a href="http://www.google.com/profiles/greenmellon">google</a>&nbsp;
+ <a href="http://twitter.com/elbrujohalcon">twitter</a>&nbsp;
+ <a href="http://www.linkedin.com/in/elbrujohalcon">linkedIn</a>
+ </blockquote>
+
+ <h3>&#955;Page thesis project is directed by</h3>
+ <blockquote>
+ Daniel Gor&iacute;n and Diego Garverbetsky
+ <a href="http://www-2.dc.uba.ar/exclusivos/garbervetsky/">web</a>
+ </blockquote>
+
+ <h3>Project developed at</h3>
+ <blockquote>
+ Computer Sciences Department
+ <a href="http://www.dc.uba.ar">web</a><br>
+ Faculty of Exact and Natural Sciences
+ <a href="http://exactas.uba.ar/">web</a><br>
+ University of Buenos Aires
+ <a href="http://www.uba.ar/">web</a>
+ </blockquote>
+
+ <h3>&#955;Page webpage design courtesy of</h3>
+ <blockquote>
+ Dar&iacute;o Ruellan
+ <a href="http://www.google.com/profiles/dario.ruellan">google</a>&nbsp;
+ <a href="http://www.twitter.com/druellan">twitter</a>&nbsp;
+ <a href="http://www.linkedin.com/in/darioruellan">linkedIn</a>
+ </blockquote>
+ </dl>
+ </div>
+ </div>
+</font>
+</body>
+</html>
View
@@ -6,25 +6,32 @@ import Graphics.UI.WX
import Graphics.UI.WXCore
import HPage.GUI.IDs
import qualified HPage.Control as HP
+import HPage.Utils.Log
data Preferences = Prefs {languageExtensions :: [HP.Extension],
sourceDirs :: [FilePath],
ghcOptions :: String}
deriving (Eq, Show)
+aboutDialog :: Window a -> FilePath -> IO ()
+aboutDialog win aboutFile =
+ htmlDialog win "About \955Page" (sz 400 500) $ "file://" ++ aboutFile
+
hayooDialog :: Window a -> String -> IO ()
hayooDialog win query =
- htmlDialog win "Hayoo!" $ "http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=" ++ query
+ htmlDialog win "Hayoo!" (sz 640 480) $ "http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=" ++ query
-htmlDialog :: Window a -> String -> String -> IO ()
-htmlDialog win caption url =
+htmlDialog :: Window a -> String -> Size -> String -> IO ()
+htmlDialog win caption size url =
do
dlg <- dialog win [text := caption]
- htmlw <- htmlWindowCreate dlg idAny (rect (point 0 0) (sz 640 480)) 0 ""
+ htmlw <- htmlWindowCreate dlg idAny (rect (point 0 0) size) 0 ""
+ debugIO ("url:", url)
htmlWindowLoadPage htmlw url
set dlg [layout := fill $ widget htmlw,
visible := True,
- clientSize := sz 640 480]
+ clientSize := size]
+ windowCenter dlg wxCENTRE_ON_SCREEN
return ()
preferencesDialog :: Window a -> String -> Preferences -> IO (Maybe Preferences)
@@ -56,6 +56,16 @@ helpFile =
return $ dropFileName progPath </> "Resources" </> "helpPage.hs"
_ ->
getDataFileName "res/help/helpPage.hs"
+
+aboutFile :: IO FilePath
+aboutFile =
+ do
+ progPath <- getProgPath
+ case takeBaseName progPath of
+ "MacOS" ->
+ return $ dropFileName progPath </> "Resources" </> "about.html"
+ _ ->
+ getDataFileName "res/help/about.html"
data GUIBottom = GUIBtm { bottomDesc :: String,
bottomSource :: String }
@@ -228,7 +238,8 @@ gui args =
mnuHelp <- menuHelp []
menuAppend mnuHelp wxId_HELP "&Help page\tCtrl-h" "Open the Help Page" False
- menuAbout mnuHelp [on command := infoDialog win "About \955Page" "Author: Fernando Brujo Benavides\nWebsite: http://haskell.hpage.com"]
+ about <- aboutFile
+ menuAbout mnuHelp [on command := aboutDialog win about]
set win [menuBar := [mnuPage, mnuEdit, mnuHask, mnuHelp]]
evtHandlerOnMenuCommand win wxId_NEW $ onCmd "runHP' addPage" $ runHP' HP.addPage

0 comments on commit 2e05521

Please sign in to comment.