Code::Blocks  SVN r11506
buildtargetpanel.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  *
5  * $Revision: 10270 $
6  * $Id: buildtargetpanel.cpp 10270 2015-05-15 10:57:08Z jenslody $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/scriptedwizard/buildtargetpanel.cpp $
8  */
9 
10 #include <sdk.h>
11 #ifndef CB_PRECOMP
12  //(*InternalHeadersPCH(BuildTargetPanel)
13  #include <wx/string.h>
14  #include <wx/intl.h>
15  //*)
16 #endif // CB_PRECOMP
17 
18 #include "buildtargetpanel.h"
19 
20 
21 //(*IdInit(BuildTargetPanel)
32 //*)
33 
34 BEGIN_EVENT_TABLE(BuildTargetPanel,wxPanel)
35  //(*EventTable(BuildTargetPanel)
36  //*)
37 END_EVENT_TABLE()
38 
40 {
41  //(*Initialize(BuildTargetPanel)
42  wxFlexGridSizer* FlexGridSizer1;
43  wxStaticText* StaticText1;
44  wxStaticText* StaticText4;
45  wxStaticText* StaticText5;
46  wxStaticBoxSizer* StaticBoxSizer1;
47 
48  Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id"));
49  BoxSizer1 = new wxBoxSizer(wxVERTICAL);
50  StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Please setup the options for the new build target."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
51  BoxSizer1->Add(StaticText1, 0, wxALL|wxALIGN_LEFT, 8);
52  StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Build target name:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
53  BoxSizer1->Add(StaticText3, 0, wxTOP|wxLEFT|wxRIGHT|wxALIGN_LEFT, 8);
54  txtName = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
55  BoxSizer1->Add(txtName, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 8);
56  lblCompiler = new wxStaticText(this, ID_STATICTEXT2, _("Compiler:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
57  BoxSizer1->Add(lblCompiler, 0, wxTOP|wxLEFT|wxRIGHT|wxALIGN_LEFT, 8);
58  cmbCompiler = new wxComboBox(this, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_SIMPLE|wxCB_READONLY, wxDefaultValidator, _T("ID_COMBOBOX1"));
59  BoxSizer1->Add(cmbCompiler, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 8);
60  StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, this, _("Options"));
61  FlexGridSizer1 = new wxFlexGridSizer(0, 2, 5, 5);
62  FlexGridSizer1->AddGrowableCol(1);
63  StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("Output dir.:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
64  FlexGridSizer1->Add(StaticText4, 0, wxEXPAND, 5);
65  txtOut = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
66  FlexGridSizer1->Add(txtOut, 0, wxEXPAND, 5);
67  StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("Objects output dir.:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5"));
68  FlexGridSizer1->Add(StaticText5, 0, wxEXPAND, 5);
69  txtObjOut = new wxTextCtrl(this, ID_TEXTCTRL3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
70  FlexGridSizer1->Add(txtObjOut, 0, wxEXPAND, 5);
71  StaticBoxSizer1->Add(FlexGridSizer1, 1, wxALL|wxEXPAND, 8);
72  chkEnableDebug = new wxCheckBox(this, ID_CHECKBOX1, _("Enable debugging symbols for this target"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
73  chkEnableDebug->SetValue(false);
74  StaticBoxSizer1->Add(chkEnableDebug, 0, wxALL|wxALIGN_LEFT, 8);
75  BoxSizer1->Add(StaticBoxSizer1, 0, wxALL|wxEXPAND, 8);
76  SetSizer(BoxSizer1);
77  BoxSizer1->Fit(this);
78  BoxSizer1->SetSizeHints(this);
79 
80  Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&BuildTargetPanel::OntxtNameText);
81  //*)
82 }
83 
85 {
86 }
87 
88 
90 {
91  // update output dirs based on target name
92  txtOut->SetValue(_T("bin") + wxString(wxFILE_SEP_PATH) + txtName->GetValue());
93  txtObjOut->SetValue(_T("obj") + wxString(wxFILE_SEP_PATH) + txtName->GetValue());
94 }
int wxNewId()
static const long ID_STATICTEXT1
const wxValidator wxDefaultValidator
static const long ID_STATICTEXT3
static const long ID_STATICTEXT4
#define _T(string)
static const long ID_STATICTEXT2
#define wxCB_SIMPLE
void AddGrowableCol(size_t idx, int proportion=0)
static const long ID_COMBOBOX1
wxTextCtrl * txtOut
const long ID_TEXTCTRL1
wxTextCtrl * txtObjOut
static const long ID_STATICTEXT5
static const long ID_CHECKBOX1
#define wxTAB_TRAVERSAL
wxSizerItem * Add(wxWindow *window, const wxSizerFlags &flags)
const wxSize wxDefaultSize
const wxPoint wxDefaultPosition
static const long ID_TEXTCTRL1
wxString wxEmptyString
static const long ID_TEXTCTRL3
#define wxCB_READONLY
const wxString & _(const wxString &string)
static const long ID_TEXTCTRL2
virtual ~BuildTargetPanel()
void OntxtNameText(wxCommandEvent &event)
wxTextCtrl * txtName
int wxWindowID