]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMCMakeListsDescriptionPanel.cpp
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 #                        pour la Sant�)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 #
10 #  This software is governed by the CeCILL-B license under French law and
11 #  abiding by the rules of distribution of free software. You can  use,
12 #  modify and/ or redistribute the software under the terms of the CeCILL-B
13 #  license as circulated by CEA, CNRS and INRIA at the following URL
14 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 #  or in the file LICENSE.txt.
16 #
17 #  As a counterpart to the access to the source code and  rights to copy,
18 #  modify and redistribute granted by the license, users are provided only
19 #  with a limited warranty  and the software's author,  the holder of the
20 #  economic rights,  and the successive licensors  have only  limited
21 #  liability.
22 #
23 #  The fact that you are presently reading this means that you have had
24 #  knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
26  */
27
28 /*
29  * wxCDMCMakeListsDescriptionPanel.cpp
30  *
31  *  Created on: Nov 27, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #include "wxCDMCMakeListsDescriptionPanel.h"
36
37 #include "creaDevManagerIds.h"
38 #include "images/CMIcon64.xpm"
39
40 BEGIN_EVENT_TABLE(wxCDMCMakeListsDescriptionPanel, wxPanel)
41 EVT_MENU(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMCMakeListsDescriptionPanel::OnBtnOpenInEditor)
42 END_EVENT_TABLE()
43
44 wxCDMCMakeListsDescriptionPanel::wxCDMCMakeListsDescriptionPanel(
45     wxWindow* parent,
46     modelCDMCMakeListsFile* makefile,
47     wxWindowID id,
48     const wxString& caption,
49     const wxPoint& pos,
50     const wxSize& size,
51     long style
52 )
53 {
54   wxCDMCMakeListsDescriptionPanel::Create(parent, makefile, id, caption, pos, size, style);
55 }
56
57 wxCDMCMakeListsDescriptionPanel::~wxCDMCMakeListsDescriptionPanel()
58 {
59 }
60
61 bool wxCDMCMakeListsDescriptionPanel::Create(
62     wxWindow* parent,
63     modelCDMCMakeListsFile* makefile,
64     wxWindowID id,
65     const wxString& caption,
66     const wxPoint& pos,
67     const wxSize& size,
68     long style
69 )
70 {
71   wxPanel::Create(parent, id, pos, size, style);
72   this->cMakeLists = makefile;
73   CreateControls();
74   return TRUE;
75 }
76
77 void wxCDMCMakeListsDescriptionPanel::CreateControls()
78 {
79   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
80
81   //Welcome
82   sizer->Add(new wxStaticText(this, -1, _("File")),0, wxALIGN_CENTER, 0);
83
84   //Image
85   sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(CMIcon64)),0, wxALIGN_CENTER, 0);
86
87   //File Name
88   sizer->Add(new wxStaticText(this, -1, crea::std2wx("CMake Configuration File (CMakeLists.txt)")), 0, wxALIGN_CENTER, 0);
89
90   //Actions
91   wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
92   wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
93   sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
94
95   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit in file editor")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
96
97   //Assign sizer
98   actionsBoxInnerSizer->SetSizeHints(this);
99
100   SetSizer(sizer);
101   sizer->SetSizeHints(this);
102 }
103
104 void wxCDMCMakeListsDescriptionPanel::OnBtnOpenInEditor(wxCommandEvent& event)
105 {
106   //TODO: implement method
107   std::cerr << "Event OnBtnOpenInEditor not implemented" << std::endl;
108   event.Skip();
109   event.StopPropagation();
110 }
111