]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCreaDevManagerDescriptionPanel.cpp
Feature #1711
[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/folder64.xpm"
11
12 #include <wx/statbox.h>
13
14 wxCreaDevManagerDescriptionPanel::wxCreaDevManagerDescriptionPanel(
15     wxWindow* parent,
16     wxWindowID id,
17     const wxString& caption,
18     const wxPoint& pos,
19     const wxSize& size,
20     long style
21 )
22 {
23   wxCreaDevManagerDescriptionPanel::Create(parent, id, caption, pos, size, style);
24 }
25
26 wxCreaDevManagerDescriptionPanel::~wxCreaDevManagerDescriptionPanel()
27 {
28 }
29
30 bool wxCreaDevManagerDescriptionPanel::Create(
31     wxWindow* parent,
32     wxWindowID id,
33     const wxString& caption,
34     const wxPoint& pos,
35     const wxSize& size,
36     long style
37 )
38 {
39   wxPanel::Create(parent, id, pos, size, style);
40
41   CreateView();
42
43   return TRUE;
44 }
45
46 void wxCreaDevManagerDescriptionPanel::CreateView(wxString title, wxString imagePath, wxString type, std::vector< std::pair< std::string, std::string > > properties)
47 {
48   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
49
50   //Title
51   sizer->Add(new wxStaticText(this, -1, _("Package")),0, wxALIGN_CENTER, 0);
52   //Image
53   sizer->Add(new wxStaticBitmap(this,-1, wxBitmap(folder64)),0, wxALIGN_CENTER, 0);
54   //Name
55   sizer->Add(new wxStaticText(this, -1, _("MyPackage")),0, wxALIGN_CENTER, 0);
56
57   //Properties Box
58   wxStaticBox* propsBox = new wxStaticBox(this, -1, _T("&Properties"));
59
60   wxStaticBoxSizer* propsBoxInnerSizer = new wxStaticBoxSizer(propsBox, wxVERTICAL);
61   sizer -> Add(propsBoxInnerSizer, 1, wxCENTER | wxEXPAND | wxALL, 5);
62
63   wxString propsText = wxString(_T("Property 1: value 1\nProperty 2: long valuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuue 2"));
64   wxStaticText* props = new wxStaticText(this, -1, propsText, wxDefaultPosition, wxSize(140,10));
65   propsBoxInnerSizer->Add(props, 1, wxEXPAND | wxALL, 5);
66
67   //Actions Box
68   wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
69
70   wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
71   sizer -> Add(actionsBoxInnerSizer, 2, wxCENTER | wxEXPAND | wxALL, 10);
72
73   actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 1")), 0, wxEXPAND, 0);
74   actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 2")), 0, wxEXPAND, 0);
75   actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 3")), 0, wxEXPAND, 0);
76   actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 4")), 0, wxEXPAND, 0);
77   actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 5")), 0, wxEXPAND, 0);
78   actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 6")), 0, wxEXPAND, 0);
79
80
81
82   sizer->SetSizeHints(this);
83
84
85   SetSizer(sizer);
86 }
87