class_docstr: Container for measurement controls
class_docstr_tok: ["Container","for","measurement","controls"]
code: def on_choose_font(self, event):
      with wx.Dialog(
          self.choice_panel.Parent, title="Measurement appearance"
      ) as dlg:
          labels = []
  
          def add_label(sizer, label):
              ctrl = wx.StaticText(dlg, label=label)
              sizer.Add(
                  ctrl, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL
              )
              labels.append(ctrl)
              sizer.AddSpacer(2)
  
          dlg.Sizer = wx.BoxSizer(wx.VERTICAL)
          sizer = wx.BoxSizer(wx.VERTICAL)
          dlg.Sizer.Add(sizer, 0, wx.EXPAND | wx.ALL, 5)
          subsizer = wx.BoxSizer(wx.HORIZONTAL)
          sizer.Add(subsizer, 0, wx.EXPAND)
          sizer.AddSpacer(2)
          add_label(subsizer, "Font")
          font_picker = wx.FontPickerCtrl(dlg)
          font_picker.SetSelectedFont(self.font)
          font_picker.SetPickerCtrlGrowable(True)
          font_picker.Bind(
              wx.EVT_FONTPICKER_CHANGED, lambda event: dlg.Layout()
          )
          subsizer.Add(font_picker, 0, wx.ALIGN_LEFT)
          #
          # Foreground color
          #
          subsizer = wx.BoxSizer(wx.HORIZONTAL)
          sizer.Add(subsizer, 0, wx.EXPAND)
          sizer.AddSpacer(2)
          add_label(subsizer, "Text color")
          foreground_color = wx.lib.colourselect.ColourSelect(
              dlg, colour=self.foreground_color
          )
          subsizer.Add(foreground_color, 0, wx.ALIGN_LEFT)
          #
          # Background color and alpha
          #
          subsizer = wx.BoxSizer(wx.HORIZONTAL)
          sizer.Add(subsizer, 0, wx.EXPAND)
          sizer.AddSpacer(2)
          add_label(subsizer, "Background color")
          background_color = wx.lib.colourselect.ColourSelect(
              dlg, colour=self.background_color
          )
          subsizer.Add(background_color, 0, wx.ALIGN_LEFT)
  
          subsizer = wx.BoxSizer(wx.HORIZONTAL)
          sizer.Add(subsizer, 0, wx.EXPAND)
          sizer.AddSpacer(2)
          add_label(subsizer, "Alpha")
          alpha = wx.Slider(
              dlg,
              value=self.background_alpha * 100,
              minValue=0,
              maxValue=100,
              style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS,
          )
          alpha.SetMinSize(wx.Size(200, alpha.GetMinSize()[0]))
          subsizer.Add(alpha, 0, wx.EXPAND)
  
          subsizer = wx.BoxSizer(wx.HORIZONTAL)
          sizer.Add(subsizer, 0, wx.EXPAND)
          sizer.AddSpacer(2)
          add_label(subsizer, "Box shape")
          box_style = wx.Choice(
              dlg,
              choices=[
                  "circle",
                  "round",
                  "roundtooth",
                  "sawtooth",
                  "square",
              ],
          )
          box_style.SetStringSelection(self.box_style)
          subsizer.Add(box_style, 0, wx.ALIGN_LEFT)
  
          subsizer = wx.BoxSizer(wx.HORIZONTAL)
          sizer.Add(subsizer, 0, wx.EXPAND)
          sizer.AddSpacer(2)
          add_label(subsizer, "Precision")
          precision = wx.SpinCtrl(dlg, value=str(self.precision), min=0)
          subsizer.AddSpacer(2)
          subsizer.Add(precision, 0, wx.ALIGN_LEFT)
  
          width = 0
          for label in labels:
              width = max(width, label.GetBestSize()[0])
          for label in labels:
              label.SetMinSize(wx.Size(width, label.GetBestSize()[1]))
  
          button_sizer = wx.StdDialogButtonSizer()
          dlg.Sizer.Add(
              button_sizer, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5
          )
          button_sizer.AddButton(wx.Button(dlg, wx.ID_OK))
          button_sizer.AddButton(wx.Button(dlg, wx.ID_CANCEL))
          button_sizer.Realize()
          dlg.Fit()
          if dlg.ShowModal() == wx.ID_OK:
              self.font = font_picker.GetSelectedFont()
              self.foreground_color = foreground_color.GetColour()
              self.background_color = background_color.GetColour()
              self.background_alpha = float(alpha.GetValue()) / 100
              self.box_style = box_style.GetStringSelection()
              self.precision = precision.GetValue()
              self.on_change(event)
  
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 2 for calling the WorkspaceViewMeasurementRow obj's underlying member method code with example usage: obj.on_choose_font(event) without return types