editors/CodeFileEditor.py
changeset 1740 b789b695b5c6
parent 1739 ec153828ded2
child 1741 dd94b9a68c61
equal deleted inserted replaced
1739:ec153828ded2 1740:b789b695b5c6
    61         self.SetMarginType(1, stc.STC_MARGIN_NUMBER)
    61         self.SetMarginType(1, stc.STC_MARGIN_NUMBER)
    62         self.SetMarginWidth(1, 25)
    62         self.SetMarginWidth(1, 25)
    63 
    63 
    64         self.SetProperty("fold", "1")
    64         self.SetProperty("fold", "1")
    65         self.SetProperty("tab.timmy.whinge.level", "1")
    65         self.SetProperty("tab.timmy.whinge.level", "1")
    66         self.SetMargins(0,0)
    66         self.SetMargins(0, 0)
    67 
    67 
    68         self.SetViewWhiteSpace(False)
    68         self.SetViewWhiteSpace(False)
    69 
    69 
    70         self.SetEdgeMode(stc.STC_EDGE_BACKGROUND)
    70         self.SetEdgeMode(stc.STC_EDGE_BACKGROUND)
    71         self.SetEdgeColumn(EDGE_COLUMN)
    71         self.SetEdgeColumn(EDGE_COLUMN)
   675         self.SetSizer(main_sizer)
   675         self.SetSizer(main_sizer)
   676 
   676 
   677         self.ParentWindow = window
   677         self.ParentWindow = window
   678         self.Controler = controler
   678         self.Controler = controler
   679 
   679 
   680         self.VariablesDefaultValue = {"Name": "", "Type": DefaultType, "Initial": "",
   680         self.VariablesDefaultValue = {
   681                                       "Description":"", "OnChange":"", "Options":""}
   681             "Name":        "",
       
   682             "Type":        DefaultType,
       
   683             "Initial":     "",
       
   684             "Description": "",
       
   685             "OnChange":    "",
       
   686             "Options":     ""
       
   687         }
   682         self.Table = VariablesTable(self, [], self.GetVariableTableColnames())
   688         self.Table = VariablesTable(self, [], self.GetVariableTableColnames())
   683         self.ColAlignements = [wx.ALIGN_RIGHT] +  \
   689         self.ColAlignements = [wx.ALIGN_RIGHT] +  \
   684                               [wx.ALIGN_LEFT]*(len(self.VariablesDefaultValue))
   690                               [wx.ALIGN_LEFT]*(len(self.VariablesDefaultValue))
   685         self.ColSizes = [20, 150] + [130]*(len(self.VariablesDefaultValue)-1)
   691         self.ColSizes = [20, 150] + [130]*(len(self.VariablesDefaultValue)-1)
   686         self.VariablesGrid.SetTable(self.Table)
   692         self.VariablesGrid.SetTable(self.Table)
   735             self.VariablesGrid.SetColSize(col, self.ColSizes[col])
   741             self.VariablesGrid.SetColSize(col, self.ColSizes[col])
   736         self.Table.ResetView(self.VariablesGrid)
   742         self.Table.ResetView(self.VariablesGrid)
   737 
   743 
   738     def GetVariableTableColnames(self):
   744     def GetVariableTableColnames(self):
   739         _ = lambda x: x
   745         _ = lambda x: x
   740     	return ["#", _("Name"),_("Type"), _("Initial"), _("Description"), _("OnChange"), _("Options")]
   746     	return ["#", _("Name"), _("Type"), _("Initial"), _("Description"), _("OnChange"), _("Options")]
   741 
   747 
   742     def RefreshModel(self):
   748     def RefreshModel(self):
   743         self.Controler.SetVariables(self.Table.GetData())
   749         self.Controler.SetVariables(self.Table.GetData())
   744         self.RefreshBuffer()
   750         self.RefreshBuffer()
   745 
   751