~ubuntu-branches/ubuntu/utopic/python-traitsui/utopic

« back to all changes in this revision

Viewing changes to traitsui/wx/file_editor.py

  • Committer: Package Import Robot
  • Author(s): Varun Hiremath
  • Date: 2012-04-23 16:05:43 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20120423160543-bgafgw04y68arfjn
Tags: 4.1.0-1
* New upstream release
* Bump Standards-Version to 3.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
            if factory.auto_set:
101
101
                wx.EVT_TEXT( panel, control.GetId(), self.update_object )
102
102
 
103
 
            button = wx.Button( panel, -1, 'Browse...' )
 
103
            bmp    = wx.ArtProvider.GetBitmap( wx.ART_FOLDER_OPEN,
 
104
                                               size = ( 15, 15 ) )
 
105
            button = wx.BitmapButton( panel, -1, bitmap = bmp )
 
106
            
104
107
            pad    = 8
105
108
 
106
109
        self._file_name = control
325
328
        self.control = wx.GenericDirCtrl( parent, style = style )
326
329
        self._tree   = tree = self.control.GetTreeCtrl()
327
330
        id           = tree.GetId()
328
 
        wx.EVT_TREE_SEL_CHANGED(    tree, id, self.update_object )
329
 
        wx.EVT_TREE_ITEM_ACTIVATED( tree, id, self._on_dclick )
 
331
        wx.EVT_TREE_SEL_CHANGED(     tree, id, self.update_object )
 
332
        wx.EVT_TREE_ITEM_ACTIVATED(  tree, id, self._on_dclick )
 
333
        wx.EVT_TREE_ITEM_GETTOOLTIP( tree, id, self._on_tooltip )
330
334
 
331
335
        self.filter = factory.filter
332
336
        self.sync_value( factory.filter_name, 'filter', 'from', is_list = True )
406
410
    def _on_dclick ( self, event ):
407
411
        """ Handles the user double-clicking on a file name.
408
412
        """
409
 
        self.dclick = True
 
413
        self.dclick = self.control.GetPath()
 
414
 
 
415
    #---------------------------------------------------------------------------
 
416
    #  Handles the user hovering on a file name for a tooltip:
 
417
    #---------------------------------------------------------------------------
 
418
 
 
419
    def _on_tooltip ( self, event ):
 
420
        """ Handles the user hovering on a file name for a tooltip.
 
421
        """
 
422
        text = self._tree.GetItemText(event.GetItem())
 
423
        event.SetToolTip(text)
410
424
 
411
425
    #---------------------------------------------------------------------------
412
426
    #  Handles the 'reload' trait being changed: