12BITMAP2CMP_PANEL_BASE::BITMAP2CMP_PANEL_BASE( wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString&
name ) : wxPanel( parent, id, pos, size, style,
name )
14 wxBoxSizer* bMainSizer;
15 bMainSizer =
new wxBoxSizer( wxHORIZONTAL );
17 m_Notebook =
new wxNotebook(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
30 bMainSizer->Add(
m_Notebook, 1, wxEXPAND|wxBOTTOM|wxLEFT, 10 );
32 wxBoxSizer* brightSizer;
33 brightSizer =
new wxBoxSizer( wxVERTICAL );
35 wxStaticBoxSizer* sbSizerInfo;
36 sbSizerInfo =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Image Information") ), wxVERTICAL );
38 wxFlexGridSizer* fgSizerInfo;
39 fgSizerInfo =
new wxFlexGridSizer( 0, 4, 0, 0 );
40 fgSizerInfo->AddGrowableCol( 1 );
41 fgSizerInfo->AddGrowableCol( 2 );
42 fgSizerInfo->SetFlexibleDirection( wxBOTH );
43 fgSizerInfo->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
45 m_staticTextISize =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"Image size:"), wxDefaultPosition, wxDefaultSize, 0 );
49 m_SizeXValue =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"0000"), wxDefaultPosition, wxDefaultSize, 0 );
51 fgSizerInfo->Add(
m_SizeXValue, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
53 m_SizeYValue =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"0000"), wxDefaultPosition, wxDefaultSize, 0 );
55 fgSizerInfo->Add(
m_SizeYValue, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
57 m_SizePixUnits =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"pixels"), wxDefaultPosition, wxDefaultSize, 0 );
59 fgSizerInfo->Add(
m_SizePixUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
61 m_staticTextDPI =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"Image PPI:"), wxDefaultPosition, wxDefaultSize, 0 );
65 m_InputXValueDPI =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"0000"), wxDefaultPosition, wxDefaultSize, 0 );
67 fgSizerInfo->Add(
m_InputXValueDPI, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
69 m_InputYValueDPI =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"0000"), wxDefaultPosition, wxDefaultSize, 0 );
71 fgSizerInfo->Add(
m_InputYValueDPI, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
73 m_DPIUnit =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"PPI"), wxDefaultPosition, wxDefaultSize, 0 );
75 fgSizerInfo->Add(
m_DPIUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
77 m_staticTextBPP =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"BPP:"), wxDefaultPosition, wxDefaultSize, 0 );
81 m_BPPValue =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"0000"), wxDefaultPosition, wxDefaultSize, 0 );
83 fgSizerInfo->Add(
m_BPPValue, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
85 m_BPPunits =
new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY,
_(
"bits"), wxDefaultPosition, wxDefaultSize, 0 );
87 fgSizerInfo->Add(
m_BPPunits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
90 fgSizerInfo->Add( 0, 0, 0, 0, 5 );
93 sbSizerInfo->Add( fgSizerInfo, 0, wxEXPAND, 5 );
96 brightSizer->Add( sbSizerInfo, 0, wxEXPAND|wxALL, 5 );
98 m_buttonLoad =
new wxButton(
this, wxID_ANY,
_(
"Load Source Image"), wxDefaultPosition, wxDefaultSize, 0 );
102 brightSizer->Add( 0, 0, 1, wxEXPAND, 5 );
104 wxStaticBoxSizer* sbSizerImgPrms;
105 sbSizerImgPrms =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Output Size") ), wxVERTICAL );
107 wxBoxSizer* bSizerRes;
108 bSizerRes =
new wxBoxSizer( wxHORIZONTAL );
110 m_sizeLabel =
new wxStaticText( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"Size:"), wxDefaultPosition, wxDefaultSize, 0 );
112 bSizerRes->Add(
m_sizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
114 m_UnitSizeX =
new wxTextCtrl( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"300"), wxDefaultPosition, wxDefaultSize, 0 );
117 bSizerRes->Add(
m_UnitSizeX, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
119 m_UnitSizeY =
new wxTextCtrl( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"300"), wxDefaultPosition, wxDefaultSize, 0 );
122 bSizerRes->Add(
m_UnitSizeY, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
124 wxArrayString m_PixelUnitChoices;
125 m_PixelUnit =
new wxChoice( sbSizerImgPrms->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PixelUnitChoices, 0 );
129 bSizerRes->Add(
m_PixelUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
132 sbSizerImgPrms->Add( bSizerRes, 0, wxEXPAND|wxBOTTOM, 5 );
134 m_aspectRatioCheckbox =
new wxCheckBox( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"Lock height / width ratio"), wxDefaultPosition, wxDefaultSize, 0 );
138 brightSizer->Add( sbSizerImgPrms, 0, wxALL|wxEXPAND, 5 );
140 wxStaticBoxSizer* sbSizer2;
141 sbSizer2 =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Options") ), wxVERTICAL );
143 m_ThresholdText =
new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY,
_(
"Black / white threshold:"), wxDefaultPosition, wxDefaultSize, 0 );
147 m_sliderThreshold =
new wxSlider( sbSizer2->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
148 m_sliderThreshold->SetToolTip(
_(
"Adjust the level to convert the greyscale picture to a black and white picture.") );
152 m_checkNegative =
new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY,
_(
"Negative"), wxDefaultPosition, wxDefaultSize, 0 );
156 brightSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
158 wxStaticBoxSizer* sbOutputFormat;
159 sbOutputFormat =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Output Format") ), wxVERTICAL );
161 wxFlexGridSizer* fgSizer2;
162 fgSizer2 =
new wxFlexGridSizer( 5, 1, 2, 0 );
163 fgSizer2->SetFlexibleDirection( wxBOTH );
164 fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
166 m_rbSymbol =
new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY,
_(
"Symbol (.kicad_sym file)"), wxDefaultPosition, wxDefaultSize, 0 );
167 fgSizer2->Add(
m_rbSymbol, 0, wxBOTTOM|wxRIGHT, 5 );
169 m_rbFootprint =
new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY,
_(
"Footprint (.kicad_mod file)"), wxDefaultPosition, wxDefaultSize, 0 );
173 bSizer4 =
new wxBoxSizer( wxHORIZONTAL );
175 m_layerLabel =
new wxStaticText( sbOutputFormat->GetStaticBox(), wxID_ANY,
_(
"Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
177 bSizer4->Add(
m_layerLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 28 );
179 wxString m_layerCtrlChoices[] = {
_(
"F.Cu"),
_(
"F.Silkscreen"),
_(
"F.Mask"),
_(
"User.Drawings"),
_(
"User.Comments"),
_(
"User.Eco1"),
_(
"User.Eco2"),
_(
"F.Fab") };
180 int m_layerCtrlNChoices =
sizeof( m_layerCtrlChoices ) /
sizeof( wxString );
181 m_layerCtrl =
new wxChoice( sbOutputFormat->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCtrlNChoices, m_layerCtrlChoices, 0 );
183 bSizer4->Add(
m_layerCtrl, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
186 fgSizer2->Add( bSizer4, 1, wxEXPAND, 5 );
188 m_rbPostscript =
new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY,
_(
"Postscript (.ps file)"), wxDefaultPosition, wxDefaultSize, 0 );
191 m_rbWorksheet =
new wxRadioButton( sbOutputFormat->GetStaticBox(), wxID_ANY,
_(
"Drawing Sheet (.kicad_wks file)"), wxDefaultPosition, wxDefaultSize, 0 );
195 sbOutputFormat->Add( fgSizer2, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
198 brightSizer->Add( sbOutputFormat, 1, wxEXPAND|wxALL, 5 );
200 m_buttonExportFile =
new wxButton(
this, wxID_ANY,
_(
"Export to File..."), wxDefaultPosition, wxDefaultSize, 0 );
203 m_buttonExportClipboard =
new wxButton(
this, wxID_ANY,
_(
"Export to Clipboard"), wxDefaultPosition, wxDefaultSize, 0 );
207 bMainSizer->Add( brightSizer, 0, wxEXPAND|wxALL, 5 );
210 this->SetSizer( bMainSizer );
212 bMainSizer->Fit(
this );
wxStaticText * m_BPPValue
wxScrolledWindow * m_GreyscalePicturePanel
virtual void OnThresholdChange(wxScrollEvent &event)
wxButton * m_buttonExportFile
wxScrolledWindow * m_BNPicturePanel
wxButton * m_buttonExportClipboard
wxStaticText * m_staticTextBPP
virtual void OnExportToFile(wxCommandEvent &event)
wxStaticText * m_ThresholdText
wxStaticText * m_BPPunits
wxSlider * m_sliderThreshold
wxStaticText * m_SizePixUnits
wxStaticText * m_staticTextDPI
wxCheckBox * m_aspectRatioCheckbox
virtual void OnFormatChange(wxCommandEvent &event)
virtual void OnPaintBW(wxPaintEvent &event)
wxRadioButton * m_rbPostscript
wxCheckBox * m_checkNegative
wxStaticText * m_staticTextISize
wxRadioButton * m_rbFootprint
virtual void OnNegativeClicked(wxCommandEvent &event)
virtual void OnPaintGreyscale(wxPaintEvent &event)
virtual void ToggleAspectRatioLock(wxCommandEvent &event)
wxRadioButton * m_rbWorksheet
virtual void OnExportToClipboard(wxCommandEvent &event)
wxStaticText * m_SizeXValue
wxRadioButton * m_rbSymbol
virtual void OnLoadFile(wxCommandEvent &event)
wxStaticText * m_layerLabel
wxStaticText * m_SizeYValue
virtual void OnSizeUnitChange(wxCommandEvent &event)
virtual void OnSizeChangeX(wxCommandEvent &event)
virtual void OnSizeChangeY(wxCommandEvent &event)
wxStaticText * m_sizeLabel
virtual void OnPaintInit(wxPaintEvent &event)
wxStaticText * m_InputYValueDPI
BITMAP2CMP_PANEL_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxStaticText * m_InputXValueDPI
wxScrolledWindow * m_InitialPicturePanel