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, 5 );
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 );
99 brightSizer->Add(
m_buttonLoad, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
102 brightSizer->Add( 0, 0, 1, wxEXPAND, 5 );
104 wxStaticBoxSizer* sbSizerImgPrms;
105 sbSizerImgPrms =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Output Size") ), wxVERTICAL );
107 m_aspectRatioCheckbox =
new wxCheckBox( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"Lock height / width ratio"), wxDefaultPosition, wxDefaultSize, 0 );
110 wxBoxSizer* bSizerRes;
111 bSizerRes =
new wxBoxSizer( wxHORIZONTAL );
113 m_staticTextOSize =
new wxStaticText( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"Size:"), wxDefaultPosition, wxDefaultSize, 0 );
115 bSizerRes->Add(
m_staticTextOSize, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
117 m_UnitSizeX =
new wxTextCtrl( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"300"), wxDefaultPosition, wxDefaultSize, 0 );
120 bSizerRes->Add(
m_UnitSizeX, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
122 m_UnitSizeY =
new wxTextCtrl( sbSizerImgPrms->GetStaticBox(), wxID_ANY,
_(
"300"), wxDefaultPosition, wxDefaultSize, 0 );
125 bSizerRes->Add(
m_UnitSizeY, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
127 wxArrayString m_PixelUnitChoices;
128 m_PixelUnit =
new wxChoice( sbSizerImgPrms->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PixelUnitChoices, 0 );
132 bSizerRes->Add(
m_PixelUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
135 sbSizerImgPrms->Add( bSizerRes, 0, wxEXPAND, 5 );
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 m_sizerPcbLayer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Pcb Layer for Graphics") ), wxVERTICAL );
160 wxString m_chPCBLayerChoices[] = {
_(
"Front silk screen"),
_(
"Front solder mask"),
_(
"Front Fab layer"),
_(
"User layer drawings"),
_(
"User layer comments"),
_(
"User layer Eco1"),
_(
"User layer Eco2") };
161 int m_chPCBLayerNChoices =
sizeof( m_chPCBLayerChoices ) /
sizeof( wxString );
162 m_chPCBLayer =
new wxChoice(
m_sizerPcbLayer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_chPCBLayerNChoices, m_chPCBLayerChoices, 0 );
169 wxString m_rbOutputFormatChoices[] = {
_(
"Symbol (.kicad_sym file)"),
_(
"Footprint (.kicad_mod file)"),
_(
"Postscript (.ps file)"),
_(
"Drawing Sheet (.kicad_wks file)") };
170 int m_rbOutputFormatNChoices =
sizeof( m_rbOutputFormatChoices ) /
sizeof( wxString );
171 m_rbOutputFormat =
new wxRadioBox(
this, wxID_ANY,
_(
"Output Format"), wxDefaultPosition, wxDefaultSize, m_rbOutputFormatNChoices, m_rbOutputFormatChoices, 1, wxRA_SPECIFY_COLS );
175 m_buttonExportFile =
new wxButton(
this, wxID_ANY,
_(
"Export to File"), wxDefaultPosition, wxDefaultSize, 0 );
178 m_buttonExportClipboard =
new wxButton(
this, wxID_ANY,
_(
"Export to Clipboard"), wxDefaultPosition, wxDefaultSize, 0 );
182 bMainSizer->Add( brightSizer, 0, wxEXPAND|wxALL, 5 );
185 this->SetSizer( bMainSizer );
187 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)
wxRadioBox * m_rbOutputFormat
virtual void OnPaintBW(wxPaintEvent &event)
wxCheckBox * m_checkNegative
wxStaticText * m_staticTextISize
virtual void OnNegativeClicked(wxCommandEvent &event)
virtual void OnPaintGreyscale(wxPaintEvent &event)
virtual void ToggleAspectRatioLock(wxCommandEvent &event)
wxStaticText * m_staticTextOSize
wxStaticBoxSizer * m_sizerPcbLayer
virtual void OnExportToClipboard(wxCommandEvent &event)
wxStaticText * m_SizeXValue
virtual void OnLoadFile(wxCommandEvent &event)
wxStaticText * m_SizeYValue
virtual void OnSizeUnitChange(wxCommandEvent &event)
virtual void OnSizeChangeX(wxCommandEvent &event)
virtual void OnSizeChangeY(wxCommandEvent &event)
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