Paul,

Here is most of the code that what we have, but the DynamicBackColor seems
to not get called. Do you see anything that we missed?

Larry

class varGrid(dabo.ui.dGrid):
    def dynBackground(self):
        if self.CurrentRow == 1 and self.CurrentColumn == 1:
            return "red"
        return None

    def initProperties(self):
        self.DynamicBackColor = self.dynBackground

                
        
class InfoPanel(dabo.ui.dPanel):
        def afterInit(self):
                self.Sizer=vs=dabo.ui.dSizer('v')
                vs.appendSpacer(10)
                hs=dabo.ui.dSizer('h')
                ds = [
                                {"name" : "Pending In", "qty" : 3500.00,
"value" :  27375.00},
                                {"name" : "In Stock", "qty" : 4800.00,
"value" :  43291.62},
                                {"name" : "Pending Out", "qty": 5720.00 ,
"value" : 101465.00},
                                {"name" : "Available", "qty": 3315.00 ,
"value" :  0}]
        
summayGrid=varGrid(self,RegID="summaryID",ColumnCount=3,SelectionMode =
"Cell",Editable = False,MovableColumns = False)
                summayGrid.DataSet=ds
                summayGrid.Columns[0].Caption='           '
                summayGrid.Columns[0].Width=100
                summayGrid.Columns[0].DataField="name"
                summayGrid.Columns[1].Caption='Quantity'
                summayGrid.Columns[1].HeaderBackColor = "orange"
                summayGrid.Columns[1].HorizontalAlignment="Center"
                summayGrid.Columns[1].Width=200
                summayGrid.Columns[1].DataField='qty'
                summayGrid.Columns[2].Caption='Value'
                summayGrid.Columns[2].HeaderBackColor = "orange"
                summayGrid.Columns[2].HorizontalAlignment="Center"
                summayGrid.Columns[2].Width=200
                summayGrid.Columns[2].DataField='value'
                summayGrid.Height=160
                hs.append1x(summayGrid)
                
                vs.append1x(hs)
                
                

class MainPanelFrames(dabo.ui.dPanel):
        
        def afterInit(self):
                self.Sizer = vs = dabo.ui.dSizer("v") 
                pageFrame = pgf = dabo.ui.dPageFrame(self)
                pgf.RegID= "FormPG"
                pgf.appendPage(pgCls=InfoPanel, caption="Information")
                vs.append(pgf, 0,"x")  # proportion=0, layout=expand)


        
class MainForm(dabo.ui.dForm):
        
        def afterInit(self):
                self.Caption = "Bonanza Accounting - Inventory status"
                self.Sizer = dabo.ui.dSizer("vertical")
                self.Sizer.append1x(MainPanelFrames(self))
                self.layout()
                







-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul McNett
Sent: Tuesday, October 21, 2008 11:47 AM
To: Dabo Users list
Subject: Re: [dabo-users] Is it possible to change the background ortext
color of a grid

johnf wrote:
> I'd like to change the background color of a cell within a grid.  If I 
> can't do that I like to change the text color.
> 
> I have tried:
> SetCellBackgroundColor(1,1,wx.Colour(0,255,0,0)) without success.

class MyGrid(dabo.ui.dGrid):
   ...
   def dynBackground(self):
     if self.CurrentRow == 1 and self.CurrentColumn == 1:
       return "red"
     return None

   def initProperties(self):
     ...
     self.DynamicBackColor = self.dynBackground

Paul


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to