Changeset 2094
- Timestamp:
- 09/06/07 05:12:04 (10 months ago)
- Files:
-
- gaphas/trunk/README.txt (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphas/trunk/README.txt
r1855 r2094 21 21 .. contents:: 22 22 23 23 24 How it Works 24 25 ============ … … 54 55 3. Solve constraints. 55 56 4. Normalize items by setting the coordinates of the first handle to (0, 0). 56 5. Updating Can avs-to-Item matrices for items that have been changed by57 normaliza rion, just to be on the save side.57 5. Updating Canvas-to-Item matrices for items that have been changed by 58 normalization, just to be on the save side. 58 59 6. Item.post_update(context) for each item marked for update, including items 59 60 that have been marked during constraint solving. … … 75 76 A word about the constraint solver seems in place. It is one of the big 76 77 features of this library after all. The Solver is able to solve constraints. 77 Constraints can be applied to items (e.g. the Element item uses constraints to 78 maintain it's recangular shape) and constraints can be created *between* items 79 (for example a line that connects to a box). 80 81 Constaints that apply to one item are pretty straight forward, as all variables 78 Constraints can be applied to items (Variables owned by the item actually). 79 Element items, for example, uses constraints to maintain their recangular 80 shape. Constraints can be created *between* items (for example a line that 81 connects to a box). 82 83 Constraints that apply to one item are pretty straight forward, as all variables 82 84 live in the same coordinate system (of the item). The variables (in most cases 83 85 a Handle's x and y coordinate) can simply be put in a constraint. … … 97 99 Canvas (first root item, then it's children; second root item, etc.) 98 100 99 There used to be a draw_children() method in the view context. This method100 has been rendered obsolete (mainly to speed up drawing).101 101 The view context passed to the Items draw() method has the following properties: 102 102 … … 123 123 Tools 124 124 ----- 125 Behavio r is added to the canvas(-view) by tools.126 127 Tools can be chained together in order to provide more complex behavio r.125 Behaviour is added to the canvas(-view) by tools. 126 127 Tools can be chained together in order to provide more complex behaviour. 128 128 129 129 To make it easy a DefaultTool has been defined: a ToolChain instance with the … … 144 144 HandleTool 145 145 The HandleTool is used to deal with handles. Handles can be dragged around. 146 Clicking on a handle automatically makes the underl aying item the focused146 Clicking on a handle automatically makes the underlying item the focused 147 147 item. 148 148 … … 151 151 152 152 TextEditTool 153 This is a demo-tool, featuring a text-edit pop up.153 This is a demo-tool, featuring a text-edit pop-up. 154 154 155 155 RubberbandTool 156 The last tool in line is the rubberband tool. It's invoked when the mouse156 The last tool in line is the rubber band tool. It's invoked when the mouse 157 157 button is pressed on a section of the view where no items or handles are 158 158 present. It allows the user to select items using a selection box 159 (rubber band).159 (rubber band). 160 160 161 161 … … 166 166 see that especially the way items connect with each other is not the way 167 167 you want it. That's okay. HandleTool provides some hooks (connect, disconnect 168 and glue) to implement custom connection behavio r (in fact, the default168 and glue) to implement custom connection behaviour (in fact, the default 169 169 implementation doesn't do any connecting at all!). 170 170 … … 195 195 196 196 tree.py: 197 Central tree structure (no more CanvasGroupable)197 Central tree structure 198 198 solver.py: 199 199 A constraint solver (infinite domain, based on diacanvas2's solver) … … 221 221 Simple example classes. 222 222 223 223 224 Guidelines 224 225 ========== 226 227 Documentation should be in UK English. 228 225 229 Following the `Python coding guidelines`_ indentation should be 4 spaces 226 230 (no tabs), function and method names should be ``lowercase_with_underscore()``, … … 249 253 250 254 .. _Python coding guidelines: http://www.python.org/dev/peps/pep-0008/ 255
