]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCreaDevManagerDescriptionPanel.cpp
5711faf62221a76a6180a60d183589029024d274
[crea.git] / lib / creaDevManagerLib / wxCreaDevManagerDescriptionPanel.cpp
1 /*
2  * wxCreaDevManagerDescriptionFrame.cpp
3  *
4  *  Created on: 23/10/2012
5  *      Author: daniel
6  */
7
8 #include "wxCreaDevManagerDescriptionPanel.h"
9
10 #include "images/Cicon64.xpm"
11
12 #include "creaDevManagerIds.h"
13
14 #include <wx/statbox.h>
15
16 #include <iostream>
17
18 BEGIN_EVENT_TABLE(wxCreaDevManagerDescriptionPanel, wxPanel)
19   EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCreaDevManagerDescriptionPanel::OnBtnNewProject)
20   EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCreaDevManagerDescriptionPanel::OnBtnOpenProject)
21 END_EVENT_TABLE()
22
23 wxCreaDevManagerDescriptionPanel::wxCreaDevManagerDescriptionPanel(
24     wxWindow* parent,
25     wxWindowID id,
26     const wxString& caption,
27     const wxPoint& pos,
28     const wxSize& size,
29     long style
30 )
31 {
32   wxCreaDevManagerDescriptionPanel::Create(parent, id, caption, pos, size, style);
33 }
34
35 wxCreaDevManagerDescriptionPanel::~wxCreaDevManagerDescriptionPanel()
36 {
37 }
38
39 bool wxCreaDevManagerDescriptionPanel::Create(
40     wxWindow* parent,
41     wxWindowID id,
42     const wxString& caption,
43     const wxPoint& pos,
44     const wxSize& size,
45     long style
46 )
47 {
48   wxPanel::Create(parent, id, pos, size, style);
49
50   CreateView();
51
52   return TRUE;
53 }
54
55 void wxCreaDevManagerDescriptionPanel::CreateView(wxString title, wxString imagePath, wxString type, std::vector< std::pair< std::string, std::string > > properties)
56 {
57   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
58
59   //Title
60   sizer->Add(new wxStaticText(this, -1, _("Welcome")),0, wxALIGN_CENTER, 0);
61   //Image
62   sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(Cicon)),0, wxALIGN_CENTER, 0);
63   //Name
64   sizer->Add(new wxStaticText(this, -1, _("Crea Development Manager")),0, wxALIGN_CENTER, 0);
65
66   //Properties Box
67   /*
68   wxStaticBox* propsBox = new wxStaticBox(this, -1, _T("&Properties"));
69
70   wxStaticBoxSizer* propsBoxInnerSizer = new wxStaticBoxSizer(propsBox, wxVERTICAL);
71   sizer -> Add(propsBoxInnerSizer, 1, wxCENTER | wxEXPAND | wxALL, 5);
72
73   wxString propsText = wxString(_T("Property 1: value 1\nProperty 2: long valuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuue 2"));
74   wxStaticText* props = new wxStaticText(this, -1, propsText, wxDefaultPosition, wxSize(140,10));
75   propsBoxInnerSizer->Add(props, 1, wxEXPAND | wxALL, 5);
76   */
77   //Actions Box
78   wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
79
80   wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
81   sizer -> Add(actionsBoxInnerSizer, 2, wxCENTER | wxEXPAND | wxALL, 10);
82
83   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_NEWPROJECT, _T("New Project")), 0, wxRIGHT | wxLEFT, 20);
84   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_OPENPROJECT, _T("Open Project")), 0, wxRIGHT | wxLEFT, 20);
85
86
87
88   sizer->SetSizeHints(this);
89
90
91   SetSizer(sizer);
92 }
93
94 void wxCreaDevManagerDescriptionPanel::OnBtnNewProject(wxCommandEvent& event)
95 {
96   event.ResumePropagation(1);
97   event.Skip();
98 }
99
100 void wxCreaDevManagerDescriptionPanel::OnBtnOpenProject(wxCommandEvent& event)
101 {
102   event.ResumePropagation(1);
103   event.Skip();
104 }