sync up with github
This commit is contained in:
parent
756ddc8082
commit
05c1be4afb
26
README.md
26
README.md
|
@ -3,14 +3,16 @@
|
|||
- GuiLite可以嵌入在iOS、Android、MFC、QT等其他UI系统中,让你的界面集百家之长,又不失个性。
|
||||
- GuiLite鼓励混合编程,开发者可以用GuiLite接管UI部分,用Swift,Java,Go,C#,Python发开业务部分。
|
||||
|
||||
## 新功能:自我监控
|
||||
**上报“编译/运行”情况至“云端”:**
|
||||
相比QT、MFC,GuiLite不预设开发者的使用场景,不在具体功能上,大包大揽;用框架的简洁,换取开发的自由;GuiLite在图形绘制上面,力图一步到位,运行效率感人。
|
||||
|
||||
![BuildInfo](doc/BuildInfo.png)
|
||||
## 新功能:支持多种文字:Unicode
|
||||
![unicode](doc/unicode.jpg)
|
||||
|
||||
**同步“本地数据”至“云端”:**
|
||||
[如何制作多种文字资源?](https://github.com/idea4good/GuiLiteToolkit)
|
||||
|
||||
![DataOnCloud](doc/data_on_cloud.png)
|
||||
[如何绘制Unicode文字?](https://github.com/idea4good/GuiLite/blob/master/core/src/word.cpp)
|
||||
|
||||
[如何在你的APP中输入unicode字符?](https://github.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/SampleCode/source/ui_tree/Dialog/patient_setup/patient_setup_dlg_xml.cpp)
|
||||
|
||||
## 卓越的跨平台能力
|
||||
在Mac, iOS下的运行效果:
|
||||
|
@ -25,7 +27,19 @@
|
|||
|
||||
![Win MR](doc/WinMR.gif) ![QQ group: 527251257](doc/qq.group.jpg)
|
||||
|
||||
相比QT、MFC,GuiLite不预设开发者的使用场景,不在具体功能上,大包大揽;用框架的简洁,换取开发的自由;GuiLite在图形绘制上面,力图一步到位,运行效率感人。
|
||||
## “换肤”功能
|
||||
![multi-theme](doc/multi-theme.png)
|
||||
|
||||
[如何“换肤”?](https://github.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/SampleCode/source/resource/resource.cpp)
|
||||
|
||||
## 自我监控
|
||||
**上报“编译/运行”情况至“云端”:**
|
||||
|
||||
![BuildInfo](doc/BuildInfo.png)
|
||||
|
||||
**同步“本地数据”至“云端”:**
|
||||
|
||||
![DataOnCloud](doc/data_on_cloud.png)
|
||||
|
||||
## 为什么开发GuiLite?如何使用?
|
||||
任何UI框架都不是为你我而生的,只有掌握核心原理,对其深度定制,才能真正掌握自己的命运!因此,我们开发了GuiLite,希望用这6千行代码揭示UI的核心原理和定制方法。
|
||||
|
|
|
@ -16,10 +16,6 @@ FILE(GLOB ADAPTER src/adapter/api_linux.cpp
|
|||
ADD_LIBRARY(core
|
||||
${MAIN}
|
||||
${ADAPTER})
|
||||
TARGET_LINK_LIBRARIES(core
|
||||
pthread
|
||||
dl
|
||||
sample)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/.sync.sh Core
|
||||
|
|
|
@ -1,184 +1,184 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{8C80C76D-F437-4C69-BC94-252AC44171C2}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>core</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\adapter\api_win.cpp" />
|
||||
<ClCompile Include="src\adapter\audio_win.cpp" />
|
||||
<ClCompile Include="src\adapter\msg_win.cpp" />
|
||||
<ClCompile Include="src\bitmap.cpp" />
|
||||
<ClCompile Include="src\cmd_target.cpp" />
|
||||
<ClCompile Include="src\display.cpp" />
|
||||
<ClCompile Include="src\surface.cpp" />
|
||||
<ClCompile Include="src\rect.cpp" />
|
||||
<ClCompile Include="src\wave_buffer.cpp" />
|
||||
<ClCompile Include="src\wave_ctrl.cpp" />
|
||||
<ClCompile Include="src\wnd.cpp" />
|
||||
<ClCompile Include="src\word.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core_include\api.h" />
|
||||
<ClInclude Include="core_include\audio.h" />
|
||||
<ClInclude Include="core_include\bitmap.h" />
|
||||
<ClInclude Include="core_include\cmd_target.h" />
|
||||
<ClInclude Include="core_include\display.h" />
|
||||
<ClInclude Include="core_include\surface.h" />
|
||||
<ClInclude Include="core_include\msg.h" />
|
||||
<ClInclude Include="core_include\rect.h" />
|
||||
<ClInclude Include="core_include\resource_type.h" />
|
||||
<ClInclude Include="core_include\wave_buffer.h" />
|
||||
<ClInclude Include="core_include\wave_ctrl.h" />
|
||||
<ClInclude Include="core_include\wnd.h" />
|
||||
<ClInclude Include="core_include\word.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{8C80C76D-F437-4C69-BC94-252AC44171C2}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>core</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\adapter\api_win.cpp" />
|
||||
<ClCompile Include="src\adapter\audio_win.cpp" />
|
||||
<ClCompile Include="src\adapter\msg_win.cpp" />
|
||||
<ClCompile Include="src\bitmap.cpp" />
|
||||
<ClCompile Include="src\cmd_target.cpp" />
|
||||
<ClCompile Include="src\display.cpp" />
|
||||
<ClCompile Include="src\surface.cpp" />
|
||||
<ClCompile Include="src\rect.cpp" />
|
||||
<ClCompile Include="src\wave_buffer.cpp" />
|
||||
<ClCompile Include="src\wave_ctrl.cpp" />
|
||||
<ClCompile Include="src\wnd.cpp" />
|
||||
<ClCompile Include="src\word.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core_include\api.h" />
|
||||
<ClInclude Include="core_include\audio.h" />
|
||||
<ClInclude Include="core_include\bitmap.h" />
|
||||
<ClInclude Include="core_include\cmd_target.h" />
|
||||
<ClInclude Include="core_include\display.h" />
|
||||
<ClInclude Include="core_include\surface.h" />
|
||||
<ClInclude Include="core_include\msg.h" />
|
||||
<ClInclude Include="core_include\rect.h" />
|
||||
<ClInclude Include="core_include\resource.h" />
|
||||
<ClInclude Include="core_include\wave_buffer.h" />
|
||||
<ClInclude Include="core_include\wave_ctrl.h" />
|
||||
<ClInclude Include="core_include\wnd.h" />
|
||||
<ClInclude Include="core_include\word.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,95 +1,95 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\core_include">
|
||||
<UniqueIdentifier>{3a033a7f-d656-4871-b7fe-f0a16aca7c8d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\bitmap.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\cmd_target.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\rect.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wave_buffer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wave_ctrl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wnd.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\word.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\api_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\audio_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\msg_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\surface.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\display.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core_include\api.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\audio.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\bitmap.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\cmd_target.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\msg.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\rect.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\resource_type.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wave_buffer.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wave_ctrl.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wnd.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\word.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\surface.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\display.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\core_include">
|
||||
<UniqueIdentifier>{3a033a7f-d656-4871-b7fe-f0a16aca7c8d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\bitmap.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\cmd_target.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\rect.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wave_buffer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wave_ctrl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wnd.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\word.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\api_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\audio_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\msg_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\surface.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\display.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core_include\api.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\audio.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\bitmap.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\cmd_target.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\msg.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\rect.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wave_buffer.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wave_ctrl.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wnd.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\word.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\surface.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\display.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\resource.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
|
@ -15,6 +15,7 @@ void do_assert(const char* file, int line);
|
|||
|
||||
void log_out(const char* log);
|
||||
|
||||
#define COLOR_TRANPARENT 0xFF000000
|
||||
#define GLT_RGB(r, g, b) ((0xFF << 24) | (((unsigned int)(r)) << 16) | (((unsigned int)(g)) << 8) | ((unsigned int)(b)))
|
||||
#define GLT_RGB_R(rgb) ((((unsigned int)(rgb)) >> 16) & 0xFF)
|
||||
#define GLT_RGB_G(rgb) ((((unsigned int)(rgb)) >> 8) & 0xFF)
|
||||
|
|
|
@ -5,11 +5,11 @@ class c_surface;
|
|||
class c_bitmap
|
||||
{
|
||||
public:
|
||||
static void draw_bitmap(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, int x, int y);
|
||||
static void draw_bitmap_in_rect(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type);
|
||||
static void draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, int x, int y);
|
||||
static void draw_bitmap_in_rect(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type);
|
||||
private:
|
||||
static void draw_bitmap_565(c_surface* surface, int z_order, int x, int y, int xsize, int ysize, const unsigned char* pPixel);
|
||||
static void get_bitmap_pos(const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y);
|
||||
static void get_bitmap_pos(const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y);
|
||||
static void draw_bitmap_565_inrect(c_surface* surface, int z_order, int x, int y, int width, int height, int xsize, int ysize, const unsigned char* pPixel);
|
||||
|
||||
c_bitmap(){}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef _RESOURCE_H_
|
||||
#define _RESOURCE_H_
|
||||
|
||||
//BITMAP
|
||||
typedef struct struct_bitmap_info
|
||||
{
|
||||
unsigned short XSize;
|
||||
unsigned short YSize;
|
||||
unsigned short BytesPerLine;
|
||||
unsigned short BitsPerPixel;
|
||||
const unsigned char* pData; /* Pointer to picture data (indices) */
|
||||
} BITMAP_INFO;
|
||||
|
||||
//FONT
|
||||
typedef struct struct_lattice
|
||||
{
|
||||
unsigned int utf8_code;
|
||||
unsigned char width;
|
||||
const unsigned char* p_data;
|
||||
} LATTICE;
|
||||
|
||||
typedef struct struct_font_info
|
||||
{
|
||||
unsigned char height;
|
||||
unsigned int count;
|
||||
LATTICE* lattice_array;
|
||||
} FONT_INFO;
|
||||
|
||||
//SHAPE
|
||||
#define INVALID_RGN 0xFFFFFF
|
||||
#define COLOR_USERDEF GLT_RGB(41,49,49)
|
||||
typedef struct struct_color_rect
|
||||
{
|
||||
int l;
|
||||
int t;
|
||||
int r;
|
||||
int b;
|
||||
unsigned int color;
|
||||
}COLOR_RECT;
|
||||
|
||||
#endif
|
|
@ -1,72 +0,0 @@
|
|||
#ifndef _RESOURCE_TYPE_H_
|
||||
#define _RESOURCE_TYPE_H_
|
||||
|
||||
typedef struct struct_gui_bitmap
|
||||
{
|
||||
unsigned short XSize;
|
||||
unsigned short YSize;
|
||||
unsigned short BytesPerLine;
|
||||
unsigned short BitsPerPixel;
|
||||
const unsigned char* pData; /* Pointer to picture data (indices) */
|
||||
} GUI_BITMAP;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char XSize;
|
||||
unsigned char XDist;
|
||||
unsigned char BytesPerLine;
|
||||
void* pData;
|
||||
} GUI_CHARINFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short First; /* first character */
|
||||
unsigned short Last; /* last character */
|
||||
const GUI_CHARINFO* paCharInfo; /* address of first character */
|
||||
void* pNext; /* pointer to next */
|
||||
} GUI_FONT_PROP;
|
||||
|
||||
typedef struct struct_gui_font
|
||||
{
|
||||
unsigned char YSize;
|
||||
unsigned char YDist;
|
||||
unsigned char XMag;
|
||||
unsigned char YMag;
|
||||
union
|
||||
{
|
||||
void *pFontData;
|
||||
const GUI_FONT_PROP* pProp;
|
||||
} p;
|
||||
unsigned char Baseline;
|
||||
} GUI_FONT;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LANGUAGE_BEGIN = 0,
|
||||
ENGLISH = LANGUAGE_BEGIN,
|
||||
CHINESE,
|
||||
LANGUAGE_MAX
|
||||
}LANGUAGE_TYPE;
|
||||
|
||||
typedef struct struct_multi_lan_strings
|
||||
{
|
||||
unsigned int index;
|
||||
const char* text[LANGUAGE_MAX];
|
||||
}MULTI_LAN_STRINGS;
|
||||
|
||||
typedef struct struct_unicode_lan_strings
|
||||
{
|
||||
unsigned int index;
|
||||
const char* unicodes;
|
||||
}MULTI_LAN_UNICODES;
|
||||
|
||||
#define ADD_STRING( index, english) \
|
||||
{ \
|
||||
index, \
|
||||
{ \
|
||||
english, \
|
||||
0 \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif
|
|
@ -15,26 +15,16 @@ typedef enum
|
|||
Z_ORDER_LEVEL_MAX
|
||||
}Z_ORDER_LEVEL;
|
||||
|
||||
#define INVALID_RGN 0xFFFFFF
|
||||
#define COLOR_USERDEF GLT_RGB(41,49,49)
|
||||
#define DUMMY_COLOR GLT_RGB(0,0,0)
|
||||
|
||||
typedef struct struct_custom_shape
|
||||
{
|
||||
int l;
|
||||
int t;
|
||||
int r;
|
||||
int b;
|
||||
unsigned int color;
|
||||
}CUSTOM_SHAPE;
|
||||
typedef struct struct_color_rect COLOR_RECT;
|
||||
|
||||
class c_display;
|
||||
class c_surface {
|
||||
friend class c_display;
|
||||
public:
|
||||
virtual void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order);
|
||||
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
|
||||
virtual unsigned int get_pixel(int x, int y, unsigned int z_order);
|
||||
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
|
||||
void fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects, int z_order);
|
||||
|
||||
int get_width() { return m_width; }
|
||||
int get_height() { return m_height; }
|
||||
|
@ -42,7 +32,6 @@ public:
|
|||
void draw_vline(int x, int y0, int y1, unsigned int rgb, unsigned int z_order);
|
||||
void draw_line(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
|
||||
void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
|
||||
void draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[], int z_order);
|
||||
int flush_scrren(int left, int top, int right, int bottom);
|
||||
|
||||
bool is_valid(c_rect rect);
|
||||
|
|
|
@ -24,12 +24,11 @@ public:
|
|||
virtual void on_init_children();
|
||||
virtual void on_paint();
|
||||
|
||||
void set_wave_name(unsigned short wave_name_id){ m_wave_name = wave_name_id;}
|
||||
unsigned short get_wave_name(){return m_wave_name;}
|
||||
void set_wave_unit(unsigned short wave_unit_id){ m_wave_unit = wave_unit_id;}
|
||||
void set_wave_name(char* wave_name){ m_wave_name = wave_name;}
|
||||
void set_wave_unit(char* wave_unit){ m_wave_unit = wave_unit;}
|
||||
|
||||
void set_wave_name_font_type(const GUI_FONT* wave_name_font_type){ m_wave_name_font_type = wave_name_font_type;}
|
||||
void set_wave_unit_font_type(const GUI_FONT* wave_unit_font_type){ m_wave_unit_font_type = wave_unit_font_type;}
|
||||
void set_wave_name_font_type(const FONT_INFO* wave_name_font_type){ m_wave_name_font_type = wave_name_font_type;}
|
||||
void set_wave_unit_font_type(const FONT_INFO* wave_unit_font_type){ m_wave_unit_font_type = wave_unit_font_type;}
|
||||
|
||||
void set_wave_name_color(unsigned int wave_name_color){ m_wave_name_color = wave_name_color;}
|
||||
void set_wave_unit_color(unsigned int wave_unit_color){ m_wave_unit_color = wave_unit_color;}
|
||||
|
@ -51,11 +50,11 @@ protected:
|
|||
void erase_oldest_vline();
|
||||
void save_foreground();
|
||||
|
||||
unsigned short m_wave_name;
|
||||
unsigned short m_wave_unit;
|
||||
char* m_wave_name;
|
||||
char* m_wave_unit;
|
||||
|
||||
const GUI_FONT* m_wave_name_font_type;
|
||||
const GUI_FONT* m_wave_unit_font_type;
|
||||
const FONT_INFO* m_wave_name_font_type;
|
||||
const FONT_INFO* m_wave_unit_font_type;
|
||||
|
||||
unsigned int m_wave_name_color;
|
||||
unsigned int m_wave_unit_color;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef XT_GUI_WND_H
|
||||
#define XT_GUI_WND_H
|
||||
#ifndef _GUI_WND_H_
|
||||
#define _GUI_WND_H_
|
||||
|
||||
//Window attribution
|
||||
#define GLT_WIN_SHOW 0x00000001
|
||||
|
@ -9,10 +9,8 @@
|
|||
#define GLT_ATTR_DISABLED 0x40000000L
|
||||
#define GLT_ATTR_FOCUS 0x20000000L
|
||||
|
||||
typedef struct struct_gui_bitmap GUI_BITMAP;
|
||||
typedef struct struct_gui_font GUI_FONT;
|
||||
typedef struct struct_custom_shape CUSTOM_SHAPE;
|
||||
typedef const GUI_FONT* (*PTR_FUNC_GET_FONT)();
|
||||
typedef struct struct_font_info FONT_INFO;
|
||||
typedef struct struct_color_rect COLOR_RECT;
|
||||
|
||||
class c_wnd;
|
||||
class c_surface;
|
||||
|
@ -29,7 +27,7 @@ typedef struct struct_wnd_tree
|
|||
{
|
||||
c_wnd* p_wnd;
|
||||
unsigned int resource_id;
|
||||
unsigned int caption_id;
|
||||
char* str;
|
||||
short x;
|
||||
short y;
|
||||
short width;
|
||||
|
@ -44,9 +42,9 @@ public:
|
|||
c_wnd();
|
||||
virtual ~c_wnd();
|
||||
virtual const char* get_class_name() const { return "c_wnd"; }
|
||||
virtual int connect(c_wnd *parent, unsigned short resource_id, unsigned short str_id,
|
||||
virtual int connect(c_wnd *parent, unsigned short resource_id, char* str,
|
||||
short x, short y, short width, short height, WND_TREE* p_child_tree = NULL);
|
||||
virtual c_wnd* connect_clone(c_wnd *parent, unsigned short resource_id, unsigned short str_id,
|
||||
virtual c_wnd* connect_clone(c_wnd *parent, unsigned short resource_id, char* str,
|
||||
short x, short y, short width, short height, WND_TREE* p_child_tree = NULL);
|
||||
void disconnect();
|
||||
virtual c_wnd* clone() = 0;
|
||||
|
@ -60,13 +58,8 @@ public:
|
|||
unsigned int get_style() const { return m_style; }
|
||||
virtual void modify_style(unsigned int add_style = 0, unsigned int remove_style = 0);
|
||||
|
||||
void set_str_id(unsigned short str_id) { m_str_id = str_id; }
|
||||
unsigned short get_str_id() const { return m_str_id; }
|
||||
|
||||
void set_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap = pBitmap; }
|
||||
void set_focus_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap_focus = pBitmap; }
|
||||
void set_pushed_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap_pushed = pBitmap; }
|
||||
void set_disable_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap_disable = pBitmap; }
|
||||
void set_str(char* str) { m_str = str; }
|
||||
char* get_str_id() const { return m_str; }
|
||||
|
||||
bool is_visible() const { return m_is_visible_now; }
|
||||
bool is_foreground();
|
||||
|
@ -81,8 +74,8 @@ public:
|
|||
unsigned int get_font_color() { return m_font_color; }
|
||||
void set_bg_color(unsigned int color) { m_bg_color = color; }
|
||||
unsigned int get_bg_color() { return m_bg_color; }
|
||||
void set_font_type(const GUI_FONT *font_type) { m_font_type = font_type; }
|
||||
const GUI_FONT* get_font_type() { return m_font_type; }
|
||||
void set_font_type(const FONT_INFO *font_type) { m_font_type = font_type; }
|
||||
const FONT_INFO* get_font_type() { return m_font_type; }
|
||||
|
||||
void set_wnd_pos(short x, short y, short width, short height);
|
||||
void get_wnd_rect(c_rect &rect) const;
|
||||
|
@ -136,7 +129,8 @@ protected:
|
|||
void draw_rect(c_rect rect, unsigned int rgb);
|
||||
void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb);
|
||||
void fill_rect(c_rect rect, unsigned int rgb);
|
||||
void draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[]);
|
||||
void fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects);
|
||||
void fill_rect_ex(c_rect rect, unsigned int color, const COLOR_RECT* extend_rects);
|
||||
protected:
|
||||
WND_STATUS m_status;
|
||||
unsigned int m_style;
|
||||
|
@ -145,13 +139,9 @@ protected:
|
|||
c_wnd* m_top_child;
|
||||
c_wnd* m_prev_sibling;
|
||||
c_wnd* m_next_sibling;
|
||||
unsigned short m_str_id;
|
||||
char* m_str;
|
||||
|
||||
const GUI_BITMAP* m_bitmap;
|
||||
const GUI_BITMAP* m_bitmap_focus;
|
||||
const GUI_BITMAP* m_bitmap_pushed;
|
||||
const GUI_BITMAP* m_bitmap_disable;
|
||||
const GUI_FONT* m_font_type;
|
||||
const FONT_INFO* m_font_type;
|
||||
unsigned int m_font_color;
|
||||
unsigned int m_bg_color;
|
||||
|
||||
|
|
|
@ -1,39 +1,23 @@
|
|||
#ifndef _WORD_UNIT_H_
|
||||
#define _WORD_UNIT_H_
|
||||
|
||||
#define COLOR_TRANPARENT 0xFF000000
|
||||
|
||||
class c_surface;
|
||||
class c_word
|
||||
{
|
||||
public:
|
||||
static void initiallize(LANGUAGE_TYPE language);
|
||||
static void draw_string(c_surface* surface, int z_order, const char *s, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_string(c_surface* surface, int z_order, unsigned long str_id, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_string_in_rect(c_surface* surface, int z_order, const char *s, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_string_in_rect(c_surface* surface, int z_order, unsigned long str_id, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_string(c_surface* surface, int z_order, const char *s, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_string_in_rect(c_surface* surface, int z_order, const char *s, c_rect rect, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT);
|
||||
static void value_2_string(int value, int dot_position, char* buf, int len);
|
||||
|
||||
static int get_str_pixel_length(const char *s, const GUI_FONT* font);
|
||||
static const int get_font_ysize(const GUI_FONT* font_type);
|
||||
static const char* get_string(unsigned long str_id);
|
||||
|
||||
static int get_str_pixel_length(const char *s, const FONT_INFO* font);
|
||||
private:
|
||||
static int get_char_cnt_in_single_line(const char *s);
|
||||
static void draw_single_line_string(c_surface* surface, int z_order, const char *s, int x, int y, int len, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color);
|
||||
static int draw_single_char(c_surface* surface, int z_order, unsigned short code, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color);
|
||||
static void draw_lattice(c_surface* surface, int z_order, int x, int y, int width, int height, int bytes_per_line, const unsigned char* pData, unsigned int font_color, unsigned int bg_color, unsigned int font_aa_flag);
|
||||
static void draw_bit_line(c_surface* surface, int z_order, int x, int y, unsigned char const*p, int width, unsigned int font_color, unsigned int bg_color);
|
||||
static void draw_bit_line_AA(c_surface* surface, int z_order, int x, int y, unsigned char const*p, int width, unsigned int font_color, unsigned int bg_color);
|
||||
|
||||
static const GUI_FONT_PROP* find_font_prop(const GUI_FONT_PROP* pProp, unsigned short code);
|
||||
static void get_string_pos(const char *s, const GUI_FONT* font, c_rect rect, unsigned int align_type, int &x, int &y);
|
||||
static bool is_AA_font(const GUI_CHARINFO* pCharInfo);
|
||||
|
||||
static const MULTI_LAN_STRINGS *m_lang_map;
|
||||
static LANGUAGE_TYPE m_lang_type;
|
||||
static int draw_single_char(c_surface* surface, int z_order, unsigned int utf8_code, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color);
|
||||
static void draw_lattice(c_surface* surface, int z_order, int x, int y, int width, int height, const unsigned char* p_data, unsigned int font_color, unsigned int bg_color);
|
||||
|
||||
static const LATTICE* get_lattice(const FONT_INFO* font, unsigned int utf8_code);
|
||||
static void get_string_pos(const char *s, const FONT_INFO* font, c_rect rect, unsigned int align_type, int &x, int &y);
|
||||
private:
|
||||
c_word(){};
|
||||
c_word(const c_word&);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource_type.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/rect.h"
|
||||
#include "../core_include/bitmap.h"
|
||||
#include "../core_include/surface.h"
|
||||
|
||||
void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, int x, int y)
|
||||
void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, int x, int y)
|
||||
{
|
||||
if (0 == pBitmap)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const GUI_BITMAP *pB
|
|||
(unsigned char const *)pBitmap->pData);
|
||||
}
|
||||
|
||||
void c_bitmap::draw_bitmap_in_rect(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type)
|
||||
void c_bitmap::draw_bitmap_in_rect(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type)
|
||||
{
|
||||
if (0 == pBitmap)
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ void c_bitmap::draw_bitmap_in_rect(c_surface* surface, int z_order, const GUI_BI
|
|||
pBitmap->XSize, pBitmap->YSize, (unsigned char const *)pBitmap->pData);
|
||||
}
|
||||
|
||||
void c_bitmap::get_bitmap_pos(const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y)
|
||||
void c_bitmap::get_bitmap_pos(const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y)
|
||||
{
|
||||
int x_size = pBitmap->XSize;
|
||||
int y_size = pBitmap->YSize;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/surface.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -374,24 +375,28 @@ int c_surface::copy_layer_pixel_2_fb(int x, int y, unsigned int z_order)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void c_surface::draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[], int z_order)
|
||||
void c_surface::fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects, int z_order)
|
||||
{
|
||||
int i = 0;
|
||||
int templ, tempt, tempr, tempb;
|
||||
unsigned int tempcolor;
|
||||
while (INVALID_RGN != pRgn[i].l)
|
||||
if (NULL == extend_rects)
|
||||
{
|
||||
templ = (pRgn[i].l < 0) ? (r + 1 + pRgn[i].l) : pRgn[i].l + l;
|
||||
tempt = (pRgn[i].t < 0) ? (b + 1 + pRgn[i].t) : pRgn[i].t + t;
|
||||
tempr = (pRgn[i].r < 0) ? (r + 1 + pRgn[i].r) : pRgn[i].r + l;
|
||||
tempb = (pRgn[i].b < 0) ? (b + 1 + pRgn[i].b) : pRgn[i].b + t;
|
||||
return fill_rect(l, t, r, b, color, z_order);
|
||||
}
|
||||
|
||||
COLOR_RECT* p_item = (COLOR_RECT*)extend_rects;
|
||||
int templ, tempt, tempr, tempb;
|
||||
for(int i = 0; INVALID_RGN != p_item[i].l; i++)
|
||||
{
|
||||
templ = (p_item[i].l < 0) ? (r + 1 + p_item[i].l) : p_item[i].l + l;
|
||||
tempt = (p_item[i].t < 0) ? (b + 1 + p_item[i].t) : p_item[i].t + t;
|
||||
tempr = (p_item[i].r < 0) ? (r + 1 + p_item[i].r) : p_item[i].r + l;
|
||||
tempb = (p_item[i].b < 0) ? (b + 1 + p_item[i].b) : p_item[i].b + t;
|
||||
|
||||
if (templ >= tempr)
|
||||
tempr = templ;
|
||||
if (tempt >= tempb)
|
||||
tempb = tempt;
|
||||
|
||||
tempcolor = (COLOR_USERDEF == pRgn[i].color) ? (color) : pRgn[i].color;
|
||||
unsigned int tempcolor = (COLOR_USERDEF == p_item[i].color) ? (color) : p_item[i].color;
|
||||
|
||||
for (int y = tempt ; y <= tempb; y++)
|
||||
{
|
||||
|
@ -400,7 +405,6 @@ void c_surface::draw_custom_shape(int l, int t, int r, int b, unsigned int color
|
|||
set_pixel(x , y, tempcolor, z_order);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/wave_buffer.h"
|
||||
#include "../core_include/surface.h"
|
||||
#include "../core_include/resource_type.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/wave_ctrl.h"
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
#include "../core_include/rect.h"
|
||||
#include "../core_include/cmd_target.h"
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource_type.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/bitmap.h"
|
||||
#include "../core_include/surface.h"
|
||||
#include "../core_include/wnd.h"
|
||||
|
||||
c_wnd::c_wnd(): m_status(STATUS_NORMAL), m_style(GLT_ATTR_VISIBLE), m_parent(NULL), m_top_child(NULL), m_prev_sibling(NULL), m_next_sibling(NULL),
|
||||
m_str_id(0),m_bitmap(NULL), m_bitmap_focus(NULL), m_bitmap_pushed(NULL), m_bitmap_disable(NULL),
|
||||
m_font_type(NULL), m_font_color(0), m_bg_color(0), m_is_visible_now(false),m_resource_id(0),
|
||||
m_z_order(Z_ORDER_LEVEL_0), m_active_child(NULL), m_surface(NULL)
|
||||
m_str(0), m_font_color(0), m_bg_color(0), m_is_visible_now(false),m_resource_id(0), m_z_order(Z_ORDER_LEVEL_0), m_active_child(NULL), m_surface(NULL)
|
||||
{
|
||||
m_wnd_rect.Empty();
|
||||
}
|
||||
|
@ -23,7 +21,7 @@ void c_wnd::pre_create_wnd()
|
|||
m_style = GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS;
|
||||
}
|
||||
|
||||
int c_wnd::connect(c_wnd *parent, unsigned short resource_id, unsigned short str_id,
|
||||
int c_wnd::connect(c_wnd *parent, unsigned short resource_id, char* str,
|
||||
short x, short y, short width, short height, WND_TREE* p_child_tree )
|
||||
{
|
||||
if(0 == resource_id)
|
||||
|
@ -58,7 +56,7 @@ int c_wnd::connect(c_wnd *parent, unsigned short resource_id, unsigned short str
|
|||
ASSERT(m_surface->is_valid(rect));
|
||||
|
||||
pre_create_wnd();
|
||||
set_str_id(str_id);
|
||||
set_str(str);
|
||||
|
||||
if ( 0 != parent )
|
||||
{
|
||||
|
@ -91,7 +89,7 @@ int c_wnd::load_child_wnd(WND_TREE *p_child_tree)
|
|||
}
|
||||
else
|
||||
{
|
||||
p_cur->p_wnd->connect(this, p_cur->resource_id, p_cur->caption_id,
|
||||
p_cur->p_wnd->connect(this, p_cur->resource_id, p_cur->str,
|
||||
p_cur->x, p_cur->y, p_cur->width, p_cur->height,p_cur->p_child_tree);
|
||||
}
|
||||
p_cur++;
|
||||
|
@ -100,7 +98,7 @@ int c_wnd::load_child_wnd(WND_TREE *p_child_tree)
|
|||
return sum;
|
||||
}
|
||||
|
||||
c_wnd* c_wnd::connect_clone(c_wnd *parent, unsigned short resource_id, unsigned short str_id,
|
||||
c_wnd* c_wnd::connect_clone(c_wnd *parent, unsigned short resource_id, char* str,
|
||||
short x, short y, short width, short height, WND_TREE* p_child_tree )
|
||||
{
|
||||
if(0 == resource_id)
|
||||
|
@ -140,7 +138,7 @@ c_wnd* c_wnd::connect_clone(c_wnd *parent, unsigned short resource_id, unsigned
|
|||
ASSERT(wnd->m_surface->is_valid(rect));
|
||||
|
||||
wnd->pre_create_wnd();
|
||||
wnd->set_str_id(str_id);
|
||||
wnd->set_str(str);
|
||||
|
||||
if ( 0 != parent )
|
||||
{
|
||||
|
@ -166,7 +164,7 @@ int c_wnd::load_clone_child_wnd(WND_TREE *p_child_tree)
|
|||
WND_TREE* p_cur = p_child_tree;
|
||||
while(p_cur->p_wnd)
|
||||
{
|
||||
p_cur->p_wnd->connect_clone(this, p_cur->resource_id, p_cur->caption_id,
|
||||
p_cur->p_wnd->connect_clone(this, p_cur->resource_id, p_cur->str,
|
||||
p_cur->x, p_cur->y, p_cur->width, p_cur->height,p_cur->p_child_tree);
|
||||
p_cur++;
|
||||
sum++;
|
||||
|
@ -787,7 +785,12 @@ void c_wnd::fill_rect(c_rect rect, unsigned int rgb)
|
|||
m_surface->fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, m_z_order);
|
||||
}
|
||||
|
||||
void c_wnd::draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[])
|
||||
void c_wnd::fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects)
|
||||
{
|
||||
m_surface->draw_custom_shape(l, t, r, b, color, pRgn, m_z_order);
|
||||
m_surface->fill_rect_ex(l, t, r, b, color, extend_rects, m_z_order);
|
||||
}
|
||||
|
||||
void c_wnd::fill_rect_ex(c_rect rect, unsigned int color, const COLOR_RECT* extend_rects)
|
||||
{
|
||||
m_surface->fill_rect_ex(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, color, extend_rects, m_z_order);
|
||||
}
|
|
@ -1,120 +1,110 @@
|
|||
#include "../core_include/api.h"
|
||||
#include "../core_include/rect.h"
|
||||
#include "../core_include/resource_type.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/surface.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define BUFFER_LEN 16
|
||||
|
||||
const MULTI_LAN_STRINGS * c_word::m_lang_map;
|
||||
LANGUAGE_TYPE c_word::m_lang_type;
|
||||
|
||||
extern const MULTI_LAN_STRINGS *get_multi_lan_pointer();
|
||||
extern const MULTI_LAN_UNICODES *get_unicode_lan_pointer();
|
||||
void c_word::initiallize(LANGUAGE_TYPE language)
|
||||
unsigned char s_utf8_length_table[256] =
|
||||
{
|
||||
m_lang_type = language;
|
||||
m_lang_map = get_multi_lan_pointer();
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
|
||||
};
|
||||
|
||||
inline static int get_utf8_code(const char* s, unsigned int& output_utf8_code)
|
||||
{
|
||||
unsigned char* us = (unsigned char*)s;
|
||||
int utf8_bytes = s_utf8_length_table[*us];
|
||||
switch (utf8_bytes)
|
||||
{
|
||||
case 1:
|
||||
output_utf8_code = *us;
|
||||
break;
|
||||
case 2:
|
||||
output_utf8_code = (*us << 8) | (*(us + 1));
|
||||
break;
|
||||
case 3:
|
||||
output_utf8_code = (*us << 16) | ((*(us + 1)) << 8) | *(us + 2);
|
||||
break;
|
||||
case 4:
|
||||
output_utf8_code = (*us << 24) | ((*(us + 1)) << 16) | (*(us + 2) << 8) | *(us + 3);
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
break;
|
||||
}
|
||||
return utf8_bytes;
|
||||
}
|
||||
|
||||
void c_word::draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
void c_word::draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
{
|
||||
char buf[BUFFER_LEN];
|
||||
value_2_string(value, dot_position, buf, BUFFER_LEN);
|
||||
draw_string_in_rect(surface, z_order, buf, rect, font, font_color, bg_color, align_type);
|
||||
}
|
||||
|
||||
void c_word::draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
void c_word::draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
{
|
||||
char buf[BUFFER_LEN];
|
||||
value_2_string(value, dot_position, buf, BUFFER_LEN);
|
||||
draw_string(surface, z_order, buf, x, y, font, font_color, bg_color, align_type);
|
||||
}
|
||||
|
||||
void c_word::draw_string_in_rect(c_surface* surface, int z_order, unsigned long str_id, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
{
|
||||
const char* s = get_string(str_id);
|
||||
if (NULL == s)
|
||||
{
|
||||
return;
|
||||
}
|
||||
draw_string_in_rect(surface, z_order, s, rect, font, font_color, bg_color, align_type);
|
||||
}
|
||||
|
||||
void c_word::draw_string_in_rect(c_surface* surface, int z_order, const char *s, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
void c_word::draw_string_in_rect(c_surface* surface, int z_order, const char *s, c_rect rect, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
{
|
||||
if(NULL == s)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (NULL == font)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
int x, y;
|
||||
get_string_pos(s, font, rect, align_type, x, y);
|
||||
draw_string(surface, z_order, s, rect.m_left + x, rect.m_top + y, font, font_color, bg_color, ALIGN_LEFT);
|
||||
}
|
||||
|
||||
void c_word::draw_string(c_surface* surface, int z_order, unsigned long str_id, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
void c_word::draw_string(c_surface* surface, int z_order, const char *s, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
{
|
||||
const char* s = get_string(str_id);
|
||||
if (NULL == s)
|
||||
{
|
||||
return;
|
||||
}
|
||||
draw_string(surface, z_order, s, x, y, font, font_color, bg_color, align_type);
|
||||
}
|
||||
|
||||
void c_word::draw_string(c_surface* surface, int z_order, const char *s, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type)
|
||||
{
|
||||
if(0 == s)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (; *s; s++)
|
||||
{
|
||||
int line_len = get_char_cnt_in_single_line(s);
|
||||
int str_pixel_length = get_str_pixel_length(s, font);
|
||||
if (align_type == ALIGN_RIGHT)
|
||||
{
|
||||
x = x - str_pixel_length + 1;
|
||||
}
|
||||
else if (align_type == ALIGN_HCENTER)
|
||||
{
|
||||
x = x - str_pixel_length / 2;
|
||||
}
|
||||
draw_single_line_string(surface, z_order, s, x, y , line_len, font, font_color, bg_color);
|
||||
s += line_len;
|
||||
if (*s == '\n')
|
||||
{
|
||||
y += font->YSize;
|
||||
}
|
||||
if (*s==0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const char* c_word::get_string(unsigned long str_id)
|
||||
{
|
||||
if(NULL == m_lang_map)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(str_id != m_lang_map[str_id].index)
|
||||
if (NULL == font)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return NULL;
|
||||
}
|
||||
return m_lang_map[str_id].text[m_lang_type];
|
||||
}
|
||||
|
||||
const int c_word::get_font_ysize(const GUI_FONT* font_type)
|
||||
{
|
||||
if (!font_type)
|
||||
{
|
||||
return 0;
|
||||
int offset = 0;
|
||||
unsigned int utf8_code;
|
||||
while (*s)
|
||||
{
|
||||
if (*s == '\n')
|
||||
{
|
||||
y += font->height;
|
||||
offset = 0;
|
||||
continue;
|
||||
}
|
||||
s += get_utf8_code(s, utf8_code);
|
||||
offset += draw_single_char(surface, z_order, utf8_code, (x + offset), y, font, font_color, bg_color);
|
||||
}
|
||||
return font_type->YSize;
|
||||
}
|
||||
|
||||
void c_word::value_2_string(int value, int dot_position, char* buf, int len)
|
||||
|
@ -145,50 +135,30 @@ void c_word::value_2_string(int value, int dot_position, char* buf, int len)
|
|||
}
|
||||
}
|
||||
|
||||
int c_word::get_char_cnt_in_single_line(const char *s)
|
||||
const LATTICE* c_word::get_lattice(const FONT_INFO* font, unsigned int utf8_code)
|
||||
{
|
||||
int len = 0;
|
||||
unsigned char code_high;
|
||||
while (((code_high = *(unsigned char*)s) != 0))
|
||||
{
|
||||
if (code_high > 127)
|
||||
{
|
||||
len++; s++;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (code_high)
|
||||
{
|
||||
case '\n': return len;
|
||||
}
|
||||
}
|
||||
len++;
|
||||
s++;
|
||||
}
|
||||
return len;
|
||||
int first = 0;
|
||||
int last = font->count - 1;
|
||||
int middle = (first + last) / 2;
|
||||
|
||||
while (first <= last)
|
||||
{
|
||||
if (font->lattice_array[middle].utf8_code < utf8_code)
|
||||
first = middle + 1;
|
||||
else if (font->lattice_array[middle].utf8_code == utf8_code)
|
||||
{
|
||||
return &font->lattice_array[middle];
|
||||
}
|
||||
else
|
||||
{
|
||||
last = middle - 1;
|
||||
}
|
||||
middle = (first + last) / 2;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void c_word::draw_single_line_string(c_surface* surface, int z_order, const char *s, int x, int y, int len, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color)
|
||||
{
|
||||
int offset = 0;
|
||||
while (--len >= 0)
|
||||
{
|
||||
offset = draw_single_char(surface, z_order, *s++, x, y, font, font_color, bg_color);
|
||||
x += offset;
|
||||
}
|
||||
}
|
||||
|
||||
const GUI_FONT_PROP* c_word::find_font_prop(const GUI_FONT_PROP* pProp, unsigned short code)
|
||||
{
|
||||
for (; pProp; pProp=(GUI_FONT_PROP*) pProp->pNext)
|
||||
{
|
||||
if ((code>=pProp->First) && (code<=pProp->Last))
|
||||
break;
|
||||
}
|
||||
return pProp;
|
||||
}
|
||||
|
||||
int c_word::draw_single_char(c_surface* surface, int z_order, unsigned short code, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color)
|
||||
int c_word::draw_single_char(c_surface* surface, int z_order, unsigned int utf8_code, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color)
|
||||
{
|
||||
if (NULL == font)
|
||||
{
|
||||
|
@ -196,137 +166,83 @@ int c_word::draw_single_char(c_surface* surface, int z_order, unsigned short cod
|
|||
return 0;
|
||||
}
|
||||
|
||||
const GUI_FONT_PROP* pProp = find_font_prop(font->p.pProp, code);
|
||||
if (pProp)
|
||||
const LATTICE* p_lattice = get_lattice(font, utf8_code);
|
||||
if (p_lattice)
|
||||
{
|
||||
const GUI_CHARINFO* pCharInfo = pProp->paCharInfo+(code - pProp->First);
|
||||
int bytes_per_line = pCharInfo->BytesPerLine;
|
||||
draw_lattice(surface, z_order, x, y, pCharInfo->XSize, font->YSize,
|
||||
bytes_per_line, (unsigned char const *)pCharInfo->pData, font_color, bg_color, is_AA_font(pCharInfo));
|
||||
return pCharInfo->XDist;
|
||||
draw_lattice(surface, z_order, x, y, p_lattice->width, font->height, p_lattice->p_data, font_color, bg_color);
|
||||
return p_lattice->width;
|
||||
}
|
||||
return 0;
|
||||
|
||||
int len = font->height;
|
||||
for (int y_ = 0; y_ < len; y_++)
|
||||
{
|
||||
for (int x_ = 0; x_ < len; x_++)
|
||||
{
|
||||
((y_ % 4) == 0) ? surface->set_pixel((x + x_), (y + y_), 0, z_order) :
|
||||
surface->set_pixel((x + x_), (y + y_), 0xFFFFFFFF, z_order);
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
void c_word::draw_lattice(c_surface* surface, int z_order, int x, int y, int width, int height,
|
||||
int bytes_per_line, const unsigned char* pData,
|
||||
unsigned int font_color, unsigned int bg_color, unsigned int font_aa_flag)
|
||||
const unsigned char* p_data, unsigned int font_color, unsigned int bg_color)
|
||||
{
|
||||
int i;
|
||||
if (!font_aa_flag)
|
||||
unsigned int r, g, b;
|
||||
unsigned int bg_color_set = (COLOR_TRANPARENT == bg_color) ? surface->get_pixel(x, y, z_order) : bg_color;
|
||||
|
||||
for (int y_ = 0; y_ < height; y_++)
|
||||
{
|
||||
for (i = 0; i < height; i++)
|
||||
for (int x_ = 0; x_ < width; x_++)
|
||||
{
|
||||
draw_bit_line(surface, z_order, x, i + y, pData, width, font_color, bg_color);
|
||||
pData += bytes_per_line;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
draw_bit_line_AA(surface, z_order, x, i + y, pData, width, font_color, bg_color);
|
||||
pData += bytes_per_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void c_word::draw_bit_line(c_surface* surface, int z_order, int x, int y, unsigned char const*p, int width, unsigned int font_color, unsigned int bg_color)
|
||||
{
|
||||
unsigned int color;
|
||||
int diff = 0;
|
||||
do
|
||||
{
|
||||
color = (*p & (0x80>>diff)) ? font_color : bg_color;
|
||||
|
||||
if (COLOR_TRANPARENT != color)
|
||||
{
|
||||
surface->set_pixel(x, y, color, z_order);
|
||||
}
|
||||
|
||||
x++;
|
||||
if (++diff == 8)
|
||||
{
|
||||
diff = 0;
|
||||
p++;
|
||||
}
|
||||
} while (--width);
|
||||
}
|
||||
|
||||
void c_word::draw_bit_line_AA(c_surface* surface, int z_order, int x, int y, unsigned char const*p, int width, unsigned int font_color, unsigned int bg_color)
|
||||
{
|
||||
unsigned int color, current_bg_color;
|
||||
unsigned int b, g, r;
|
||||
|
||||
if(COLOR_TRANPARENT == bg_color)
|
||||
{
|
||||
current_bg_color = surface->get_pixel(x, y, z_order);
|
||||
}
|
||||
else
|
||||
{
|
||||
current_bg_color = bg_color;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (0x00 == *p)
|
||||
{
|
||||
if(bg_color != COLOR_TRANPARENT)
|
||||
unsigned char value = *p_data;
|
||||
if (0x00 == value)
|
||||
{
|
||||
surface->set_pixel(x, y, current_bg_color, z_order);
|
||||
if (bg_color != COLOR_TRANPARENT)
|
||||
{
|
||||
surface->set_pixel(x + x_, y + y_, bg_color_set, z_order);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
b = (GLT_RGB_B(font_color) * (*p) + GLT_RGB_B(current_bg_color) * (255 - *p)) >> 8;
|
||||
g = (GLT_RGB_G(font_color) * (*p) + GLT_RGB_G(current_bg_color) * (255 - *p)) >> 8;
|
||||
r = (GLT_RGB_R(font_color) * (*p) + GLT_RGB_R(current_bg_color) * (255 - *p)) >> 8;
|
||||
color = GLT_RGB(r, g, b);
|
||||
surface->set_pixel(x, y, color, z_order);
|
||||
}
|
||||
x++;
|
||||
p++;
|
||||
} while (--width);
|
||||
}
|
||||
|
||||
int c_word::get_str_pixel_length(const char *s, const GUI_FONT* font)
|
||||
{
|
||||
int ret = 0;
|
||||
if(0 == s)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (; *s; s++)
|
||||
{
|
||||
int len = get_char_cnt_in_single_line(s);
|
||||
|
||||
unsigned char code_high;
|
||||
int last_char_xdist = 0;
|
||||
|
||||
while (--len >= 0)
|
||||
{
|
||||
const GUI_FONT_PROP* pProp = find_font_prop(font->p.pProp, *s);
|
||||
if (pProp)
|
||||
else
|
||||
{
|
||||
const GUI_CHARINFO* pCharInfo = pProp->paCharInfo+(*s - pProp->First);
|
||||
|
||||
last_char_xdist = pCharInfo->XDist;
|
||||
b = (GLT_RGB_B(font_color) * value + GLT_RGB_B(bg_color_set) * (255 - value)) >> 8;
|
||||
g = (GLT_RGB_G(font_color) * value + GLT_RGB_G(bg_color_set) * (255 - value)) >> 8;
|
||||
r = (GLT_RGB_R(font_color) * value + GLT_RGB_R(bg_color_set) * (255 - value)) >> 8;
|
||||
surface->set_pixel((x + x_), (y + y_), GLT_RGB(r, g, b), z_order);
|
||||
}
|
||||
ret += last_char_xdist;
|
||||
s++;
|
||||
p_data++;
|
||||
}
|
||||
if (*s==0)
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void c_word::get_string_pos(const char *s, const GUI_FONT* font, c_rect rect, unsigned int align_type, int &x, int &y)
|
||||
int c_word::get_str_pixel_length(const char *s, const FONT_INFO* font)
|
||||
{
|
||||
if(NULL == s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (NULL == font)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
||||
int lattice_width = 0;
|
||||
unsigned int utf8_code;
|
||||
int utf8_bytes;
|
||||
while (*s)
|
||||
{
|
||||
utf8_bytes = get_utf8_code(s, utf8_code);
|
||||
const LATTICE* p_lattice = get_lattice(font, utf8_code);
|
||||
lattice_width += p_lattice?p_lattice->width:font->height;
|
||||
s += utf8_bytes;
|
||||
}
|
||||
return lattice_width;
|
||||
}
|
||||
|
||||
void c_word::get_string_pos(const char *s, const FONT_INFO* font, c_rect rect, unsigned int align_type, int &x, int &y)
|
||||
{
|
||||
int x_size = get_str_pixel_length(s, font);
|
||||
int y_size = get_font_ysize(font);
|
||||
int y_size = font->height;
|
||||
|
||||
int height = rect.m_bottom - rect.m_top + 1;
|
||||
int width = rect.m_right - rect.m_left + 1;
|
||||
|
@ -387,8 +303,3 @@ void c_word::get_string_pos(const char *s, const GUI_FONT* font, c_rect rect, un
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool c_word::is_AA_font(const GUI_CHARINFO* pCharInfo)
|
||||
{
|
||||
return (pCharInfo->XSize == pCharInfo->BytesPerLine) ? true : false;
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 89 KiB |
Binary file not shown.
After Width: | Height: | Size: 120 KiB |
|
@ -11,8 +11,6 @@ FILE(GLOB SRC src/*.cpp)
|
|||
|
||||
ADD_LIBRARY(gui ${SRC})
|
||||
|
||||
TARGET_LINK_LIBRARIES(gui core sample)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/.sync.sh Gui
|
||||
)
|
||||
|
|
415
gui/gui.vcxproj
415
gui/gui.vcxproj
|
@ -1,209 +1,208 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>gui</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\core;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<SmallerTypeCheck>false</SmallerTypeCheck>
|
||||
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<OpenMPSupport>
|
||||
</OpenMPSupport>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\core\core_include\api.h" />
|
||||
<ClInclude Include="..\core\core_include\audio.h" />
|
||||
<ClInclude Include="..\core\core_include\bitmap.h" />
|
||||
<ClInclude Include="..\core\core_include\cmd_target.h" />
|
||||
<ClInclude Include="..\core\core_include\display.h" />
|
||||
<ClInclude Include="..\core\core_include\msg.h" />
|
||||
<ClInclude Include="..\core\core_include\rect.h" />
|
||||
<ClInclude Include="..\core\core_include\resource_type.h" />
|
||||
<ClInclude Include="..\core\core_include\surface.h" />
|
||||
<ClInclude Include="..\core\core_include\wave_buffer.h" />
|
||||
<ClInclude Include="..\core\core_include\wave_ctrl.h" />
|
||||
<ClInclude Include="..\core\core_include\wnd.h" />
|
||||
<ClInclude Include="..\core\core_include\word.h" />
|
||||
<ClInclude Include="gui_include\button.h" />
|
||||
<ClInclude Include="gui_include\dialog.h" />
|
||||
<ClInclude Include="gui_include\edit.h" />
|
||||
<ClInclude Include="gui_include\font.h" />
|
||||
<ClInclude Include="gui_include\gesture.h" />
|
||||
<ClInclude Include="gui_include\keyboard.h" />
|
||||
<ClInclude Include="gui_include\label.h" />
|
||||
<ClInclude Include="gui_include\list_box.h" />
|
||||
<ClInclude Include="gui_include\slide_group.h" />
|
||||
<ClInclude Include="gui_include\shape_resource.h" />
|
||||
<ClInclude Include="gui_include\spinbox.h" />
|
||||
<ClInclude Include="gui_include\table.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\button.cpp" />
|
||||
<ClCompile Include="src\dialog.cpp" />
|
||||
<ClCompile Include="src\edit.cpp" />
|
||||
<ClCompile Include="src\gesture.cpp" />
|
||||
<ClCompile Include="src\keyboard.cpp" />
|
||||
<ClCompile Include="src\label.cpp" />
|
||||
<ClCompile Include="src\list_box.cpp" />
|
||||
<ClCompile Include="src\slide_group.cpp" />
|
||||
<ClCompile Include="src\shape_resource.cpp" />
|
||||
<ClCompile Include="src\spinbox.cpp" />
|
||||
<ClCompile Include="src\table.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>gui</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\core;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<SmallerTypeCheck>false</SmallerTypeCheck>
|
||||
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<OpenMPSupport>
|
||||
</OpenMPSupport>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync.bat" "Gui"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\core\core_include\api.h" />
|
||||
<ClInclude Include="..\core\core_include\audio.h" />
|
||||
<ClInclude Include="..\core\core_include\bitmap.h" />
|
||||
<ClInclude Include="..\core\core_include\cmd_target.h" />
|
||||
<ClInclude Include="..\core\core_include\display.h" />
|
||||
<ClInclude Include="..\core\core_include\msg.h" />
|
||||
<ClInclude Include="..\core\core_include\rect.h" />
|
||||
<ClInclude Include="..\core\core_include\resource_type.h" />
|
||||
<ClInclude Include="..\core\core_include\surface.h" />
|
||||
<ClInclude Include="..\core\core_include\wave_buffer.h" />
|
||||
<ClInclude Include="..\core\core_include\wave_ctrl.h" />
|
||||
<ClInclude Include="..\core\core_include\wnd.h" />
|
||||
<ClInclude Include="..\core\core_include\word.h" />
|
||||
<ClInclude Include="gui_include\button.h" />
|
||||
<ClInclude Include="gui_include\dialog.h" />
|
||||
<ClInclude Include="gui_include\edit.h" />
|
||||
<ClInclude Include="gui_include\my_resource.h" />
|
||||
<ClInclude Include="gui_include\gesture.h" />
|
||||
<ClInclude Include="gui_include\keyboard.h" />
|
||||
<ClInclude Include="gui_include\label.h" />
|
||||
<ClInclude Include="gui_include\list_box.h" />
|
||||
<ClInclude Include="gui_include\slide_group.h" />
|
||||
<ClInclude Include="gui_include\spinbox.h" />
|
||||
<ClInclude Include="gui_include\table.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\button.cpp" />
|
||||
<ClCompile Include="src\dialog.cpp" />
|
||||
<ClCompile Include="src\edit.cpp" />
|
||||
<ClCompile Include="src\my_resource.cpp" />
|
||||
<ClCompile Include="src\gesture.cpp" />
|
||||
<ClCompile Include="src\keyboard.cpp" />
|
||||
<ClCompile Include="src\label.cpp" />
|
||||
<ClCompile Include="src\list_box.cpp" />
|
||||
<ClCompile Include="src\slide_group.cpp" />
|
||||
<ClCompile Include="src\spinbox.cpp" />
|
||||
<ClCompile Include="src\table.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,131 +1,128 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\core_include">
|
||||
<UniqueIdentifier>{ee075da6-cdde-4d0a-8c3e-4f969486d78a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\gui_include">
|
||||
<UniqueIdentifier>{545b674c-c3e9-476a-b488-f4b0cb591cfc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="gui_include\button.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\dialog.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\edit.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\font.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\gesture.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\keyboard.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\label.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\list_box.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\shape_resource.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\spinbox.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\table.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\slide_group.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\surface.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\wave_buffer.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\wave_ctrl.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\wnd.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\word.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\api.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\audio.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\bitmap.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\cmd_target.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\display.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\msg.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\rect.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\resource_type.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\button.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dialog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\gesture.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\label.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\shape_resource.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\spinbox.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\table.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\edit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\keyboard.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\list_box.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\slide_group.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\core_include">
|
||||
<UniqueIdentifier>{ee075da6-cdde-4d0a-8c3e-4f969486d78a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\gui_include">
|
||||
<UniqueIdentifier>{545b674c-c3e9-476a-b488-f4b0cb591cfc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="gui_include\button.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\dialog.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\edit.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\gesture.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\keyboard.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\label.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\list_box.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\spinbox.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\table.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\slide_group.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\surface.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\wave_buffer.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\wave_ctrl.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\wnd.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\word.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\api.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\audio.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\bitmap.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\cmd_target.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\display.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\msg.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\rect.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\core\core_include\resource_type.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gui_include\my_resource.h">
|
||||
<Filter>Header Files\gui_include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\button.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dialog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\gesture.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\label.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\spinbox.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\table.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\edit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\keyboard.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\list_box.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\slide_group.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\my_resource.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
|
@ -2,15 +2,20 @@
|
|||
#define _BUTTON_H_
|
||||
|
||||
#define GLT_BN_CLICKED 0x1111
|
||||
|
||||
#define ON_GLT_BN_CLICKED(ctrlId, func) \
|
||||
{MSG_TYPE_WND, GLT_BN_CLICKED, (c_cmd_target*)ctrlId, MSG_CALLBACK_VWV, (MsgFuncVV)(static_cast<void (c_cmd_target::*)(unsigned int)>(&func))},
|
||||
|
||||
typedef struct struct_bitmap_info BITMAP_INFO;
|
||||
class c_button : public c_wnd
|
||||
{
|
||||
public:
|
||||
virtual const char* get_class_name() const {return "c_button";}
|
||||
virtual c_wnd* clone(){return new c_button();}
|
||||
|
||||
void set_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_normal = pBitmap; }
|
||||
void set_focus_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_focus = pBitmap; }
|
||||
void set_pushed_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_pushed = pBitmap; }
|
||||
void set_disable_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_disable = pBitmap; }
|
||||
protected:
|
||||
virtual void on_paint();
|
||||
virtual void on_focus();
|
||||
|
@ -18,7 +23,11 @@ protected:
|
|||
virtual void on_touch_down(int x, int y);
|
||||
virtual void on_touch_up(int x, int y);
|
||||
virtual void pre_create_wnd();
|
||||
private:
|
||||
|
||||
const BITMAP_INFO* m_bitmap_normal;
|
||||
const BITMAP_INFO* m_bitmap_focus;
|
||||
const BITMAP_INFO* m_bitmap_pushed;
|
||||
const BITMAP_INFO* m_bitmap_disable;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
#ifndef _FONT_H_
|
||||
#define _FONT_H_
|
||||
|
||||
#define FONT_ENG_S font_language_s
|
||||
#define FONT_ENG_SB font_language_sb
|
||||
#define FONT_ENG_SBM font_language_sbm
|
||||
#define FONT_ENG_SMB font_language_smb
|
||||
#define FONT_ENG_SMB_AA font_language_smb_aa
|
||||
#define FONT_ENG_MB_AA font_language_mb_aa
|
||||
#define FONT_ENG_MMB_AA font_language_mmb_aa
|
||||
#define FONT_ENG_MB font_language_mb
|
||||
#define FONT_ENG_LLB font_language_llb
|
||||
#define FONT_ENG_LLLB font_language_lllb
|
||||
#define FONT_ENG_LLLLB font_language_llllb
|
||||
|
||||
const GUI_FONT * font_language_s();
|
||||
const GUI_FONT * font_language_sb();
|
||||
const GUI_FONT * font_language_sbm();
|
||||
const GUI_FONT * font_language_smb();
|
||||
const GUI_FONT * font_language_smb_aa();
|
||||
const GUI_FONT * font_language_mb_aa();
|
||||
const GUI_FONT * font_language_mmb_aa();
|
||||
const GUI_FONT * font_language_mb();
|
||||
const GUI_FONT * font_language_llb();
|
||||
const GUI_FONT * font_language_lllb();
|
||||
const GUI_FONT * font_language_llllb();
|
||||
|
||||
#endif
|
|
@ -27,7 +27,7 @@ typedef enum
|
|||
class c_keyboard: public c_wnd
|
||||
{
|
||||
public:
|
||||
virtual int create(c_wnd *parent, unsigned short resource_id, unsigned short str_id,
|
||||
virtual int create(c_wnd *parent, unsigned short resource_id, char* str,
|
||||
short x, short y, short width, short height, WND_TREE* p_child_tree = NULL);
|
||||
KEYBOARD_STATUS get_cap_status(){return m_cap_status;}
|
||||
void set_style(KEYBOARD_STYLE style) { m_style = style; }
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
class c_list_box : public c_wnd
|
||||
{
|
||||
public:
|
||||
int add_item(unsigned short str_id);
|
||||
int add_item(char* str);
|
||||
void clear_item();
|
||||
short get_item_count() { return m_item_total; }
|
||||
void select_item(short index);
|
||||
|
@ -40,7 +40,7 @@ private:
|
|||
|
||||
short m_selected_item;
|
||||
short m_item_total;
|
||||
unsigned short m_item_array[MAX_ITEM_NUM];
|
||||
char* m_item_array[MAX_ITEM_NUM];
|
||||
c_rect m_list_wnd_rect; //rect relative to parent wnd.
|
||||
c_rect m_list_screen_rect; //rect relative to physical screen(frame buffer)
|
||||
};
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
#ifndef _MY_RESOURCE_H_
|
||||
#define _MY_RESOURCE_H_
|
||||
|
||||
typedef struct struct_font_info FONT_INFO;
|
||||
typedef struct struct_color_rect COLOR_RECT;
|
||||
typedef struct struct_bitmap_info BITMAP_INFO;
|
||||
|
||||
//Redefine them to meet your need.
|
||||
#define DEFAULT_NORMAL_COLOR GLT_RGB(211, 211, 211)
|
||||
#define DEFAULT_FOCUS_COLOR GLT_RGB(188, 185, 182)
|
||||
#define DEFAULT_PUSH_COLOR GLT_RGB(165, 162, 159)
|
||||
#define DEFAULT_FONT_COLOR GLT_RGB(0, 0, 0)
|
||||
|
||||
enum FONT_TYPE
|
||||
{
|
||||
FONT_ENG_S,
|
||||
FONT_ENG_SB,
|
||||
FONT_ENG_SBM,
|
||||
FONT_ENG_SMB,
|
||||
FONT_ENG_SMB_AA,
|
||||
FONT_ENG_MB_AA,
|
||||
FONT_ENG_MMB_AA,
|
||||
FONT_ENG_MB,
|
||||
FONT_ENG_LLB,
|
||||
FONT_ENG_LLLB,
|
||||
FONT_ENG_LLLLB,
|
||||
|
||||
FONT_MAX
|
||||
};
|
||||
|
||||
enum BITMAP_TYPE
|
||||
{
|
||||
BITMAP_UP_BT_NORMAL,
|
||||
BITMAP_UP_BT_FOCUS,
|
||||
BITMAP_DOWN_BT_NORMAL,
|
||||
BITMAP_DOWN_BT_FOCUS,
|
||||
|
||||
BITMAP_MAX
|
||||
};
|
||||
|
||||
enum SHAPE_TYPE
|
||||
{
|
||||
BUTTON_NORMAL,
|
||||
BUTTON_FOCUS,
|
||||
BUTTON_PUSH,
|
||||
|
||||
LIST_BOX_SELECT,
|
||||
LIST_BOX_PUSH,
|
||||
LIST_BOX_EXTEND,
|
||||
|
||||
KEY_BUTTON_NORMAL,
|
||||
KEY_BUTTON_PUSH,
|
||||
|
||||
SHAPE_MAX
|
||||
};
|
||||
|
||||
enum COLOR_TYPE
|
||||
{
|
||||
CTRL_BACK_GROUND,
|
||||
CTRL_FORE_GROUND,
|
||||
|
||||
COLOR_MAX
|
||||
};
|
||||
|
||||
class c_my_resource
|
||||
{
|
||||
public:
|
||||
static int add_font(FONT_TYPE index, const FONT_INFO* font);
|
||||
static const FONT_INFO* get_font(FONT_TYPE index);
|
||||
|
||||
static int add_bitmap(BITMAP_TYPE index, const BITMAP_INFO* bmp);
|
||||
static const BITMAP_INFO* get_bmp(BITMAP_TYPE index);
|
||||
|
||||
static int add_shape(SHAPE_TYPE index, const COLOR_RECT* shape);
|
||||
static const COLOR_RECT* get_shape(SHAPE_TYPE index);
|
||||
|
||||
static int add_color(COLOR_TYPE index, const unsigned int color);
|
||||
static const unsigned int get_color(COLOR_TYPE index);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef _SHAPE_RESOURCE_H_
|
||||
#define _SHAPE_RESOURCE_H_
|
||||
|
||||
extern const CUSTOM_SHAPE g_shape_btn_focus[];
|
||||
extern const CUSTOM_SHAPE g_shape_btn_normal[];
|
||||
extern const CUSTOM_SHAPE g_shape_btn_push[];
|
||||
extern const CUSTOM_SHAPE g_shape_btn_disable[];
|
||||
|
||||
extern const CUSTOM_SHAPE g_shape_listbox_select[];
|
||||
extern const CUSTOM_SHAPE g_shape_listbox_push[];
|
||||
extern const CUSTOM_SHAPE g_shape_listbox_push_top[];
|
||||
extern const CUSTOM_SHAPE g_shape_listbox_extend[];
|
||||
|
||||
extern const CUSTOM_SHAPE g_shape_keyboard_btn_normal[];
|
||||
extern const CUSTOM_SHAPE g_shape_keyboard_btn_push[];
|
||||
|
||||
#endif
|
|
@ -58,10 +58,10 @@ protected:
|
|||
short m_min;
|
||||
short m_digit;
|
||||
|
||||
c_button m_bt_arrow_up;
|
||||
c_button m_bt_arrow_down;
|
||||
c_rect m_bt_arrow_up_rect;
|
||||
c_rect m_bt_arrow_down_rect;
|
||||
c_button m_bt_up;
|
||||
c_button m_bt_down;
|
||||
c_rect m_bt_up_rect;
|
||||
c_rect m_bt_down_rect;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -17,7 +17,6 @@ public:
|
|||
int set_col_width(unsigned int index, unsigned int width);
|
||||
|
||||
int set_item(int row, int col, char* str, unsigned int with_bg_color = -1);
|
||||
int set_item(int row, int col, unsigned int str_id, unsigned int with_bg_color = -1);
|
||||
|
||||
unsigned int get_row_num(){ return m_row_num;}
|
||||
unsigned int get_col_num(){ return m_col_num;}
|
||||
|
@ -26,7 +25,6 @@ protected:
|
|||
virtual void pre_create_wnd();
|
||||
|
||||
void draw_item(int col, int row, const char* str, unsigned int with_bg_color = -1);
|
||||
void draw_item(int col, int row, unsigned int str_id, unsigned int with_bg_color = -1);
|
||||
|
||||
unsigned int m_align_type;
|
||||
unsigned int m_row_num;
|
||||
|
|
|
@ -2,21 +2,20 @@
|
|||
#include "core_include/rect.h"
|
||||
#include "core_include/cmd_target.h"
|
||||
#include "core_include/wnd.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/bitmap.h"
|
||||
#include "core_include/word.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "../gui_include/font.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/button.h"
|
||||
#include "../gui_include/dialog.h"
|
||||
#include "../gui_include/shape_resource.h"
|
||||
|
||||
void c_button::pre_create_wnd()
|
||||
{
|
||||
m_style |= GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER;
|
||||
m_font_type = FONT_ENG_SMB_AA();
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
m_bg_color = GLT_RGB(36,36,36);
|
||||
m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA);
|
||||
m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND);
|
||||
m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND);
|
||||
}
|
||||
|
||||
void c_button::on_focus()
|
||||
|
@ -56,16 +55,15 @@ void c_button::on_paint()
|
|||
|
||||
switch(m_status)
|
||||
{
|
||||
case STATUS_PUSHED:
|
||||
if (m_bitmap_pushed)
|
||||
case STATUS_NORMAL:
|
||||
if (m_bitmap_normal)
|
||||
{
|
||||
c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_pushed, rect, m_style);
|
||||
c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_normal, rect, m_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_push);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL));
|
||||
}
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
break;
|
||||
case STATUS_FOCUSED:
|
||||
if (m_bitmap_focus)
|
||||
|
@ -74,39 +72,26 @@ void c_button::on_paint()
|
|||
}
|
||||
else
|
||||
{
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS));
|
||||
}
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
break;
|
||||
case STATUS_NORMAL:
|
||||
if (m_bitmap)
|
||||
case STATUS_PUSHED:
|
||||
if (m_bitmap_pushed)
|
||||
{
|
||||
c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap, rect, m_style);
|
||||
c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_pushed, rect, m_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_PUSH));
|
||||
}
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
break;
|
||||
case STATUS_DISABLED:
|
||||
if (m_bitmap_disable)
|
||||
{
|
||||
c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_disable, rect, m_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_disable);
|
||||
}
|
||||
m_font_color = GLT_RGB(70,73,76);
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_str_id)
|
||||
if (m_str)
|
||||
{
|
||||
c_word::draw_string_in_rect(m_surface, m_z_order, m_str_id, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style);
|
||||
c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
#include "core_include/wnd.h"
|
||||
#include "core_include/msg.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/bitmap.h"
|
||||
#include "core_include/word.h"
|
||||
#include "../gui_include/button.h"
|
||||
#include "../gui_include/font.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/dialog.h"
|
||||
#include "../gui_include/shape_resource.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -40,9 +39,9 @@ void c_dialog::on_paint()
|
|||
}
|
||||
}
|
||||
|
||||
if (m_str_id)
|
||||
if (m_str)
|
||||
{
|
||||
c_word::draw_string(m_surface, m_z_order, m_str_id, rect.m_left+35, rect.m_top, FONT_ENG_MB_AA(), GLT_RGB(255, 255, 255), COLOR_TRANPARENT, ALIGN_LEFT);
|
||||
c_word::draw_string(m_surface, m_z_order, m_str, rect.m_left+35, rect.m_top, c_my_resource::get_font(FONT_ENG_MB_AA), GLT_RGB(255, 255, 255), COLOR_TRANPARENT, ALIGN_LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,14 +2,13 @@
|
|||
#include "core_include/rect.h"
|
||||
#include "core_include/cmd_target.h"
|
||||
#include "core_include/wnd.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/word.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "../gui_include/button.h"
|
||||
#include "../gui_include/label.h"
|
||||
#include "../gui_include/edit.h"
|
||||
#include "../gui_include/shape_resource.h"
|
||||
#include "../gui_include/font.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/dialog.h"
|
||||
#include "../gui_include/keyboard.h"
|
||||
#include <string.h>
|
||||
|
@ -27,9 +26,9 @@ static c_keyboard s_keyboard;
|
|||
void c_edit::pre_create_wnd()
|
||||
{
|
||||
m_style |= GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER | KEY_BOARD_STYLE;
|
||||
m_font_type = FONT_ENG_SMB_AA();
|
||||
m_font_color = GLT_RGB(33,41,57);
|
||||
m_bg_color = GLT_RGB(2,124,165);
|
||||
m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA);
|
||||
m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND);
|
||||
m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND);
|
||||
|
||||
memset(m_str_input, 0, sizeof(m_str_input));
|
||||
memset(m_str, 0, sizeof(m_str));
|
||||
|
@ -114,14 +113,14 @@ void c_edit::on_paint()
|
|||
empty_rect.Empty();
|
||||
switch(m_status)
|
||||
{
|
||||
case STATUS_PUSHED:
|
||||
if (m_z_order == m_parent->get_z_order())
|
||||
case STATUS_NORMAL:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
{
|
||||
m_z_order++;
|
||||
show_keyboard();
|
||||
s_keyboard.disconnect();
|
||||
m_surface->set_frame_layer(empty_rect, s_keyboard.get_z_order());
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
m_surface->draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_listbox_select, m_parent->get_z_order());
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL));
|
||||
break;
|
||||
case STATUS_FOCUSED:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
|
@ -130,18 +129,15 @@ void c_edit::on_paint()
|
|||
m_surface->set_frame_layer(empty_rect, s_keyboard.get_z_order());
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus);
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS));
|
||||
break;
|
||||
case STATUS_NORMAL:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
case STATUS_PUSHED:
|
||||
if (m_z_order == m_parent->get_z_order())
|
||||
{
|
||||
s_keyboard.disconnect();
|
||||
m_surface->set_frame_layer(empty_rect, s_keyboard.get_z_order());
|
||||
m_z_order = m_parent->get_z_order();
|
||||
m_z_order++;
|
||||
show_keyboard();
|
||||
}
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal);
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
m_surface->fill_rect_ex(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_bg_color, c_my_resource::get_shape(LIST_BOX_SELECT), m_parent->get_z_order());
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include "core_include/api.h"
|
||||
#include "core_include/rect.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/word.h"
|
||||
#include "core_include/cmd_target.h"
|
||||
#include "core_include/wnd.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "../gui_include/button.h"
|
||||
#include "../gui_include/shape_resource.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/keyboard.h"
|
||||
#include <string.h>
|
||||
|
||||
|
@ -145,16 +145,16 @@ ON_GLT_BN_CLICKED('\n', c_keyboard::on_enter_clicked)
|
|||
ON_GLT_BN_CLICKED(0x1B, c_keyboard::on_esc_clicked)
|
||||
GLT_END_MESSAGE_MAP()
|
||||
|
||||
int c_keyboard::create(c_wnd *parent, unsigned short resource_id, unsigned short str_id,
|
||||
int c_keyboard::create(c_wnd *parent, unsigned short resource_id, char* str,
|
||||
short x, short y, short width, short height, WND_TREE* p_child_tree)
|
||||
{
|
||||
if (m_style == STYLE_ALL_BOARD)
|
||||
{
|
||||
return c_wnd::connect(parent, resource_id, str_id, (0 - x), (height - y - KEYBOARD_HEIGHT), KEYBOARD_WIDTH, KEYBOARD_HEIGHT, g_key_board_children);
|
||||
return c_wnd::connect(parent, resource_id, str, (0 - x), (height - y - KEYBOARD_HEIGHT), KEYBOARD_WIDTH, KEYBOARD_HEIGHT, g_key_board_children);
|
||||
}
|
||||
else if(m_style == STYLE_NUM_BOARD)
|
||||
{
|
||||
return c_wnd::connect(parent, resource_id, str_id, x, y, NUM_BOARD_WIDTH, NUM_BOARD_HEIGHT, g_number_board_children);
|
||||
return c_wnd::connect(parent, resource_id, str, x, y, NUM_BOARD_WIDTH, NUM_BOARD_HEIGHT, g_number_board_children);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -230,14 +230,14 @@ void c_keyboard_button::on_paint()
|
|||
get_screen_rect(rect);
|
||||
switch(m_status)
|
||||
{
|
||||
case STATUS_PUSHED:
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_keyboard_btn_push);
|
||||
case STATUS_NORMAL:
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(KEY_BUTTON_NORMAL));
|
||||
break;
|
||||
case STATUS_FOCUSED:
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS));
|
||||
break;
|
||||
case STATUS_NORMAL:
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_keyboard_btn_normal);
|
||||
case STATUS_PUSHED:
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(KEY_BUTTON_PUSH));
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
#include "core_include/cmd_target.h"
|
||||
#include "core_include/wnd.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/bitmap.h"
|
||||
#include "core_include/word.h"
|
||||
#include "../gui_include/font.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/label.h"
|
||||
|
||||
void c_label::pre_create_wnd()
|
||||
|
@ -14,7 +14,7 @@ void c_label::pre_create_wnd()
|
|||
m_style = GLT_ATTR_VISIBLE | ALIGN_LEFT | ALIGN_VCENTER;
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
|
||||
m_font_type = FONT_ENG_SMB_AA();
|
||||
m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA);
|
||||
m_bg_color = get_parent()->get_bg_color();
|
||||
}
|
||||
|
||||
|
@ -23,15 +23,9 @@ void c_label::on_paint()
|
|||
c_rect rect;
|
||||
get_screen_rect(rect);
|
||||
|
||||
if (m_bitmap)
|
||||
if (m_str)
|
||||
{
|
||||
fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom,m_bg_color);
|
||||
c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap, rect, m_style);
|
||||
}
|
||||
|
||||
if (m_str_id)
|
||||
{
|
||||
fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom,m_bg_color);
|
||||
c_word::draw_string_in_rect(m_surface, m_z_order, m_str_id, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style);
|
||||
c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
#include "core_include/api.h"
|
||||
#include "core_include/rect.h"
|
||||
#include "core_include/cmd_target.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/wnd.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "core_include/bitmap.h"
|
||||
#include "core_include/word.h"
|
||||
|
||||
#include "../gui_include/button.h"
|
||||
#include "../gui_include/font.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/dialog.h"
|
||||
#include "../gui_include/list_box.h"
|
||||
#include "../gui_include/shape_resource.h"
|
||||
#include <string.h>
|
||||
|
||||
#define ITEM_HEIGHT 45
|
||||
|
@ -21,15 +20,16 @@ void c_list_box::pre_create_wnd()
|
|||
m_style |= GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER;
|
||||
memset(m_item_array, 0, sizeof(m_item_array));
|
||||
m_item_total = 0;
|
||||
m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND);
|
||||
}
|
||||
|
||||
void c_list_box::on_init_children()
|
||||
{
|
||||
m_item_total = 0;
|
||||
m_selected_item = 0;
|
||||
m_font_type = FONT_ENG_SMB_AA();
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
m_bg_color = GLT_RGB(33,41,57);
|
||||
m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA);
|
||||
m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND);
|
||||
m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND);
|
||||
}
|
||||
|
||||
void c_list_box::on_focus()
|
||||
|
@ -52,10 +52,25 @@ void c_list_box::on_paint()
|
|||
|
||||
switch(m_status)
|
||||
{
|
||||
case STATUS_NORMAL:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
{
|
||||
m_surface->set_frame_layer(empty_rect, m_z_order);
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL));
|
||||
break;
|
||||
case STATUS_FOCUSED:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
{
|
||||
m_surface->set_frame_layer(empty_rect, m_z_order);
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS));
|
||||
break;
|
||||
case STATUS_PUSHED:
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_listbox_push);
|
||||
m_font_color = GLT_RGB(2,124,165);
|
||||
c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], rect, m_font_type, m_font_color, COLOR_TRANPARENT, ALIGN_HCENTER | ALIGN_VCENTER);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(LIST_BOX_PUSH));
|
||||
c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], rect, m_font_type, GLT_RGB(2, 124, 165), COLOR_TRANPARENT, ALIGN_HCENTER | ALIGN_VCENTER);
|
||||
//draw list
|
||||
if (m_item_total > 0)
|
||||
{
|
||||
|
@ -68,35 +83,6 @@ void c_list_box::on_paint()
|
|||
return;
|
||||
}
|
||||
break;
|
||||
case STATUS_FOCUSED:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
{
|
||||
m_surface->set_frame_layer(empty_rect, m_z_order);
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus);
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
break;
|
||||
case STATUS_NORMAL:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
{
|
||||
m_surface->set_frame_layer(empty_rect, m_z_order);
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal);
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
break;
|
||||
case STATUS_DISABLED:
|
||||
if (m_bitmap_disable)
|
||||
{
|
||||
c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_disable, rect, m_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_disable);
|
||||
}
|
||||
m_font_color = GLT_RGB(70,73,76);
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
break;
|
||||
|
@ -175,7 +161,7 @@ void c_list_box::update_list_size()
|
|||
|
||||
void c_list_box::show_list()
|
||||
{
|
||||
draw_custom_shape(m_list_screen_rect.m_left, m_list_screen_rect.m_top, m_list_screen_rect.m_right, m_list_screen_rect.m_bottom, m_bg_color, g_shape_listbox_extend);
|
||||
fill_rect_ex(m_list_screen_rect, m_bg_color, c_my_resource::get_shape(LIST_BOX_EXTEND));
|
||||
|
||||
m_font_color = GLT_RGB(255, 255, 255);
|
||||
//draw all items
|
||||
|
@ -195,20 +181,20 @@ void c_list_box::show_list()
|
|||
tmp_rect.m_top = m_list_screen_rect.m_top + m_selected_item * ITEM_HEIGHT;
|
||||
tmp_rect.m_bottom = tmp_rect.m_top + ITEM_HEIGHT;
|
||||
|
||||
draw_custom_shape(tmp_rect.m_left, tmp_rect.m_top, tmp_rect.m_right, tmp_rect.m_bottom, GLT_RGB(0, 255, 0), g_shape_listbox_select);
|
||||
fill_rect_ex(tmp_rect, GLT_RGB(0, 255, 0), c_my_resource::get_shape(LIST_BOX_SELECT));
|
||||
|
||||
m_font_color = GLT_RGB(255, 255, 255);
|
||||
c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], tmp_rect, m_font_type, m_font_color, COLOR_TRANPARENT, ALIGN_HCENTER | ALIGN_VCENTER);
|
||||
}
|
||||
|
||||
int c_list_box::add_item(unsigned short str_id)
|
||||
int c_list_box::add_item(char* str)
|
||||
{
|
||||
if (m_item_total >= MAX_ITEM_NUM)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return -1;
|
||||
}
|
||||
m_item_array[m_item_total++] = str_id;
|
||||
m_item_array[m_item_total++] = str;
|
||||
update_list_size();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
#include "core_include/rect.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
|
||||
static const FONT_INFO* s_font_map[FONT_MAX];
|
||||
static const BITMAP_INFO* s_bmp_map[BITMAP_MAX];
|
||||
static const COLOR_RECT* s_shape_map[SHAPE_MAX];
|
||||
static unsigned int s_color_map[COLOR_MAX];
|
||||
|
||||
int c_my_resource::add_font(FONT_TYPE index, const FONT_INFO* font)
|
||||
{
|
||||
s_font_map[index] = font;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const FONT_INFO* c_my_resource::get_font(FONT_TYPE index)
|
||||
{
|
||||
return s_font_map[index];
|
||||
}
|
||||
|
||||
int c_my_resource::add_bitmap(BITMAP_TYPE index, const BITMAP_INFO* bmp)
|
||||
{
|
||||
s_bmp_map[index] = bmp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const BITMAP_INFO* c_my_resource::get_bmp(BITMAP_TYPE index)
|
||||
{
|
||||
return s_bmp_map[index];
|
||||
}
|
||||
|
||||
int c_my_resource::add_shape(SHAPE_TYPE index, const COLOR_RECT* shape)
|
||||
{
|
||||
s_shape_map[index] = shape;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const COLOR_RECT* c_my_resource::get_shape(SHAPE_TYPE index)
|
||||
{
|
||||
return s_shape_map[index];
|
||||
}
|
||||
|
||||
int c_my_resource::add_color(COLOR_TYPE index, const unsigned int color)
|
||||
{
|
||||
s_color_map[index] = color;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const unsigned int c_my_resource::get_color(COLOR_TYPE index)
|
||||
{
|
||||
return s_color_map[index];
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -2,13 +2,12 @@
|
|||
#include "core_include/rect.h"
|
||||
#include "core_include/cmd_target.h"
|
||||
#include "core_include/wnd.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/word.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "../gui_include/button.h"
|
||||
#include "../gui_include/font.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/spinbox.h"
|
||||
#include "../gui_include/shape_resource.h"
|
||||
|
||||
#define ARROW_BT_HEIGHT 55
|
||||
#define ID_BT_ARROW_UP 1
|
||||
|
@ -22,9 +21,9 @@ GLT_END_MESSAGE_MAP()
|
|||
void c_spin_box::pre_create_wnd()
|
||||
{
|
||||
m_style = GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER;
|
||||
m_font_type = FONT_ENG_SMB_AA();
|
||||
m_font_color = GLT_RGB(33,41,57);
|
||||
m_bg_color = GLT_RGB(255,255,255);
|
||||
m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA);
|
||||
m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND);
|
||||
m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND);
|
||||
|
||||
m_max = 6;
|
||||
m_min = 1;
|
||||
|
@ -35,22 +34,22 @@ void c_spin_box::pre_create_wnd()
|
|||
c_rect rect;
|
||||
get_screen_rect(rect);
|
||||
|
||||
m_bt_arrow_up_rect.m_left = rect.m_left;
|
||||
m_bt_arrow_up_rect.m_right = rect.m_left + rect.Width() / 2 - 1;
|
||||
m_bt_arrow_up_rect.m_top = rect.m_bottom + 1;
|
||||
m_bt_arrow_up_rect.m_bottom = m_bt_arrow_up_rect.m_top + ARROW_BT_HEIGHT;
|
||||
m_bt_up_rect.m_left = rect.m_left;
|
||||
m_bt_up_rect.m_right = rect.m_left + rect.Width() / 2 - 1;
|
||||
m_bt_up_rect.m_top = rect.m_bottom + 1;
|
||||
m_bt_up_rect.m_bottom = m_bt_up_rect.m_top + ARROW_BT_HEIGHT;
|
||||
|
||||
m_bt_arrow_down_rect.m_left = rect.m_left + rect.Width() / 2;
|
||||
m_bt_arrow_down_rect.m_right = rect.m_right;
|
||||
m_bt_arrow_down_rect.m_top = rect.m_bottom + 1;
|
||||
m_bt_arrow_down_rect.m_bottom = m_bt_arrow_down_rect.m_top + ARROW_BT_HEIGHT;
|
||||
m_bt_down_rect.m_left = rect.m_left + rect.Width() / 2;
|
||||
m_bt_down_rect.m_right = rect.m_right;
|
||||
m_bt_down_rect.m_top = rect.m_bottom + 1;
|
||||
m_bt_down_rect.m_bottom = m_bt_down_rect.m_top + ARROW_BT_HEIGHT;
|
||||
}
|
||||
|
||||
void c_spin_box::on_touch_down(int x, int y)
|
||||
{
|
||||
c_rect arrow_rect = m_wnd_rect;
|
||||
arrow_rect.m_right = m_bt_arrow_down_rect.m_right;
|
||||
arrow_rect.m_bottom = m_bt_arrow_down_rect.m_bottom;
|
||||
arrow_rect.m_right = m_bt_down_rect.m_right;
|
||||
arrow_rect.m_bottom = m_bt_down_rect.m_bottom;
|
||||
|
||||
if ( TRUE == m_wnd_rect.PtInRect(x, y) )
|
||||
{//click spin box
|
||||
|
@ -120,30 +119,25 @@ void c_spin_box::on_kill_focus()
|
|||
|
||||
void c_spin_box::show_arrow_button()
|
||||
{
|
||||
extern const GUI_BITMAP bmspin_up_button_normal;
|
||||
extern const GUI_BITMAP bmspin_up_button_focus;
|
||||
extern const GUI_BITMAP bmspin_down_button_normal;
|
||||
extern const GUI_BITMAP bmspin_down_button_focus;
|
||||
|
||||
fill_rect(m_bt_arrow_up_rect.m_left, m_bt_arrow_up_rect.m_top, m_bt_arrow_down_rect.m_right, m_bt_arrow_down_rect.m_bottom, GLT_RGB(99,108,124));
|
||||
fill_rect(m_bt_up_rect.m_left, m_bt_up_rect.m_top, m_bt_down_rect.m_right, m_bt_down_rect.m_bottom, GLT_RGB(99,108,124));
|
||||
|
||||
m_bt_arrow_up.connect(this, ID_BT_ARROW_UP, 0, 0, m_wnd_rect.Height(), m_bt_arrow_up_rect.Width(),m_bt_arrow_up_rect.Height());
|
||||
m_bt_arrow_up.set_bitmap(&bmspin_up_button_normal);
|
||||
m_bt_arrow_up.set_focus_bitmap(&bmspin_up_button_focus);
|
||||
m_bt_arrow_up.set_pushed_bitmap(&bmspin_up_button_focus);
|
||||
m_bt_arrow_up.show_window();
|
||||
m_bt_up.connect(this, ID_BT_ARROW_UP, 0, 0, m_wnd_rect.Height(), m_bt_up_rect.Width(),m_bt_up_rect.Height());
|
||||
m_bt_up.set_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_NORMAL));
|
||||
m_bt_up.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_FOCUS));
|
||||
m_bt_up.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_FOCUS));
|
||||
m_bt_up.show_window();
|
||||
|
||||
m_bt_arrow_down.connect(this, ID_BT_ARROW_DOWN, 0, m_bt_arrow_up_rect.Width(), m_wnd_rect.Height(), m_bt_arrow_down_rect.Width(),m_bt_arrow_down_rect.Height());
|
||||
m_bt_arrow_down.set_bitmap(&bmspin_down_button_normal);
|
||||
m_bt_arrow_down.set_focus_bitmap(&bmspin_down_button_focus);
|
||||
m_bt_arrow_down.set_pushed_bitmap(&bmspin_down_button_focus);
|
||||
m_bt_arrow_down.show_window();
|
||||
m_bt_down.connect(this, ID_BT_ARROW_DOWN, 0, m_bt_up_rect.Width(), m_wnd_rect.Height(), m_bt_down_rect.Width(),m_bt_down_rect.Height());
|
||||
m_bt_down.set_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_NORMAL));
|
||||
m_bt_down.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_FOCUS));
|
||||
m_bt_down.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_FOCUS));
|
||||
m_bt_down.show_window();
|
||||
}
|
||||
|
||||
void c_spin_box::hide_arrow_button()
|
||||
{
|
||||
m_bt_arrow_up.disconnect();
|
||||
m_bt_arrow_down.disconnect();
|
||||
m_bt_up.disconnect();
|
||||
m_bt_down.disconnect();
|
||||
}
|
||||
|
||||
void c_spin_box::on_paint()
|
||||
|
@ -155,18 +149,15 @@ void c_spin_box::on_paint()
|
|||
|
||||
switch(m_status)
|
||||
{
|
||||
case STATUS_PUSHED:
|
||||
if (m_z_order == m_parent->get_z_order())
|
||||
case STATUS_NORMAL:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
{
|
||||
m_z_order++;
|
||||
hide_arrow_button();
|
||||
tmp_rect.Empty();
|
||||
m_surface->set_frame_layer(tmp_rect, m_z_order);
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
tmp_rect.m_top = m_bt_arrow_down_rect.m_top;
|
||||
tmp_rect.m_bottom = m_bt_arrow_down_rect.m_bottom;
|
||||
m_surface->set_frame_layer(tmp_rect, m_z_order);
|
||||
show_arrow_button();
|
||||
|
||||
m_surface->draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_listbox_push,m_parent->get_z_order());
|
||||
m_font_color = GLT_RGB(2,124,165);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL));
|
||||
break;
|
||||
case STATUS_FOCUSED:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
|
@ -176,21 +167,21 @@ void c_spin_box::on_paint()
|
|||
m_surface->set_frame_layer(tmp_rect, m_z_order);
|
||||
m_z_order = m_parent->get_z_order();
|
||||
}
|
||||
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus);
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS));
|
||||
break;
|
||||
case STATUS_NORMAL:
|
||||
if (m_z_order > m_parent->get_z_order())
|
||||
case STATUS_PUSHED:
|
||||
if (m_z_order == m_parent->get_z_order())
|
||||
{
|
||||
hide_arrow_button();
|
||||
tmp_rect.Empty();
|
||||
m_surface->set_frame_layer(tmp_rect, m_z_order);
|
||||
m_z_order = m_parent->get_z_order();
|
||||
m_z_order++;
|
||||
}
|
||||
tmp_rect.m_top = m_bt_down_rect.m_top;
|
||||
tmp_rect.m_bottom = m_bt_down_rect.m_bottom;
|
||||
m_surface->set_frame_layer(tmp_rect, m_z_order);
|
||||
show_arrow_button();
|
||||
|
||||
draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal);
|
||||
m_font_color = GLT_RGB(255,255,255);
|
||||
m_surface->fill_rect_ex(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_bg_color, c_my_resource::get_shape(LIST_BOX_PUSH),m_parent->get_z_order());
|
||||
c_word::draw_value_in_rect(m_surface, m_parent->get_z_order(), m_cur_value, m_digit, rect, m_font_type, GLT_RGB(2, 124, 165), COLOR_TRANPARENT, m_style);
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "core_include/api.h"
|
||||
#include "core_include/resource_type.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/rect.h"
|
||||
#include "core_include/word.h"
|
||||
#include "core_include/surface.h"
|
||||
#include "core_include/cmd_target.h"
|
||||
#include "core_include/wnd.h"
|
||||
#include "../gui_include/font.h"
|
||||
#include "../gui_include/my_resource.h"
|
||||
#include "../gui_include/table.h"
|
||||
|
||||
|
||||
|
@ -16,13 +16,7 @@ void c_table::pre_create_wnd()
|
|||
|
||||
int c_table::set_item(int row, int col, char* str, unsigned int with_bg_color)
|
||||
{
|
||||
draw_item( row, col,str, with_bg_color);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int c_table::set_item(int row, int col, unsigned int str_id, unsigned int with_bg_color)
|
||||
{
|
||||
draw_item(row, col, str_id, with_bg_color);
|
||||
draw_item( row, col, str, with_bg_color);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -44,11 +38,6 @@ void c_table::draw_item(int row, int col, const char* str, unsigned int with_bg_
|
|||
c_word::draw_string_in_rect(m_surface, m_z_order, str, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_align_type);
|
||||
}
|
||||
|
||||
void c_table::draw_item(int row, int col, unsigned int str_id, unsigned int with_bg_color)
|
||||
{
|
||||
draw_item(row, col, c_word::get_string(str_id), with_bg_color);
|
||||
}
|
||||
|
||||
void c_table::set_row_height(unsigned int height)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_row_num; i ++)
|
||||
|
|
Loading…
Reference in New Issue