Parent Directory
|
Revision Log
Sticky Revision: |
made a copy
2006-09-18 Didrik Pinte <dpinte@itae.be> * wxPython 2.6 update : wx 2.4 syntax has been updated to 2.6
Remove the #! line as it annoys lintian which warns about these files not being executable. The #! isn't necessary here since if you absolutely must execute them you can always say "python <filename>".
Dialog derived from NonModalNonParentDialog
Explicit imports.
Implement multiple selected shapes * Thuban/UI/selection.py: New module with a class to represent the selection. * Thuban/UI/messages.py (SELECTED_TABLE, SELECTED_MAP): Remove these unused messages * Thuban/UI/application.py (ThubanApplication.OnInit) (ThubanApplication.OnExit, ThubanApplication.SetSession): The interactor is gone now. (ThubanApplication.CreateMainWindow): There is no interactor anymore so we pass None as the interactor argument for now for compatibility. * Thuban/UI/view.py (MapCanvas.delegated_messages) (MapCanvas.Subscribe, MapCanvas.Unsubscribe): In Subscribe and Unsubscribe, delegate messages according to the delegated_messages class variable. (MapCanvas.__getattr__, MapCanvas.delegated_methods): Get some attributes from instance variables as described with the delegated_methods class variable. (MapCanvas.__init__): New instance variable selection holding the current selection (MapCanvas.do_redraw): Deal with multiple selected shapes. Simply pass them on to the renderer (MapCanvas.SetMap): Clear the selection when a different map is selected. (MapCanvas.shape_selected): Simple force a complete redraw. The selection class now takes care of only issueing SHAPES_SELECTED messages when the set of selected shapes actually does change. (MapCanvas.SelectShapeAt): The selection is now managed in self.selection * Thuban/UI/mainwindow.py (MainWindow.delegated_messages) (MainWindow.Subscribe, MainWindow.Unsubscribe): In Subscribe and Unsubscribe, delegate messages according to the delegated_messages class variable. (MainWindow.delegated_methods, MainWindow.__getattr__): Get some attributes from instance variables as described with the delegated_methods class variable. (MainWindow.__init__): The interactor as ivar is gone. The parameter is still there for compatibility. The selection messages now come from the canvas. (MainWindow.current_layer, MainWindow.has_selected_layer): Delegate to the the canvas. (MainWindow.LayerShowTable, MainWindow.Classify) (MainWindow.identify_view_on_demand): The dialogs don't need the interactor parameter anymore. * Thuban/UI/tableview.py (TableFrame.__init__) (LayerTableFrame.__init__, LayerTableFrame.OnClose) (LayerTableFrame.row_selected): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. Subscribe to SHAPES_SELECTED instead of SELECTED_SHAPE * Thuban/UI/dialogs.py (NonModalDialog.__init__): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. * Thuban/UI/classifier.py (Classifier.__init__): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. * Thuban/UI/tree.py (SessionTreeView.__init__): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. (SessionTreeCtrl.__init__): New parameter mainwindow which is stored as self.mainwindow. The mainwindow is need so that the tree can still subscribe to the selection messages. (SessionTreeCtrl.__init__, SessionTreeCtrl.unsubscribe_all) (SessionTreeCtrl.update_tree, SessionTreeCtrl.OnSelChanged): The selection is now accessible through the mainwindow. Subscribe to SHAPES_SELECTED instead of SELECTED_SHAPE * Thuban/UI/identifyview.py (IdentifyView.__init__): Use the SHAPES_SELECTED message now. (IdentifyView.selected_shape): Now subscribed to SHAPES_SELECTED, so deal with multiple shapes (IdentifyView.__init__, IdentifyView.OnClose): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. * Thuban/UI/renderer.py (ScreenRenderer.RenderMap): Rename the selected_shape parameter and ivar to selected_shapes. It's now a list of shape ids. (MapRenderer.draw_label_layer): Deal with multiple selected shapes. Rearrange the code a bit so that the setup and shape type distinctions are only executed once.
Create an empty image to use when there is no special image for an item.
Try using a 0x0 image for items that don't need an image so that the tree looks OK under Windows.
Fixed problem with unwanted tree item images under Windows.
Changed SESSION_CHANGED to SESSION_REPLACED. Go back to using OnClose() instead of Shutdown().
(SessionTreeView): Remove OnClose and let the parent class handle it. Add Shutdown() to unsubscibe from event notification and call the parent Shutdown(). This was necessary so the application can close the tree window.
Use common.py functions.
Formatting changes.
Handle drawing Colors in the tree view.
Replace user string by _() for i18n.
(SessionTreeCtrl.normalize_selection): Handle the case of selected items that are not children of Layers or Maps properly. Previously this bug would trigger an assertion in wxWindows.
* Thuban/UI/tree.py: We can now simply subscribe to the session's CHANGED channel to be informed of changes. (SessionTreeCtrl.session_channels): Not needed any longer. (SessionTreeCtrl.unsubscribe_all, SessionTreeCtrl.session_changed): Only have to (un)subscribe CHANGED
* Thuban/UI/tree.py (SessionTreeCtrl.update_tree): The interactor's selected_layer may not be a layer of the current session when the tree is updated while a new session is being set.
* Thuban/UI/tree.py (color_string): Removed. No longer used. (SessionTreeCtrl.update_tree, SessionTreeCtrl.add_items): Split update_tree into update_tree and add_items. The tree now uses a more generic way to display the contents of the tree. (SessionTreeCtrl): Add a doc string explaining the TreeInfo method * Thuban/Model/layer.py (Layer.TreeInfo), Thuban/Model/extension.py (Extension.TreeInfo), Thuban/Model/map.py (Map.TreeInfo), Thuban/Model/session.py (Session.TreeInfo): Add TreeInfo methods to implement the new tree view update scheme
(SessionTreeCrtl:update_tree): Added visualization of Extension titles and title and names of its objects.
* Thuban/UI/tree.py (SessionTreeCtrl.update_tree): Deal with the layer's bbox being None.
* Thuban/UI/tree.py (SessionTreeCtrl.unsubscribe_all): Remove a debug print and set session to None after unsubscribing
* Thuban/UI/tree.py (session_channels): New class constant with all the session channels to subscribe to to update the tree (SessionTreeCtrl.session_changed): Remember the session so that we can unsubscribe properly. Use the new class constant to unsubscribe from the old session and subscribe to the new one. (SessionTreeCtrl.unsubscribe_all): New method to unsubscribe all subscriptions of the SessionTreeCtrl. (SessionTreeView.OnClose): Call the tree's unsubscribe_all method.
added test for None on map bounding box
added map extent to tree view
add filename and modified status to tree view
* Thuban/UI/tree.py (SessionTreeCtrl.OnSelChanged): Make sure to deselect the layer if no layer is selected
* Thuban/UI/tree.py (SessionTreeCtrl, SessionTreeView.__init__): Correct the spelling of SessionTreeCtrl. dabbrev is too damn convenient :-) (SessionTreeCtrl.__init__, SessionTreeCtrl.update_tree): Introduce a new instvar layer_to_item to map layers to tree items (SessionTreeCtrl.layer_selected): Select the appropriate tree item to match the current selection in the interactor
* Thuban/UI/tree.py (myTreeCtrlPanel): (SessioinTreeCtrl): Rename to SessioinTreeCtrl and turn it into a TreeCtrl isntead of a panel. This affects most method since we now refer to self instead of self.tree (SessionTreeView): New class implementing a non-modal dialog showing the session tree.
* Thuban/UI/tree.py (myTreeCtrlPanel.__init__): New inst var changing_selection to avoid recursive selection events when modifying the selection in response to a selection event. (myTreeCtrlPanel.normalize_selection): Set the new inst var when changing the tree's selection. (myTreeCtrlPanel.OnSelChanged): Only normalize the selection when we're not being called indirectly from normalize_selection.
import all the source files
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |