mirror of
https://gitee.com/Polarix/simplegui.git
synced 2025-06-17 13:37:52 +00:00
2018-01-07:订正部分注释内容;微调工程目录结构。
This commit is contained in:
parent
3c64019635
commit
aa0b8f7705
@ -30,12 +30,9 @@ class MonochromeDotLCD : public wxDotLCD
|
|||||||
LCD_PIXEL_COLOR_H,
|
LCD_PIXEL_COLOR_H,
|
||||||
}LCD_PIXEL_COLOR_T;
|
}LCD_PIXEL_COLOR_T;
|
||||||
|
|
||||||
MonochromeDotLCD(wxWindow *parent,
|
MonochromeDotLCD(wxWindow *pclsParent,
|
||||||
wxWindowID winid = wxID_ANY,
|
wxWindowID iWinID = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& clsPosition = wxDefaultPosition);
|
||||||
const wxSize& size = wxDefaultSize,
|
|
||||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
|
||||||
const wxString& name = wxPanelNameStr);
|
|
||||||
~MonochromeDotLCD(void);
|
~MonochromeDotLCD(void);
|
||||||
|
|
||||||
void SetParameter(PixelPanelParameter* pstPanelParameter);
|
void SetParameter(PixelPanelParameter* pstPanelParameter);
|
||||||
|
@ -20,8 +20,8 @@ END_EVENT_TABLE()
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Function define. =//
|
//= Function define. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
MonochromeDotLCD::MonochromeDotLCD(wxWindow *parent, wxWindowID winid, const wxPoint& pos, const wxSize& size, long style, const wxString& name):
|
MonochromeDotLCD::MonochromeDotLCD(wxWindow *pclsParent, wxWindowID iWinID, const wxPoint& clsPosition):
|
||||||
wxDotLCD(parent, winid, pos, size, style, name)
|
wxDotLCD(pclsParent, iWinID, clsPosition)
|
||||||
{
|
{
|
||||||
m_pclsPanelColor = new wxColor(0x00, 0x00, 0x00, 0x00);
|
m_pclsPanelColor = new wxColor(0x00, 0x00, 0x00, 0x00);
|
||||||
m_pclsPixelColor = new wxColor(0x00, 0x00, 0x00, 0x00);
|
m_pclsPixelColor = new wxColor(0x00, 0x00, 0x00, 0x00);
|
||||||
@ -37,11 +37,10 @@ void MonochromeDotLCD::SetParameter(PixelPanelParameter* pstPanelParameter)
|
|||||||
{
|
{
|
||||||
if(NULL != pstPanelParameter)
|
if(NULL != pstPanelParameter)
|
||||||
{
|
{
|
||||||
wxDotLCD::SetDisplaySizes( pstPanelParameter->EdgeWidth,
|
wxDotLCD::SetEdgeWidth(pstPanelParameter->EdgeWidth);
|
||||||
pstPanelParameter->HorizontalPixelNumber,
|
wxDotLCD::SetPixelSize(pstPanelParameter->PixelSize);
|
||||||
pstPanelParameter->VerticalPixelNumber,
|
wxDotLCD::SetGridVisibled(pstPanelParameter->EnableGrid);
|
||||||
pstPanelParameter->PixelSize,
|
wxDotLCD::SetDisplaySizes(pstPanelParameter->HorizontalPixelNumber, pstPanelParameter->VerticalPixelNumber);
|
||||||
pstPanelParameter->EnableGrid);
|
|
||||||
m_uiColumnCount = pstPanelParameter->HorizontalPixelNumber;
|
m_uiColumnCount = pstPanelParameter->HorizontalPixelNumber;
|
||||||
m_uiPageCount = pstPanelParameter->VerticalPixelNumber/8;
|
m_uiPageCount = pstPanelParameter->VerticalPixelNumber/8;
|
||||||
|
|
||||||
@ -58,11 +57,11 @@ void MonochromeDotLCD::SetPixel(uint32_t uiPosX, uint32_t uiPosY, LCD_PIXEL_COLO
|
|||||||
{
|
{
|
||||||
if(LCD_PIXEL_COLOR_L == ePixelValue)
|
if(LCD_PIXEL_COLOR_L == ePixelValue)
|
||||||
{
|
{
|
||||||
wxDotLCD::SetPixelColor(uiPosX, uiPosY, *m_pclsPanelColor);
|
wxDotLCD::SetPixelUnitColor(uiPosX, uiPosY, *m_pclsPanelColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxDotLCD::SetPixelColor(uiPosX, uiPosY, *m_pclsPixelColor);
|
wxDotLCD::SetPixelUnitColor(uiPosX, uiPosY, *m_pclsPixelColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ MonochromeDotLCD::LCD_PIXEL_COLOR_T MonochromeDotLCD::GetPixel(uint32_t uiPosX,
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
uiPixelColor = GetPixelColor(uiPosX, uiPosY);
|
uiPixelColor = GetPixelUnitColor(uiPosX, uiPosY);
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
@ -116,12 +115,12 @@ void MonochromeDotLCD::CleanScreen(void)
|
|||||||
{
|
{
|
||||||
uint32_t uiHorizontalPixelNumber, uiVerticalPixelNumber;
|
uint32_t uiHorizontalPixelNumber, uiVerticalPixelNumber;
|
||||||
|
|
||||||
GetDisplaySize(NULL, &uiHorizontalPixelNumber, &uiVerticalPixelNumber, NULL, NULL);
|
GetDisplaySize(&uiHorizontalPixelNumber, &uiVerticalPixelNumber);
|
||||||
for(uint32_t i_V=0; i_V<uiVerticalPixelNumber; i_V++)
|
for(uint32_t i_V=0; i_V<uiVerticalPixelNumber; i_V++)
|
||||||
{
|
{
|
||||||
for(uint32_t i_H=0; i_H<uiHorizontalPixelNumber; i_H++)
|
for(uint32_t i_H=0; i_H<uiHorizontalPixelNumber; i_H++)
|
||||||
{
|
{
|
||||||
SetPixelColor(i_H, i_V, *m_pclsPanelColor);
|
SetPixelUnitColor(i_H, i_V, *m_pclsPanelColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,183 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="SimpleGUI" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Debug">
|
|
||||||
<Option output="../../Build/Debug/bin/SimpleGUI" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="../../Build" />
|
|
||||||
<Option object_output="../../Build/Debug/obj/" />
|
|
||||||
<Option type="0" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option projectLinkerOptionsRelation="2" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
|
||||||
</Compiler>
|
|
||||||
<ResourceCompiler>
|
|
||||||
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
|
||||||
</ResourceCompiler>
|
|
||||||
<Linker>
|
|
||||||
<Add library="libwxmsw31u.a" />
|
|
||||||
<Add directory="$(#wx31)/lib/gcc_dll" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Release">
|
|
||||||
<Option output="../../Build/Release/bin/SimpleGUI" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="../../Build" />
|
|
||||||
<Option object_output="../../Build/Release/obj/" />
|
|
||||||
<Option type="0" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option projectLinkerOptionsRelation="2" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O2" />
|
|
||||||
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
|
||||||
</Compiler>
|
|
||||||
<ResourceCompiler>
|
|
||||||
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
|
||||||
</ResourceCompiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add library="libwxmsw31u.a" />
|
|
||||||
<Add directory="$(#wx31)/lib/gcc_dll" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++11" />
|
|
||||||
<Add option="-pipe" />
|
|
||||||
<Add option="-mthreads" />
|
|
||||||
<Add option="-D__GNUWIN32__" />
|
|
||||||
<Add option="-D__WXMSW__" />
|
|
||||||
<Add option="-DWXUSINGDLL" />
|
|
||||||
<Add option="-DwxUSE_UNICODE" />
|
|
||||||
<Add directory="$(#wx31)/include" />
|
|
||||||
<Add directory="../../Frame/inc" />
|
|
||||||
<Add directory="../../GUI/inc" />
|
|
||||||
<Add directory="../../Library/inc" />
|
|
||||||
<Add directory="../../HMI/inc" />
|
|
||||||
<Add directory="../../Demo/inc" />
|
|
||||||
<Add directory="../../wxExpand/inc" />
|
|
||||||
<Add directory="../../Application/inc" />
|
|
||||||
<Add directory="../../Common/inc" />
|
|
||||||
<Add directory="../../Interface/inc" />
|
|
||||||
</Compiler>
|
|
||||||
<ResourceCompiler>
|
|
||||||
<Add directory="$(#wx31)/include" />
|
|
||||||
</ResourceCompiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-mthreads" />
|
|
||||||
<Add library="iconv" />
|
|
||||||
<Add directory="../../Library/lib" />
|
|
||||||
</Linker>
|
|
||||||
<Unit filename="../../Application/inc/Application.h" />
|
|
||||||
<Unit filename="../../Application/src/Application.cpp" />
|
|
||||||
<Unit filename="../../Common/inc/Common.h" />
|
|
||||||
<Unit filename="../../Common/src/Common.cpp" />
|
|
||||||
<Unit filename="../../Demo/inc/DemoProc.h" />
|
|
||||||
<Unit filename="../../Demo/inc/DemoProcText.h" />
|
|
||||||
<Unit filename="../../Demo/src/DemoProc.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Demo/src/List.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Demo/src/RTCNotice.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Demo/src/RealtimeGraph.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Demo/src/ScrollingText.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Demo/src/TextNotice.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Demo/src/VariableBox.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Frame/inc/LCDFrame.h" />
|
|
||||||
<Unit filename="../../Frame/inc/MonochromeDotLCD.h" />
|
|
||||||
<Unit filename="../../Frame/src/LCDFrame.cpp" />
|
|
||||||
<Unit filename="../../Frame/src/MonochromeDotLCD.cpp" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_Basic.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_Common.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_Config.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_Frame.h">
|
|
||||||
<Option target="<{~None~}>" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_List.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_Notice.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_ProcessBar.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_RealtimeGraph.h">
|
|
||||||
<Option target="<{~None~}>" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_ScrollBar.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_Text.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_Typedef.h" />
|
|
||||||
<Unit filename="../../GUI/inc/SGUI_VariableBox.h" />
|
|
||||||
<Unit filename="../../GUI/src/SGUI_Basic.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_Common.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_FlashData.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_Frame.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_List.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_Notice.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_ProcessBar.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_RealtimeGraph.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_ScrollBar.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_Text.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../GUI/src/SGUI_VariableBox.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../HMI/inc/HMI_Engine.h" />
|
|
||||||
<Unit filename="../../HMI/src/HMI_Engine.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Interface/inc/UserActionInterface.h" />
|
|
||||||
<Unit filename="../../Interface/inc/VirtualDeviceInterface.h">
|
|
||||||
<Option target="<{~None~}>" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Interface/src/UserActionInterface.cpp">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Interface/src/VirtualDeviceInterface.cpp">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../Library/inc/iconv.h" />
|
|
||||||
<Unit filename="../../Resource/Resource.rc">
|
|
||||||
<Option compilerVar="WINDRES" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../../wxExpand/inc/wxDotLCD.h" />
|
|
||||||
<Unit filename="../../wxExpand/src/wxDotLCD.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
File diff suppressed because it is too large
Load Diff
@ -1,120 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_layout_file>
|
|
||||||
<FileVersion major="1" minor="0" />
|
|
||||||
<ActiveTarget name="Debug" />
|
|
||||||
<File name="..\..\Interface\src\UserActionInterface.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="4301" topLine="63" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Common\src\Common.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="368" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Demo\src\RealtimeGraph.c" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="4448" topLine="69" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\HMI\inc\HMI_Engine.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="4459" topLine="102" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Demo\src\ScrollingText.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="8606" topLine="141" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Demo\src\TextNotice.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="0" topLine="48" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Demo\inc\DemoProcText.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="103" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\HMI\src\HMI_Engine.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="12432" topLine="298" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Interface\inc\UserActionInterface.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="767" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Interface\inc\VirtualDeviceInterface.h" open="1" top="1" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="1683" topLine="37" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Frame\src\LCDFrame.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="14704" topLine="304" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\GUI\inc\SGUI_Typedef.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="1027" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\GUI\src\SGUI_Basic.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="21653" topLine="571" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Common\inc\Common.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="895" topLine="12" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Frame\inc\LCDFrame.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="1107" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\GUI\src\SGUI_Frame.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="3931" topLine="56" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\GUI\inc\SGUI_Common.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="449" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Demo\src\DemoProc.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="5669" topLine="120" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\GUI\inc\SGUI_Config.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="508" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Interface\src\VirtualDeviceInterface.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="4114" topLine="66" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\GUI\inc\SGUI_List.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="1137" topLine="27" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\wxExpand\src\wxDotLCD.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="532" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\Demo\inc\DemoProc.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="2069" topLine="32" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
</CodeBlocks_layout_file>
|
|
183
Project/SimulatorEnv/CodeBlocks/SimpleGUI.cbp
Normal file
183
Project/SimulatorEnv/CodeBlocks/SimpleGUI.cbp
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="SimpleGUI" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="Debug">
|
||||||
|
<Option output="../../../Build/Debug/bin/SimpleGUI" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="../../../Build" />
|
||||||
|
<Option object_output="../../../Build/Debug/obj/" />
|
||||||
|
<Option type="0" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option projectLinkerOptionsRelation="2" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
||||||
|
</Compiler>
|
||||||
|
<ResourceCompiler>
|
||||||
|
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
||||||
|
</ResourceCompiler>
|
||||||
|
<Linker>
|
||||||
|
<Add library="libwxmsw31u.a" />
|
||||||
|
<Add directory="$(#wx31)/lib/gcc_dll" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Release">
|
||||||
|
<Option output="../../../Build/Release/bin/SimpleGUI" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="../../../Build" />
|
||||||
|
<Option object_output="../../../Build/Release/obj/" />
|
||||||
|
<Option type="0" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option projectLinkerOptionsRelation="2" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
||||||
|
</Compiler>
|
||||||
|
<ResourceCompiler>
|
||||||
|
<Add directory="$(#wx31)/lib/gcc_dll/mswu" />
|
||||||
|
</ResourceCompiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add library="libwxmsw31u.a" />
|
||||||
|
<Add directory="$(#wx31)/lib/gcc_dll" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-Wall" />
|
||||||
|
<Add option="-std=c++11" />
|
||||||
|
<Add option="-pipe" />
|
||||||
|
<Add option="-mthreads" />
|
||||||
|
<Add option="-D__GNUWIN32__" />
|
||||||
|
<Add option="-D__WXMSW__" />
|
||||||
|
<Add option="-DWXUSINGDLL" />
|
||||||
|
<Add option="-DwxUSE_UNICODE" />
|
||||||
|
<Add directory="$(#wx31)/include" />
|
||||||
|
<Add directory="../../../Frame/inc" />
|
||||||
|
<Add directory="../../../GUI/inc" />
|
||||||
|
<Add directory="../../../Library/inc" />
|
||||||
|
<Add directory="../../../HMI/inc" />
|
||||||
|
<Add directory="../../../Demo/inc" />
|
||||||
|
<Add directory="../../../wxExpand/inc" />
|
||||||
|
<Add directory="../../../Application/inc" />
|
||||||
|
<Add directory="../../../Common/inc" />
|
||||||
|
<Add directory="../../../Interface/inc" />
|
||||||
|
</Compiler>
|
||||||
|
<ResourceCompiler>
|
||||||
|
<Add directory="$(#wx31)/include" />
|
||||||
|
</ResourceCompiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-mthreads" />
|
||||||
|
<Add library="iconv" />
|
||||||
|
<Add directory="../../../Library/lib" />
|
||||||
|
</Linker>
|
||||||
|
<Unit filename="../../../Application/inc/Application.h" />
|
||||||
|
<Unit filename="../../../Application/src/Application.cpp" />
|
||||||
|
<Unit filename="../../../Common/inc/Common.h" />
|
||||||
|
<Unit filename="../../../Common/src/Common.cpp" />
|
||||||
|
<Unit filename="../../../Demo/inc/DemoProc.h" />
|
||||||
|
<Unit filename="../../../Demo/inc/DemoProcText.h" />
|
||||||
|
<Unit filename="../../../Demo/src/DemoProc.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Demo/src/List.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Demo/src/RTCNotice.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Demo/src/RealtimeGraph.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Demo/src/ScrollingText.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Demo/src/TextNotice.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Demo/src/VariableBox.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Frame/inc/LCDFrame.h" />
|
||||||
|
<Unit filename="../../../Frame/inc/MonochromeDotLCD.h" />
|
||||||
|
<Unit filename="../../../Frame/src/LCDFrame.cpp" />
|
||||||
|
<Unit filename="../../../Frame/src/MonochromeDotLCD.cpp" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_Basic.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_Common.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_Config.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_Frame.h">
|
||||||
|
<Option target="<{~None~}>" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_List.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_Notice.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_ProcessBar.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_RealtimeGraph.h">
|
||||||
|
<Option target="<{~None~}>" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_ScrollBar.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_Text.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_Typedef.h" />
|
||||||
|
<Unit filename="../../../GUI/inc/SGUI_VariableBox.h" />
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_Basic.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_Common.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_FlashData.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_Frame.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_List.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_Notice.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_ProcessBar.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_RealtimeGraph.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_ScrollBar.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_Text.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../GUI/src/SGUI_VariableBox.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../HMI/inc/HMI_Engine.h" />
|
||||||
|
<Unit filename="../../../HMI/src/HMI_Engine.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Interface/inc/UserActionInterface.h" />
|
||||||
|
<Unit filename="../../../Interface/inc/VirtualDeviceInterface.h">
|
||||||
|
<Option target="<{~None~}>" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Interface/src/UserActionInterface.cpp">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Interface/src/VirtualDeviceInterface.cpp">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../Library/inc/iconv.h" />
|
||||||
|
<Unit filename="../../../Resource/Resource.rc">
|
||||||
|
<Option compilerVar="WINDRES" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../../../wxExpand/inc/wxDotLCD.h" />
|
||||||
|
<Unit filename="../../../wxExpand/src/wxDotLCD.cpp" />
|
||||||
|
<Extensions>
|
||||||
|
<code_completion />
|
||||||
|
<envvars />
|
||||||
|
<debugger />
|
||||||
|
</Extensions>
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
@ -26,7 +26,6 @@ private: //Appearance parameters.
|
|||||||
// Private data declare.
|
// Private data declare.
|
||||||
private: // Private data.
|
private: // Private data.
|
||||||
uint32_t* m_parrDisplayBuffer;
|
uint32_t* m_parrDisplayBuffer;
|
||||||
wxWindow* m_pclsParent;
|
|
||||||
void (wxDotLCD::*m_pfDrawPoint)(wxMemoryDC& clsCDCObject, uint32_t uiPosX, uint32_t uiPosY, uint32_t uiPixelSize);
|
void (wxDotLCD::*m_pfDrawPoint)(wxMemoryDC& clsCDCObject, uint32_t uiPosX, uint32_t uiPosY, uint32_t uiPixelSize);
|
||||||
|
|
||||||
private: // Private object;
|
private: // Private object;
|
||||||
@ -39,28 +38,28 @@ private: // Event callback function.
|
|||||||
|
|
||||||
|
|
||||||
public: // Constructor/Destructor
|
public: // Constructor/Destructor
|
||||||
wxDotLCD(wxWindow *parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER,const wxString& name = wxPanelNameStr);
|
wxDotLCD(wxWindow *pclsParent, wxWindowID iWinID = wxID_ANY, const wxPoint& clsPosition = wxDefaultPosition);
|
||||||
~wxDotLCD();
|
~wxDotLCD();
|
||||||
|
|
||||||
public: // Public interface
|
public: // Public interface
|
||||||
void SetDisplaySizes(uint32_t uiEdgeWidth, uint32_t uiHorizontalPixelNumber, uint32_t uiVerticalPixelNumber, uint32_t uiPixelSize, bool bGridVisible);
|
void SetDisplaySizes(uint32_t uiHorizontalPixelNumber, uint32_t uiVerticalPixelNumber);
|
||||||
void GetDisplaySize(uint32_t* puiEdgeWidth, uint32_t* puiHorizontalPixelNumber, uint32_t* puiVerticalPixelNumber, uint32_t* puiPixelSize, bool* pbGridVisible);
|
void GetDisplaySize(uint32_t* puiHorizontalPixelNumber, uint32_t* puiVerticalPixelNumber);
|
||||||
void SetDisplayColors(const wxColor& clsEdgeColor, const wxColor& clsBaseColor, const wxColor& clsGridColor);
|
void SetDisplayColors(const wxColor& clsEdgeColor, const wxColor& clsBaseColor, const wxColor& clsGridColor);
|
||||||
void SetEdgeWidth(uint32_t uiEdgeWidth);
|
void SetEdgeWidth(uint32_t uiEdgeWidth);
|
||||||
uint32_t GetEdgeWidth(void) {return m_uiEdgeWidth;}
|
uint32_t GetEdgeWidth(void) {return m_uiEdgeWidth;}
|
||||||
void SetPixelSize(uint32_t uiPixelSize);
|
void SetPixelSize(uint32_t uiPixelSize);
|
||||||
uint32_t GetPixelSize(void) {return m_uiPixelSize;}
|
uint32_t GetPixelSize(void) {return m_uiPixelSize;}
|
||||||
void SetGridVisibled(bool bGridVisible);
|
void SetGridVisibled(bool bGridVisible);
|
||||||
|
bool GetGridVisibled(void) {return m_bGridVisible;}
|
||||||
void SetDisplayAreaSize( uint32_t uiHorizontalPixelNumber, uint32_t uiVerticalPixelNumber);
|
void SetDisplayAreaSize( uint32_t uiHorizontalPixelNumber, uint32_t uiVerticalPixelNumber);
|
||||||
void SetEdgeColor(const wxColor& clsColor);
|
void SetEdgeColor(const wxColor& clsColor);
|
||||||
void SetBaseColor(const wxColor& clsColor);
|
void SetBaseColor(const wxColor& clsColor);
|
||||||
void SetDrawColor(const wxColor& clsColor);
|
void SetDrawColor(const wxColor& clsColor);
|
||||||
void SetGridColor(const wxColor& clsColor);
|
void SetGridColor(const wxColor& clsColor);
|
||||||
wxWindow* GetParentWindow(void);
|
|
||||||
void OnPaint(void);
|
void OnPaint(void);
|
||||||
void SetPixelColor(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor, bool bRefreshNow = false);
|
void SetPixelUnitColor(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor, bool bRefreshNow = false);
|
||||||
void DrawPixel(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor);
|
void DrawPixel(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor);
|
||||||
uint32_t GetPixelColor(uint32_t uiPosX, uint32_t uiPosY);
|
uint32_t GetPixelUnitColor(uint32_t uiPosX, uint32_t uiPosY);
|
||||||
void RefreshDisplay(void);
|
void RefreshDisplay(void);
|
||||||
void CleanPanel(void);
|
void CleanPanel(void);
|
||||||
bool SaveScreenImageToFile(const wxString& strFilePath);
|
bool SaveScreenImageToFile(const wxString& strFilePath);
|
||||||
|
@ -14,11 +14,10 @@ END_EVENT_TABLE()
|
|||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
//= Function define. =//
|
//= Function define. =//
|
||||||
//=======================================================================//
|
//=======================================================================//
|
||||||
wxDotLCD::wxDotLCD(wxWindow *parent, wxWindowID winid, const wxPoint& pos, const wxSize& size, long style, const wxString& name):
|
wxDotLCD::wxDotLCD(wxWindow *pclsParent, wxWindowID iWinID, const wxPoint& clsPosition):
|
||||||
wxPanel(parent, winid, pos, size, style, name),
|
wxPanel(pclsParent, iWinID, clsPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxNO_BORDER, wxPanelNameStr),
|
||||||
m_clsCDC(this)
|
m_clsCDC(this)
|
||||||
{
|
{
|
||||||
m_pclsParent = parent;
|
|
||||||
m_parrDisplayBuffer = NULL;
|
m_parrDisplayBuffer = NULL;
|
||||||
m_pfDrawPoint = NULL;
|
m_pfDrawPoint = NULL;
|
||||||
|
|
||||||
@ -45,37 +44,12 @@ wxDotLCD::~wxDotLCD()
|
|||||||
delete m_pclsGridColor;
|
delete m_pclsGridColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDotLCD::SetDisplaySizes(uint32_t uiEdgeWidth, uint32_t uiHorizontalPixelNumber, uint32_t uiVerticalPixelNumber, uint32_t uiPixelSize, bool bGridVisible)
|
void wxDotLCD::SetDisplaySizes(uint32_t uiHorizontalPixelNumber, uint32_t uiVerticalPixelNumber)
|
||||||
{
|
{
|
||||||
// Set grid visible status.
|
|
||||||
m_uiEdgeWidth = uiEdgeWidth;
|
|
||||||
m_bGridVisible = bGridVisible;
|
|
||||||
m_uiPixelSize = uiPixelSize;
|
|
||||||
|
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(m_uiPixelSize == 0)
|
// Free current buffer.
|
||||||
{
|
|
||||||
m_pfDrawPoint = NULL;
|
|
||||||
}
|
|
||||||
else if(m_uiPixelSize == 1)
|
|
||||||
{
|
|
||||||
m_pfDrawPoint = &DrawPointSinglePixel;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if((true == bGridVisible) && (m_uiPixelSize > 2))
|
|
||||||
{
|
|
||||||
m_pfDrawPoint = &DrawPointMultiplePixelWithGrid;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_pfDrawPoint = &DrawPointMultiplePixel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free current buffer.
|
|
||||||
if(NULL != m_parrDisplayBuffer)
|
if(NULL != m_parrDisplayBuffer)
|
||||||
{
|
{
|
||||||
free(m_parrDisplayBuffer);
|
free(m_parrDisplayBuffer);
|
||||||
@ -102,16 +76,11 @@ void wxDotLCD::SetDisplaySizes(uint32_t uiEdgeWidth, uint32_t uiHorizontalPixelN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDotLCD::GetDisplaySize(uint32_t* puiEdgeWidth, uint32_t* puiHorizontalPixelNumber, uint32_t* puiVerticalPixelNumber, uint32_t* puiPixelSize, bool* pbGridVisible)
|
void wxDotLCD::GetDisplaySize(uint32_t* puiHorizontalPixelNumber, uint32_t* puiVerticalPixelNumber)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if(NULL != puiEdgeWidth)
|
|
||||||
{
|
|
||||||
*puiEdgeWidth = m_uiEdgeWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(NULL != puiHorizontalPixelNumber)
|
if(NULL != puiHorizontalPixelNumber)
|
||||||
{
|
{
|
||||||
*puiHorizontalPixelNumber = m_uiHorizontalPixelNumber;
|
*puiHorizontalPixelNumber = m_uiHorizontalPixelNumber;
|
||||||
@ -121,16 +90,6 @@ void wxDotLCD::GetDisplaySize(uint32_t* puiEdgeWidth, uint32_t* puiHorizontalPix
|
|||||||
{
|
{
|
||||||
*puiVerticalPixelNumber = m_uiVerticalPixelNumber;
|
*puiVerticalPixelNumber = m_uiVerticalPixelNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NULL != puiPixelSize)
|
|
||||||
{
|
|
||||||
*puiPixelSize = m_uiPixelSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(NULL != pbGridVisible)
|
|
||||||
{
|
|
||||||
*pbGridVisible = m_bGridVisible;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDotLCD::SetDisplayColors(const wxColor& clsEdgeColor, const wxColor& clsBaseColor, const wxColor& clsGridColor)
|
void wxDotLCD::SetDisplayColors(const wxColor& clsEdgeColor, const wxColor& clsBaseColor, const wxColor& clsGridColor)
|
||||||
@ -174,7 +133,38 @@ void wxDotLCD::SetPixelSize(uint32_t uiPixelSize)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
|
// Save the pixel size value.
|
||||||
m_uiPixelSize = uiPixelSize;
|
m_uiPixelSize = uiPixelSize;
|
||||||
|
|
||||||
|
if(3 > m_uiPixelSize)
|
||||||
|
// If pixel size is less then 3, grid is fixed to NOT visible.
|
||||||
|
{
|
||||||
|
if(0 == m_uiPixelSize)
|
||||||
|
// If pixel size is 0, the pixel drawing function will set to invalid.
|
||||||
|
{
|
||||||
|
m_pfDrawPoint = NULL;
|
||||||
|
}
|
||||||
|
else if(1 == m_uiPixelSize)
|
||||||
|
// If pixel size is 1, the pixel drawing function will set to draw pixel unit by point.
|
||||||
|
{
|
||||||
|
m_pfDrawPoint = &DrawPointSinglePixel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pfDrawPoint = &DrawPointMultiplePixel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(true == m_bGridVisible)
|
||||||
|
{
|
||||||
|
m_pfDrawPoint = &DrawPointMultiplePixelWithGrid;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pfDrawPoint = &DrawPointMultiplePixel;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDotLCD::SetGridVisibled(bool bGridVisible)
|
void wxDotLCD::SetGridVisibled(bool bGridVisible)
|
||||||
@ -182,7 +172,20 @@ void wxDotLCD::SetGridVisibled(bool bGridVisible)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
|
// Save the grid visible value set.
|
||||||
m_bGridVisible = bGridVisible;
|
m_bGridVisible = bGridVisible;
|
||||||
|
|
||||||
|
if(3 <= m_uiPixelSize)
|
||||||
|
{
|
||||||
|
if(true == m_bGridVisible)
|
||||||
|
{
|
||||||
|
m_pfDrawPoint = &DrawPointMultiplePixelWithGrid;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pfDrawPoint = &DrawPointMultiplePixel;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDotLCD::CleanPanel(void)
|
void wxDotLCD::CleanPanel(void)
|
||||||
@ -271,7 +274,7 @@ void wxDotLCD::DrawPointMultiplePixelWithGrid(wxMemoryDC& clsCDCObject, uint32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/** Function Name: SetPixelColor **/
|
/** Function Name: SetPixelUnitColor **/
|
||||||
/** Purpose: Set a pixel RGBA color value. **/
|
/** Purpose: Set a pixel RGBA color value. **/
|
||||||
/** Params: **/
|
/** Params: **/
|
||||||
/** @ uiPosX[in]: X-Coordinate of pixel. **/
|
/** @ uiPosX[in]: X-Coordinate of pixel. **/
|
||||||
@ -286,7 +289,7 @@ void wxDotLCD::DrawPointMultiplePixelWithGrid(wxMemoryDC& clsCDCObject, uint32_t
|
|||||||
/** only one pixel, please use the DrawPixel function **/
|
/** only one pixel, please use the DrawPixel function **/
|
||||||
/** directly. **/
|
/** directly. **/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
void wxDotLCD::SetPixelColor(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor, bool bRefreshNow)
|
void wxDotLCD::SetPixelUnitColor(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor, bool bRefreshNow)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Process */
|
/* Process */
|
||||||
@ -304,7 +307,16 @@ void wxDotLCD::SetPixelColor(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t wxDotLCD::GetPixelColor(uint32_t uiPosX, uint32_t uiPosY)
|
/*************************************************************************/
|
||||||
|
/** Function Name: GetPixelUnitColor **/
|
||||||
|
/** Purpose: Get color of a pixel unit. **/
|
||||||
|
/** Params: **/
|
||||||
|
/** @ uiPosX[in]: X-Coordinate of pixel. **/
|
||||||
|
/** @ uiPosY[in]: Y-Coordinate of pixel. **/
|
||||||
|
/** Return: RGBA color value of the pixel unit. **/
|
||||||
|
/** Notice: None. **/
|
||||||
|
/*************************************************************************/
|
||||||
|
uint32_t wxDotLCD::GetPixelUnitColor(uint32_t uiPosX, uint32_t uiPosY)
|
||||||
{
|
{
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
@ -359,7 +371,7 @@ void wxDotLCD::DrawPixel(uint32_t uiPosX, uint32_t uiPosY, wxColor& clsColor)
|
|||||||
m_clsCDC.DrawRectangle(wxPoint(m_uiEdgeWidth+uiPosX*m_uiPixelSize, m_uiEdgeWidth+uiPosY*m_uiPixelSize), wxSize(m_uiPixelSize, m_uiPixelSize));
|
m_clsCDC.DrawRectangle(wxPoint(m_uiEdgeWidth+uiPosX*m_uiPixelSize, m_uiEdgeWidth+uiPosY*m_uiPixelSize), wxSize(m_uiPixelSize, m_uiPixelSize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetPixelColor(uiPosX, uiPosY, clsColor);
|
SetPixelUnitColor(uiPosX, uiPosY, clsColor);
|
||||||
ReleaseDC(m_clsCDC);
|
ReleaseDC(m_clsCDC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,11 +472,11 @@ void wxDotLCD::ResizeParent(void)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
if((true == m_bGridVisible) && (2 <m_uiPixelSize))
|
if((true == m_bGridVisible) && (2 <m_uiPixelSize))
|
||||||
{
|
{
|
||||||
m_pclsParent->SetClientSize(uiPaintSizeWidth+1, uiPaintSizeHeight+1);
|
GetParent()->SetClientSize(uiPaintSizeWidth+1, uiPaintSizeHeight+1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_pclsParent->SetClientSize(uiPaintSizeWidth, uiPaintSizeHeight);
|
GetParent()->SetClientSize(uiPaintSizeWidth, uiPaintSizeHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,7 +498,6 @@ bool wxDotLCD::SaveScreenImageToFile(const wxString& strFilePath)
|
|||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
/* Variable Declaration */
|
/* Variable Declaration */
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
// Create and initialize bitmap.
|
|
||||||
wxBitmap* pclsBitMap;
|
wxBitmap* pclsBitMap;
|
||||||
wxMemoryDC* pclsMemoryDC;
|
wxMemoryDC* pclsMemoryDC;
|
||||||
bool bReturn;
|
bool bReturn;
|
||||||
@ -520,30 +531,54 @@ bool wxDotLCD::SaveScreenImageToFile(const wxString& strFilePath)
|
|||||||
return bReturn;
|
return bReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/** Function Name: CopyScreenImageToClipBoard **/
|
||||||
|
/** Purpose: Copy current screen image to clip board. **/
|
||||||
|
/** Params: None. **/
|
||||||
|
/** Return: **/
|
||||||
|
/** @ true: Copy successfully. **/
|
||||||
|
/** @ false: Copy failed. **/
|
||||||
|
/** Notice: None. **/
|
||||||
|
/*************************************************************************/
|
||||||
bool wxDotLCD::CopyScreenImageToClipBoard(void)
|
bool wxDotLCD::CopyScreenImageToClipBoard(void)
|
||||||
{
|
{
|
||||||
uint32_t uiPictureWidth, uiPictureHeight;
|
/*----------------------------------*/
|
||||||
// Get panel size
|
/* Variable Declaration */
|
||||||
uiPictureWidth = GetSize().GetX();
|
/*----------------------------------*/
|
||||||
uiPictureHeight = GetSize().GetY();
|
uint32_t uiPictureWidth, uiPictureHeight;
|
||||||
|
wxBitmap* pclsDCBufferBitmap;
|
||||||
|
wxMemoryDC* pclsDCBuffer;
|
||||||
|
bool bReturn;
|
||||||
|
|
||||||
wxBitmap CBitMap(uiPictureWidth, uiPictureHeight, wxBITMAP_SCREEN_DEPTH);
|
/*----------------------------------*/
|
||||||
wxMemoryDC CMemoryDC(CBitMap);
|
/* Initialize */
|
||||||
CMemoryDC.Blit(wxPoint(0, 0), wxSize(uiPictureWidth, uiPictureHeight), &m_clsCDC, wxPoint(0, 0));
|
/*----------------------------------*/
|
||||||
|
uiPictureWidth = GetSize().GetX();
|
||||||
|
uiPictureHeight = GetSize().GetY();
|
||||||
|
pclsDCBufferBitmap = new wxBitmap(uiPictureWidth, uiPictureHeight, wxBITMAP_SCREEN_DEPTH);
|
||||||
|
pclsDCBuffer = new wxMemoryDC(*pclsDCBufferBitmap);
|
||||||
|
bReturn = true;
|
||||||
|
|
||||||
if(wxTheClipboard->Open())
|
/*----------------------------------*/
|
||||||
{
|
/* Process */
|
||||||
wxTheClipboard->SetData(new wxBitmapDataObject(CBitMap));
|
/*----------------------------------*/
|
||||||
wxTheClipboard->Close();
|
if((NULL != pclsDCBufferBitmap) && (NULL != pclsDCBuffer))
|
||||||
return true;
|
{
|
||||||
}
|
if(true == wxTheClipboard->Open())
|
||||||
else
|
{
|
||||||
{
|
pclsDCBuffer->Blit(0, 0, uiPictureWidth, uiPictureHeight, &m_clsCDC, 0, 0);
|
||||||
return false;
|
wxTheClipboard->SetData(new wxBitmapDataObject(*pclsDCBufferBitmap));
|
||||||
}
|
wxTheClipboard->Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bReturn = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete pclsDCBufferBitmap;
|
||||||
|
delete pclsDCBuffer;
|
||||||
|
|
||||||
|
return bReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow* wxDotLCD::GetParentWindow(void)
|
|
||||||
{
|
|
||||||
return m_pclsParent;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user