class_docstr: The module sizer uses the maximum best width of the setting
  edit controls to compute the column widths, then it sets the text
  controls to wrap within the remaining space, then it uses the best
  height of each text control to lay out the rows.
class_docstr_tok: ["The","module","sizer","uses","the","maximum","best","width","of","the","setting","edit","controls","to","compute","the","column","widths",",","then","it","sets","the","text","controls","to","wrap","within","the","remaining","space",",","then","it","uses","the","best","height","of","each","text","control","to","lay","out","the","rows","."]
code: def calc_max_text_width(self):
      width = self.__min_text_width
      for i in range(self.__rows):
          item = self.get_item(0, i)
          if item is None:
              continue
          control = item.GetWindow()
          assert isinstance(control, wx.StaticText), (
              "Control at column 0, "
              "%d of grid is not StaticText: %s" % (i, str(control))
          )
          text = control.GetLabel().replace("\n", " ")
          ctrl_width = (
              control.GetFullTextExtent(text)[0] + 2 * item.GetBorder()
          )
          width = max(width, ctrl_width)
      return width
  
file_path: CellProfiler/src/frontend/cellprofiler/gui/module_view/_module_sizer.py
imports: import logging
  import wx
label_desc: Use image node_id 10 for calling the ModuleSizer obj's underlying member method code with example usage: obj.calc_max_text_width() and returns: width