c_ext/CFileEditor.py
changeset 782 6f0e10085df9
parent 751 a8dace95f965
child 801 435e49e80832
equal deleted inserted replaced
781:cdc6393705ce 782:6f0e10085df9
     2 
     2 
     3 import wx
     3 import wx
     4 import wx.grid
     4 import wx.grid
     5 import wx.stc as stc
     5 import wx.stc as stc
     6 import wx.lib.buttons
     6 import wx.lib.buttons
     7 from util.misc import opjimg
       
     8 
     7 
     9 from controls import CustomGrid, CustomTable
     8 from controls import CustomGrid, CustomTable
    10 from ConfTreeNodeEditor import ConfTreeNodeEditor
     9 from ConfTreeNodeEditor import ConfTreeNodeEditor
       
    10 from utils.BitmapLibrary import GetBitmap
    11 
    11 
    12 if wx.Platform == '__WXMSW__':
    12 if wx.Platform == '__WXMSW__':
    13     faces = { 'times': 'Times New Roman',
    13     faces = { 'times': 'Times New Roman',
    14               'mono' : 'Courier New',
    14               'mono' : 'Courier New',
    15               'helv' : 'Arial',
    15               'helv' : 'Arial',
   788         self.MainSizer.AddGrowableCol(0)
   788         self.MainSizer.AddGrowableCol(0)
   789         
   789         
   790         for idx, (name, panel_class) in enumerate(CFILE_PARTS):
   790         for idx, (name, panel_class) in enumerate(CFILE_PARTS):
   791             button_id = wx.NewId()
   791             button_id = wx.NewId()
   792             button = FoldPanelCaption(id=button_id, name='FoldPanelCaption_%s' % name, 
   792             button = FoldPanelCaption(id=button_id, name='FoldPanelCaption_%s' % name, 
   793                   label=name, bitmap=wx.Bitmap(opjimg("CollapsedIconData")), 
   793                   label=name, bitmap=GetBitmap("CollapsedIconData"), 
   794                   parent=self.ConfNodeEditor, pos=wx.Point(0, 0),
   794                   parent=self.ConfNodeEditor, pos=wx.Point(0, 0),
   795                   size=wx.Size(0, 20), style=wx.NO_BORDER|wx.ALIGN_LEFT)
   795                   size=wx.Size(0, 20), style=wx.NO_BORDER|wx.ALIGN_LEFT)
   796             button.SetBitmapSelected(wx.Bitmap(opjimg("ExpandedIconData")))
   796             button.SetBitmapSelected(GetBitmap("ExpandedIconData"))
   797             button.Bind(wx.EVT_BUTTON, self.GenPanelButtonCallback(name), id=button_id)
   797             button.Bind(wx.EVT_BUTTON, self.GenPanelButtonCallback(name), id=button_id)
   798             self.MainSizer.AddWindow(button, 0, border=0, flag=wx.TOP|wx.GROW)
   798             self.MainSizer.AddWindow(button, 0, border=0, flag=wx.TOP|wx.GROW)
   799             
   799             
   800             if panel_class == VariablesEditor:
   800             if panel_class == VariablesEditor:
   801                 panel = VariablesEditor(self.ConfNodeEditor, self.ParentWindow, self.Controler)
   801                 panel = VariablesEditor(self.ConfNodeEditor, self.ParentWindow, self.Controler)