Thu Jan 19 16:43:10 WET 2006 Miguel Vilaca <jmvilaca@di.uminho.pt>
* extend DisplayOptions and correct View Menu
Extend the DisplayOptions type with EdgeLabel.
The View Menu wasn't indicating correctly which DisplayOptions are being used.
This patch fixs that problem substituting RadioItems by checkable MenuItems.
{
hunk ./src/DisplayOptions.hs 6
-data What = NodeLabel | NodeInfo | EdgeInfo deriving (Eq)
+data What = NodeLabel | NodeInfo | EdgeLabel | EdgeInfo deriving (Eq)
hunk ./src/NetworkUI.hs 179
- ; menuRadioItem viewMenu
- [ text := "Node Labels"
+ ; menuItem viewMenu
+ [ text := "Node Label"
+ , checkable := True
hunk ./src/NetworkUI.hs 186
- ; menuRadioItem viewMenu
+ ; menuItem viewMenu
hunk ./src/NetworkUI.hs 188
+ , checkable := True
hunk ./src/NetworkUI.hs 193
- ; menuRadioItem viewMenu
+ ; menuItem viewMenu
+ [ text := "Edge Label"
+ , checkable := True
+ , checked := EdgeLabel `elem` opts
+ , on command := safetyNet theFrame $ do
+ { changeDisplayOptions (toggle EdgeLabel) state
+ ; repaintAll state } ]
+ ; menuItem viewMenu
hunk ./src/NetworkUI.hs 202
+ , checkable := True
hunk ./src/NetworkView.hs 58
- ; mapM_ (\edge -> drawEdge edge []) (getEdges network)
+ ; mapM_ (\edge -> drawEdge edge []) (getEdgeAssocs network)
hunk ./src/NetworkView.hs 61
- drawEdge (getEdge edgeNr network) kSELECTED_OPTIONS
+ drawEdge (edgeNr, getEdge edgeNr network) kSELECTED_OPTIONS
hunk ./src/NetworkView.hs 148
- drawEdge :: InfoKind e g => Edge e -> [Prop (DC ())] -> IO ()
- drawEdge edge options =
+ drawEdge :: InfoKind e g => (EdgeNr, Edge e) -> [Prop (DC ())] -> IO ()
+ drawEdge (edgeNr, edge) options =
hunk ./src/NetworkView.hs 152
- ; logicalPoly ppi dc [pt2, tr1, tr2] (options ++ solidFill licorice)
- -- draw info
+ -- ; logicalPoly ppi dc [pt2, tr1, tr2] (options ++ solidFill licorice)
+[_^I_][_$_]
+ -- draw label
+ ; when (EdgeLabel `elem` dpShowInfo opt) $
+ drawLabel 0 False [toEnum (edgeNr + fromEnum 'a' -1)] [_$_]
+ (translate (DoublePoint 0.2 0.1 )$ middle via)
+ (Justify LeftJ TopJ)
+ [ textColor := wxcolor kEdgeLabelColour ] [_$_]
+
+ -- draw info
}