docstr: Initialize the field
  
  pipeline - the pipeline being run
  module - the module containing the setting
  value (optional) - initial value for control
  padding (optional) - padding around text in pixels
docstr_tok: ["Initialize","the","field","pipeline","-","the","pipeline","being","run","module","-","the","module","containing","the","setting","value","(","optional",")","-","initial","value","for","control","padding","(","optional",")","-","padding","around","text","in","pixels"]
code: def __init__(self, pipeline, module, *args, **kwargs):
      """Initialize the field
  
      pipeline - the pipeline being run
      module - the module containing the setting
      value (optional) - initial value for control
      padding (optional) - padding around text in pixels
      """
      kwargs = kwargs.copy()
      style = kwargs.get("style", wx.BORDER_DEFAULT)
      value = kwargs.pop("value", "")
      self.padding = kwargs.pop("padding", 1)
      self.offset = 0
      if (style & wx.BORDER_MASK) == wx.BORDER_DEFAULT:
          self.native_border = True
          self.padding += 2
          style = (style & ~wx.BORDER_MASK) | wx.BORDER_NONE
      else:
          self.native_border = False
      kwargs["style"] = style | wx.WANTS_CHARS
  
      super(MetadataControl, self).__init__(*args, **kwargs)
      columns = pipeline.get_measurement_columns(module)
      choices = [
          C_SERIES,
          C_FRAME,
      ]
      for column in columns:
          object_name, feature, coltype = column[:3]
          choice = feature[(len(C_METADATA) + 1) :]
          if object_name == IMAGE and feature.startswith(C_METADATA):
              choices.append(choice)
      self.__metadata_choices = choices
      self.SetValue(value)
      self.__cursor_pos = len(self.__tokens)
      self.__caret = None
      self.__metadata_choice_ids = {}
      self.__metadata_choice_dict = {}
      for i, choice in enumerate(sorted(choices)):
          choice_id = get_choice_id(i)
          self.__metadata_choice_ids[choice_id] = choice
          self.__metadata_choice_dict[choice] = choice_id
          self.Bind(wx.EVT_MENU, self.select_value, id=choice_id)
  
      self.selection = [0, 0]
  
      def on_focus(event):
          if self.__caret is None:
              self.make_caret()
          self.show_caret()
  
      def on_lose_focus(event):
          if self.__caret is not None:
              self.__caret.Hide()
              del self.__caret
              self.__caret = None
  
      def on_show(event):
          if event:
              if isinstance(event.EventObject, MetadataControl):
                  self.make_caret()
          else:
              del self.__caret
              self.__caret = None
  
      self.Bind(wx.EVT_SET_FOCUS, on_focus)
      self.Bind(wx.EVT_KILL_FOCUS, on_lose_focus)
      self.Bind(wx.EVT_KEY_DOWN, self.on_key_down)
      self.Bind(wx.EVT_CHAR, self.on_char)
      self.Bind(wx.EVT_PAINT, self.OnPaint)
      self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
      self.Bind(wx.EVT_MOTION, self.OnMouseMotion)
      self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
      self.Bind(wx.EVT_RIGHT_DOWN, self.on_right_down)
      self.Bind(wx.EVT_CONTEXT_MENU, self.on_context_menu)
      self.Bind(wx.EVT_SHOW, on_show)
      self.Bind(wx.EVT_SIZE, self.OnSize)
  
imports: import wx
  import wx.lib.masked
  from cellprofiler_core.constants.measurement import C_FRAME
  from cellprofiler_core.constants.measurement import C_METADATA
  from cellprofiler_core.constants.measurement import C_SERIES
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.preferences import get_primary_outline_color
label_desc: Use image node_id 1 to create a new MetadataControl object from inherited base classes: wx with example: obj = MetadataControl(pipeline, module)