From: <kr_...@us...> - 2003-08-15 21:26:04
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv11074/port/src/Port Modified Files: Menu.hs Log Message: Simplified API for MenuRadioItems Index: Menu.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Menu.hs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Menu.hs 17 Jul 2003 19:30:03 -0000 1.9 --- Menu.hs 15 Aug 2003 21:24:54 -0000 1.10 *************** *** 22,34 **** , insertMenuItem , insertMenuSeparatorItem ! , insertMenuCheckItem , setMenuItemAccel, getMenuItemAccel , setMenuItemEnabled, getMenuItemEnabled , setMenuItemChecked, getMenuItemChecked ! , setMenuItemBitmap, getMenuItemBitmap ! -- * Radio groups and radio items ! , insertMenuRadioGroup ! , insertMenuRadioItem ! , setMenuRadioGroupSelection, getMenuRadioGroupSelection -- * Common functions , destroyMenu --- 22,32 ---- , insertMenuItem , insertMenuSeparatorItem ! , insertMenuCheckItem ! , insertMenuRadioItem ! , setMenuRadioGroup , setMenuItemAccel, getMenuItemAccel , setMenuItemEnabled, getMenuItemEnabled , setMenuItemChecked, getMenuItemChecked ! , setMenuItemBitmap, getMenuItemBitmap -- * Common functions , destroyMenu *************** *** 70,76 **** ----------------------------------------------------------------------------------------- ! -- | Add a menu item. Use a null character ('keyNull') if no ! -- short-cut key should be registered. An event handler for a menu item can be ! -- installed with 'registerMenuCommand'. insertMenuItem :: MenuHandle -> Maybe Int -> IO MenuHandle insertMenuItem handle pos = osInsertMenuItem handle (fromMaybe (-1) pos) --- 68,73 ---- ----------------------------------------------------------------------------------------- ! -- | Add a menu item. An event handler for a menu item can be ! -- installed with 'setMenuCommandHandler'. insertMenuItem :: MenuHandle -> Maybe Int -> IO MenuHandle insertMenuItem handle pos = osInsertMenuItem handle (fromMaybe (-1) pos) *************** *** 78,86 **** -- | Add a checkable menu item. An event handler for a menu item can be ! -- installed with 'registerMenuCommand'. insertMenuCheckItem :: MenuHandle -> Maybe Int -> IO MenuHandle insertMenuCheckItem handle pos = osInsertMenuCheckItem handle (fromMaybe (-1) pos) foreign import ccall osInsertMenuCheckItem :: MenuHandle -> Int -> IO MenuHandle -- | Add a menu item separator line. insertMenuSeparatorItem :: MenuHandle -> Maybe Int -> IO MenuHandle --- 75,93 ---- -- | Add a checkable menu item. An event handler for a menu item can be ! -- installed with 'setMenuCommandHandler'. insertMenuCheckItem :: MenuHandle -> Maybe Int -> IO MenuHandle insertMenuCheckItem handle pos = osInsertMenuCheckItem handle (fromMaybe (-1) pos) foreign import ccall osInsertMenuCheckItem :: MenuHandle -> Int -> IO MenuHandle + -- | Add a menu radio item. . An event handler for a menu item can be + -- installed with 'setMenuCommandHandler'. + insertMenuRadioItem :: MenuHandle -> Maybe Int -> IO MenuHandle + insertMenuRadioItem handle pos = osInsertMenuRadioItem handle (fromMaybe (-1) pos) + foreign import ccall osInsertMenuRadioItem :: MenuHandle -> Int -> IO MenuHandle + + setMenuRadioGroup :: [MenuHandle] -> IO () + setMenuRadioGroup handles = withArray0 nullHandle handles osSetMenuRadioGroup + foreign import ccall osSetMenuRadioGroup :: Ptr MenuHandle -> IO () + -- | Add a menu item separator line. insertMenuSeparatorItem :: MenuHandle -> Maybe Int -> IO MenuHandle *************** *** 131,154 **** map <- readMVar menuBitmaps return (PtrMap.lookup hmenu map) - - ----------------------------------------------------------------------------------------- - -- Radio groups and radio items - ----------------------------------------------------------------------------------------- - - -- | Add a radio group to the menu. - insertMenuRadioGroup :: MenuHandle -> Maybe Int -> IO MenuHandle - insertMenuRadioGroup handle pos = osInsertMenuRadioGroup handle (fromMaybe (-1) pos) - foreign import ccall osInsertMenuRadioGroup :: MenuHandle -> Int -> IO MenuHandle - - -- | Add a menu radio item to the radio group. - insertMenuRadioItem :: MenuHandle -> Maybe Int -> IO MenuHandle - insertMenuRadioItem handle pos = osInsertMenuRadioItem handle (fromMaybe (-1) pos) - foreign import ccall osInsertMenuRadioItem :: MenuHandle -> Int -> IO MenuHandle - - -- | Select an active item in the radio group. - foreign import ccall "osSetMenuRadioGroupSelection" setMenuRadioGroupSelection :: MenuHandle -> Int -> IO () - - -- | returns an index of the currently selected radio item. - foreign import ccall "osGetMenuRadioGroupSelection" getMenuRadioGroupSelection :: MenuHandle -> IO Int ----------------------------------------------------------------------------------------- --- 138,141 ---- |