Mercurial > gui
view examples/navtest.ur @ 19:3a303df9ae92
Partial generalize togglePanel solution (breaks build)
author | Ron de Bruijn <rmbruijn@gmail.com> |
---|---|
date | Fri, 23 Sep 2011 13:30:01 +0200 |
parents | 48a4180171b0 |
children |
line wrap: on
line source
open Navbar open Navigation val bar = navAdd (mkNavItem "Item 2" (bless "http://item2.com")) (navAdd (mkNavItem "Item 1" (bless "http://item1.org")) emptyNavBar) val link = mkNavItem "Special link" (bless "http://special.net") structure N = Make(struct con navbarPos = [Main] con msgPos = [Top] con themePos = [Main] val linkStyles = {Special = None} fun formatNav barPieces lnkPieces msgPieces = {Main = <xml>{msgPieces.Top}<h3>Here is a menu.</h3><ul>{barPieces.Main}<li>{lnkPieces.Special}</li></ul></xml>} end) open N val topMsg : xbody = <xml><div>A banner message</div></xml> val nav = mkNav {Main = bar} {Special = Some link} {Top = Some topMsg} val xml = toXml nav fun main () = return <xml> <head> <title>Navbar Based Navigation.</title> </head> <body> <h1>Example of using a Navigation.</h1> <p> This is a theme widget which manages a set of links, messages and menus for site navigation. </p> <h2>Example of a navigation turned into a piece of xml.</h2> <div> {xml.Main} </div> </body> </xml>