-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectMain.h
71 lines (57 loc) · 1.81 KB
/
ProjectMain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//#include <wx/wxprec.h>
#include <wx/frame.h>
#include <wx/menu.h>
#include <wx/button.h>
//#include <wx/vscroll.h>
//#include <wx/dataview.h>
//#include <wx/event.h>
#include <MongoDatabase.h>
//#include <bsoncxx/builder/basic/kvp.hpp>
#include <ToDoDataModel.h>
#include <IDs.h>
#include <MultiLineCustomRenderer.h>
#pragma once
class ProjectItems : public wxPanel
{
public:
ProjectItems(wxWindow* parent, mongocxx::collection collection);
~ProjectItems();
// Creates and start editing the item
ToDoModelNode* CreateItem(const wxDataViewItem& parent, const wxString& task, const bool& status);
private:
mongocxx::collection currentCollection;
ToDoTreeModel* treeData;
wxBoxSizer* treeSizer;
wxDataViewCtrl* tree;
wxMenu* contextMenu;
void OnBeginDrag(wxDataViewEvent& e);
void OnDropPossible (wxDataViewEvent& e);
void OnDrop(wxDataViewEvent& e);
void OnItemContextMenu(wxDataViewEvent& e);
void OnCreateItemContextMenu(wxCommandEvent& e);
void OnDeleteItemContextMenu(wxCommandEvent& e);
void OnItemExpanded(wxDataViewEvent& e);
void OnItemCollapsing(wxDataViewEvent& e);
void DeleteItem(const wxDataViewItem& item);
void ItemValueChanged(wxDataViewEvent& e);
//void ItemValueChanged(wxDataViewEvent& e);
void SaveItemValue(const wxDataViewItem& item);
// Check if item created with empty task
void ItemCreationCheck(wxDataViewEvent& e);
void OnSizeChanged(wxSizeEvent& e);
};
class ProjectMain : public wxFrame
{
public:
ProjectMain(wxWindow* parent, mongocxx::collection selectedCollection, wxString projectN, const wxPoint& position, const wxSize& size);
wxString OpenedProject();
private:
ProjectItems* items;
wxString m_projectName;
void OnCreateItemMenu(wxCommandEvent& e);
};
class TestDataItemView : public wxDataViewItem, public wxPanel
{
public:
TestDataItemView(wxWindow* parent, void* pItem);
};