15#ifndef LISTGENREPORT_H
16#define LISTGENREPORT_H
28#include <wx/listctrl.h>
30#include <wx/textdlg.h>
32#include "../core/textparser.h"
39#define ID_MENU_MOVE_TOP 20000
40#define ID_MENU_MOVE_UP 20001
41#define ID_MENU_MOVE_DOWN 20002
42#define ID_MENU_MOVE_BOTTOM 20003
68 void CreateColumns(wxArrayString* pColsName, wxArrayInt* pColsSize =
nullptr);
71 virtual void OnDoubleClickItem(wxListEvent& event);
73 virtual void OnPressBackSpace(wxListEvent& event);
75 virtual void OnContextMenu(wxListEvent& event);
77 void OnMoveItemInList(wxCommandEvent& event);
85 void SortListItem(
int x_col,
int low,
int high,
int typecol,
bool bAscending = TRUE);
87 void SwapRow(
int x_row1,
int x_row2);
89 virtual int Compare(
int iColumnCompareType,
const wxString& x_strValue1,
const wxString& x_strValue2,
105 ListGenReport(wxWindow* parent, wxWindowID
id, wxSize size = wxDefaultSize);
129 ListGenReport(wxWindow* parent, wxWindowID
id, wxArrayString* pColsName, wxArrayInt* pColsSize =
nullptr,
130 wxSize size = wxDefaultSize,
long style = wxLC_REPORT);
140 static const int ID_LIST;
182 bool SetItemText(
int iItem,
int iCol, wxString text);
193 void SetSelectedItem(
long index);
217 void MoveItem(
int iItem,
int iNewPos = 0);
285 virtual bool EditDataToList(
const wxArrayString& myValue,
int index = -1);
316 DECLARE_EVENT_TABLE();
325 virtual void BeforeAdding() {
329 virtual void BeforeDeleting() {
333 virtual void AfterAdding(
bool bRealyAddItem) {
337 virtual void BeforeEditing() {
341 virtual void AfterEditing(
bool bRealyEdited) {
345 virtual void AddingValueToArray(wxArrayString& myImportedValues) {
349 virtual void OnDoubleClickItem(wxListEvent& event);
351 virtual void OnPressBackSpace(wxListEvent& event);
356 ListGenReportWithDialog(wxWindow* parent, wxWindowID
id, wxArrayString* pColsName, wxArrayInt* pColsSize =
nullptr,
357 wxSize size = wxDefaultSize,
long style = wxLC_REPORT);
363 void SetDialog(wxDialog* pDialog) {
367 virtual void AddItem();
369 virtual void DeleteItem();
376 MENU_DISABLE_TOP = 1,
377 MENU_DISABLE_BOTTOM = 2
395 virtual wxMenu* CreateContextMenu();
397 wxMenu* m_ContextMenu;
402 ListGenMenu(
const wxString& title,
long style = 0);
405 delete m_ContextMenu;
409 void DisableMenuMove(
int flags);
411 wxMenu* GetTheMenu() {
412 return m_ContextMenu;
435 virtual void GetDlgData(wxArrayString& myStringArray) = 0;
437 virtual void SetDlgData(wxArrayString& myStringArray) = 0;
Definition listgenreport.h:416
Definition listgenreport.h:319
virtual int ImportParsedFileToListCtrl(const wxString &filename, const int &FilterIndex)
Import file data to list.
Definition listgenreport.cpp:841
Manage a report list.
Definition listgenreport.h:63
bool SetItemText(int iItem, int iCol, wxString text)
Set the text of a specified column for a specified item.
Definition listgenreport.cpp:324
~ListGenReport()
Desctructor.
Definition listgenreport.cpp:177
int GetAllSelectedItem(wxArrayLong &results)
Get all selected item.
Definition listgenreport.cpp:308
void SwapRow(int x_row1, int x_row2)
Swap two items value.
Definition listgenreport.cpp:613
bool DataToList(ListGenDialog *pdialog, wxArrayString &myValues)
Change list values using a ListGenDialog.
Definition listgenreport.cpp:372
virtual int Compare(int iColumnCompareType, const wxString &x_strValue1, const wxString &x_strValue2, bool bAscending)
Compare two values for sorting data.
Definition listgenreport.cpp:684
bool ItemExist(long index)
Check for an item existence.
Definition listgenreport.cpp:429
void MoveItem(int iItem, int iNewPos=0)
Move item in the list.
Definition listgenreport.cpp:343
bool DeleteSelectedItem()
Delete the selected item.
Definition listgenreport.cpp:394
long GetSelectedItem()
Get the first item selected.
Definition listgenreport.cpp:292
void SortListItem(int x_col, int low, int high, int typecol, bool bAscending=TRUE)
Sort columns.
Definition listgenreport.cpp:559
virtual bool EditDataToList(const wxArrayString &myValue, int index=-1)
Fill list using a string array.
Definition listgenreport.cpp:45
virtual int ImportParsedFileToListCtrl(const wxString &filename, const int &FilterIndex)
Import and parse file to a list.
Definition listgenreport.cpp:72
virtual void OnSortColumns(wxListEvent &event)
Called when user click on the column header.
Definition listgenreport.cpp:278
int GetColumnClicked(wxWindow *parent, int iIndex, int iBorderMargin)
Get the column in wich user has clicked.
Definition listgenreport.cpp:449
wxString GetItemColText(int iItem, int iCol)
Get the text of a specified column for a specified item.
Definition listgenreport.cpp:282
virtual int GetAllDataAsStringArray(wxArrayString &myStringArray, long index)
Get all data from a row into an array of string.
Definition listgenreport.cpp:409
void AddItemToList(wxString myValue, int iPosition=-1)
Add an item to the list.
Definition listgenreport.cpp:181
int ExportListParsedToFile(const wxString &filename, const int &FilterIndex)
Export values of a list to a parsed file.
Definition listgenreport.cpp:115
Super-class for parsing different file.
Definition textparser.h:64