Fri Nov 18 23:54:43 WET 2005 Malcolm.Wallace@cs.york.ac.uk
* Draw rectangle when dragging canvas area for multiple selection.
{
hunk ./Makefile 143
+src/Document.o : src/Math.hi
hunk ./src/Document.hs 20
+import Math
hunk ./src/Document.hs 36
- | MultipleSelection Bool [Int] [(Int,Int)]
+ | MultipleSelection (Maybe (DoublePoint,DoublePoint)) [Int] [(Int,Int)]
+ -- DoublePoint pair is for displaying dragged selection rectangle
hunk ./src/GUIEvents.hs 101
- | i /= j -> selectMultiple False (nub [i,j]) [] state
- ViaSelection e v -> selectMultiple False [j] [(e,v)] state
+ | i /= j -> selectMultiple Nothing (nub [i,j]) [] state
+ ViaSelection e v -> selectMultiple Nothing [j] [(e,v)] state
hunk ./src/GUIEvents.hs 104
- | j `elem` ns -> selectMultiple False (ns\\[j]) vs state
- | otherwise -> selectMultiple False (j:ns) vs state
+ | j `elem` ns -> selectMultiple Nothing (ns\\[j]) vs state
+ | otherwise -> selectMultiple Nothing (j:ns) vs state
hunk ./src/GUIEvents.hs 110
- case getSelection doc of
- NodeSelection i -> selectMultiple False [i] [(e,v)] state
- ViaSelection e' v'
- | e==e' && v==v' -> selectNothing state
- | otherwise -> selectMultiple False [] [via,(e',v')]
+ case getSelection doc of
+ NodeSelection i -> selectMultiple Nothing [i] [(e,v)] state
+ ViaSelection e' v'
+ | e==e' && v==v' -> selectNothing state
+ | otherwise -> selectMultiple Nothing [] [via,(e',v')]
hunk ./src/GUIEvents.hs 116
- MultipleSelection _ ns vs
- | via `elem` vs -> selectMultiple False ns (vs\\[via])
+ MultipleSelection _ ns vs
+ | via `elem` vs -> selectMultiple Nothing ns (vs\\[via])
hunk ./src/GUIEvents.hs 119
- | otherwise -> selectMultiple False ns (via:vs) state
- _ -> selectVia e v state
+ | otherwise -> selectMultiple Nothing ns (via:vs) state
+ _ -> selectVia e v state
hunk ./src/GUIEvents.hs 137
- MultipleSelection False ns vs ->
+ MultipleSelection Nothing ns vs ->
hunk ./src/GUIEvents.hs 139
- MultipleSelection True _ _ ->
+ MultipleSelection _ _ _ ->
hunk ./src/GUIEvents.hs 158
- MultipleSelection False ns vs ->
+ MultipleSelection Nothing ns vs ->
hunk ./src/GUIEvents.hs 160
- MultipleSelection True _ _ ->
+ MultipleSelection _ _ _ ->
hunk ./src/NetworkControl.hs 250
-selectMultiple :: Bool -> [Int] -> [(Int,Int)] -> State g n e -> IO ()
+selectMultiple :: Maybe (DoublePoint,DoublePoint) -> [Int] -> [(Int,Int)]
+ -> State g n e -> IO ()
hunk ./src/NetworkControl.hs 263
--- ; selectMultiple False nodeNrs viaNrs state -- already selected
+-- ; selectMultiple Nothing nodeNrs viaNrs state -- already selected
hunk ./src/NetworkControl.hs 316
- ; selectMultiple True [] [] state
+ ; selectMultiple (Just (mousePoint,mousePoint)) [] [] state
hunk ./src/NetworkControl.hs 327
- ; selectMultiple True ns vs state
+ ; selectMultiple (Just (origin,mousePoint)) ns vs state
hunk ./src/NetworkControl.hs 352
- (setSelection (MultipleSelection False ns vs)) pDoc
+ (setSelection (MultipleSelection Nothing ns vs)) pDoc
hunk ./src/NetworkView.hs 81
+ -- multiple selection drag area rectangle
+ ; case theSelection of
+ MultipleSelection (Just (p,q)) _ _ ->
+ logicalRect ppi dc (doublePointX p) (doublePointY p)
+ (doublePointX q - doublePointX p)
+ (doublePointY q - doublePointY p)
+ [ penColor := wxcolor lightGrey
+ , brushKind := BrushTransparent]
+ _ -> return ()
+
}