<commit_before>////////////////////////////////////////////////////////////////////////////////
// Name:      configitem.cpp
// Purpose:   Implementation of wxExConfigItem class
// Author:    <NAME>
// Created:   2009-11-10
// RCS-ID:    $Id$
// Copyright: (c) 2009 <NAME>
////////////////////////////////////////////////////////////////////////////////

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/clrpicker.h> // for wxColourPickerWidget
#include <wx/config.h>
#include <wx/filepicker.h>
#include <wx/fontpicker.h>
#include <wx/spinctrl.h>
#include <wx/extension/configitem.h>
#include <wx/extension/frd.h>
#include <wx/extension/util.h>

#if wxUSE_GUI

wxExConfigItem::wxExConfigItem()
  : m_Control(NULL)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  int min,
  int max,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_Min(min)
  , m_Max(max)
  , m_MaxItems(0)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(CONFIG_SPINCTRL)
  , m_Cols(cols)
  , m_AddName(true)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  double min,
  double max,
  double inc,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_MaxItems(0)
  , m_MinDouble(min)
  , m_MaxDouble(max)
  , m_Inc(inc)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(CONFIG_SPINCTRL_DOUBLE)
  , m_Cols(cols)
  , m_AddName(true)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  const wxString& page,
  long style,
  bool is_required,
  bool add_name,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(is_required)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(0)
  , m_Name(name)
  , m_Page(page)
  , m_Style(style)
  , m_Type(CONFIG_STRING)
  , m_Cols(cols)
  , m_AddName(add_name)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  const std::map<long, const wxString> & choices,
  bool use_radiobox,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(0)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(use_radiobox ? CONFIG_RADIOBOX: CONFIG_CHECKLISTBOX)
  , m_Choices(choices)
  , m_Cols(cols)
  , m_AddName(false)
{
}

wxExConfigItem::wxExConfigItem(
  const std::set<wxString> & choices,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(0)
  , m_Name("checklistbox_noname")
  , m_Page(page)
  , m_Style(0)
  , m_Type(CONFIG_CHECKLISTBOX_NONAME)
  , m_ChoicesBool(choices) 
  , m_Cols(cols)
  , m_AddName(false)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  int type,
  const wxString& page,
  bool is_required,
  int id,
  int max_items,
  bool add_name,
  int cols)
  : m_Control(NULL)
  , m_Id(id)
  , m_IsRequired(is_required)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(max_items)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(type) 
  , m_Cols(cols)
  , m_AddName(add_name)
{
}

void wxExConfigItem::AddBrowseButton(wxSizer* sizer) const
{
  wxASSERT(m_Control != NULL);<commit_msg>a checkbox has no name<commit_after>////////////////////////////////////////////////////////////////////////////////
// Name:      configitem.cpp
// Purpose:   Implementation of wxExConfigItem class
// Author:    <NAME>
// Created:   2009-11-10
// RCS-ID:    $Id$
// Copyright: (c) 2009 <NAME>
////////////////////////////////////////////////////////////////////////////////

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/clrpicker.h> // for wxColourPickerWidget
#include <wx/config.h>
#include <wx/filepicker.h>
#include <wx/fontpicker.h>
#include <wx/spinctrl.h>
#include <wx/extension/configitem.h>
#include <wx/extension/frd.h>
#include <wx/extension/util.h>

#if wxUSE_GUI

wxExConfigItem::wxExConfigItem()
  : m_Control(NULL)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  int min,
  int max,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_Min(min)
  , m_Max(max)
  , m_MaxItems(0)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(CONFIG_SPINCTRL)
  , m_Cols(cols)
  , m_AddName(true)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  double min,
  double max,
  double inc,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_MaxItems(0)
  , m_MinDouble(min)
  , m_MaxDouble(max)
  , m_Inc(inc)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(CONFIG_SPINCTRL_DOUBLE)
  , m_Cols(cols)
  , m_AddName(true)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  const wxString& page,
  long style,
  bool is_required,
  bool add_name,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(is_required)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(0)
  , m_Name(name)
  , m_Page(page)
  , m_Style(style)
  , m_Type(CONFIG_STRING)
  , m_Cols(cols)
  , m_AddName(add_name)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  const std::map<long, const wxString> & choices,
  bool use_radiobox,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(0)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(use_radiobox ? CONFIG_RADIOBOX: CONFIG_CHECKLISTBOX)
  , m_Choices(choices)
  , m_Cols(cols)
  , m_AddName(false)
{
}

wxExConfigItem::wxExConfigItem(
  const std::set<wxString> & choices,
  const wxString& page,
  int cols)
  : m_Control(NULL)
  , m_Id(wxID_ANY)
  , m_IsRequired(false)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(0)
  , m_Name("checklistbox_noname")
  , m_Page(page)
  , m_Style(0)
  , m_Type(CONFIG_CHECKLISTBOX_NONAME)
  , m_ChoicesBool(choices) 
  , m_Cols(cols)
  , m_AddName(false)
{
}

wxExConfigItem::wxExConfigItem(
  const wxString& name,
  int type,
  const wxString& page,
  bool is_required,
  int id,
  int max_items,
  bool add_name,
  int cols)
  : m_Control(NULL)
  , m_Id(id)
  , m_IsRequired(is_required)
  , m_Min(0)
  , m_Max(0)
  , m_MaxItems(max_items)
  , m_Name(name)
  , m_Page(page)
  , m_Style(0)
  , m_Type(type) 
  , m_Cols(cols)
  , m_AddName(type == CONFIG_CHECKBOX ? false: add_name)
{
}

void wxExConfigItem::AddBrowseButton(wxSizer* sizer) const
{
  wxASSERT(m_Control != NULL);
{'fraction_non_alphanumeric': 0.18162128712871287, 'fraction_numerical': 0.009282178217821782, 'mean_word_length': 3.187176165803109, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2536994', 'n_tokens_mistral': 2807, 'n_tokens_neox': 2771, 'n_words': 440}