class_docstr: The window frame that lets you add modules to a pipeline
  
      
class_docstr_tok: ["The","window","frame","that","lets","you","add","modules","to","a","pipeline"]
docstr: Initialize the frame and its layout
  
          
docstr_tok: ["Initialize","the","frame","and","its","layout"]
code: def __init__(self, *args, **kwds):
      """Initialize the frame and its layout"""
      kwds["style"] = wx.DEFAULT_FRAME_STYLE
      wx.Frame.__init__(self, *args, **kwds)
      # Top level panels
      left_panel = wx.Panel(self, -1)
      right_panel = wx.Panel(self, -1)
      # Module categories (in left panel)
      module_categories_text = wx.StaticText(
          left_panel, -1, "Module Categories", style=wx.ALIGN_CENTER
      )
      font = module_categories_text.GetFont()
      font.SetWeight(wx.FONTWEIGHT_BOLD)
      module_categories_text.SetFont(font)
      self.__module_categories_list_box = wx.ListBox(left_panel, -1)
      # Control panel for the selected module
      selected_module_panel = wx.Panel(left_panel, -1)
      add_to_pipeline_button = wx.Button(
          selected_module_panel, -1, "+ Add to Pipeline"
      )
      module_help_button = wx.Button(
          selected_module_panel, -1, "? Module Help"
      )
      # Other buttons
      getting_started_button = wx.Button(
          left_panel, -1, "Getting Started"
      )
      done_button = wx.Button(left_panel, -1, "Done")
      # Right-side panel
      self.__module_list_box = wx.ListBox(right_panel, -1)
      w, h, _, _ = self.__module_list_box.GetFullTextExtent(
          "MeasureObjectIntensityDistribution"
      )
      self.__module_list_box.SetMinSize(wx.Size(w, h * 30))
      # Sizers
      self.SetSizer(wx.BoxSizer(wx.VERTICAL))
      search_sizer = wx.BoxSizer(wx.HORIZONTAL)
      self.GetSizer().Add(search_sizer, 0, wx.EXPAND | wx.ALL, 2)
      search_sizer.Add(
          wx.StaticText(self, label="Find Modules:"),
          0,
          wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL,
      )
      self.search_text = wx.TextCtrl(self, style=wx.TE_PROCESS_ENTER)
      search_sizer.Add(self.search_text, 1, wx.EXPAND)
      self.search_button = wx.Button(self, label="Search Help")
      search_sizer.Add(self.search_button, 0, wx.EXPAND)
      self.GetSizer().AddSpacer(2)
      top_sizer = wx.BoxSizer(wx.HORIZONTAL)
      top_sizer.AddMany(
          [
              (left_panel, 0, wx.EXPAND | wx.LEFT, 5),
              (right_panel, 1, wx.EXPAND),
          ]
      )
      self.GetSizer().Add(top_sizer, 1, wx.EXPAND)
      left_sizer = wx.BoxSizer(wx.VERTICAL)
      left_sizer.Add(module_categories_text, 0, wx.EXPAND)
      left_sizer.AddSpacer(4)
      left_sizer.Add(self.__module_categories_list_box, 1, wx.EXPAND)
      left_sizer.Add((-1, 10))
      left_sizer.Add(selected_module_panel, 0, wx.EXPAND)
      left_sizer.Add((-1, 10))
      left_sizer.Add(getting_started_button, 0, wx.EXPAND)
      left_sizer.AddSpacer(2)
      left_sizer.Add(done_button, 0, wx.EXPAND | wx.BOTTOM, 5)
      left_panel.SetSizer(left_sizer)
  
      right_sizer = wx.BoxSizer(wx.VERTICAL)
      right_sizer.Add(self.__module_list_box, 1, wx.EXPAND | wx.ALL, 5)
      right_panel.SetSizer(right_sizer)
  
      selected_module_panel_sizer = wx.BoxSizer(wx.VERTICAL)
      selected_module_panel_sizer.Add(
          add_to_pipeline_button, 0, wx.EXPAND
      )
      selected_module_panel_sizer.AddSpacer(2)
      selected_module_panel_sizer.Add(module_help_button, 0, wx.EXPAND)
      selected_module_panel.SetSizer(selected_module_panel_sizer)
  
      self.__set_icon()
      accelerators = wx.AcceleratorTable(
          [
              (
                  wx.ACCEL_CMD,
                  ord("W"),
                  cellprofiler.gui.cpframe.ID_FILE_EXIT,
              )
          ]
      )
      self.SetAcceleratorTable(accelerators)
  
      self.Bind(wx.EVT_CLOSE, self.__on_close, self)
      self.Bind(
          wx.EVT_LISTBOX,
          self.__on_category_selected,
          self.__module_categories_list_box,
      )
      self.Bind(
          wx.EVT_LISTBOX_DCLICK,
          self.__on_add_to_pipeline,
          self.__module_list_box,
      )
      self.Bind(
          wx.EVT_BUTTON,
          self.__on_add_to_pipeline,
          add_to_pipeline_button,
      )
      self.Bind(wx.EVT_BUTTON, self.__on_close, done_button)
      self.Bind(wx.EVT_BUTTON, self.__on_help, module_help_button)
      self.Bind(
          wx.EVT_BUTTON,
          self.__on_getting_started,
          getting_started_button,
      )
      self.Bind(
          wx.EVT_MENU,
          self.__on_close,
          id=cellprofiler.gui.cpframe.ID_FILE_EXIT,
      )
      self.Bind(wx.EVT_CHAR_HOOK, self.__on_special_key)
      self.search_text.Bind(wx.EVT_TEXT, self.__on_search_modules)
      self.search_button.Bind(wx.EVT_BUTTON, self.__on_search_help)
      self.__get_module_files()
      self.__set_categories()
      self.__listeners = []
      self.__module_categories_list_box.Select(0)
      self.__on_category_selected(None)
      self.Fit()
      self.search_text.SetFocus()
  
imports: import wx
  from rapidfuzz.utils import default_process
  from rapidfuzz.process import extract
  from rapidfuzz.distance import DamerauLevenshtein
  from cellprofiler_core.utilities.core.modules import get_module_names, instantiate_module, get_module_class
  import cellprofiler.gui
  import cellprofiler.gui.cpframe
  import cellprofiler.gui.help.search
  import cellprofiler.gui.utilities.icon
  import cellprofiler.modules
label_desc: Use image node_id 1 to create a new AddModuleFrame object from inherited base classes: wx with example: obj = AddModuleFrame()