<commit_before>unit frmMain;

{$mode objfpc}{$H+}

interface

uses
  SysUtils, Classes, fpg_base, fpg_main,
  fpg_widget, fpg_form, fpg_label, fpg_button,
  fpg_listbox, fpg_combobox, fpg_dialogs, fpg_checkbox;

type

  TMainForm = class(TfpgForm)
  private
    procedure chkColorNameChange(Sender: TObject);
    procedure ckdReorderChanged(Sender: TObject);
    procedure cbName1Change(Sender: TObject);
    procedure btnName1Clicked(Sender: TObject);
    procedure SetBGColor(Sender: TObject);
    procedure PopulatePaletteColorCombo;
  public
    {@VFD_HEAD_BEGIN: MainForm}
    cbName1: TfpgComboBox;
    lblName4: TfpgLabel;
    btnName1: TfpgButton;
    lbColorPick: TfpgColorListBox;
    btnName2: TfpgButton;
    btnName3: TfpgButton;
    btnName4: TfpgButton;
    lblName1: TfpgLabel;
    chkColorName: TfpgCheckBox;
    chkReorder: TfpgCheckBox;
    {@VFD_HEAD_END: MainForm}
    procedure AfterCreate; override;
  end;
  
  

{@VFD_NEWFORM_DECL}

implementation

uses
  TypInfo;

{@VFD_NEWFORM_IMPL}

procedure TMainForm.chkColorNameChange(Sender: TObject);
begin
  lbColorPick.ShowColorNames := chkColorName.Checked;
end;

procedure TMainForm.ckdReorderChanged(Sender: TObject);
begin
  lbColorPick.DragToReorder := not lbColorPick.DragToReorder;
end;

procedure TMainForm.cbName1Change(Sender: TObject);
begin
  if cbName1.Text = 'cpStandardColors' then
    lbColorPick.ColorPalette := cpStandardColors
  else if cbName1.Text = 'cpSystemColors' then
    lbColorPick.ColorPalette := cpSystemColors
  else<commit_msg>colorlistbox demo event handlers are now moved to private.<commit_after>unit frmMain;

{$mode objfpc}{$H+}

interface

uses
  SysUtils, Classes, fpg_base, fpg_main,
  fpg_widget, fpg_form, fpg_label, fpg_button,
  fpg_listbox, fpg_combobox, fpg_dialogs, fpg_checkbox;

type

  TMainForm = class(TfpgForm)
  private
    {@VFD_HEAD_BEGIN: MainForm}
    cbName1: TfpgComboBox;
    lblName4: TfpgLabel;
    btnName1: TfpgButton;
    lbColorPick: TfpgColorListBox;
    btnName2: TfpgButton;
    btnName3: TfpgButton;
    btnName4: TfpgButton;
    lblName1: TfpgLabel;
    chkColorName: TfpgCheckBox;
    chkReorder: TfpgCheckBox;
    {@VFD_HEAD_END: MainForm}
    procedure chkColorNameChange(Sender: TObject);
    procedure ckdReorderChanged(Sender: TObject);
    procedure cbName1Change(Sender: TObject);
    procedure btnName1Clicked(Sender: TObject);
    procedure SetBGColor(Sender: TObject);
    procedure PopulatePaletteColorCombo;
  public
    procedure AfterCreate; override;
  end;
  
  

{@VFD_NEWFORM_DECL}

implementation

uses
  TypInfo;

{@VFD_NEWFORM_IMPL}

procedure TMainForm.chkColorNameChange(Sender: TObject);
begin
  lbColorPick.ShowColorNames := chkColorName.Checked;
end;

procedure TMainForm.ckdReorderChanged(Sender: TObject);
begin
  lbColorPick.DragToReorder := not lbColorPick.DragToReorder;
end;

procedure TMainForm.cbName1Change(Sender: TObject);
begin
  if cbName1.Text = 'cpStandardColors' then
    lbColorPick.ColorPalette := cpStandardColors
  else if cbName1.Text = 'cpSystemColors' then
    lbColorPick.ColorPalette := cpSystemColors
  else
{'fraction_non_alphanumeric': 0.08158658497258948, 'fraction_numerical': 0.007739438890680426, 'mean_word_length': 5.05859375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3295788', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1132, 'n_words': 219}