From: Duncan C. <dun...@us...> - 2005-01-08 15:23:20
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv684/gtk/Graphics/UI/Gtk/Layout Added Files: AspectFrame.chs Fixed.chs HBox.chs HButtonBox.chs HPaned.chs Log Message: hierarchical namespace conversion --- NEW FILE: HPaned.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget HPaned -- -- Author : Axel Simon -- -- Created: 15 May 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 15:23:11 $ -- -- Copyright (c) 1999..2002 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.Layout.HPaned ( HPaned, HPanedClass, castToHPaned, hPanedNew ) where import Monad (liftM) import System.Glib.FFI import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} {# context lib="gtk" prefix="gtk" #} -- methods -- | -- hPanedNew :: IO HPaned hPanedNew = makeNewObject mkHPaned $ liftM castPtr {#call unsafe hpaned_new#} --- NEW FILE: AspectFrame.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget AspectFrame -- -- Author : Axel Simon -- -- Created: 15 May 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 15:23:11 $ -- -- Copyright (c) 1999..2002 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- A frame that constrains its child to a particular aspect ratio. -- -- * The 'AspectFrame' is useful when you want pack a widget so -- that it can -- resize but always retains the same aspect ratio. For instance, one might -- be drawing a small preview of a larger image. 'AspectFrame' -- derives from -- 'Frame', so it can draw a label and a frame around the child. -- The frame -- will be \"shrink-wrapped\" to the size of the child. -- module Graphics.UI.Gtk.Layout.AspectFrame ( AspectFrame, AspectFrameClass, castToAspectFrame, aspectFrameNew, aspectFrameSet ) where import Monad (liftM) import Maybe (isNothing) import System.Glib.FFI import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} {# context lib="gtk" prefix="gtk" #} -- methods -- | Create an AspectFrame widget. -- -- * If ratio is not given, the aspect ratio is taken from the child widget. -- -- * The frame may be augmented with a label which can be set by -- @frameSetLabel@. -- aspectFrameNew :: Float -> Float -> Maybe Float -> IO AspectFrame aspectFrameNew xalign yalign ratio = makeNewObject mkAspectFrame $ liftM castPtr $ {#call unsafe aspect_frame_new#} nullPtr (realToFrac xalign) (realToFrac yalign) (maybe 0.0 realToFrac ratio) (fromBool $ isNothing ratio) -- | Change the space use behaviour of an -- 'AspectFrame'. -- aspectFrameSet :: AspectFrameClass af => af -> Float -> Float -> Maybe Float -> IO () aspectFrameSet af xalign yalign ratio = {#call aspect_frame_set#} (toAspectFrame af) (realToFrac xalign) (realToFrac yalign) (maybe 0.0 realToFrac ratio) (fromBool $ isNothing ratio) --- NEW FILE: HBox.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget HBox -- -- Author : Axel Simon -- -- Created: 15 May 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 15:23:11 $ -- -- Copyright (c) 1999..2002 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- This is a special version of 'Box'. This widget shows its child -- widgets in a horizontal line. -- module Graphics.UI.Gtk.Layout.HBox ( HBox, HBoxClass, castToHBox, hBoxNew ) where import Monad (liftM) import System.Glib.FFI import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} {# context lib="gtk" prefix="gtk" #} -- methods -- | -- Create a container that shows several children horizontally. If -- @homogeneous@ -- is set all children will be allotted the same amount of space. There will be -- @spacing@ pixel between each two children. -- hBoxNew :: Bool -> Int -> IO HBox hBoxNew homogeneous spacing = makeNewObject mkHBox $ liftM castPtr $ {#call unsafe hbox_new#} (fromBool homogeneous) (fromIntegral spacing) -- --- NEW FILE: Fixed.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget Fixed -- -- Author : Duncan Coutts -- Created: 2 August 2004 -- -- Copyright (c) 2004 Duncan Coutts -- documentation Copyright (c) 1995..2000 the GTK+ Team -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Library General Public -- License as published by the Free Software Foundation; either -- version 2 of the License, or (at your option) any later version. -- -- This library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Library General Public License for more details. -- -- | -- -- The 'Fixed' widget is a container which can place child widgets at fixed -- positions and with fixed sizes, given in pixels. 'Fixed' performs no -- automatic layout management. -- -- For most applications, you should not use this container! It keeps you from -- having to learn about the other GTK+ containers, but it results in broken -- applications. -- -- * Themes, which may change widget sizes. -- -- * Fonts other than the one you used to write the app will of course change -- the size of widgets containing text; keep in mind that users may use a larger -- font because of difficulty reading the default, or they may be using Windows -- or the framebuffer port of GTK+, where different fonts are available. -- -- * Translation of text into other languages changes its size. Also, display of -- non-English text will use a different font in many cases. -- -- In addition, the fixed widget can't properly be mirrored in right-to-left -- languages such as Hebrew and Arabic. i.e. normally GTK+ will flip the -- interface to put labels to the right of the thing they label, but it can't do -- that with 'Fixed'. So your application will not be usable in right-to-left -- languages. -- -- Finally, fixed positioning makes it kind of annoying to add\/remove GUI -- elements, since you have to reposition all the other elements. This is a -- long-term maintenance problem for your application. -- -- If you know none of these things are an issue for your application, and -- prefer the simplicity of 'Fixed', by all means use the widget. But you should -- be aware of the tradeoffs. -- module Graphics.UI.Gtk.Layout.Fixed ( fixedNew, fixedPut, fixedMove, fixedSetHasWindow, fixedGetHasWindow ) where import Monad (liftM) import System.Glib.FFI import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} {# context lib="gtk" prefix="gtk" #} -- | Creates a new 'Fixed' container. -- fixedNew :: IO Fixed fixedNew = makeNewObject mkFixed $ liftM castPtr $ {#call unsafe fixed_new#} -- | Adds a widget to a 'Fixed' container at the given position. -- fixedPut :: (FixedClass obj, WidgetClass widget) => obj -> widget -> (Int, Int) -> IO () fixedPut obj widget (x, y) = {#call fixed_put#} (toFixed obj) (toWidget widget) (fromIntegral x) (fromIntegral y) -- | Moves a child of a 'Fixed' container to the given position. -- fixedMove :: (FixedClass obj, WidgetClass widget) => obj -> widget -> (Int, Int) -> IO () fixedMove obj widget (x, y) = {#call fixed_move#} (toFixed obj) (toWidget widget) (fromIntegral x) (fromIntegral y) -- | Sets whether the 'Fixed' widget is created with a separate "DrawWindow" for -- its window or not. (By default, it will be created with no separate -- "DrawWindow"). This function must be called while the widget is not realized, -- for instance, immediately after the window is created. -- fixedSetHasWindow :: FixedClass obj => obj -> Bool -> IO () fixedSetHasWindow obj hasWindow = {#call fixed_set_has_window#} (toFixed obj) (fromBool hasWindow) -- | Gets whether the 'Fixed' container has its own "DrawWindow". See -- 'fixedSetHasWindow'. -- fixedGetHasWindow :: FixedClass obj => obj -> IO Bool fixedGetHasWindow obj = liftM toBool $ {#call unsafe fixed_get_has_window#} (toFixed obj) --- NEW FILE: HButtonBox.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget HButtonBox -- -- Author : Matthew Walton -- -- Created: 29 April 2004 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 15:23:11 $ -- -- Copyright (c) 2004 Matthew Walton -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.Layout.HButtonBox ( HButtonBox, HButtonBoxClass, castToHButtonBox, hButtonBoxNew ) where import Monad (liftM) import System.Glib.FFI import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} {# context lib="gtk" prefix="gtk" #} --methods -- | -- hButtonBoxNew :: IO HButtonBox hButtonBoxNew = makeNewObject mkHButtonBox $ liftM castPtr {#call unsafe hbutton_box_new#} |