From 0e80ac404431ff023a4925c88e3eb0cd12efbd96 Mon Sep 17 00:00:00 2001 From: Polarix Date: Wed, 10 Jan 2018 20:35:55 +0800 Subject: [PATCH] =?UTF-8?q?2018-01-09=EF=BC=9A=E6=94=B9=E8=BF=9B=E6=A8=A1?= =?UTF-8?q?=E6=8B=9F=E5=99=A8=E5=83=8F=E7=B4=A0=E9=9D=A2=E6=9D=BF=E7=9A=84?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E7=BB=93=E6=9E=84=EF=BC=8C=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E6=8B=93=E5=B1=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SimulatorEnv/Frame/inc/MonochromeDotLCD.h | 4 +- SimulatorEnv/Frame/src/MonochromeDotLCD.cpp | 24 +- SimulatorEnv/Project/CodeBlocks/SimpleGUI.cbp | 8 +- .../inc/{wxDotLCD.h => wxPixelatedPanel.h} | 54 ++-- .../{wxDotLCD.cpp => wxPixelatedPanel.cpp} | 257 ++++++++++-------- 5 files changed, 192 insertions(+), 155 deletions(-) rename SimulatorEnv/wxExpand/inc/{wxDotLCD.h => wxPixelatedPanel.h} (53%) rename SimulatorEnv/wxExpand/src/{wxDotLCD.cpp => wxPixelatedPanel.cpp} (69%) diff --git a/SimulatorEnv/Frame/inc/MonochromeDotLCD.h b/SimulatorEnv/Frame/inc/MonochromeDotLCD.h index 8a5e73a..c814be8 100644 --- a/SimulatorEnv/Frame/inc/MonochromeDotLCD.h +++ b/SimulatorEnv/Frame/inc/MonochromeDotLCD.h @@ -3,14 +3,14 @@ //=======================================================================// //= Include files. =// //=======================================================================// -#include "wxDotLCD.h" +#include "wxPixelatedPanel.h" #include "Common.h" #include //=======================================================================// //= Class declare. =// //=======================================================================// -class MonochromeDotLCD : public wxDotLCD +class MonochromeDotLCD : public wxPixelatedPanel { private: uint32_t m_uiPageCount; diff --git a/SimulatorEnv/Frame/src/MonochromeDotLCD.cpp b/SimulatorEnv/Frame/src/MonochromeDotLCD.cpp index dc3dacd..c03997d 100644 --- a/SimulatorEnv/Frame/src/MonochromeDotLCD.cpp +++ b/SimulatorEnv/Frame/src/MonochromeDotLCD.cpp @@ -13,7 +13,7 @@ //=======================================================================// //= Event table. =// //=======================================================================// -BEGIN_EVENT_TABLE(MonochromeDotLCD,wxDotLCD) +BEGIN_EVENT_TABLE(MonochromeDotLCD,wxPixelatedPanel) EVT_SET_FOCUS (MonochromeDotLCD::wxEvent_OnSetFocus) END_EVENT_TABLE() @@ -21,7 +21,7 @@ END_EVENT_TABLE() //= Function define. =// //=======================================================================// MonochromeDotLCD::MonochromeDotLCD(wxWindow *pclsParent, wxWindowID iWinID, const wxPoint& clsPosition): -wxDotLCD(pclsParent, iWinID, clsPosition) +wxPixelatedPanel(pclsParent, iWinID, clsPosition) { m_pclsPanelColor = new wxColor(0x00, 0x00, 0x00, 0x00); m_pclsPixelColor = new wxColor(0x00, 0x00, 0x00, 0x00); @@ -37,16 +37,16 @@ void MonochromeDotLCD::SetParameter(PixelPanelParameter* pstPanelParameter) { if(NULL != pstPanelParameter) { - wxDotLCD::SetEdgeWidth(pstPanelParameter->EdgeWidth); - wxDotLCD::SetPixelSize(pstPanelParameter->PixelSize); - wxDotLCD::SetGridVisibled(pstPanelParameter->EnableGrid); - wxDotLCD::SetDisplaySizes(pstPanelParameter->HorizontalPixelNumber, pstPanelParameter->VerticalPixelNumber); + wxPixelatedPanel::SetEdgeWidth(pstPanelParameter->EdgeWidth); + wxPixelatedPanel::SetPixelSize(pstPanelParameter->PixelSize); + wxPixelatedPanel::SetGridVisibled(pstPanelParameter->EnableGrid); + wxPixelatedPanel::SetPixelNumber(pstPanelParameter->HorizontalPixelNumber, pstPanelParameter->VerticalPixelNumber); m_uiColumnCount = pstPanelParameter->HorizontalPixelNumber; m_uiPageCount = pstPanelParameter->VerticalPixelNumber/8; m_pclsPanelColor->SetRGBA(pstPanelParameter->PanelColor.RGBA); m_pclsPixelColor->SetRGBA(pstPanelParameter->PixelColor.RGBA); - wxDotLCD::SetDisplayColors( wxColor(pstPanelParameter->EdgeColor.RGBA), + wxPixelatedPanel::SetColors( wxColor(pstPanelParameter->EdgeColor.RGBA), wxColor(pstPanelParameter->PanelColor.RGBA), wxColor(pstPanelParameter->GridColor.RGBA)); } @@ -57,11 +57,11 @@ void MonochromeDotLCD::SetPixel(uint32_t uiPosX, uint32_t uiPosY, LCD_PIXEL_COLO { if(LCD_PIXEL_COLOR_L == ePixelValue) { - wxDotLCD::SetPixelUnitColor(uiPosX, uiPosY, *m_pclsPanelColor); + wxPixelatedPanel::SetPixelUnitColor(uiPosX, uiPosY, *m_pclsPanelColor); } else { - wxDotLCD::SetPixelUnitColor(uiPosX, uiPosY, *m_pclsPixelColor); + wxPixelatedPanel::SetPixelUnitColor(uiPosX, uiPosY, *m_pclsPixelColor); } } @@ -97,11 +97,11 @@ void MonochromeDotLCD::DrawPixel(uint32_t uiPosX, uint32_t uiPosY, LCD_PIXEL_COL { if(LCD_PIXEL_COLOR_L == ePixelValue) { - wxDotLCD::DrawPixel(uiPosX, uiPosY, *m_pclsPanelColor); + wxPixelatedPanel::DrawPixel(uiPosX, uiPosY, *m_pclsPanelColor); } else { - wxDotLCD::DrawPixel(uiPosX, uiPosY, *m_pclsPixelColor); + wxPixelatedPanel::DrawPixel(uiPosX, uiPosY, *m_pclsPixelColor); } } @@ -115,7 +115,7 @@ void MonochromeDotLCD::CleanScreen(void) { uint32_t uiHorizontalPixelNumber, uiVerticalPixelNumber; - GetDisplaySize(&uiHorizontalPixelNumber, &uiVerticalPixelNumber); + GetPixelNumber(&uiHorizontalPixelNumber, &uiVerticalPixelNumber); for(uint32_t i_V=0; i_V