2002-10-23 Bernhard Herzog * setup.py (setup call): version now 0.1.3 * MANIFEST.in: Add the files in test/ * test/README: Add note about tests requiring the iceland data * Thuban/UI/mainwindow.py (MainWindow.About): Add 2002 to copyright notice. 2002-10-18 Bernhard Herzog * test/test_map.py (TestMapWithContents.test_projected_bounding_box): Use an explicit epsilon. * test/support.py (FloatComparisonMixin.assertFloatEqual) (FloatComparisonMixin.assertFloatSeqEqual): give a more useful message if the assertion fails and don't return the return value of self.assert_. In assertFloatSeqEqual the return meant that not all items of the sequence were compared. 2002-09-20 Bernhard Herzog * test/test_fileutil.py: New. Test cases for Thuban.Lib.fileutil * Thuban/Lib/fileutil.py: Fixup some whitespace and typos * test/test_map.py (TestMapWithContents.test_tree_info): Create the string with the bounding box on the fly because of platform differences in the way %g is handled. * test/test_layer.py (TestLayer.test_empty_layer): Create an empty DBFfile too because Thuban layers can't yet cope missing DBF files. 2002-09-20 Bernhard Herzog * test/test_menu.py: Use initthuban instead of add_thuban_dir_to_path to initialize Thuban. * test/support.py (FloatComparisonMixin.assertFloatEqual): New. Mixin class for float comparisons (SubscriberMixin): New. Mixin class to test messages sent through the Connector class * test/README: Fix a typo and add the -v flag to the command for individual tests * test/test_session.py: New. Test cases for Thuban.Model.session * test/test_proj.py: New. Test cases for Thuban.Model.proj * test/test_map.py: New. Test cases for Thuban.Model.map * test/test_layer.py: New. Test cases for Thuban.Model.layer * test/test_label.py: New. Test cases for Thuban.Model.label * test/test_connector.py: New. Test cases for Thuban.Lib.connector * test/test_color.py: New. Test cases for Thuban.Model.color * test/test_base.py: New. Test cases for Thuban.Model.base 2002-09-13 Bernhard Herzog * Thuban/Model/session.py (Session.forwarded_channels): Forward the CHANGED channel too. * Thuban/Model/map.py (Map.forwarded_channels): Forward the CHANGED channel too. (Map.__init__): Call the Modifiable constructor as well. * Thuban/Model/base.py (Modifiable.UnsetModified): Issue a CHANGED event if the modified flag changes. (Modifiable.changed): Tweak the doc-string. * Thuban/UI/mainwindow.py (MainWindow.view_position_changed) (MainWindow.set_position_text): Put the code that puts the text with the mouse position into the status bar into the new method set_position_text so that it can overwritten in derived classes. 2002-09-12 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.RunMessageBox): Center the message box on the main window. 2002-09-11 Bernhard Herzog * Thuban/UI/mainwindow.py: Underline the 'x' in "Exit" instead of the 'E' because it's less likely to interfere with other menu entries. (MainWindow.build_menu): remove an incorrect comment. 2002-09-10 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.Map): New. (_tool_command): Add sensitive parameter (_has_visible_map): Sensitivity callback to tools and other commands that require a visible map. Use it in map_zoom_in_tool, map_zoom_out_tool, map_pan_tool, map_identify_tool, map_label_tool and map_full_extent 2002-09-06 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.OnClose): Unsubscribe VIEW_POSITION 2002-09-04 Frank Koormann * Resources/Bitmaps/fullextent.xpm: Updated Icon (removed "potatoe") 2002-09-02 Bernhard Herzog * Thuban/UI/view.py: Get rid of the idle redraw. This is done by wxWindows already and our implementation doesn't work correctly with wxGTK 2.3: (MapCanvas.__init__): Remove the instance variable (MapCanvas.OnPaint): Always call do_redraw when there's a map to be drawin (MapCanvas.OnIdle): Removed. * Thuban/UI/view.py (MapCanvas.unprojected_rect_around_point): Add a parameter to determine the size of the rectangle. (MapCanvas.find_shape_at): Create the box around the point on a layer by layer basis and make the size depend on the shape type. This solves a problem with the selection of point shapes at the border of the layer's bounding box 2002-08-30 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.CanRemoveLayer): New method for the sensitivity of remove layer. (_can_remove_layer): New. Sensitivity callback for remove layer (Command layer_remove): Use _can_remove_layer * Thuban/Model/map.py (Map.CanRemoveLayer): New method to determine whether a given layer can be deleted. * Thuban/UI/view.py (MapCanvas.__init__, MapCanvas.OnPaint) (MapCanvas.do_redraw): Get rid of the unused update_region instance variable * Thuban/UI/view.py: Add/update some doc-strings. * test/: new subdirectory with a bunch of unit tests. * test/README, test/test_table.py, test/test_save.py, test/test_menu.py, test/test_load.py: Initial set of tests and brief instructions on how to run them 2002-08-29 Bernhard Herzog * Thuban/UI/renderer.py (ScreenRenderer.draw_shape_layer): Handle arcs with multiple parts. * Thuban/UI/view.py (ZoomInTool.MouseUp, ZoomOutTool.MouseUp): Handle degenrate rectangles. * Thuban/Model/table.py: Make writing records work correctly: (Table.__init__): Keep track of whether the DBF is open for writing (Table.write_record): Open the DBF file for writing when necessary 2002-08-27 Bernhard Herzog * Thuban/Model/table.py (Table.write_record, Table.__init__): Open dbf files only for reading by default. Use a new writable dbf object for writing. 2002-08-26 Bernhard Herzog * Thuban/UI/mainwindow.py: Refactor the context creation: (MainWindow.Context): New method to return a context (MainWindow.invoke_command, MainWindow.update_command_ui): Use the new method * Thuban/UI/tableview.py (TableGrid, LayerTableGrid): Split the layer table specific code from TableGrid into LayerTableGrid (TableFrame, LayerTableFrame): Split the layer table specific code from TableFrame into LayerTableFrame (LayerTableGrid.select_shape): Remove a debug print * Thuban/UI/mainwindow.py (MainWindow.LayerShowTable): Use the LayerTableFrame 2002-08-23 Bernhard Herzog * Thuban/Model/layer.py (Layer.__init__): Make sure we have an absolute filename. 2002-08-22 Bernhard Herzog * Thuban/Model/table.py (Table.write_record): New method to write records. (Table.__init__): Open the DBF file for writing too. * Thuban/UI/controls.py (RecordTable.SetValue): Write the value into the underlying table. * extensions/shapelib/shapefil.h (DBFCommit), extensions/shapelib/dbfopen.c (DBFCommit): New API function to commit any changes made to the DBF file. * Thuban/UI/mainwindow.py (make_check_current_tool) (_tool_command): Put the code that generates the "checked" callback into a separate function so that we can reuse it elsewhere * Thuban/Model/save.py (Saver): New class to handle serializing a session into an XML file. The main reason to introduce a class is that applications built on Thuban can derive from it so that they can save additional information in a session file. (save_session): Delegate almost all the work to the Saver class. Rename the filename argument to file because it may be a file like object now. * Thuban/Model/load.py: Get rid of the Python 1.5.2 compatibility code. Remove the little test code which would be executed when the module is run as a script which didn't work anymore since it can't import the other Thuban modules. (ProcessSession, load_session): Refactor the ProcessSession to have one method for each element start and end tag so that derived classes can easily override the processing of individual tags. Also, always parse with namespaces enabled because applications built on top of Thuban will likely use namespaces if they extend the session file format. 2002-08-21 Bernhard Herzog * setup.py (ThubanInstall.run): Don't repr install_lib_orig because thubaninit_contents will do it for us. 2002-08-16 Jan-Oliver Wagner * Thuban/UI/mainwindow.py: menu item 'show session tree' now disable if tree window already open 2002-08-15 Bernhard Herzog * Thuban/Model/layer.py (Layer.Destroy): Call the unboundd method with self. * Thuban/UI/view.py (MapCanvas.OnLeftUp): Only release the mouse when we have actually captured it. * Thuban/Model/layer.py (Layer.Destroy): New. Explicitly close the shapefile and destroy the table. * Thuban/Model/table.py (Table.Destroy): New. Close the DBF file. 2002-08-14 Bernhard Herzog * Thuban/UI/controls.py (RecordTable.__init__): Remove the unused instance variable columns (RecordTable.GetTypeName): row and col may be negative in some cases. * setup.py (InstallLocal.initialize_options) (InstallLocal.finalize_options, InstallLocal.user_options): New option create-init-file to build a thubaninit.py when running install_local (InstallLocal.run): Create the thubaninit.py module when requested (thubaninit_contents): Split the template into several parts and create a new function thubaninit_contents that creates the contents of a thubaninit module. (ThubanInstall.run): Use the new function to create the thubaninit module. 2002-07-30 Bernhard Herzog * Thuban/UI/application.py (ThubanApplication.OnExit): Do some cleanup. (ThubanApplication.MainLoop): Extend to automatically call OnExit. * Thuban/Model/session.py (Session.Destroy): Don't bypass the direct base class' Destroy method. * Thuban/Model/map.py (Map.ClearLayers): New method to delete all layers. (Map.Destroy): Destroy the label_layer as well and call the inherited Desatroymethod first so that no more messages are issued. (Map.RaiseLayer, Map.LowerLayer): Only issue LAYERS_CHANGED message if the stacking order actually has changed. Add doc-strings. (Map.BoundingBox): Correct the doc-string. (Map.AddLayer, Map.RemoveLayer, Map.Layers, Map.HasLayers) (Map.ProjectedBoundingBox, Map.SetProjection): Add doc-strings. * Thuban/Model/label.py (LabelLayer.ClearLabels): New to delete all labels. 2002-07-29 Bernhard Herzog * Thuban/Model/map.py (Map.subscribe_layer_channels) (Map.unsubscribe_layer_channels): Put the code that (un)subscribes to a layer's channels into separate methods. (Map.RemoveLayer, Map.AddLayer): Call the new methods (Map.Destroy): Unsubscribe from a layer's channels before destroying it. * Thuban/UI/view.py (MapCanvas.find_shape_at): Change the selected_layer parameter to searched_layer which is the layer to search in. (MapCanvas.SelectShapeAt): New parameter layer to restrict the search to that layer. Return the selected layer and shape. * Examples/simple_extensions/simple_tool.py (simple_tool): Fix a typo 2002-07-24 Bernhard Herzog * Thuban/UI/application.py (ThubanApplication.create_session): Extend the doc string. (ThubanApplication.subscribe_session) (ThubanApplication.unsubscribe_session): New methods to subscribe/unsubscribe to/from session channels. (ThubanApplication.SetSession): Call the new methods here. (ThubanApplication.maps_changed, ThubanApplication.set_map): Renamed set_map to maps_changed. Its now a subscriber for MAPS_CHANGED. * Thuban/UI/view.py (ZoomOutTool.MouseUp): Use the correct x-coordinate in case of simple clicks * Thuban/Model/base.py (Modifiable.changed): Apply the args tuple, don't pass it as a parameter * Thuban/Model/session.py (Session.RemoveMap): New * Thuban/UI/mainwindow.py (MainWindow.__init__): Turn the initial window size into a parameter. 2002-07-23 Bernhard Herzog * Thuban/UI/menu.py (Menu.item_index): Also search for menus not just commands. * Thuban/UI/mainwindow.py (MainWindow.__init__): Change the parameter list a bit to allow setting the window title and the initial message in the status bar. Update the callers. * Thuban/UI/application.py (ThubanApplication.OnInit) (ThubanApplication.CreateMainWindow): Put the mainwindow instantiation into a separate method so that it can be overridden by a subclass. 2002-07-19 Bernhard Herzog * Thuban/Model/session.py: Issue a CHANGED message every time another changed message is issued to make it easier to get notified of changes. (Session): Update the doc string (Session.forward): Issue changed-events as CHANGED as well. (Session.changed): Overwrite the inherited version to issue CHANGED events as well. * 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/Model/map.py (Map.TreeInfo): Deal better with empty maps. * Thuban/UI/main.py, Thuban/UI/__init__.py: Move the work-around for the wxPython locale bug to __init__.py so that it's automatically executed by anybody using UI code from Thuban. 2002-07-18 Bernhard Herzog * Thuban/UI/main.py (main): app no longer needs to be global * Thuban/UI/mainwindow.py (MainWindow.__init__): Add application as parameter and store it in an instance variable (MainWindow.invoke_command, MainWindow.update_command_ui) (MainWindow.save_modified_session, MainWindow.NewSession) (MainWindow.OpenSession, MainWindow.SaveSession) (MainWindow.SaveSessionAs, MainWindow.ShowSessionTree): Use self's application object. * Thuban/UI/application.py (ThubanApplication.OnInit): Instantiate the main window with self. * Thuban/UI/context.py: New module with the context class * Thuban/UI/command.py (Command): Update doc string. * Thuban/UI/mainwindow.py (MainWindow.invoke_command, MainWindow.update_command_ui): Pass an instance of the context class to the command's methods (check_current_tool, call_method): Handle the new context implementation * Examples/simple_extensions/simple_tool.py (simple_tool, check_simple_tool): Handle the new context implementation * Examples/simple_extensions/simple_command.py (simple_command): Handle the new context implementation. Update the comments about the context. * Thuban/UI/application.py (ThubanApplication.SetSession): Add doc-string (ThubanApplication.Session): New method to return the session object * 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. 2002-07-17 Bernhard Herzog * 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 2002-07-16 Bernhard Herzog * Thuban/UI/application.py: Don't use "import from" for the MainWindow. It can't always be resolved. (ThubanApplication.OnInit): change reference to MainWindow accordingly. * Thuban/UI/menu.py (Menu.SetItems): New method to replace a menu completely 2002-07-10 Bernhard Herzog * setup.py (create_init_module): New configurable variable whose default depends on the platform we're running on. (ThubanInstall.initialize_options): Initialize self.create_init_module from the global create_init_module (ThubanInstall.user_options): indictate that the options create-init-module and init-module-dir have arguments. * setup.py: In the setup call change the version number to include cvs. * MANIFEST.in: Add the files in Examples 2002-07-09 Bernhard Herzog * setup.py: In the setup call, use the thuban homepage as the value of the url parameter. * Examples: New subdirectory for examples. * Examples/simple_extensions/simple_tool.xpm, Examples/simple_extensions/simple_tool.py, Examples/simple_extensions/simple_command.py, Examples/simple_extensions/README: Simple examples showing how to add new commands and tools. * setup.cfg (bdist_rpm): Add the default value for prefix and tell bdist_rpm that we also have an install script. (bdist_inno): Add 2002 to the copyright notice. * setup.py: Create a file in python's site-packages directory to make installation of Thuban as a library easier. (ThubanInstall.user_options): Add two new options, create-init-module and init-module-dir (ThubanInstall.expand_with_pure_python_dirs): New method to expand filenames for installation in the default directories. (ThubanInstall.select_scheme, ThubanInstall.convert_paths): Extend the inherited methods to capture some filenames before they're transformed too much by distutils. (ThubanInstall.run): Create the init module if requested. (ThubanInstall.thuban_init_filename): New method to return the full name of the init module. (ThubanInstall.get_outputs): Append the filename of the init module. 2002-07-08 Bernhard Herzog * setup.py (thuban_bdist_rpm): Extend this version of bdist_rpm to handle the prefix properly which means that the default for the installation prefix should be /usr for RPMs and /usr/local when doing a normal source install. (bdist_rpm_install_script): Script to override the default install commands in the specfile generated by the bdist_rpm command. (thuban_bdist_rpm.user_options): Add a prefix option (thuban_bdist_rpm.initialize_options): Init the prefix option. Create the script files for the spec files as empty files here (thuban_bdist_rpm._make_spec_file): Override the inherited method to fill the script files with content. * Thuban/Model/save.py (relative_filename): Wrapper around Thuban.Lib.fileutil.relative_filename that accepts an empty dir argument. save_session now automatically uses this version, solving a problem when saving to a relative filename. * setup.py: In the setup call, make sure that the library directories are under $prefix/lib not directly under $prefix. 2002-06-20 Jan-Oliver Wagner * Thuban/Model/extension.py: new module to handle extension objects. * Thuban/Model/messages.py: new messages for extensions. * Thuban/Model/session.py (Session.Extensions, Session.HasExtensions, Session.AddExtension): new for handling extensions. Also some other minor changes to round up extension handling. * Thuban/UI/tree.py (SessionTreeCrtl:update_tree): Added visualization of Extension titles and title and names of its objects. 2002-05-29 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.bind_command_events): Bind the events for a command. (MainWindow.add_toolbar_command, MainWindow.add_menu_command): Call bind_command_events to bind the events. add_toolbar_command can now bind events too so that it's possible to have commands that are only available through the toolbar. (MainWindow.init_ids): New instance variable events_bound to keep track of for which commands events have been bound. 2002-05-28 Bernhard Herzog * Thuban/UI/menu.py: New module to build and manage menus. * Thuban/UI/mainwindow.py: Remove some unused imports. (MainWindow.__init__, main_menu): move the definition of the main menu from __init__ to the Menu instance main_menu. (MainWindow.build_menu_bar, MainWindow.build_menu): New methods to build the menu bar and sub-menus from a menu description. * Thuban/UI/application.py (ThubanApplication.OnInit): Read the startup file (ThubanApplication.read_startup_files): New method to run ~/.thuban/thubanstart.py * Thuban/UI/mainwindow.py (MainWindow.__init__, main_toolbar): Move the toolbar definition to the Menu instance main_toolbar. (MainWindow.build_toolbar): New method to build the toolbar similar to the build_menu methods 2002-05-23 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.__init__): Fix spelling of layer_outline_color. Fix it in the definition of the command too. * Thuban/UI/command.py (Command): Fix typo in doc string 2002-05-22 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.RunMessageBox): Fix a typo in the docstring 2002-05-15 Bernhard Herzog * Thuban/Model/layer.py (Layer.open_shapefile): Set bbox to None when the shapefile is empty. (Layer.BoundingBox, Layer.LatLongBoundingBox): Both methods may now return None for empty shapefiles. Update doc-strings. * Thuban/Model/map.py (Map.BoundingBox): Add doc-string. Deal with the layer's bbox being None. * Thuban/UI/tree.py (SessionTreeCtrl.update_tree): Deal with the layer's bbox being None. * Thuban/UI/view.py (MapCanvas.shape_selected): Only redraw when necessary. (MapCanvas.__init__): New instance variables, last_selected_layer and last_selected_shape to determine how the selection has changed. * Thuban/UI/tableview.py (TableGrid.__init__): Do not call AutoSizeColumns because it will cause a traversal of the entire table which for large .dbf files will take a very long time. 2002-05-14 Bernhard Herzog * Thuban/Model/layer.py (Layer.open_shapefile): Choose a better maximum depth for the tree than shapelib does by default. 2002-05-10 Bernhard Herzog * setup.py (py_modules): The shptree modules doesn't have a wrapper, so don't include it in the py_modules 2002-05-08 Bernhard Herzog * extensions/shapelib/shptree.c (compare_ints): Make arguments const void * as in the qsort prototype (SHPTreeFindLikelyShapes): Remove some unused variables. * Thuban/UI/view.py (PanTool.MouseMove): Use the bitmap the view maintains to redraw the window during a drag. (MapCanvas.unprojected_rect_around_point): New method to determine a small region around a point for hit-testing. (MapCanvas.find_shape_at): Only test the shapes in a small region around the point. * setup.py: Increment the version to 0.1.2 * Thuban/UI/tree.py (SessionTreeCtrl.unsubscribe_all): Remove a debug print and set session to None after unsubscribing 2002-05-07 Bernhard Herzog * Data/iceland_sample.session, Data/iceland_sample.thuban: Rename the file to have a .thuban extension. * 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. * Thuban/UI/mainwindow.py (MainWindow.__init__): Add the "Show Session Tree" command to the file menu. * Thuban/UI/view.py (MapCanvas.do_redraw): Pass the entire bitmap as update_region to the renderer. * Thuban/UI/renderer.py (ScreenRenderer.layer_ids, ScreenRenderer.draw_shape_layer): The update box is now directly a tuple, not a wxRect anymore. * Thuban/Model/layer.py (Layer.ShapesInRegion): Remove some debug prints. 2002-05-07 Bernhard Herzog * setup.py: Add the shptree extension module. See extensions/pyshapelib/ChangeLog for more details. * extensions/shapelib/shpopen.c, extensions/shapelib/shapefil.h, extensions/shapelib/dbfopen.c: Really update to the versions of shapelib 1.2.9. For some reason it wasn't really done on 2002-04-11. * extensions/shapelib/shptree.c: Modified version of shptree.c of shapelib 1.2.9. The only real difference is the use of qsort instead of a bubble sort implementation * Thuban/Model/layer.py (Layer.__init__): New instance variable shapetree to hold the shapelib quadtree for the shapefile (Layer.open_shapefile): Create the quad tree. (Layer.ShapesInRegion): New method to return the ids of shapes in a given region using the quad tree. * extensions/thuban/wxproj.cpp (project_points): Fix some typos in comment (draw_polygon_shape): Accept both arcs and polygons. (initwxproj): Use the new PYSHAPELIB_IMPORT_API macro to import the api. * Thuban/UI/renderer.py (MapRenderer.layer_ids): New method to return the shape ids to be rendered in a given layer. (MapRenderer.draw_shape_layer): Call layer_ids to get the list of ids. Use draw_polygon_shape to draw arc shapes as well. (ScreenRenderer.RenderMap): New parameter for the rectangle that has to be updated (ScreenRenderer.layer_ids): Make use of the layer's quadtree by calling it's ShapesInRegion method. * Thuban/UI/view.py (MapCanvas.__init__): New instance variable update_region for the update region. (MapCanvas.OnPaint): Maintain the update region (MapCanvas.do_redraw): Pass the bounding box of the update_region to the renderer when drawing the bitmap. Reset the update_region. 2002-05-03 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.SaveSessionAs, MainWindow.OpenSession): Change the file extension of the session files to .thuban * Thuban/Model/session.py (Session.AddMap, forwarded_channels): Move the map channels to be forwarded by the session into the class constant with forwarded_channels. Also add LAYER_PROJECTION_CHANGED and LAYER_VISIBILITY_CHANGED to forwarded_channels * Thuban/Model/base.py (Modifiable.changed): Fix doc-string (a typo and some rewording). 2002-05-02 Bernhard Herzog * Thuban/UI/view.py: Keep the temporary bitmap used during drawing around to speed up most redraws: (MapCanvas.__init__): New instance variable bitmap which holds the bitmap (MapCanvas.do_redraw): Redraw self.bitmap if necessary. Use self.bitmap to draw. (MapCanvas.full_redraw): New method to force a full redraw including the bitmap (MapCanvas.SetMap): Subscribe full_redraw instead of redraw to make sure the bitmap is redrawn. (MapCanvas.projection_changed, MapCanvas.set_view_transform, MapCanvas.shape_selected): Call full_redraw instead of readraw to make sure the bitmap is redrawn. (MapCanvas.OnSize): New method to handle size events so that the bitmap can be redrawn. 2002-04-29 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.__init__): Subscribe to the canvas' VIEW_POSITION event (MainWindow.view_position_changed): Handler for VIEW_POSITION. Update the text in the status-bar accordingly. * Thuban/UI/view.py (MapCanvas): Derive from Publisher as well (MapCanvas.__del__): Implement because Publisher.__del__ has to be called. (MapCanvas.__init__): Bind EVT_LEAVE_WINDOW too. Initialize current_position (MapCanvas.set_current_position): New method to set current_position. Issue a VIEW_POSITION event (MapCanvas.CurrentPosition): New public method to return the value of current_position. Should be called when the VIEW_POSITION event is processed. (MapCanvas.OnLeftDown, MapCanvas.OnLeftUp, MapCanvas.OnMotion): Update the position. (MapCanvas.OnLeaveWindow): Set the position to None. * Thuban/UI/messages.py (VIEW_POSITION): New message for the position in the statusbar 2002-04-26 Frank Koormann * Thuban/UI/mainwindow.py: AddLayer, Dialog title s/session/data 2002-04-24 Frank Koormann * Resources/Bitmaps/identify.xpm: shadow added * Resources/Bitmaps/fullextent.xpm: new 2002-04-22 Jan-Oliver Wagner * Thuban/UI/tree.py (update_tree): added test for None on map bounding box 2002-04-21 Jan-Oliver Wagner * Thuban/UI/proj4dialog.py (UTMProposeZoneDialog): new * Thuban/UI/tree.py (update_tree): added added map extent * Thuban/UI/mainwindow.py (_method_command): extended by parameter icon; added map_full_extend as tool 2002-04-19 Jan-Oliver Wagner * Thuban/UI/mainwindow.py (SaveSession): launch save as dialog for saving _new_ sessions * Thuban/Model/session.py (create_empty_session): new session don't have a filename (set to None) * Thuban/UI/tree.py (update_tree): added filename and modified flag * Thuban/Model/load.py (ProcessSession): convert projection parameters from unicode to regular string * Data/iceland_sample.session: Added UTM Zone 26 projection. 2002-04-11 Bernhard Herzog * extensions/shapelib/shapefil.h, extensions/shapelib/shpopen.c, extensions/shapelib/dbfopen.c: Update to the versions of shapelib 1.2.9 * setup.py (Lib.wxproj extension): Don't link shpopen.c and put the pyshapelib directoy into the list of include dirs, so that pyshapelib_api.h can be found. * extensions/thuban/wxproj.cpp (pyshapelib_api): New variable that holds the pyshapelib C-API (draw_polygon_shape, point_in_polygon_shape, shape_centroid): Use pyshapelib_api to access the shapelib functions. (initwxproj): Import the c_api from the shapelib module and initialize pyshapelib_api. 2002-04-04 Bernhard Herzog * setup.py (thuban_bdist_rpm.initialize_options): Use initialize_options to create the scripts for the rpm. * extensions/pyprojection/setup.py (PROJ4_PREFIX): Just use / 2002-04-03 Bernhard Herzog * setup.py: Increment version to 0.1.1 * Thuban/UI/mainwindow.py (MainWindow.__init__): Move the "Add Layer" and "Remove Layer" commands from the layer menu to the map menu 2002-02-15 Bernhard Herzog * Thuban/Model/layer.py (Layer.Shape): list append only takes one argument (python <= 1.5.2 erroneously accepted multiuple arguments) 2002-02-04 Bernhard Herzog * Thuban/UI/identifyview.py (IdentifyGridCtrl): New class to use a RecordGrid in the identifyview. (IdentifyView.__init__): Use IdentifyGridCtrl instead of IdentifyListCtrl. The grid allows editing of the values. * Thuban/UI/controls.py (RecordTable, RecordGridCtrl): New classes implementing a grid for a single row of a thuban table. * Thuban/UI/view.py (MapCanvas.SelectShapeAt): Search through all layers by default. Easier to use than the previous default of only searching through the select layer which meant that if no layer was selected, you couldn't select a shape. * Thuban/UI/tableview.py (TableGrid.__init__): Fix typo * Thuban/UI/renderer.py (MapRenderer.draw_shape_layer): Honour the stroke_width attribute * Thuban/Model/save.py (save_session): Write the new stroke_width attribute * Thuban/Model/load.py (ProcessSession.startElement): Read the stroke_width attribute * Thuban/Model/layer.py (Layer.__init__): New parameter and instance variable stroke_width (Layer.SetStrokeWidth): Set the stroke_width. 2002-02-01 Bernhard Herzog * extensions/thuban/wxproj.cpp (project_points): Fix two off-by-one errors in the last loop that joins the various parts together. 2002-01-14 Bernhard Herzog * setup.py (data_dist.make_distribution): Fix some typos 2001-09-18 Bernhard Herzog * README: Slight tweaking in preparation for the 0.1 release * setup.cfg: Add section for sdist to create both tgz and zip archives * setup.py: increase version number to 0.1 (data_dist): New command class for data distribution 2001-09-14 Bernhard Herzog * Thuban/UI/identifyview.py (IdentifyListCtrl.selected_shape): Handle the case of no layer (i.e. layer is None) properly. * Thuban/UI/proj4dialog.py (UTMDialog.__init__, Proj4Dialog.__init__): Set the initial selection of the combo boxes to reflect the projection we're starting with in a way that works on windows, too. * Thuban/Lib/connector.py (Connector.print_connections): Print the puiblisher's ids in hex to make it easier to compare them to the standard repr of python methods * Thuban/Model/map.py (Map.Destroy): Unsubscribe the label_layer messages 2001-09-13 Bernhard Herzog * Thuban/UI/tree.py (SessionTreeCtrl.OnSelChanged): Make sure to deselect the layer if no layer is selected * Thuban/UI/view.py (MapCanvas.OnPaint): Only delay drawing to idle time when there actually is something to draw. If there's nothing to draw simply clear the window (MapCanvas.do_redraw): Call dc.EndDrawing and add some comments. (MapCanvas.SetMap): force a redraw in all cases because FitMapToWindow doesn't always do it. (MapCanvas.ZoomFactor): Add an optional parameter, center, to specify the point to move into the center of the window (ZoomOutTool.MouseUp, ZoomInTool.MouseUp): If the mouse wasn't dragged, zoon in/out by a factor of 2 (MapCanvas.find_shape_at): Iterate backwards (i.e. with decreasing index, i.e. reversed drawing order) so that objects appearing to be in from of others are selected first. This is probably mostly relevant for point shapes where the symbols used may overlap * Thuban/Model/session.py (create_empty_session): Unset the modified bit before returning it * Thuban/UI/mainwindow.py (MainWindow.NewSession): Use create_empty_session session to create the new, empty session. * Thuban/UI/mainwindow.py (MainWindow.__init__): Set the size of the tool bitmaps. (MainWindow.OnClose, MainWindow.save_modified_session): Separate the code that asks whether the session should be saved into the new method save_modified_session. (MainWindow.OpenSession, MainWindow.NewSession): Use the new method to save modified session here too. 2001-09-11 Bernhard Herzog * setup.py (InnoIconItem): fix typo (thuban_bdist_inno.run): (bdist_inno.run): Move the decision not to create symlinks on non-nt platforms to thuban_bdist_inno and do it unconditinally since we never want to create the symlinks here 2001-09-10 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.IdentifyTool): Popup the identify view immediately * Thuban/UI/controls.py: New file with two classes RecordListCtrl and SelectableRecordListCtrl that implement the code shared by the identify view and the label dialog * Thuban/UI/identifyview.py (IdentifyListCtrl): Derive from the new class RecordListCtrl * Thuban/UI/labeldialog.py (LabelDialog.OnOK): Check whether the return value of GetValue is None instead of using it as a boolean directly so that Zero numbers are handled properly. (LabelListCtrl): Derive from the new class SelectableRecordListCtrl * Thuban/UI/proj4dialog.py (Proj4Dialog.__init__): (Proj4Dialog.dialogLayout): Make the window resizable and set the size of the text control explicitly to make the sizers work on both Windows and X. 2001-09-07 Bernhard Herzog * Thuban/UI/view.py (MapCanvas.find_shape_at):Add a new parameter that can limit the search to the currently selected layer. (MapCanvas.SelectShapeAt): Make sure that the currently selected layer stays selected even when no shape is found (MapCanvas.FitRectToWindow): If the rect has zero with or zero height do nothing (avoids zero division errors) 2001-09-06 Bernhard Herzog * 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/interactor.py (Interactor.SelectedLayer): (Interactor.HasSelectedLayer): New methods to query the current selection * Thuban/UI/mainwindow.py (MainWindow.current_layer): (MainWindow.has_selected_layer): Simply call the appropriate interactor method * Thuban/UI/mainwindow.py (MainWindow.__init__): (MainWindow.LayerShowTable): (MainWindow.identify_view_on_demand): Store the interactor in an instvar and use that reference instead of going through main.app * Thuban/UI/mainwindow.py (MainWindow.ShowSessionTree): * Thuban/UI/application.py (ThubanApplication.OnInit): * Thuban/UI/main.py (main): Create the session tree view in main with the new mainwindow method ShowSessionTree and not directly the application's OnInit method * 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/mainwindow.py (MainWindow.LayerShowTable): Pass the layer to the tableview dialog. * Thuban/UI/tableview.py: Add some doc-strings (TableGrid): (TableGrid.OnRangeSelect): (TableGrid.OnSelectCell): (TableFrame.__init__): (TableFrame.row_selected): Selecting rows in the grid view now updates the selected shapes through the TableFrame. To achieve this we derive TableGrid from Publisher and introduce the message type ROW_SELECTED which the TableFrame subscribes to and which is issued by OnRangeSelect and OnSelectCell (DataTable.SelectRow): Removed because it's no longer needed in the row/shape selection scheme * Thuban/UI/dialogs.py: New file implementing common classes for dialogs * Thuban/UI/tableview.py (TableGrid.__init__): Don't subscribe to the SELECTED_SHAPE message anymore. This is now handled by the parent. (TableGrid.select_shape): Only update the selection if the shape is not None. (TableFrame): Inherit from the new NonModalDialog class. (TableFrame.__init__, TableFrame.select_shape): Handle the SELECT_SHAPE message. (TableFrame.OnClose): Extend the inherited method to unsubscribe SELECT_SHAPE * Thuban/UI/mainwindow.py (MainWindow.init_dialogs): (MainWindow.add_dialog): (MainWindow.dialog_open): (MainWindow.remove_dialog): (MainWindow.get_open_dialog): New methods to maintain a dictionary of opened non-modal dialogs. (MainWindow.__init__): Initialize the new non-modal dictionary management code (MainWindow.LayerShowTable): maintain separate dialogs for each table using the non-modal dialog management code to only open a view once for each table. (MainWindow.IdentifyTool): (MainWindow.__init__): (MainWindow.identify_view_on_demand): Don't open the identify view in IdentifyTool anymore. This will be done automatically by the new method identify_view_on_demand which handles the SELECTED_SHAPE message so that the identify view will be opened on demand * Thuban/UI/identifyview.py (IdentifyListCtrl.__init__): Remove the interactor argument. The SELECTED_SHAPE message is now handled by the parent. (IdentifyView.__init__): Add the interactor argument so that we can handle the SELECTED_SHAPE message here (IdentifyView.selected_shape): New method to handle the SELECTED_SHAPE messages * Thuban/UI/identifyview.py (IdentifyView): Derive from the new NonModalDialog class (IdentifyView.OnClose): Extend the inherited version to unsubscribe SELECT_SHAPE * Thuban/Model/session.py (Session.UnsetModified): Remove debug prints 2001-09-05 Bernhard Herzog * Thuban/UI/view.py (MapCanvas.__init__): New argument, interactor. * Thuban/UI/mainwindow.py (MainWindow.__init__): New argument interactor to pass through to the MapCanvas * Thuban/UI/application.py (ThubanApplication.OnInit): Use the new argument to the MainWindow constructor to get rid of the ugly hack that made main.app available early just so that the mapcanvas could access the interactor object. 2001-09-04 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.RunMessageBox): New method that runs a modal message box (MainWindow.OnClose): Use the new method (MainWindow.RemoveLayer): Just do nothing in case no layer is selected. The command should be grayed out anyway, so there's no need to pop up a message box. (MainWindow.AddLayer): Pop up a message box with an error message if the shape file can't be opened * Thuban/Model/layer.py (Layer.__init__): Open the shapefile immediately. This will cause an exception in case the file can't be opened and we can display an appropriate message. * MANIFEST.in: Add extensions/pyprojection/LICENSE * setup.py (thuban_bdist_rpm): New class implementing a Thuban specific bdist_rpm command. * Thuban/UI/main.py: Catch ImportError exceptions when importing the locale module because it may not be available on some installations. * extensions/pyprojection/LICENSE: Copy of the license text in Projection.i. Having it in a separate file makes it easier to refer to license text in e.g. RPMs 2001-09-03 Bernhard Herzog * setup.py: use wx-config instead of wxgtk-config because it's more generic * setup.py (ThubanInstall.get_outputs): Add the symlink in /bin to the outputs (ThubanInstall.link_file): New method to link files. We need this because the standard copy_files refuses to link non-existing files. (ThubanInstall.run): Remove the leading install root from the script filename if an install root was specified and use the new link_file method * Thuban/UI/mainwindow.py (MainWindow.AddLayer): Fit the map to the window when the first layer is added to the map. * setup.py (ThubanInstall.run): Honor the build root (self.root) when linking thuban.py to /bin 2001-08-31 Bernhard Herzog * setup.py: In the setup call, the install parameters shouldn't have trailing slashes because distutils on non-posix platforms doesn't like that. The same applies to other directories like "Resources/Bitmaps" In the configuration section for nt, move the wxWindows directory optins into the part clearly marked as editable. (InstallLocal.initialize_options): (InstallLocal.user_options): remove the currently unused debug flag (thuban_build_py.find_all_modules): Add this method so that it works for our case of having packages and modules in one distribution as well. (ThubanInstall.initialize_options): (ThubanInstall.finalize_options): (ThubanInstall.user_options): (ThubanInstall.boolean_options): Add new options, do-symlink and extra files. Since these are the first ThubanInstall specific options, override user_options and boolean_options (ThubanInstall.run): Honor the new do-symlink and extra-files options. (ThubanInstall.get_outputs): Add to override the base-class's version and add the extra-files to the outputs (bdist_inno): New class for windows distributions with Inno Setup (InnoIconItem): Helper class for bdist_inno (thuban_bdist_inno): Thuban specific version of bdist_inno. Added this together with the appropriate parameters, to the setup call. * setup.cfg (bdist_inno): added new section for the inno setup installer * 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. * Thuban/UI/mainwindow.py (MainWindow.update_command_ui): Call event.Check only if the command is actuall checkable. (MainWindow.__init__): Call the toolbar's Realize method to make sure that the items are actually shown 2001-08-28 Bernhard Herzog * setup.py: Fix some doc strings * ChangeLog: started