Changeset 3076

Show
Ignore:
Timestamp:
04/22/2007 02:25:46 PM (2 years ago)
Author:
paul
Message:

Fixed dGrid's AlternateRowColoring? to be settable from the constructor
or initProperties (previously, it was only settable in afterInit() or
later). Changed datanav's setting of this to initProperties, before
user code has a chance to set it, so that the default setting in
datanav doesn't override the developer's wishes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/lib/datanav2/Grid.py

    r3073 r3076  
    1818        self.bindEvent(dEvents.KeyDown, self._onGridKeyDown) 
    1919 
     20     
     21    def _initProperties(self): 
     22        # Highlight the selected row for the grid 
     23        self.SelectionMode = "Row" 
     24        # Limit selection to a single row 
     25        self._multipleSelection = False 
     26        # Turn on alternate row coloring 
     27        self.AlternateRowColoring = True 
     28 
     29        super(Grid, self)._initProperties() 
     30 
    2031 
    2132    def _afterInit(self): 
     
    2839            self.DataSource = self.Form.previewDataSource 
    2940         
    30         # Highlight the selected row for the grid 
    31         self.SelectionMode = "Row" 
    32         # Limit selection to a single row 
    33         self._multipleSelection = False 
    34         # Turn on alternate row coloring 
    35         self.AlternateRowColoring = True 
    36  
    3741 
    3842    def populate(self): 
  • trunk/dabo/ui/uiwx/dGrid.py

    r3071 r3076  
    33813381 
    33823382    def _setAlternateRowColoring(self, val): 
    3383         self._alternateRowColoring = val 
    3384         self.setTableAttributes(self._Table) 
    3385         self.Refresh() 
     3383        if self._constructed(): 
     3384            self._alternateRowColoring = val 
     3385            self.setTableAttributes(self._Table) 
     3386            self.Refresh() 
     3387        else: 
     3388            self._properties["AlternateRowColoring"] = val 
    33863389 
    33873390