I wanted to have a vertical slider with small numbers at the bottom and
large numbers at the top. To this end I implemented a variant of
'vslider' that automatically inverses its direction, if the bottom value
is smaller than the top value. You may like to replace the current
'vslider' implementation by this one (and the hslider accordingly).


wxSL_INVERSE :: Int
wxSL_INVERSE = 0x1000

vslider ::
   WX.Window a -> Bool -> Int -> Int ->
   [WX.Prop (WX.Slider ())] -> IO (WX.Slider ())
vslider parentW showLabels top bottom props =
   let (minV, maxV, dirFlags) =
          if top<bottom
            then (top, bottom, 0)
            else (bottom, top, wxSL_INVERSE)
   in  WX.sliderEx parentW minV maxV
          (WXCore.wxVERTICAL .+. dirFlags -- .+. wxSL_LEFT .+.
wxSL_AUTOTICKS
            .+. (if showLabels then WXCore.wxSL_LABELS else 0))
          props

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to