<commit_before>/******************************************************************************\
* File:          listview.h
* Purpose:       Declaration of class 'wxExListViewStandard' and 
*                'wxExListViewWithFrame'
* Author:        <NAME>
* RCS-ID:        $Id$
*
* Copyright (c) 1998-2009, <NAME>
* All rights are reserved. Reproduction in whole or part is prohibited
* without the written consent of the copyright owner.
\******************************************************************************/

#ifndef _EX_REPORT_LISTVIEW_H
#define _EX_REPORT_LISTVIEW_H

#include <wx/extension/listview.h>
#include <wx/extension/tool.h>

/// Adds some standard lists.
class wxExListViewStandard : public wxExListView
{
public:
  /// The supported lists.
  enum ListType
  {
    LIST_BEFORE_FIRST, ///< for iterating
    LIST_COUNT,        ///< a list to show statistics
    LIST_FIND,         ///< a list to show find results
    LIST_HISTORY,      ///< a list to show history items
    LIST_KEYWORD,      ///< a list to show keywords
    LIST_REPLACE,      ///< a list to show replace results
    LIST_PROCESS,      ///< a list to show process output
    LIST_FILE,         ///< a list associated with a file
    LIST_REVISION,     ///< a list to show revisions
    LIST_SQL,          ///< a list to show embedded sql
    LIST_VERSION,      ///< a list to show versions
    LIST_AFTER_LAST,   ///< for iterating
  };

  /// Menu flags, they determine how the context menu will appear.
  enum
  {
    LIST_MENU_REPORT_FIND = 0x0001, ///< for adding find and replace in files
    LIST_MENU_TOOL        = 0x0002, ///< for adding tool menu

    LIST_MENU_DEFAULT = 
      LIST_MENU_REPORT_FIND | 
      LIST_MENU_TOOL
  };

  /// Constructor.
  wxExListViewStandard(wxWindow* parent,
    ListType type,
    wxWindowID id = wxID_ANY,
    const wxExLexer* lexer = NULL,
    const wxPoint& pos = wxDefaultPosition,
    const wxSize& size = wxDefaultSize,
    long style = wxLC_LIST  | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER,
    const wxValidator& validator = wxDefaultValidator,
    const wxString &name = wxListCtrlNameStr);

  /// Deletes double items.
  void DeleteDoubles();

  /// Gets the list type.
  const ListType GetType() const {return m_Type;};

  /// Gets info about this list.
  virtual const wxString GetListInfo() const {
    return GetTypeDescription();};

  /// Gets the list type as a string.
  const wxString GetTypeDescription() const {
    return GetTypeDescription(m_Type);};

  /// Gets the list type as a string for specified type.
  static const wxString GetTypeDescription(ListType type);

  /// Returns list type from tool id.
  static ListType GetTypeTool(const wxExTool& tool);

  /// Updates all items.
  virtual void ItemsUpdate();

  /// Tries to insert items from specified text.
  /// Returns true if successfull.
  virtual bool ItemFromText(const wxString& text);

  /// Returns column text for specified item.
  virtual const wxString ItemToText(long item_number) const;
protected:
  virtual void BuildPopupMenu(wxExMenu& menu);
  void OnCommand(wxCommandEvent& event);
  void OnIdle(wxIdleEvent& event);
  void OnList(wxListEvent& event);
private:
  void Initialize(const wxExLexer* lexer);
  const ListType m_Type;
  bool m_ItemUpdated;
  long m_ItemNumber;

  DECLARE_EVENT_TABLE()
};

class wxExFrameWithHistory;

/// Adds a wxExFrameWithHistory to wxExListViewStandard.
/// It also adds a tool menu if appropriate.
class wxExListViewWithFrame : public wxExListViewStandard
{
public:
  /// Constructor.
  wxExListViewWithFrame(wxWindow* parent,
    wxExFrameWithHistory* frame,
    ListType type,
    wxWindowID id = wxID_ANY,
    long menu_flags = LIST_MENU_DEFAULT,
    const wxExLexer* lexer = NULL,
    const wxPoint& pos = wxDefaultPosition,
    const wxSize& size = wxDefaultSize,
    long style = wxLC_LIST  | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER,
    const wxValidator& validator = wxDefaultValidator,
    const wxString &name = wxListCtrlNameStr);
    
  /// Gets the frame.
  wxExFrameWithHistory* GetFrame() {return m_Frame;};
protected:
  virtual void BuildPopupMenu(wxExMenu& menu);
  void OnCommand(wxCommandEvent& event);<commit_msg>made GetFrame protected<commit_after>/******************************************************************************\
* File:          listview.h
* Purpose:       Declaration of class 'wxExListViewStandard' and 
*                'wxExListViewWithFrame'
* Author:        <NAME>
* RCS-ID:        $Id$
*
* Copyright (c) 1998-2009, <NAME>
* All rights are reserved. Reproduction in whole or part is prohibited
* without the written consent of the copyright owner.
\******************************************************************************/

#ifndef _EX_REPORT_LISTVIEW_H
#define _EX_REPORT_LISTVIEW_H

#include <wx/extension/listview.h>
#include <wx/extension/tool.h>

/// Adds some standard lists.
class wxExListViewStandard : public wxExListView
{
public:
  /// The supported lists.
  enum ListType
  {
    LIST_BEFORE_FIRST, ///< for iterating
    LIST_COUNT,        ///< a list to show statistics
    LIST_FIND,         ///< a list to show find results
    LIST_HISTORY,      ///< a list to show history items
    LIST_KEYWORD,      ///< a list to show keywords
    LIST_REPLACE,      ///< a list to show replace results
    LIST_PROCESS,      ///< a list to show process output
    LIST_FILE,         ///< a list associated with a file
    LIST_REVISION,     ///< a list to show revisions
    LIST_SQL,          ///< a list to show embedded sql
    LIST_VERSION,      ///< a list to show versions
    LIST_AFTER_LAST,   ///< for iterating
  };

  /// Menu flags, they determine how the context menu will appear.
  enum
  {
    LIST_MENU_REPORT_FIND = 0x0001, ///< for adding find and replace in files
    LIST_MENU_TOOL        = 0x0002, ///< for adding tool menu

    LIST_MENU_DEFAULT = 
      LIST_MENU_REPORT_FIND | 
      LIST_MENU_TOOL
  };

  /// Constructor.
  wxExListViewStandard(wxWindow* parent,
    ListType type,
    wxWindowID id = wxID_ANY,
    const wxExLexer* lexer = NULL,
    const wxPoint& pos = wxDefaultPosition,
    const wxSize& size = wxDefaultSize,
    long style = wxLC_LIST  | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER,
    const wxValidator& validator = wxDefaultValidator,
    const wxString &name = wxListCtrlNameStr);

  /// Deletes double items.
  void DeleteDoubles();

  /// Gets the list type.
  const ListType GetType() const {return m_Type;};

  /// Gets info about this list.
  virtual const wxString GetListInfo() const {
    return GetTypeDescription();};

  /// Gets the list type as a string.
  const wxString GetTypeDescription() const {
    return GetTypeDescription(m_Type);};

  /// Gets the list type as a string for specified type.
  static const wxString GetTypeDescription(ListType type);

  /// Returns list type from tool id.
  static ListType GetTypeTool(const wxExTool& tool);

  /// Updates all items.
  virtual void ItemsUpdate();

  /// Tries to insert items from specified text.
  /// Returns true if successfull.
  virtual bool ItemFromText(const wxString& text);

  /// Returns column text for specified item.
  virtual const wxString ItemToText(long item_number) const;
protected:
  virtual void BuildPopupMenu(wxExMenu& menu);
  void OnCommand(wxCommandEvent& event);
  void OnIdle(wxIdleEvent& event);
  void OnList(wxListEvent& event);
private:
  void Initialize(const wxExLexer* lexer);
  const ListType m_Type;
  bool m_ItemUpdated;
  long m_ItemNumber;

  DECLARE_EVENT_TABLE()
};

class wxExFrameWithHistory;

/// Adds a wxExFrameWithHistory to wxExListViewStandard.
/// It also adds a tool menu if appropriate.
class wxExListViewWithFrame : public wxExListViewStandard
{
public:
  /// Constructor.
  wxExListViewWithFrame(wxWindow* parent,
    wxExFrameWithHistory* frame,
    ListType type,
    wxWindowID id = wxID_ANY,
    long menu_flags = LIST_MENU_DEFAULT,
    const wxExLexer* lexer = NULL,
    const wxPoint& pos = wxDefaultPosition,
    const wxSize& size = wxDefaultSize,
    long style = wxLC_LIST  | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER,
    const wxValidator& validator = wxDefaultValidator,
    const wxString &name = wxListCtrlNameStr);    
protected:
  virtual void BuildPopupMenu(wxExMenu& menu);
  wxExFrameWithHistory* GetFrame() {return m_Frame;};
  void OnCommand(wxCommandEvent& event);
{'fraction_non_alphanumeric': 0.12168115251815692, 'fraction_numerical': 0.004286224550541731, 'mean_word_length': 3.2900919305413687, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 11, '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': '5523064', 'n_tokens_mistral': 2640, 'n_tokens_neox': 2463, 'n_words': 788}