class_docstr: Container for measurement controls
class_docstr_tok: ["Container","for","measurement","controls"]
docstr: MeasurementRow contstructor
  
  panel - the panel that's going to be the host for the controls
  grid_sizer - put the controls in this grid sizer
  row_idx - the row # in the grid sizer
  on_change - a function (with no args) that's called whenever any control
              is changed. This handler should call MeasurementRow.update
docstr_tok: ["MeasurementRow","contstructor","panel","-","the","panel","that","'s","going","to","be","the","host","for","the","controls","grid_sizer","-","put","the","controls","in","this","grid","sizer","row_idx","-","the","row","#","in","the","grid","sizer","on_change","-","a","function","(","with","no","args",")","that","'s","called","whenever","any","control","is","changed",".","This","handler","should","call","MeasurementRow.update"]
code: def __init__(self, panel, grid_sizer, row_idx, on_change):
      """MeasurementRow contstructor
  
      panel - the panel that's going to be the host for the controls
      grid_sizer - put the controls in this grid sizer
      row_idx - the row # in the grid sizer
      on_change - a function (with no args) that's called whenever any control
                  is changed. This handler should call MeasurementRow.update
      """
      #
      # Create three-tiered measurement choice:
      #    object name
      #    category
      #    measurement name
      #
      assert isinstance(grid_sizer, wx.GridBagSizer)
      self.process_events = True
      self.change_fn = on_change
      self.choice_panel = wx.Panel(panel)
      grid_sizer.Add(
          self.choice_panel,
          (
              row_idx,
              C_CHOOSER,
          ),
          flag=wx.EXPAND,
      )
      self.choice_sizer = wx.BoxSizer(wx.VERTICAL)
      self.choice_panel.SetSizer(self.choice_sizer)
      self.object_choice = wx.Choice(self.choice_panel)
      self.choice_sizer.Add(self.object_choice, 0, wx.EXPAND)
      self.category_choice = wx.Choice(self.choice_panel)
      self.category_choice.Hide()
      self.choice_sizer.Add(
          self.category_choice, 0, wx.EXPAND | wx.TOP, 2
      )
      self.measurement_choice = wx.Choice(self.choice_panel)
      self.measurement_choice.Hide()
      self.choice_sizer.Add(
          self.measurement_choice, 0, wx.EXPAND | wx.TOP, 2
      )
      #
      # Font button
      #
      self.font_button = wx.Button(panel, label="Font")
      grid_sizer.Add(
          self.font_button,
          (
              row_idx,
              C_COLOR,
          ),
          flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_TOP,
      )
      self.font_button.Bind(wx.EVT_BUTTON, self.on_choose_font)
      self.show_ctrl = wx.CheckBox(panel)
      grid_sizer.Add(
          self.show_ctrl,
          (
              row_idx,
              C_SHOW,
          ),
          flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_TOP,
      )
      #
      # The drawing characteristics
      #
      self.font = self.font_button.Font
      self.foreground_color = wx.SystemSettings.GetColour(
          wx.SYS_COLOUR_BTNTEXT
      )
      self.background_color = wx.SystemSettings.GetColour(
          wx.SYS_COLOUR_WINDOW
      )
      self.background_alpha = 0.5
      self.box_style = "round"
      self.precision = 4  # of decimal places
  
      for control, event in (
          (self.object_choice, wx.EVT_CHOICE),
          (self.category_choice, wx.EVT_CHOICE),
          (self.measurement_choice, wx.EVT_CHOICE),
          (self.show_ctrl, wx.EVT_CHECKBOX),
      ):
          control.Bind(event, self.on_change)
  
file_path: CellProfiler/src/frontend/cellprofiler/gui/workspace_view/_workspace_view_measurement_row.py
imports: import wx
  import wx.lib
  import wx.lib.colourselect
  from ..constants.workspace_view import C_CHOOSER
  from ..constants.workspace_view import C_COLOR
  from ..constants.workspace_view import C_SHOW
label_desc: Use image node_id 1 to create a new WorkspaceViewMeasurementRow object  with example: obj = WorkspaceViewMeasurementRow(panel, grid_sizer, row_idx, on_change)