controls/SearchResultPanel.py
changeset 1745 f9d32913bad4
parent 1744 69dfdb26f600
child 1749 d73b64672238
equal deleted inserted replaced
1744:69dfdb26f600 1745:f9d32913bad4
    66     def _init_coll_MainSizer_Growables(self, parent):
    66     def _init_coll_MainSizer_Growables(self, parent):
    67         parent.AddGrowableCol(0)
    67         parent.AddGrowableCol(0)
    68         parent.AddGrowableRow(1)
    68         parent.AddGrowableRow(1)
    69 
    69 
    70     def _init_coll_HeaderSizer_Items(self, parent):
    70     def _init_coll_HeaderSizer_Items(self, parent):
    71         parent.AddWindow(self.HeaderLabel, 1, border=5, flag=wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL)
    71         parent.AddWindow(self.HeaderLabel, 1, border=5, flag=wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
    72         parent.AddWindow(self.ResetButton, 0, border=0, flag=0)
    72         parent.AddWindow(self.ResetButton, 0, border=0, flag=0)
    73 
    73 
    74     def _init_coll_HeaderSizer_Growables(self, parent):
    74     def _init_coll_HeaderSizer_Growables(self, parent):
    75         parent.AddGrowableCol(0)
    75         parent.AddGrowableCol(0)
    76 
    76 
    91 
    91 
    92         self.HeaderLabel = wx.StaticText(id=ID_SEARCHRESULTPANELHEADERLABEL,
    92         self.HeaderLabel = wx.StaticText(id=ID_SEARCHRESULTPANELHEADERLABEL,
    93               name='HeaderLabel', parent=self,
    93               name='HeaderLabel', parent=self,
    94               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
    94               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
    95 
    95 
    96         search_results_tree_style = CT.TR_HAS_BUTTONS|CT.TR_NO_LINES|CT.TR_HAS_VARIABLE_ROW_HEIGHT
    96         search_results_tree_style = CT.TR_HAS_BUTTONS | CT.TR_NO_LINES | CT.TR_HAS_VARIABLE_ROW_HEIGHT
    97         self.SearchResultsTree = CT.CustomTreeCtrl(id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE,
    97         self.SearchResultsTree = CT.CustomTreeCtrl(id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE,
    98               name="SearchResultsTree", parent=self,
    98               name="SearchResultsTree", parent=self,
    99               pos=wx.Point(0, 0), style=search_results_tree_style)
    99               pos=wx.Point(0, 0), style=search_results_tree_style)
   100         if wx.VERSION >= (2, 8, 11):
   100         if wx.VERSION >= (2, 8, 11):
   101             self.SearchResultsTree.SetAGWWindowStyleFlag(search_results_tree_style)
   101             self.SearchResultsTree.SetAGWWindowStyleFlag(search_results_tree_style)
   293             text = _("(%d matches)") % infos["matches"]
   293             text = _("(%d matches)") % infos["matches"]
   294             start_idx, end_idx = 0, len(text)
   294             start_idx, end_idx = 0, len(text)
   295             style = wx.TextAttr(wx.Colour(0, 127, 174))
   295             style = wx.TextAttr(wx.Colour(0, 127, 174))
   296 
   296 
   297         if text is not None:
   297         if text is not None:
   298             text_ctrl_style = wx.BORDER_NONE|wx.TE_READONLY|wx.TE_RICH2
   298             text_ctrl_style = wx.BORDER_NONE | wx.TE_READONLY | wx.TE_RICH2
   299             if wx.Platform != '__WXMSW__' or len(text.splitlines()) > 1:
   299             if wx.Platform != '__WXMSW__' or len(text.splitlines()) > 1:
   300                 text_ctrl_style |= wx.TE_MULTILINE
   300                 text_ctrl_style |= wx.TE_MULTILINE
   301             text_ctrl = wx.TextCtrl(id=-1, parent=self.SearchResultsTree, pos=wx.Point(0, 0),
   301             text_ctrl = wx.TextCtrl(id=-1, parent=self.SearchResultsTree, pos=wx.Point(0, 0),
   302                     value=text, style=text_ctrl_style)
   302                     value=text, style=text_ctrl_style)
   303             width, height = text_ctrl.GetTextExtent(text)
   303             width, height = text_ctrl.GetTextExtent(text)