wx 0.90.0.1 → 0.90.1.0
raw patch · 10 files changed
+122/−58 lines, 10 filesdep ~wxcorenew-uploader
Dependency ranges changed: wxcore
Files
- src/Graphics/UI/WX.hs +7/−7
- src/Graphics/UI/WX/Attributes.hs +18/−6
- src/Graphics/UI/WX/Classes.hs +8/−8
- src/Graphics/UI/WX/Controls.hs +63/−12
- src/Graphics/UI/WX/Dialogs.hs +6/−6
- src/Graphics/UI/WX/Frame.hs +3/−3
- src/Graphics/UI/WX/Menu.hs +11/−11
- src/Graphics/UI/WX/TopLevelWindow.hs +1/−1
- src/Graphics/UI/WX/Window.hs +2/−1
- wx.cabal +3/−3
src/Graphics/UI/WX.hs view
@@ -1,16 +1,16 @@ ---------------------------------------------------------------------------------{-| Module : WX- Copyright : (c) Daan Leijen 2003- License : wxWindows+{-| Module : WX+ Copyright : (c) Daan Leijen 2003+ License : wxWindows - Maintainer : wxhaskell-devel@lists.sourceforge.net- Stability : provisional- Portability : portable+ Maintainer : wxhaskell-devel@lists.sourceforge.net+ Stability : provisional+ Portability : portable The WX module just re-exports functionality from helper modules and defines the 'start' function. -The WX library provides a /haskellized/ interface to the raw wxWindows+The WX library provides a /haskellized/ interface to the raw wxWidgets functionality provided by the "Graphics.UI.WXCore" library. -} --------------------------------------------------------------------------------
src/Graphics/UI/WX/Attributes.hs view
@@ -1,12 +1,12 @@ {-# LANGUAGE ExistentialQuantification #-} ---------------------------------------------------------------------------------{-| Module : Attributes- Copyright : (c) Daan Leijen 2003- License : wxWindows+{-| Module : Attributes+ Copyright : (c) Daan Leijen 2003+ License : wxWindows - Maintainer : wxhaskell-devel@lists.sourceforge.net- Stability : provisional- Portability : portable+ Maintainer : wxhaskell-devel@lists.sourceforge.net+ Stability : provisional+ Portability : portable Widgets @w@ can have attributes of type @a@ represented by the type 'Attr' @w a@.@@ -93,7 +93,14 @@ | forall a. Attr w a ::= (w -> a) -- ^ Assign a value to an attribute with the widget as argument. | forall a. Attr w a ::~ (w -> a -> a) -- ^ Apply an update function to an attribute with the widget as an argument. +-- For debugging purposes+instance Show a => Show (Prop a) where+ show ((Attr string _ _ _ _) := _) = "Attr \"" ++ string ++ "\" _ _ _ _ := _"+ show ((Attr string _ _ _ _) :~ _) = "Attr \"" ++ string ++ "\" _ _ _ _ :~ _"+ show ((Attr string _ _ _ _) ::= _) = "Attr \"" ++ string ++ "\" _ _ _ _ ::= _"+ show ((Attr string _ _ _ _) ::~ _) = "Attr \"" ++ string ++ "\" _ _ _ _ ::~ _" + -- | An attribute that should be specified at creation time. Just for documentation purposes. type CreateAttr w a = Attr w a @@ -107,6 +114,11 @@ data Attr w a = Attr String (Maybe (a -> Dynamic, Dynamic -> Maybe a)) -- name, dynamic conversion (w -> IO a) (w -> a -> IO ()) -- getter setter (w -> (a -> a) -> IO a) -- updater ++-- For debugging purposes+instance Show a => Show (Attr w a) where+ show (Attr string _ _ _ _) =+ "Attr \"" ++ string ++ "\" _ _ _ _" -- | Cast attributes.
src/Graphics/UI/WX/Classes.hs view
@@ -1,12 +1,12 @@ {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, DeriveDataTypeable, ScopedTypeVariables #-} ---------------------------------------------------------------------------------{-| Module : Classes- Copyright : (c) Daan Leijen 2003- License : wxWindows+{-| Module : Classes+ Copyright : (c) Daan Leijen 2003+ License : wxWindows - Maintainer : wxhaskell-devel@lists.sourceforge.net- Stability : provisional- Portability : portable+ Maintainer : wxhaskell-devel@lists.sourceforge.net+ Stability : provisional+ Portability : portable This modules defines attributes common to many widgets and organizes them into Haskell classes. Look at the instance definitions@@ -287,9 +287,9 @@ -- | Is the widget checked? checked :: Attr w Bool --- | The identity determines the wxWindows ID of a widget.+-- | The identity determines the wxWidgets ID of a widget. class Identity w where- -- | The identity determines the wxWindows ID of a widget.+ -- | The identity determines the wxWidgets ID of a widget. identity :: Attr w Int
src/Graphics/UI/WX/Controls.hs view
@@ -1,13 +1,13 @@ {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable #-} ---------------------------------------------------------------------------------{-| Module : Controls- Copyright : (c) Daan Leijen 2003- (c) Shelarcy (shelarcy@gmail.com) 2006- License : wxWindows+{-| Module : Controls+ Copyright : (c) Daan Leijen 2003+ (c) Shelarcy (shelarcy@gmail.com) 2006+ License : wxWindows - Maintainer : wxhaskell-devel@lists.sourceforge.net- Stability : provisional- Portability : portable+ Maintainer : wxhaskell-devel@lists.sourceforge.net+ Stability : provisional+ Portability : portable Defines common GUI controls. -}@@ -45,6 +45,9 @@ , Slider, hslider, vslider, sliderEx, sliderRes -- ** Gauge , Gauge, hgauge, vgauge, gaugeEx, gaugeRes+ -- ** ToggleButton+ , ToggleButton, BitmapToggleButton+ , toggleButton, bitmapToggleButton -- ** Tree control , TreeCtrl, treeCtrl, treeCtrlEx, treeEvent, treeCtrlRes -- ** List control@@ -95,7 +98,7 @@ -- -- * Instances: 'Form' -- 'Dimensions', 'Colored', 'Visible', 'Child', -- 'Able', 'Tipped', 'Identity', 'Styled',--- 'Textual', 'Literate'+-- 'Textual', 'Literate', 'Reactive', 'Paint' panel :: Window a -> [Prop (Panel ())] -> IO (Panel ()) panel parent props = panelEx parent (wxTAB_TRAVERSAL .+. defaultStyle) props@@ -197,10 +200,10 @@ instance Commanding (Button a) where command = newEvent "command" buttonGetOnCommand buttonOnCommand --- | Create a bitmap button. Use the 'image' attribute to set the+-- | Create a bitmap button. Use the 'picture' attribute to set the -- bitmap. ----- * Instances: 'Commanding' -- 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child',+-- * Instances: 'Commanding', 'Pictured' -- 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child', -- 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'. -- bitmapButton :: Window a -> [Prop (BitmapButton ())] -> IO (BitmapButton ())@@ -209,12 +212,13 @@ initialWindow $ \id rect -> \props flags -> do bb <- bitmapButtonCreate parent id nullBitmap rect flags set bb props+ windowReLayout bb return bb -- | Complete the construction of a bitmap button instance which has been loaded -- from a resource file. ----- * Instances: 'Commanding' -- 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child',+-- * Instances: 'Commanding', 'Pictured' -- 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child', -- 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'. -- bitmapButtonRes :: Window a -> String -> [Prop (BitmapButton ())] -> IO (BitmapButton ())@@ -732,7 +736,7 @@ -- multiListBox :: Window a -> [Prop (MultiListBox ())] -> IO (MultiListBox ()) multiListBox parent props- = feed2 props (wxLB_MULTIPLE .+. wxLB_EXTENDED .+. wxHSCROLL .+. wxLB_NEEDED_SB) $+ = feed2 props (wxLB_EXTENDED .+. wxHSCROLL .+. wxLB_NEEDED_SB) $ initialWindow $ \id rect -> initialSorted $ \props flags -> do lb <- listBoxCreate parent id rect [] flags@@ -963,6 +967,53 @@ instance Selecting (SpinCtrl a) where select = newEvent "select" spinCtrlGetOnCommand spinCtrlOnCommand++{--------------------------------------------------------------------------------+ ToggleButton+--------------------------------------------------------------------------------}+-- | Create a toggle button. +--+-- * Instances: 'Commanding', 'Checkable', -- 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child',+-- 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'.+--+toggleButton :: Window a -> [Prop (ToggleButton ())] -> IO (ToggleButton ())+toggleButton parent props+ = feed2 props defaultStyle $+ initialWindow $ \id rect -> \props flags ->+ do bb <- toggleButtonCreate parent id "" rect flags+ set bb props+ return bb++instance Commanding (ToggleButton a) where+ command = newEvent "command" toggleButtonGetOnCommand toggleButtonOnCommand++instance Checkable (ToggleButton a) where+ checkable = enabled + checked = newAttr "checked" toggleButtonGetValue toggleButtonSetValue++-- | Create a bitmap toggle button. Use the 'picture' attribute to set the+-- bitmap.+--+-- * Instances: 'Commanding', 'Pictured' -- 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child',+-- 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'.+--+bitmapToggleButton :: Window a -> [Prop (BitmapToggleButton ())] -> IO (BitmapToggleButton ())+bitmapToggleButton parent props+ = feed2 props defaultStyle $+ initialWindow $ \id rect -> \props flags ->+ do img <- imageCreateFromPixels (Size 1 1) [black]+ bm <- bitmapCreateFromImage img (-1)+ bb <- bitmapToggleButtonCreate parent id bm rect flags+ set bb props+ return bb++instance Pictured (BitmapToggleButton a) where+ picture+ = writeAttr "picture" setter+ where+ setter w fname+ = do fpath <- getAbsoluteFilePath fname+ withBitmapFromFile fpath (bitmapToggleButtonSetBitmapLabel w) {--------------------------------------------------------------------------------
src/Graphics/UI/WX/Dialogs.hs view
@@ -1,12 +1,12 @@ {-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} ---------------------------------------------------------------------------------{-| Module : Dialogs- Copyright : (c) Daan Leijen 2003- License : wxWindows+{-| Module : Dialogs+ Copyright : (c) Daan Leijen 2003+ License : wxWindows - Maintainer : wxhaskell-devel@lists.sourceforge.net- Stability : provisional- Portability : portable+ Maintainer : wxhaskell-devel@lists.sourceforge.net+ Stability : provisional+ Portability : portable Defines common dialogs.
src/Graphics/UI/WX/Frame.hs view
@@ -11,10 +11,10 @@ Frames. -* Instances: 'HasImage', 'Form', 'Closeable', 'Framed' -- - 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child', +* Instances: 'Form', 'Closeable', 'Framed' --+ 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child', 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint',- 'HasDefault'.+ 'HasDefault'. -}
src/Graphics/UI/WX/Menu.hs view
@@ -301,13 +301,13 @@ 1) As an "on command" on the menu item itself. 2) With an "on (menu xxx)" on a window. - Unfortunately, wxWindows does not support method (1) for menus that are+ Unfortunately, wxWidgets does not support method (1) for menus that are part of a menubar and assumes they are set on using (2) on the associated- frame. We can't tell whether a menu is part of a menubar or popupmenu untill- the user sets it. Thus we both set the eventhandlers always directly on the+ frame. We can't tell whether a menu is part of a menubar or popup menu until+ the user sets it. Thus we both set the event handlers always directly on the top level menu (this is good enough for popup menus) and we maintain a list of menu item id's and associated event handler as client data on the- top level menu. When the menu is set as part of a menubar, we install the+ top level menu. When the menu is set as part of a menu bar, we install the handlers on the associated frame. --------------------------------------------------------------------------------} instance Commanding (MenuItem a) where@@ -326,7 +326,7 @@ topmenu <- menuItemGetTopMenu item -- always set it on the menu itself (has only effect on popup menus) evtHandlerOnMenuCommand topmenu id io- -- update the haskell event handler list for delayed frame installation+ -- update the Haskell event handler list for delayed frame installation menuUpdateEvtHandlers topmenu (insert id io) -- and set it directly on the frame if already instantiated. frame <- menuGetFrame topmenu@@ -443,7 +443,7 @@ -- -- * Events: 'tool' ----- * Instances: 'Textual', 'Able', 'Help', 'Tipped', 'Checkable', 'Identity', 'Commanding'.+-- * Instances: 'Able', 'Help', 'Tipped', 'Checkable', 'Identity', 'Commanding'. -- data ToolBarItem = ToolBarItem (ToolBar ()) Id Bool @@ -526,7 +526,7 @@ = evtHandlerOnMenuCommand w id io -- | Create a tool bar item based on a menu. Takes a a relevant menu--- item, a label and an image file (bmp,png,gif,ico,etc.) as arguments. The image+-- item, a label and an image file (bmp, png, gif, ico, etc.) as arguments. The image -- file is normally 16x15 pixels. -- The toolbar item will fire the relevant menu items just as if the menu has been selected. -- Checkable menus will give a checkable toolbar item. Beware though that checkable tools@@ -555,7 +555,7 @@ -- | Create an /orphan/ toolbar item that is unassociated with a menu. Takes a -- label, a flag that is 'True' when the item is 'checkable' and a path to an image--- (bmp,png,gif,ico,etc.) as arguments.+-- (bmp, png, gif, ico, etc.) as arguments. toolItem :: ToolBar a -> String -> Bool -> FilePath -> [Prop ToolBarItem] -> IO ToolBarItem toolItem toolbar label isCheckable bitmapPath props = withBitmapFromFile bitmapPath $ \bitmap ->@@ -586,11 +586,11 @@ data StatusField = SF (Var Int) (Var (StatusBar ())) (Var Int) (Var String) -- | The status width attribute determines the width of a status bar field.--- A negative width makes the field strechable. The width than determines--- the amount of stretch in relation with other fields. The default +-- A negative width makes the field stretchable. The width than determines+-- the amount of stretch in relation to other fields. The default -- status width is @-1@, ie. all fields stretch evenly. ----- Here is an example of a statusbar+-- Here is an example of a status bar -- with three fields, where the last field is 50 pixels wide, the first takes -- 66% of the remaining space and the second field 33%. --
src/Graphics/UI/WX/TopLevelWindow.hs view
@@ -14,7 +14,7 @@ In the wxHaskell implementation, TopLevel has been added to encapsulate some of the common functionality between the 'Dialog' and 'Frame' modules. -* Instances: 'HasDefault' +* Instances: 'HasDefault', 'Pictured', 'Framed', 'Form', 'Closeable' * Instances inherited from 'Window': 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child', 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'.
src/Graphics/UI/WX/Window.hs view
@@ -10,7 +10,8 @@ Exports default instances for generic windows. -* Instances: 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible', 'Child', +* Instances: 'Textual', 'Literate', 'Dimensions', 'Colored', 'Visible',+ 'Child', 'Sized', 'Parent', 'Help', 'Bordered', 'Able', 'Tipped', 'Identity', 'Styled', 'Reactive', 'Paint'. -} --------------------------------------------------------------------------------
wx.cabal view
@@ -1,5 +1,5 @@ Name: wx-Version: 0.90.0.1+Version: 0.90.1.0 License: OtherLicense License-file: license.txt Homepage: http://haskell.org/haskellwiki/WxHaskell@@ -24,7 +24,7 @@ Library if flag(splitBase)- build-depends: wxcore >= 0.90,+ build-depends: wxcore >= 0.90.1.0, stm if flag(newBase) build-depends:@@ -34,7 +34,7 @@ base >= 3 && < 4 else build-depends: base < 3, - wxcore >= 0.90,+ wxcore >= 0.90.1.0, stm Exposed-Modules: