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
(BMP_SIZE_W, BMP_SIZE_H): Set both to 16 to match the site of the legend_icon_layer icon. Otherwise wxpython 2.5 complains when the legend is created with the error: PyAssertionError: C++ assertion "(bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0)" failed in ./src/generic/imaglist.cpp(81): invalid bitmap size in wxImageList: this might work on this platform but definitely won't under Windows.
Further wxPython 2.5 changes using patches from Daniel Calvelo Aros so that that wxproj doesn't crash. Added GUI support for selecting alpha channel (opacity can't be selected yet).
Compatibility with wxPython 2.5. The changes should make it work better with 2.5 while still keeping compatibility with 2.4. There are still problems with 2.5, though. * Thuban/UI/dock.py (DockableWindow.__CreateBorder): Pass the size of a spacer as a single item. * Thuban/UI/classifier.py (ClassGroupPropertiesCtrl): Derive only from wxControl * Thuban/UI/legend.py (LegendTree): When running with wxPython < 2.5, add an implementation of the GetFirstChild method that does not require the second parameter. (LegendTree.find_layer, LegendTree._OnMsgMapLayersAdded) (LegendTree._OnMsgMapLayersRemoved, LegendTree.DeleteAllItems) (LegendTree.DeleteChildren, LegendTree.__ShowHideLayer): Do not pass the second parameter to GetFirstChild
ID_POP_xxx: removed. (LegendPanel.__init__): Removed EVT_MENU bindings. (LegendTree._OnRightClick): Replace direct creation of menu via wx Classes by applying the menu definition as of Menu class of menu.py.
Added two items to legend popup menu: Remove Layer and Show Layer Table * Thuban/UI/legend.py (LegendPanel._OnRemoveLayer, LegendPanel._OnShowTable): New event handlers, call the corresponding mainwindow methods. (LegendTree._OnRightClick): Added items to popup menu.
Popup menu for legend. Scheduled for the 1.2 release this was too simple to implement: The popup menu is bound to the legend tree, while the events are hanlded by its anchestor, the legend panel. This allows reuse of all the event handlers already implemented for the legend toolbar buttons. * Thuban/UI/legend.py (LegendPanel.__init__): EVT_MENU macros to add handlers for the events issued by the popup menu. (LegendPanel._OnToggleVisibility): Handler for toggling layer visibility event (LegendPanel._OnProjection): Handler for layer projection event. (LegendTree.__init__): Added EVT_TREE_ITEM_RIGHT_CLICK (LegendTree._OnRightClick): Event handler for right click, select item and pop up menu. (LegendTree.ToggleVisibility): Toggle layer visibility (LegendTree.LayerProjection): Raise layer projection dialog for current layer.
(ScaleBarBitmap.__SetScale): Do scale adjustment here if the map projection uses degrees.
(LegendTree.__init__): Instance variable raiseProperties initialized to prevent endless loops (LegendTree._OnItemActivated): Depending on self.raiseProperties simply raise the properties or open the dialog and issue a second event.
(ScaleBarBitmap.__SetScale): Check if the map is None which may be the case if none has been loaded yet.
(LegendTree.__init__): Add instance variable preventExpandCollapse and subscribe to expanding and collapsing events. (LegendTree.OnItemExpandCollapse): New. Responds to expanding and collapsing events and will veto the event if it has been triggered by the user double clicking on a layer. (LegendTree._OnItemActivated): Set preventExpandCollapse to indicate that an expanding/collapsing event should be vetoed.
(ScaleBarBitmap.__SetScale): Don't draw the scalebar if the current map has no projection set.
(LegendTree.__init__): Remove instance variable layer2id (LegendTree.find_layer): New method to do with brute force what layer2id tried to accomplish (LegendTree._OnMsgLayerChanged) (LegendTree._OnMsgLayerTitleChanged, LegendTree.__ShowHideLayer): Use find_layer instead of layer2id (LegendTree.__RemoveLayer, LegendTree.__AddLayer): No need to update layer2id anymore (LegendTree._OnMsgMapLayersRemoved) (LegendTree._OnMsgMapLayersAdded): Get by without layer2id.
(LegendTree._OnMsgMapLayersRemoved): It's possible that a layer is removed that is not currently selected in the legend so don't check for this.
(LegendTree.GetRootItem): Reset availImgListIndices when a new image list is created
(LegendTree.__init__): New instance variable changing_selection to indicate whether the LegendTree code itself is currently changing the selection (LegendTree.normalize_selection): New method to normalize the selection by selecting the layer item even if the user clicked on the classification. (LegendTree._OnSelChanged): normalize the selection. This works around a bug in wx which doesn't keep track of the selection properly when subtrees are deleted.
The legend was cleared and repopulated any time something changed which caused some state to be lost such as which children were expanded or collapsed. Fixes RTBug #1901. (LegendTree._OnMsgMapLayersAdded): Add only new layers. (LegendTree.__OnMsgMapLayersRemoved): Remove layers that exist in the legend but not in the map. (LegendTree.__FillTree): Move main functionality out into smaller methods that can be used by other methods. (LegendTree.__FillTreeLayer): Reuse old slots in the image list if they are available. (LegendTree.DeleteAllItems): Renamed from __DeleteAllItems so that we override the wxTreeCtrl method. Iterate over children and call __RemoveLayer. (LegendTree.__AddLayer): New. Add a new layer to the legend. (LegendTree.__RemoveLayer): Remove a layer from the legend. (LegendTree.DeleteChildren): New, overrides wxTreeCtrl method. Should only be called with the id of a layer branch. (LegendTree.GetRootItem): New, overrides wxTreeCtrl method. Returns the root item or creates one if necessary.
(LegendTree.__FillTree): Use 'legend_icon_layer'
BMP_SIZE_W = 15 (LegendTree.__FillTree): Display "legend_icon_map.xpm" with layer title. (LegendTree.__FillTreeLayer): Explicitely set SelectedImage.
(LegendPanel._OnMoveTop(), LayerPanel._OnMoveBottom): New, methods bound to tool events. (LegendTree.MoveCurrentItemTop(), LegendTree.MoveCurrentItemBottom): New, methods binding the event methods with the map methods.
(LegendTree.__SetVisibilityStyle): Only gray out the text if not visible. The italic font sometimes exceeds the rendering area.
Change all checks that a layer is an instance of Layer into checks against BaseLayer. (LegendTree.__FillTreeLayer): Only add children to a branch if the layer supports classification.
(ScalebarBitmap.__SetScale): Update to extended scalebar.DrawScalebar header.
Explicit imports.
Import Thuban.UI.scalebar
Initialize ScaleBar with canvas.map
(LegendPanel): Added scalebar bitmap (ScaleBarBitmap): New, links the scalebar bitmap with view messages and the renderer.
(LegendTree.MoveCurrentItemUp, LegendTree.MoveCurrentItemDown): If the layer or any of the layer's groups are selected, move the layer up/down. Fixes RTbug #1833.
(LegendPanel.__init__): The toolbar should be allowed to grow within the sizer. Fixes a bug under Windows where the toolbar wasn't being drawn.
remove print statement
Call Create() at the end of __init__.
Enable/disable the legend buttons when the legend changes. Fixes RTbug #1793.
Use new bitmaps for the control buttons. (LegendTree._OnMsgLayerTitleChanged): Change the displayed title if the layer's title changes.
Classify button is now called "Properties". Refactored the code to change variable names. (LegendTree.__FillTreeLayer): Only list a group if it is visible.
(LegendTree): Use a private method to consistently set the font and style of the text. Fixes RTbug #1786.
Fix assert calls.
(LegendPanel.Destroy): New. Cleans up when then window is told to close. (LegendTree._OnMsgLayerChanged): Fixes a seg fault bug. See comment in source for more info.
Modifications to support selecting a specific group in the classification dialog. Changed how layers are drawn when the layer is visible/invisible.
Removed unnecessary LegendDialog class. (LegendPanel): Removed _OnDock()/_OnUnDock() methods which are now part of DockableWindow. (LegendPanel.DoOnSelChanged): Select the current layer in the map. (LegendTree._OnSelChanged): Call LegendPanel.DoOnSelChanged() with the selected layer and/or group.
Added some more buttons and made the LegendPanel a DockPanel.
New. Creates a window that shows the map's Legend information and allows the user to add/modify classifications and how the layers are drawn on the map.
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 |