mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +01:00
Deleted old MFC files.
This commit is contained in:
parent
8b1bb38fc1
commit
54a0bfe612
50 changed files with 0 additions and 5841 deletions
|
@ -1,317 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E30CACDB-116F-4A85-AC64-0B9987FC9ADB}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>.\Debug/3dsftk.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Debug/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Debug\3dsftk.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug/3dsftk.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeaderOutputFile>.\Release/3dsftk.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Release/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Release\3dsftk.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release/3dsftk.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Source\3dsambm.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsaset.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsbbox.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsbgnd.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dscamm.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dscamr.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dserr.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsfile.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dshier.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsiobj.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dskey.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dslites.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsmatr.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsmatx.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsmobj.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsmset.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsobjm.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsomnm.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsprim.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsrobj.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dssptm.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsstrlf.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsutil.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsvers.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\3dsvprt.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Assert.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Chunk3ds.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Dbase3ds.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Dumpchnk.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Dumpsrc.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Dumpstr.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Kdata3ds.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Kfutils.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Makeswap.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Mdata3ds.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Seekchil.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Smartall.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Strcmpi.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Strdup.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\swapbyte.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Source\Xdata.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Source\3dsambm.h" />
|
||||
<ClInclude Include="Source\3dsaset.h" />
|
||||
<ClInclude Include="Source\3dsbbox.h" />
|
||||
<ClInclude Include="Source\3dsbgnd.h" />
|
||||
<ClInclude Include="Source\3dscamm.h" />
|
||||
<ClInclude Include="Source\3dscamr.h" />
|
||||
<ClInclude Include="Source\3dserr.h" />
|
||||
<ClInclude Include="Source\3dsfile.h" />
|
||||
<ClInclude Include="Source\3dsftkst.h" />
|
||||
<ClInclude Include="Source\3dshier.h" />
|
||||
<ClInclude Include="Source\3dsiobj.h" />
|
||||
<ClInclude Include="Source\3dskey.h" />
|
||||
<ClInclude Include="Source\3dslites.h" />
|
||||
<ClInclude Include="Source\3dsmatr.h" />
|
||||
<ClInclude Include="Source\3dsmatx.h" />
|
||||
<ClInclude Include="Source\3dsmobj.h" />
|
||||
<ClInclude Include="Source\3dsmset.h" />
|
||||
<ClInclude Include="Source\3dsobjm.h" />
|
||||
<ClInclude Include="Source\3dsomnm.h" />
|
||||
<ClInclude Include="Source\3dsprim.h" />
|
||||
<ClInclude Include="Source\3dsrange.h" />
|
||||
<ClInclude Include="Source\3dsrobj.h" />
|
||||
<ClInclude Include="Source\3dssptm.h" />
|
||||
<ClInclude Include="Source\3dsstrlf.h" />
|
||||
<ClInclude Include="Source\3dstype.h" />
|
||||
<ClInclude Include="Source\3dsutil.h" />
|
||||
<ClInclude Include="Source\3dsvers.h" />
|
||||
<ClInclude Include="Source\3dsvprt.h" />
|
||||
<ClInclude Include="Source\Chunk3ds.h" />
|
||||
<ClInclude Include="Source\Chunkinf.h" />
|
||||
<ClInclude Include="Source\Dbase3ds.h" />
|
||||
<ClInclude Include="Source\Dumpchnk.h" />
|
||||
<ClInclude Include="Source\Dumpsrc.h" />
|
||||
<ClInclude Include="Source\Dumpstr.h" />
|
||||
<ClInclude Include="Source\Ftkhead.h" />
|
||||
<ClInclude Include="Source\Ftktail.h" />
|
||||
<ClInclude Include="Source\Kdata3ds.h" />
|
||||
<ClInclude Include="Source\Kfutils.h" />
|
||||
<ClInclude Include="Source\Mdata3ds.h" />
|
||||
<ClInclude Include="Source\Seekchil.h" />
|
||||
<ClInclude Include="Source\Smartall.h" />
|
||||
<ClInclude Include="Source\Strcmpi.h" />
|
||||
<ClInclude Include="Source\Swapbyte.h" />
|
||||
<ClInclude Include="Source\Xdata.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,36 +0,0 @@
|
|||
/* this source was algorythmically generated by makeswap.c */
|
||||
|
||||
#include "3dstype.h"
|
||||
#include "swapbyte.h"
|
||||
void N2ILong3ds(void *native, void *intel){
|
||||
*((unsigned long *)(intel)) = *((unsigned long *)(native));
|
||||
}
|
||||
|
||||
void I2NLong3ds(void *intel, void *native){
|
||||
*((unsigned long *)(native)) = *((unsigned long *)(intel));
|
||||
}
|
||||
|
||||
void N2IShort3ds(void *native, void *intel){
|
||||
*((unsigned short *)(intel)) = *((unsigned short *)(native));
|
||||
}
|
||||
|
||||
void I2NShort3ds(void *intel, void *native){
|
||||
*((unsigned short *)(native)) = *((unsigned short *)(intel));
|
||||
}
|
||||
|
||||
void N2IFloat3ds(void *native, void *intel){
|
||||
*((float *)(intel)) = *((float *)(native));
|
||||
}
|
||||
|
||||
void I2NFloat3ds(void *intel, void *native){
|
||||
*((float *)(native)) = *((float *)(intel));
|
||||
}
|
||||
|
||||
void N2IDouble3ds(void *native, void *intel){
|
||||
*((double *)(intel)) = *((double *)(native));
|
||||
}
|
||||
|
||||
void I2NDouble3ds(void *intel, void *native){
|
||||
*((double *)(native)) = *((double *)(intel));
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "LeoCAD.h"
|
||||
#include "CADDoc.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCADDoc
|
||||
|
||||
IMPLEMENT_DYNCREATE(CCADDoc, CDocument)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCADDoc, CDocument)
|
||||
//{{AFX_MSG_MAP(CCADDoc)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCADDoc construction/destruction
|
||||
|
||||
CCADDoc::CCADDoc()
|
||||
{
|
||||
}
|
||||
|
||||
CCADDoc::~CCADDoc()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCADDoc commands
|
36
win/Caddoc.h
36
win/Caddoc.h
|
@ -1,36 +0,0 @@
|
|||
// CADDoc.h : interface of the CCADDoc class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _CADDOC_H_
|
||||
#define _CADDOC_H_
|
||||
|
||||
class CCADDoc : public CDocument
|
||||
{
|
||||
protected: // create from serialization only
|
||||
CCADDoc();
|
||||
virtual ~CCADDoc();
|
||||
|
||||
DECLARE_DYNCREATE(CCADDoc)
|
||||
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCADDoc)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CCADDoc)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // _CADDOC_H_
|
211
win/Clrpick.cpp
211
win/Clrpick.cpp
|
@ -1,211 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "ClrPopup.h"
|
||||
#include "ClrPick.h"
|
||||
#include "lc_colors.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPicker
|
||||
|
||||
CColorPicker::CColorPicker()
|
||||
{
|
||||
m_bActive = FALSE;
|
||||
m_nColor = -1;
|
||||
SetColorIndex(-1);
|
||||
}
|
||||
|
||||
CColorPicker::~CColorPicker()
|
||||
{
|
||||
}
|
||||
|
||||
IMPLEMENT_DYNCREATE(CColorPicker, CButton)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CColorPicker, CButton)
|
||||
//{{AFX_MSG_MAP(CColorPicker)
|
||||
ON_CONTROL_REFLECT_EX(BN_CLICKED, OnClicked)
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
ON_MESSAGE(CPN_SELENDOK, OnSelEndOK)
|
||||
ON_MESSAGE(CPN_SELENDCANCEL, OnSelEndCancel)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPicker message handlers
|
||||
|
||||
LONG CColorPicker::OnSelEndOK(UINT /*lParam*/, LONG wParam)
|
||||
{
|
||||
m_bActive = FALSE;
|
||||
SetColorIndex(wParam);
|
||||
|
||||
CWnd *pParent = GetParent();
|
||||
if (pParent)
|
||||
pParent->SendMessage(CPN_SELENDOK, wParam, (LPARAM)GetDlgCtrlID());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LONG CColorPicker::OnSelEndCancel(UINT /*lParam*/, LONG wParam)
|
||||
{
|
||||
m_bActive = FALSE;
|
||||
|
||||
CWnd *pParent = GetParent();
|
||||
if (pParent)
|
||||
pParent->SendMessage(CPN_SELENDCANCEL, (WPARAM)wParam, (LPARAM)GetDlgCtrlID());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int CColorPicker::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CButton::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
SetWindowSize(); // resize appropriately
|
||||
return 0;
|
||||
}
|
||||
|
||||
// On mouse click, create and show a CColorPopup window for colour selection
|
||||
BOOL CColorPicker::OnClicked()
|
||||
{
|
||||
if (!IsWindowEnabled())
|
||||
return TRUE;
|
||||
|
||||
m_bActive = TRUE;
|
||||
CRect rect;
|
||||
GetWindowRect(rect);
|
||||
new CColorPopup(CPoint(rect.left, rect.bottom), m_nColor, this, false);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CColorPicker::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
|
||||
{
|
||||
ASSERT(lpDrawItemStruct);
|
||||
|
||||
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
|
||||
CRect rect = lpDrawItemStruct->rcItem;
|
||||
UINT state = lpDrawItemStruct->itemState;
|
||||
DWORD dwStyle = GetStyle();
|
||||
CString m_strText;
|
||||
|
||||
CSize Margins(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));
|
||||
|
||||
// Draw arrow
|
||||
if (m_bActive) state |= ODS_SELECTED;
|
||||
pDC->DrawFrameControl(&m_ArrowRect, DFC_SCROLL, DFCS_SCROLLDOWN |
|
||||
((state & ODS_SELECTED) ? DFCS_PUSHED : 0) |
|
||||
((state & ODS_DISABLED) ? DFCS_INACTIVE : 0));
|
||||
|
||||
pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT);
|
||||
|
||||
// Must reduce the size of the "client" area of the button due to edge thickness.
|
||||
rect.DeflateRect(Margins.cx, Margins.cy);
|
||||
rect.bottom +=1;
|
||||
|
||||
// Fill remaining area with colour
|
||||
rect.right -= m_ArrowRect.Width()-1;
|
||||
|
||||
COLORREF brushColor;
|
||||
if ((state & ODS_DISABLED) || m_nColor == -1)
|
||||
brushColor = ::GetSysColor(COLOR_3DFACE);
|
||||
else
|
||||
{
|
||||
float* Value = gColorList[m_nColor].Value;
|
||||
brushColor = RGB(Value[0] * 255.0f, Value[1] * 255.0f, Value[2] * 255.0f);
|
||||
}
|
||||
|
||||
CBrush brush(brushColor);
|
||||
CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
|
||||
pDC->SelectStockObject(NULL_PEN);
|
||||
pDC->Rectangle(rect);
|
||||
pDC->SelectObject(pOldBrush);
|
||||
|
||||
if (lcIsColorTranslucent(m_nColor))
|
||||
{
|
||||
for (int x = rect.left; x < rect.right; x++)
|
||||
{
|
||||
for (int y = rect.top + x % 4; y < rect.bottom; y += 4)
|
||||
pDC->SetPixel(x, y, RGB(255, 255, 255));
|
||||
|
||||
for (int y = rect.bottom - x % 4; y > rect.top; y -= 4)
|
||||
pDC->SetPixel(x, y, RGB(255, 255, 255));
|
||||
}
|
||||
}
|
||||
|
||||
// Draw focus rect
|
||||
if (state & ODS_FOCUS)
|
||||
{
|
||||
rect.DeflateRect(1, 1);
|
||||
pDC->DrawFocusRect(rect);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPicker overrides
|
||||
|
||||
void CColorPicker::PreSubclassWindow()
|
||||
{
|
||||
ModifyStyle(0, BS_OWNERDRAW); // Make it owner drawn
|
||||
CButton::PreSubclassWindow();
|
||||
SetWindowSize(); // resize appropriately
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPicker attributes
|
||||
|
||||
int CColorPicker::GetColorIndex()
|
||||
{
|
||||
return m_nColor;
|
||||
}
|
||||
|
||||
void CColorPicker::SetColorIndex(int nColor)
|
||||
{
|
||||
if (m_nColor != nColor)
|
||||
{
|
||||
m_nColor = nColor;
|
||||
if (IsWindow(m_hWnd))
|
||||
RedrawWindow();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPicker implementation
|
||||
|
||||
void CColorPicker::SetWindowSize()
|
||||
{
|
||||
// Get size dimensions of edges
|
||||
CSize MarginSize(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));
|
||||
|
||||
// Get size of dropdown arrow
|
||||
int nArrowWidth = max(::GetSystemMetrics(SM_CXHTHUMB), 5*MarginSize.cx);
|
||||
int nArrowHeight = max(::GetSystemMetrics(SM_CYVTHUMB), 5*MarginSize.cy);
|
||||
CSize ArrowSize(max(nArrowWidth, nArrowHeight), max(nArrowWidth, nArrowHeight));
|
||||
|
||||
// Get window size
|
||||
CRect rect;
|
||||
GetWindowRect(rect);
|
||||
|
||||
CWnd* pParent = GetParent();
|
||||
if (pParent)
|
||||
pParent->ScreenToClient(rect);
|
||||
|
||||
// Set window size at least as wide as 2 arrows, and as high as arrow + margins
|
||||
int nWidth = max(rect.Width(), 2*ArrowSize.cx + 2*MarginSize.cx);
|
||||
int nHeight = max(rect.Height(), ArrowSize.cy + 2*MarginSize.cy);
|
||||
MoveWindow(rect.left, rect.top, nWidth, nHeight, TRUE);
|
||||
|
||||
// Get the new coords of this window
|
||||
GetWindowRect(rect);
|
||||
ScreenToClient(rect);
|
||||
|
||||
// Get the rect where the arrow goes, and convert to client coords.
|
||||
m_ArrowRect.SetRect(rect.right - ArrowSize.cx - MarginSize.cx,
|
||||
rect.top + MarginSize.cy, rect.right - MarginSize.cx,
|
||||
rect.bottom - MarginSize.cy);
|
||||
}
|
566
win/Clrpopup.cpp
566
win/Clrpopup.cpp
|
@ -1,566 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include <math.h>
|
||||
#include "ClrPick.h"
|
||||
#include "ClrPopup.h"
|
||||
#include "propertiesgridctrl.h"
|
||||
#include "lc_colors.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
#define INVALID_COLOUR -1
|
||||
|
||||
#define MAX_COLOURS 256
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPopup
|
||||
|
||||
CColorPopup::CColorPopup()
|
||||
{
|
||||
Initialise();
|
||||
}
|
||||
|
||||
CColorPopup::CColorPopup(CPoint p, int nColor, CWnd* pParentWnd, bool IgnoreMouse)
|
||||
{
|
||||
Initialise();
|
||||
|
||||
m_nColor = m_nInitialColor = nColor;
|
||||
m_pParent = pParentWnd;
|
||||
m_IgnoreMouse = IgnoreMouse;
|
||||
|
||||
CColorPopup::Create(p, nColor, pParentWnd);
|
||||
}
|
||||
|
||||
void CColorPopup::Initialise()
|
||||
{
|
||||
m_nNumColumns = 0;
|
||||
m_nNumRows = 0;
|
||||
m_nBoxSize = 18;
|
||||
m_nMargin = ::GetSystemMetrics(SM_CXEDGE);
|
||||
m_nCurrentSel = INVALID_COLOUR;
|
||||
m_nChosenColorSel = INVALID_COLOUR;
|
||||
m_pParent = NULL;
|
||||
m_nColor = m_nInitialColor = 0;
|
||||
m_IgnoreMouse = false;
|
||||
|
||||
// Idiot check: Make sure the colour square is at least 5 x 5;
|
||||
if (m_nBoxSize - 2 * m_nMargin - 2 < 5)
|
||||
m_nBoxSize = 5 + 2 * m_nMargin + 2;
|
||||
|
||||
// Create the font
|
||||
NONCLIENTMETRICS ncm;
|
||||
ncm.cbSize = sizeof(NONCLIENTMETRICS);
|
||||
VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0));
|
||||
m_Font.CreateFontIndirect(&(ncm.lfMessageFont));
|
||||
|
||||
// Create the palette
|
||||
int NumColors = gColorList.GetSize() < MAX_COLOURS ? gColorList.GetSize() : MAX_COLOURS;
|
||||
struct {
|
||||
LOGPALETTE LogPalette;
|
||||
PALETTEENTRY PalEntry[MAX_COLOURS];
|
||||
} pal;
|
||||
|
||||
LOGPALETTE* pLogPalette = (LOGPALETTE*) &pal;
|
||||
pLogPalette->palVersion = 0x300;
|
||||
pLogPalette->palNumEntries = (WORD)gColorList.GetSize();
|
||||
|
||||
for (int i = 0; i < NumColors; i++)
|
||||
{
|
||||
float* Value = gColorList[i].Value;
|
||||
pLogPalette->palPalEntry[i].peRed = (BYTE)(Value[0] * 255);
|
||||
pLogPalette->palPalEntry[i].peGreen = (BYTE)(Value[1] * 255);
|
||||
pLogPalette->palPalEntry[i].peBlue = (BYTE)(Value[2] * 255);
|
||||
pLogPalette->palPalEntry[i].peFlags = 0;
|
||||
}
|
||||
|
||||
m_Palette.CreatePalette(pLogPalette);
|
||||
}
|
||||
|
||||
CColorPopup::~CColorPopup()
|
||||
{
|
||||
m_Font.DeleteObject();
|
||||
m_Palette.DeleteObject();
|
||||
}
|
||||
|
||||
BOOL CColorPopup::Create(CPoint p, int nColor, CWnd* pParentWnd)
|
||||
{
|
||||
ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
|
||||
ASSERT(pParentWnd->IsKindOf(RUNTIME_CLASS(CColorPicker)) || pParentWnd->IsKindOf(RUNTIME_CLASS(CMFCPropertyGridCtrl)));
|
||||
|
||||
m_pParent = pParentWnd;
|
||||
m_nColor = m_nInitialColor = nColor;
|
||||
|
||||
// Get the class name and create the window
|
||||
CString szClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW, 0, (HBRUSH)GetStockObject(LTGRAY_BRUSH),0);
|
||||
|
||||
if (!CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP, p.x, p.y, 100, 100, pParentWnd->GetSafeHwnd(), 0, NULL))
|
||||
return FALSE;
|
||||
|
||||
// Set the window size
|
||||
SetWindowSize();
|
||||
|
||||
// Calculate the layout
|
||||
CalculateLayout();
|
||||
|
||||
// Create the tooltips
|
||||
CreateToolTips();
|
||||
|
||||
// Find which cell (if any) corresponds to the initial colour
|
||||
for (int i = 0; i < mCells.GetSize(); i++)
|
||||
{
|
||||
if (mCells[i].ColorIndex == nColor)
|
||||
{
|
||||
m_nChosenColorSel = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Capture all mouse events for the life of this window
|
||||
SetCapture();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CColorPopup, CWnd)
|
||||
//{{AFX_MSG_MAP(CColorPopup)
|
||||
ON_WM_NCDESTROY()
|
||||
ON_WM_LBUTTONUP()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_MOUSEMOVE()
|
||||
ON_WM_KEYDOWN()
|
||||
ON_WM_QUERYNEWPALETTE()
|
||||
ON_WM_PALETTECHANGED()
|
||||
ON_WM_KILLFOCUS()
|
||||
ON_WM_ACTIVATEAPP()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPopup message handlers
|
||||
|
||||
// For tooltips
|
||||
BOOL CColorPopup::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
m_ToolTip.RelayEvent(pMsg);
|
||||
return CWnd::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
// If an arrow key is pressed, then move the selection
|
||||
void CColorPopup::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
if (nChar == VK_LEFT)
|
||||
{
|
||||
if (m_nCurrentSel > 0)
|
||||
ChangeSelection(m_nCurrentSel - 1);
|
||||
}
|
||||
else if (nChar == VK_RIGHT)
|
||||
{
|
||||
if (m_nCurrentSel < mCells.GetSize() - 1)
|
||||
ChangeSelection(m_nCurrentSel + 1);
|
||||
}
|
||||
else if (nChar == VK_UP || nChar == VK_DOWN)
|
||||
{
|
||||
if (m_nCurrentSel < 0 || m_nCurrentSel >= mCells.GetSize())
|
||||
m_nCurrentSel = 0;
|
||||
|
||||
int CurGroup = 0;
|
||||
int NumCells = 0;
|
||||
|
||||
for (CurGroup = 0; CurGroup < LC_NUM_COLORGROUPS; CurGroup++)
|
||||
{
|
||||
int NumColors = gColorGroups[CurGroup].Colors.GetSize();
|
||||
|
||||
if (m_nCurrentSel < NumCells + NumColors)
|
||||
break;
|
||||
|
||||
NumCells += NumColors;
|
||||
}
|
||||
|
||||
int Row = (m_nCurrentSel - NumCells) / m_nNumColumns;
|
||||
int Column = (m_nCurrentSel - NumCells) % m_nNumColumns;
|
||||
|
||||
if (nChar == VK_UP)
|
||||
{
|
||||
if (Row > 0)
|
||||
ChangeSelection(m_nCurrentSel - m_nNumColumns);
|
||||
else if (CurGroup > 0)
|
||||
{
|
||||
int NumColors = gColorGroups[CurGroup - 1].Colors.GetSize();
|
||||
int NumColumns = NumColors % m_nNumColumns;
|
||||
|
||||
if (NumColumns <= Column + 1)
|
||||
ChangeSelection(m_nCurrentSel - NumColumns - m_nNumColumns);
|
||||
else
|
||||
ChangeSelection(m_nCurrentSel - NumColumns);
|
||||
}
|
||||
}
|
||||
else if (nChar == VK_DOWN)
|
||||
{
|
||||
int NumColors = gColorGroups[CurGroup].Colors.GetSize();
|
||||
|
||||
if (m_nCurrentSel + m_nNumColumns < NumCells + NumColors)
|
||||
ChangeSelection(m_nCurrentSel + m_nNumColumns);
|
||||
else
|
||||
{
|
||||
int NumColumns = NumColors % m_nNumColumns;
|
||||
|
||||
if (NumColumns > Column)
|
||||
ChangeSelection(m_nCurrentSel + NumColumns);
|
||||
else
|
||||
ChangeSelection(m_nCurrentSel + m_nNumColumns + NumColumns);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (nChar == VK_ESCAPE)
|
||||
{
|
||||
m_nColor = m_nInitialColor;
|
||||
EndSelection(CPN_SELENDCANCEL);
|
||||
return;
|
||||
}
|
||||
else if (nChar == VK_RETURN || nChar == VK_SPACE)
|
||||
{
|
||||
EndSelection(CPN_SELENDOK);
|
||||
return;
|
||||
}
|
||||
|
||||
CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
|
||||
}
|
||||
|
||||
// auto-deletion
|
||||
void CColorPopup::OnNcDestroy()
|
||||
{
|
||||
CWnd::OnNcDestroy();
|
||||
delete this;
|
||||
}
|
||||
|
||||
void CColorPopup::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
CRect rect;
|
||||
GetClientRect(rect);
|
||||
|
||||
dc.FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
|
||||
|
||||
CFont *pOldFont = (CFont*)dc.SelectObject(&m_Font);
|
||||
dc.SetBkMode(TRANSPARENT);
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
dc.DrawText(gColorGroups[GroupIdx].Name, mGroups[GroupIdx], DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
|
||||
dc.SelectObject(pOldFont);
|
||||
|
||||
// Draw colour cells
|
||||
for (int i = 0; i < mCells.GetSize(); i++)
|
||||
DrawCell(&dc, i);
|
||||
|
||||
// Draw raised window edge (ex-window style WS_EX_WINDOWEDGE is sposed to do this,
|
||||
// but for some reason isn't
|
||||
dc.DrawEdge(rect, EDGE_RAISED, BF_RECT);
|
||||
}
|
||||
|
||||
void CColorPopup::OnMouseMove(UINT nFlags, CPoint point)
|
||||
{
|
||||
int nNewSelection = INVALID_COLOUR;
|
||||
|
||||
for (int i = 0; i < mCells.GetSize(); i++)
|
||||
{
|
||||
if (mCells[i].Rect.PtInRect(point))
|
||||
{
|
||||
nNewSelection = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nNewSelection == INVALID_COLOUR)
|
||||
{
|
||||
CWnd::OnMouseMove(nFlags, point);
|
||||
return;
|
||||
}
|
||||
|
||||
m_IgnoreMouse = false;
|
||||
|
||||
// Has the row/col selection changed? If yes, then redraw old and new cells.
|
||||
if (nNewSelection != m_nCurrentSel)
|
||||
ChangeSelection(nNewSelection);
|
||||
|
||||
CWnd::OnMouseMove(nFlags, point);
|
||||
}
|
||||
|
||||
// End selection on LButtonUp
|
||||
void CColorPopup::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
{
|
||||
CWnd::OnLButtonUp(nFlags, point);
|
||||
|
||||
if (m_IgnoreMouse)
|
||||
{
|
||||
m_IgnoreMouse = false;
|
||||
return;
|
||||
}
|
||||
|
||||
DWORD pos = GetMessagePos();
|
||||
point = CPoint(LOWORD(pos), HIWORD(pos));
|
||||
|
||||
if (m_WindowRect.PtInRect(point))
|
||||
EndSelection(CPN_SELENDOK);
|
||||
else
|
||||
EndSelection(CPN_SELENDCANCEL);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPopup implementation
|
||||
|
||||
// Works out an appropriate size and position of this window
|
||||
void CColorPopup::SetWindowSize()
|
||||
{
|
||||
CSize TextSize(0, 0);
|
||||
|
||||
// Calculate the number of columns and rows.
|
||||
m_nNumColumns = 14;
|
||||
m_nNumRows = 0;
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
m_nNumRows += (gColorGroups[GroupIdx].Colors.GetSize() + m_nNumColumns - 1) / m_nNumColumns;
|
||||
|
||||
// Calculate text size.
|
||||
CClientDC dc(this);
|
||||
CFont* pOldFont = (CFont*) dc.SelectObject(&m_Font);
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
{
|
||||
lcColorGroup* Group = &gColorGroups[GroupIdx];
|
||||
|
||||
CSize NameSize = dc.GetTextExtent(Group->Name);
|
||||
if (NameSize.cx > TextSize.cx)
|
||||
TextSize.cx = NameSize.cx;
|
||||
TextSize.cy += NameSize.cy + 2;
|
||||
}
|
||||
|
||||
dc.SelectObject(pOldFont);
|
||||
|
||||
// Get the current window position, and set the new size
|
||||
CRect rect;
|
||||
GetWindowRect(rect);
|
||||
|
||||
m_WindowRect.SetRect(rect.left, rect.top,
|
||||
rect.left + m_nNumColumns*m_nBoxSize + 2*m_nMargin,
|
||||
rect.top + m_nNumRows*m_nBoxSize + 2*m_nMargin);
|
||||
|
||||
if (TextSize.cx > m_WindowRect.Width())
|
||||
m_WindowRect.right = m_WindowRect.left + TextSize.cx;
|
||||
m_WindowRect.bottom += TextSize.cy;
|
||||
|
||||
// Need to check it'll fit on screen: Too far right?
|
||||
CSize ScreenSize(::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN));
|
||||
if (m_WindowRect.right > ScreenSize.cx)
|
||||
m_WindowRect.OffsetRect(-(m_WindowRect.right - ScreenSize.cx), 0);
|
||||
|
||||
// Too far left?
|
||||
if (m_WindowRect.left < 0)
|
||||
m_WindowRect.OffsetRect( -m_WindowRect.left, 0);
|
||||
|
||||
// Bottom falling out of screen?
|
||||
if (m_WindowRect.bottom > ScreenSize.cy)
|
||||
{
|
||||
CRect ParentRect;
|
||||
m_pParent->GetWindowRect(ParentRect);
|
||||
m_WindowRect.OffsetRect(0, -(ParentRect.Height() + m_WindowRect.Height()));
|
||||
}
|
||||
|
||||
// Set the window size and position
|
||||
MoveWindow(m_WindowRect, TRUE);
|
||||
}
|
||||
|
||||
void CColorPopup::CalculateLayout()
|
||||
{
|
||||
CRect ClientRect;
|
||||
GetClientRect(&ClientRect);
|
||||
|
||||
CClientDC dc(this);
|
||||
CFont* pOldFont = (CFont*) dc.SelectObject(&m_Font);
|
||||
|
||||
int CurCell = 0;
|
||||
int CurY = m_nMargin;
|
||||
|
||||
mGroups.RemoveAll();
|
||||
mGroups.SetSize(LC_NUM_COLORGROUPS);
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
{
|
||||
lcColorGroup* Group = &gColorGroups[GroupIdx];
|
||||
int CurColumn = 0;
|
||||
|
||||
CSize TextSize = dc.GetTextExtent(Group->Name);
|
||||
mGroups[GroupIdx].SetRect(0, CurY + 1, ClientRect.Width(), CurY + TextSize.cy + 2);
|
||||
CurY += TextSize.cy + 2;
|
||||
|
||||
for (int ColorIdx = 0; ColorIdx < Group->Colors.GetSize(); ColorIdx++)
|
||||
{
|
||||
int Left = m_nMargin + CurColumn * m_nBoxSize;
|
||||
int Right = Left + m_nBoxSize;
|
||||
int Top = CurY;
|
||||
int Bottom = CurY + m_nBoxSize;
|
||||
|
||||
lcColor* Color = &gColorList[Group->Colors[ColorIdx]];
|
||||
CColorPopupCell Cell;
|
||||
|
||||
Cell.Color = RGB(Color->Value[0] * 255, Color->Value[1] * 255, Color->Value[2] * 255);
|
||||
Cell.ColorIndex = Group->Colors[ColorIdx];
|
||||
Cell.Rect.SetRect(Left, Top, Right, Bottom);
|
||||
|
||||
mCells.Add(Cell);
|
||||
|
||||
CurColumn++;
|
||||
if (CurColumn == m_nNumColumns)
|
||||
{
|
||||
CurColumn = 0;
|
||||
CurY += m_nBoxSize;
|
||||
}
|
||||
|
||||
CurCell++;
|
||||
}
|
||||
|
||||
if (CurColumn != 0)
|
||||
CurY += m_nBoxSize;
|
||||
}
|
||||
|
||||
dc.SelectObject(pOldFont);
|
||||
}
|
||||
|
||||
void CColorPopup::CreateToolTips()
|
||||
{
|
||||
// Create the tool tip
|
||||
if (!m_ToolTip.Create(this)) return;
|
||||
|
||||
// Add a tool for each cell
|
||||
for (int i = 0; i < mCells.GetSize(); i++)
|
||||
{
|
||||
CString Text;
|
||||
lcColor* Color = &gColorList[mCells[i].ColorIndex];
|
||||
Text.Format("%s (%d)", Color->Name, Color->Code);
|
||||
m_ToolTip.AddTool(this, Text, mCells[i].Rect, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void CColorPopup::ChangeSelection(int nIndex)
|
||||
{
|
||||
CClientDC dc(this); // device context for drawing
|
||||
|
||||
if (m_nCurrentSel >= 0 && m_nCurrentSel < mCells.GetSize())
|
||||
{
|
||||
// Set Current selection as invalid and redraw old selection (this way
|
||||
// the old selection will be drawn unselected)
|
||||
int OldSel = m_nCurrentSel;
|
||||
m_nCurrentSel = INVALID_COLOUR;
|
||||
DrawCell(&dc, OldSel);
|
||||
}
|
||||
|
||||
// Set the current selection as row/col and draw (it will be drawn selected)
|
||||
m_nCurrentSel = nIndex;
|
||||
DrawCell(&dc, m_nCurrentSel);
|
||||
|
||||
m_nColor = m_nCurrentSel;
|
||||
}
|
||||
|
||||
void CColorPopup::EndSelection(int nMessage)
|
||||
{
|
||||
ReleaseCapture();
|
||||
|
||||
if (nMessage == CPN_SELENDCANCEL)
|
||||
m_nColor = m_nInitialColor;
|
||||
|
||||
int ColorIndex = m_nColor >= 0 ? mCells[m_nColor].ColorIndex : 0;
|
||||
|
||||
if (m_pParent->IsKindOf(RUNTIME_CLASS(CMFCPropertyGridCtrl)))
|
||||
{
|
||||
CLeoCADMFCPropertyGridCtrl* Ctrl = (CLeoCADMFCPropertyGridCtrl*)m_pParent;
|
||||
Ctrl->SetColor(ColorIndex);
|
||||
}
|
||||
else
|
||||
m_pParent->SendMessage(nMessage, 0, (LPARAM)ColorIndex);
|
||||
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
void CColorPopup::DrawCell(CDC* pDC, int nIndex)
|
||||
{
|
||||
CRect rect = mCells[nIndex].Rect;
|
||||
|
||||
// Select and realize the palette
|
||||
CPalette* pOldPalette;
|
||||
if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
|
||||
{
|
||||
pOldPalette = pDC->SelectPalette(&m_Palette, FALSE);
|
||||
pDC->RealizePalette();
|
||||
}
|
||||
|
||||
// fill background
|
||||
if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex)
|
||||
pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DHILIGHT));
|
||||
else
|
||||
pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
|
||||
|
||||
// Draw button
|
||||
if (m_nCurrentSel == nIndex)
|
||||
pDC->DrawEdge(rect, EDGE_RAISED, BF_RECT);
|
||||
else if (m_nChosenColorSel == nIndex)
|
||||
pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT);
|
||||
|
||||
CBrush brush(PALETTERGB(GetRValue(mCells[nIndex].Color), GetGValue(mCells[nIndex].Color), GetBValue(mCells[nIndex].Color) ));
|
||||
CPen pen;
|
||||
pen.CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW));
|
||||
|
||||
CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
|
||||
CPen* pOldPen = (CPen*) pDC->SelectObject(&pen);
|
||||
|
||||
// Draw the cell colour
|
||||
rect.DeflateRect(m_nMargin+1, m_nMargin+1);
|
||||
pDC->Rectangle(rect);
|
||||
|
||||
rect.DeflateRect(1, 1);
|
||||
rect.bottom -= 1;
|
||||
|
||||
// restore DC and cleanup
|
||||
pDC->SelectObject(pOldBrush);
|
||||
pDC->SelectObject(pOldPen);
|
||||
brush.DeleteObject();
|
||||
pen.DeleteObject();
|
||||
|
||||
if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
|
||||
pDC->SelectPalette(pOldPalette, FALSE);
|
||||
}
|
||||
|
||||
BOOL CColorPopup::OnQueryNewPalette()
|
||||
{
|
||||
Invalidate();
|
||||
return CWnd::OnQueryNewPalette();
|
||||
}
|
||||
|
||||
void CColorPopup::OnPaletteChanged(CWnd* pFocusWnd)
|
||||
{
|
||||
CWnd::OnPaletteChanged(pFocusWnd);
|
||||
|
||||
if (pFocusWnd->GetSafeHwnd() != GetSafeHwnd())
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
void CColorPopup::OnKillFocus(CWnd* pNewWnd)
|
||||
{
|
||||
CWnd::OnKillFocus(pNewWnd);
|
||||
|
||||
ReleaseCapture();
|
||||
//DestroyWindow(); - causes crash when Custom colour dialog appears.
|
||||
}
|
||||
|
||||
// KillFocus problem fix suggested by Paul Wilkerson.
|
||||
void CColorPopup::OnActivateApp(BOOL bActive, DWORD hTask)
|
||||
{
|
||||
CWnd::OnActivateApp(bActive, hTask);
|
||||
|
||||
// If Deactivating App, cancel this selection
|
||||
if (!bActive)
|
||||
EndSelection(CPN_SELENDCANCEL);
|
||||
}
|
460
win/Colorlst.cpp
460
win/Colorlst.cpp
|
@ -1,460 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "lc_colors.h"
|
||||
#include "ColorLst.h"
|
||||
#include "Piecebar.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC(CColorToolTipCtrl, CMFCToolTipCtrl)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CColorToolTipCtrl, CMFCToolTipCtrl)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
CSize CColorToolTipCtrl::GetIconSize()
|
||||
{
|
||||
return CSize(24, 24);
|
||||
}
|
||||
|
||||
BOOL CColorToolTipCtrl::OnDrawIcon(CDC* pDC, CRect rectImage)
|
||||
{
|
||||
ASSERT_VALID(pDC);
|
||||
|
||||
CString Text;
|
||||
GetWindowText(Text);
|
||||
|
||||
const char* Ptr = strrchr((const char*)Text, '(');
|
||||
if (!Ptr)
|
||||
return FALSE;
|
||||
|
||||
int Code;
|
||||
if (sscanf(Ptr, "(%d)", &Code) != 1)
|
||||
return FALSE;
|
||||
|
||||
lcColor* Color = &gColorList[lcGetColorIndex(Code)];
|
||||
|
||||
pDC->SetBkColor(RGB(Color->Value[0] * 255, Color->Value[1] * 255, Color->Value[2] * 255));
|
||||
pDC->ExtTextOut(0, 0, ETO_OPAQUE, rectImage, NULL, 0, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CColorList, CWnd)
|
||||
//{{AFX_MSG_MAP(CColorList)
|
||||
ON_WM_PAINT()
|
||||
ON_WM_ERASEBKGND()
|
||||
ON_WM_LBUTTONUP()
|
||||
ON_WM_LBUTTONDOWN()
|
||||
ON_WM_MOUSEMOVE()
|
||||
ON_WM_SIZE()
|
||||
ON_WM_KEYDOWN()
|
||||
ON_WM_SETFOCUS()
|
||||
ON_WM_KILLFOCUS()
|
||||
ON_WM_GETDLGCODE()
|
||||
ON_WM_SETCURSOR()
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
CColorList::CColorList()
|
||||
{
|
||||
mCurCell = 0;
|
||||
mTracking = FALSE;
|
||||
|
||||
UpdateColors();
|
||||
}
|
||||
|
||||
CColorList::~CColorList()
|
||||
{
|
||||
}
|
||||
|
||||
void CColorList::UpdateColors()
|
||||
{
|
||||
mCells.RemoveAll();
|
||||
mGroups.RemoveAll();
|
||||
mGroups.SetSize(LC_NUM_COLORGROUPS);
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
{
|
||||
lcColorGroup* Group = &gColorGroups[GroupIdx];
|
||||
|
||||
for (int ColorIdx = 0; ColorIdx < Group->Colors.GetSize(); ColorIdx++)
|
||||
{
|
||||
lcColor* Color = &gColorList[Group->Colors[ColorIdx]];
|
||||
CColorListCell Cell;
|
||||
|
||||
Cell.Color = RGB(Color->Value[0] * 255, Color->Value[1] * 255, Color->Value[2] * 255);
|
||||
Cell.ColorIndex = Group->Colors[ColorIdx];
|
||||
|
||||
mCells.Add(Cell);
|
||||
}
|
||||
}
|
||||
|
||||
mColumns = 14;
|
||||
mRows = 0;
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
mRows += (gColorGroups[GroupIdx].Colors.GetSize() + mColumns - 1) / mColumns;
|
||||
}
|
||||
|
||||
void CColorList::UpdateLayout()
|
||||
{
|
||||
if (!IsWindow(m_hWnd))
|
||||
return;
|
||||
|
||||
CRect ClientRect;
|
||||
GetClientRect(&ClientRect);
|
||||
|
||||
CClientDC dc(this);
|
||||
CFont* OldFont = dc.SelectObject(&afxGlobalData.fontRegular);
|
||||
float TextHeight = 0.0f;
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
{
|
||||
lcColorGroup* Group = &gColorGroups[GroupIdx];
|
||||
|
||||
CSize TextSize = dc.GetTextExtent(Group->Name);
|
||||
TextHeight += TextSize.cy;
|
||||
}
|
||||
|
||||
float CellWidth = (float)ClientRect.Width() / (float)mColumns;
|
||||
float CellHeight = ((float)ClientRect.Height() - TextHeight) / (float)mRows;
|
||||
|
||||
int CurCell = 0;
|
||||
float CurY = 0.0f;
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
{
|
||||
lcColorGroup* Group = &gColorGroups[GroupIdx];
|
||||
int CurColumn = 0;
|
||||
|
||||
CSize TextSize = dc.GetTextExtent(Group->Name);
|
||||
mGroups[GroupIdx].Rect.SetRect(0, (int)CurY, ClientRect.Width(), (int)CurY + TextSize.cy);
|
||||
CurY += TextSize.cy;
|
||||
|
||||
for (int ColorIdx = 0; ColorIdx < Group->Colors.GetSize(); ColorIdx++)
|
||||
{
|
||||
float Left = CurColumn * CellWidth;
|
||||
float Right = (CurColumn + 1) * CellWidth;
|
||||
float Top = CurY;
|
||||
float Bottom = CurY + CellHeight;
|
||||
|
||||
CRect CellRect((int)Left, (int)Top, (int)Right, (int)Bottom);
|
||||
|
||||
mCells[CurCell].Rect = CellRect;
|
||||
|
||||
CString Text;
|
||||
lcColor* Color = &gColorList[mCells[CurCell].ColorIndex];
|
||||
Text.Format("%s (%d)", Color->Name, Color->Code);
|
||||
mToolTip.AddTool(this, Text, CellRect, CurCell + 1);
|
||||
|
||||
CurColumn++;
|
||||
if (CurColumn == mColumns)
|
||||
{
|
||||
CurColumn = 0;
|
||||
CurY += CellHeight;
|
||||
}
|
||||
|
||||
CurCell++;
|
||||
}
|
||||
|
||||
if (CurColumn != 0)
|
||||
CurY += CellHeight;
|
||||
}
|
||||
|
||||
dc.SelectObject(OldFont);
|
||||
}
|
||||
|
||||
void CColorList::SelectCell(int CellIdx)
|
||||
{
|
||||
if (CellIdx < 0 || CellIdx >= mCells.GetSize())
|
||||
return;
|
||||
|
||||
if (CellIdx == mCurCell)
|
||||
return;
|
||||
|
||||
InvalidateRect(mCells[mCurCell].Rect, TRUE);
|
||||
InvalidateRect(mCells[CellIdx].Rect, TRUE);
|
||||
mCurCell = CellIdx;
|
||||
|
||||
CPiecesBar* Bar = (CPiecesBar*)GetParent();
|
||||
Bar->OnSelChangeColor();
|
||||
}
|
||||
|
||||
BOOL CColorList::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
|
||||
{
|
||||
ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
|
||||
|
||||
// Get the class name and create the window
|
||||
CString ClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW, 0, CreateSolidBrush(GetSysColor(COLOR_BTNFACE)), 0);
|
||||
|
||||
if (!CWnd::Create(ClassName, _T(""), dwStyle, rect, pParentWnd, nID, NULL))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int CColorList::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CWnd::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
mToolTip.Create(this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL CColorList::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
if (mToolTip.m_hWnd)
|
||||
mToolTip.RelayEvent(pMsg);
|
||||
|
||||
return CWnd::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
void CColorList::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this);
|
||||
|
||||
CDC MemDC;
|
||||
CRect rect;
|
||||
CBitmap bitmap, *pOldBitmap;
|
||||
dc.GetClipBox(&rect);
|
||||
MemDC.CreateCompatibleDC(&dc);
|
||||
bitmap.CreateCompatibleBitmap(&dc, rect.Width(), rect.Height());
|
||||
pOldBitmap = MemDC.SelectObject(&bitmap);
|
||||
MemDC.SetWindowOrg(rect.left, rect.top);
|
||||
Draw(MemDC);
|
||||
dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(), &MemDC, rect.left, rect.top, SRCCOPY);
|
||||
MemDC.SelectObject(pOldBitmap);
|
||||
}
|
||||
|
||||
BOOL CColorList::OnEraseBkgnd(CDC* pDC)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CColorList::Draw(CDC& dc)
|
||||
{
|
||||
CRect VisRect, ClipRect, rect;
|
||||
GetClientRect(VisRect);
|
||||
CBrush Back(GetSysColor(COLOR_WINDOW));
|
||||
dc.FillRect(VisRect, &Back);
|
||||
|
||||
CFont* OldFont = dc.SelectObject(&afxGlobalData.fontRegular);
|
||||
dc.SetBkMode(TRANSPARENT);
|
||||
|
||||
for (int GroupIdx = 0; GroupIdx < mGroups.GetSize(); GroupIdx++)
|
||||
{
|
||||
lcColorGroup* Group = &gColorGroups[GroupIdx];
|
||||
CColorListGroup* ListGroup = &mGroups[GroupIdx];
|
||||
|
||||
dc.DrawText(Group->Name, ListGroup->Rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
}
|
||||
|
||||
dc.SelectObject(OldFont);
|
||||
|
||||
for (int CellIdx = 0; CellIdx < mCells.GetSize(); CellIdx++)
|
||||
{
|
||||
CBrush brush;
|
||||
brush.CreateSolidBrush(mCells[CellIdx].Color);
|
||||
|
||||
CBrush* OldBrush = (CBrush*)dc.SelectObject(&brush);
|
||||
|
||||
CRect rc = mCells[CellIdx].Rect;
|
||||
rc.bottom++;
|
||||
rc.right++;
|
||||
dc.Rectangle(rc);
|
||||
|
||||
dc.SelectObject(OldBrush);
|
||||
}
|
||||
|
||||
if (mCurCell < mCells.GetSize())
|
||||
{
|
||||
CBrush* OldBrush = dc.SelectObject(CBrush::FromHandle((HBRUSH)GetStockObject(NULL_BRUSH)));
|
||||
|
||||
COLORREF cr = mCells[mCurCell].Color;
|
||||
CPen BorderPen;
|
||||
BorderPen.CreatePen(PS_SOLID, 1, RGB(255-GetRValue(cr), 255-GetGValue(cr), 255-GetBValue(cr)));
|
||||
CPen* OldPen = (CPen*)dc.SelectObject(&BorderPen);
|
||||
|
||||
CRect rc = mCells[mCurCell].Rect;
|
||||
rc.OffsetRect(1, 1);
|
||||
rc.bottom--;
|
||||
rc.right--;
|
||||
dc.Rectangle(rc);
|
||||
|
||||
if (GetFocus() == this)
|
||||
{
|
||||
rc.DeflateRect(2, 2);
|
||||
dc.DrawFocusRect(rc);
|
||||
}
|
||||
|
||||
dc.SelectObject(OldPen);
|
||||
dc.SelectObject(OldBrush);
|
||||
}
|
||||
}
|
||||
|
||||
void CColorList::OnLButtonDown(UINT Flags, CPoint pt)
|
||||
{
|
||||
CWnd::OnLButtonDown(Flags, pt);
|
||||
SetFocus();
|
||||
|
||||
CRect rc;
|
||||
GetClientRect(&rc);
|
||||
|
||||
if (!rc.PtInRect(pt))
|
||||
return;
|
||||
|
||||
for (int CellIdx = 0; CellIdx < mCells.GetSize(); CellIdx++)
|
||||
{
|
||||
if (!mCells[CellIdx].Rect.PtInRect(pt))
|
||||
continue;
|
||||
|
||||
SelectCell(CellIdx);
|
||||
|
||||
SetCapture();
|
||||
mMouseDown = pt;
|
||||
mTracking = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CColorList::OnLButtonUp(UINT Flags, CPoint pt)
|
||||
{
|
||||
mTracking = FALSE;
|
||||
ReleaseCapture();
|
||||
|
||||
CWnd::OnLButtonUp(Flags, pt);
|
||||
}
|
||||
|
||||
void CColorList::OnMouseMove(UINT Flags, CPoint pt)
|
||||
{
|
||||
/*
|
||||
if (m_Tracking && m_MouseDown != pt)
|
||||
{
|
||||
m_Tracking = FALSE;
|
||||
ReleaseCapture();
|
||||
lcGetActiveProject()->BeginColorDrop();
|
||||
|
||||
// Force a cursor update.
|
||||
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
|
||||
CView* pView = pFrame->GetActiveView();
|
||||
pView->PostMessage(WM_LC_SET_CURSOR, 0, 0);
|
||||
}
|
||||
*/
|
||||
CWnd::OnMouseMove(Flags, pt);
|
||||
}
|
||||
|
||||
void CColorList::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
if (nChar == VK_LEFT)
|
||||
{
|
||||
if (mCurCell > 0)
|
||||
SelectCell(mCurCell - 1);
|
||||
}
|
||||
else if (nChar == VK_RIGHT)
|
||||
{
|
||||
if (mCurCell < mCells.GetSize() - 1)
|
||||
SelectCell(mCurCell + 1);
|
||||
}
|
||||
else if (nChar == VK_UP || nChar == VK_DOWN)
|
||||
{
|
||||
if (mCurCell < 0 || mCurCell >= mCells.GetSize())
|
||||
mCurCell = 0;
|
||||
|
||||
int CurGroup = 0;
|
||||
int NumCells = 0;
|
||||
|
||||
for (CurGroup = 0; CurGroup < LC_NUM_COLORGROUPS; CurGroup++)
|
||||
{
|
||||
int NumColors = gColorGroups[CurGroup].Colors.GetSize();
|
||||
|
||||
if (mCurCell < NumCells + NumColors)
|
||||
break;
|
||||
|
||||
NumCells += NumColors;
|
||||
}
|
||||
|
||||
int Row = (mCurCell - NumCells) / mColumns;
|
||||
int Column = (mCurCell - NumCells) % mColumns;
|
||||
|
||||
if (nChar == VK_UP)
|
||||
{
|
||||
if (Row > 0)
|
||||
SelectCell(mCurCell - mColumns);
|
||||
else if (CurGroup > 0)
|
||||
{
|
||||
int NumColors = gColorGroups[CurGroup - 1].Colors.GetSize();
|
||||
int NumColumns = NumColors % mColumns;
|
||||
|
||||
if (NumColumns <= Column + 1)
|
||||
SelectCell(mCurCell - NumColumns - mColumns);
|
||||
else
|
||||
SelectCell(mCurCell - NumColumns);
|
||||
}
|
||||
}
|
||||
else if (nChar == VK_DOWN)
|
||||
{
|
||||
int NumColors = gColorGroups[CurGroup].Colors.GetSize();
|
||||
|
||||
if (mCurCell + mColumns < NumCells + NumColors)
|
||||
SelectCell(mCurCell + mColumns);
|
||||
else
|
||||
{
|
||||
int NumColumns = NumColors % mColumns;
|
||||
|
||||
if (NumColumns > Column)
|
||||
SelectCell(mCurCell + NumColumns);
|
||||
else
|
||||
SelectCell(mCurCell + mColumns + NumColumns);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
|
||||
}
|
||||
|
||||
BOOL CColorList::OnSetCursor(CWnd* inWnd, UINT inHitTest, UINT inMessage)
|
||||
{
|
||||
HCURSOR Cursor = LoadCursor(NULL, IDC_ARROW);
|
||||
|
||||
if (Cursor)
|
||||
{
|
||||
SetCursor(Cursor);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return CWnd::OnSetCursor(inWnd, inHitTest, inMessage);
|
||||
}
|
||||
|
||||
UINT CColorList::OnGetDlgCode()
|
||||
{
|
||||
return DLGC_WANTARROWS;
|
||||
}
|
||||
|
||||
void CColorList::OnSetFocus(CWnd* pOldWnd)
|
||||
{
|
||||
if (mCurCell < mCells.GetSize())
|
||||
InvalidateRect(mCells[mCurCell].Rect, TRUE);
|
||||
|
||||
CWnd::OnSetFocus(pOldWnd);
|
||||
}
|
||||
|
||||
void CColorList::OnKillFocus(CWnd* pNewWnd)
|
||||
{
|
||||
if (mCurCell < mCells.GetSize())
|
||||
InvalidateRect(mCells[mCurCell].Rect, TRUE);
|
||||
|
||||
CWnd::OnKillFocus(pNewWnd);
|
||||
}
|
||||
|
||||
void CColorList::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
CWnd::OnSize(nType, cx, cy);
|
||||
|
||||
UpdateLayout();
|
||||
}
|
107
win/Colorlst.h
107
win/Colorlst.h
|
@ -1,107 +0,0 @@
|
|||
#ifndef _COLORLST_H_
|
||||
#define _COLORLST_H_
|
||||
|
||||
class CColorToolTipCtrl : public CMFCToolTipCtrl
|
||||
{
|
||||
DECLARE_DYNAMIC(CColorToolTipCtrl)
|
||||
|
||||
public:
|
||||
CColorToolTipCtrl(CMFCToolTipInfo* pParams = NULL)
|
||||
: CMFCToolTipCtrl(pParams)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~CColorToolTipCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual CSize GetIconSize();
|
||||
virtual BOOL OnDrawIcon(CDC* pDC, CRect rectImage);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
struct CColorListGroup
|
||||
{
|
||||
CRect Rect;
|
||||
};
|
||||
|
||||
struct CColorListCell
|
||||
{
|
||||
CRect Rect;
|
||||
COLORREF Color;
|
||||
int ColorIndex;
|
||||
};
|
||||
|
||||
class CColorList : public CWnd
|
||||
{
|
||||
public:
|
||||
CColorList();
|
||||
virtual ~CColorList();
|
||||
|
||||
BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
|
||||
|
||||
void SetColorIndex(int ColorIndex)
|
||||
{
|
||||
for (int CellIdx = 0; CellIdx < mCells.GetSize(); CellIdx++)
|
||||
{
|
||||
if (mCells[CellIdx].ColorIndex == ColorIndex)
|
||||
{
|
||||
SelectCell(CellIdx);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int GetColorIndex() const
|
||||
{
|
||||
return mCells[mCurCell].ColorIndex;
|
||||
}
|
||||
|
||||
protected:
|
||||
CArray<CColorListGroup, const CColorListGroup&> mGroups;
|
||||
CArray<CColorListCell, const CColorListCell&> mCells;
|
||||
|
||||
int mColumns;
|
||||
int mRows;
|
||||
|
||||
int mCurCell;
|
||||
CPoint mMouseDown;
|
||||
BOOL mTracking;
|
||||
|
||||
CColorToolTipCtrl mToolTip;
|
||||
|
||||
void UpdateColors();
|
||||
void UpdateLayout();
|
||||
void Draw(CDC& dc);
|
||||
void SelectCell(int CellIdx);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CColorList)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CColorList)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg UINT OnGetDlgCode();
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif // _COLORLST_H_
|
164
win/Figdlg.cpp
164
win/Figdlg.cpp
|
@ -1,164 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "LeoCAD.h"
|
||||
#include "FigDlg.h"
|
||||
#include "minifig.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMinifigDlg dialog
|
||||
|
||||
CMinifigDlg::CMinifigDlg(void* param, CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CMinifigDlg::IDD, pParent)
|
||||
{
|
||||
m_pMinifig = (MinifigWizard*)param;
|
||||
m_pMinifigWnd = NULL;
|
||||
|
||||
//{{AFX_DATA_INIT(CMinifigDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CMinifigDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CMinifigDlg)
|
||||
DDX_Control(pDX, IDC_MF_HATSCOLOR, m_clrHats);
|
||||
DDX_Control(pDX, IDC_MF_HATS2COLOR, m_clrHats2);
|
||||
DDX_Control(pDX, IDC_MF_HEADCOLOR, m_clrHead);
|
||||
DDX_Control(pDX, IDC_MF_NECKCOLOR, m_clrNeck);
|
||||
DDX_Control(pDX, IDC_MF_BODYCOLOR, m_clrBody);
|
||||
DDX_Control(pDX, IDC_MF_BODY2COLOR, m_clrBody2);
|
||||
DDX_Control(pDX, IDC_MF_BODY3COLOR, m_clrBody3);
|
||||
DDX_Control(pDX, IDC_MF_ARMLCOLOR, m_clrArmLeft);
|
||||
DDX_Control(pDX, IDC_MF_ARMRCOLOR, m_clrArmRight);
|
||||
DDX_Control(pDX, IDC_MF_HANDLCOLOR, m_clrHandLeft);
|
||||
DDX_Control(pDX, IDC_MF_HANDRCOLOR, m_clrHandRight);
|
||||
DDX_Control(pDX, IDC_MF_TOOLLCOLOR, m_clrToolLeft);
|
||||
DDX_Control(pDX, IDC_MF_TOOLRCOLOR, m_clrToolRight);
|
||||
DDX_Control(pDX, IDC_MF_LEGLCOLOR, m_clrLegLeft);
|
||||
DDX_Control(pDX, IDC_MF_LEGRCOLOR, m_clrLegRight);
|
||||
DDX_Control(pDX, IDC_MF_SHOELCOLOR, m_clrShoeLeft);
|
||||
DDX_Control(pDX, IDC_MF_SHOERCOLOR, m_clrShoeRight);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMinifigDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CMinifigDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
ON_MESSAGE(CPN_SELENDOK, OnColorSelEndOK)
|
||||
ON_CONTROL_RANGE(CBN_SELENDOK, IDC_MF_HATS, IDC_MF_SHOER, OnPieceSelEndOK)
|
||||
ON_CONTROL_RANGE(EN_CHANGE, IDC_MF_HATSANGLE, IDC_MF_SHOERANGLE, OnChangeAngle)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMinifigDlg message handlers
|
||||
|
||||
BOOL CMinifigDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
ModifyStyle(0, WS_CLIPCHILDREN, 0);
|
||||
|
||||
RECT r;
|
||||
::GetWindowRect(::GetDlgItem(m_hWnd, IDC_PREVIEWSTATIC), &r);
|
||||
ScreenToClient(&r);
|
||||
|
||||
HINSTANCE hInst = AfxGetInstanceHandle();
|
||||
WNDCLASS wndcls;
|
||||
LRESULT CALLBACK GLWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#define OPENGL_CLASSNAME _T("LeoCADOpenGLClass")
|
||||
#define MINIFIG_CLASSNAME _T("LeoCADMinifigOpenGLClass")
|
||||
|
||||
// check if our class is registered
|
||||
if(!(GetClassInfo(hInst, MINIFIG_CLASSNAME, &wndcls)))
|
||||
{
|
||||
if (GetClassInfo(hInst, OPENGL_CLASSNAME, &wndcls))
|
||||
{
|
||||
// set our class name
|
||||
wndcls.lpszClassName = MINIFIG_CLASSNAME;
|
||||
wndcls.lpfnWndProc = GLWindowProc;
|
||||
|
||||
// register class
|
||||
if (!AfxRegisterClass(&wndcls))
|
||||
AfxThrowResourceException();
|
||||
}
|
||||
else
|
||||
AfxThrowResourceException();
|
||||
}
|
||||
|
||||
m_pMinifigWnd = new CWnd;
|
||||
m_pMinifigWnd->CreateEx(0, MINIFIG_CLASSNAME, "LeoCAD", WS_BORDER | WS_CHILD | WS_VISIBLE, r, this, 0, m_pMinifig);
|
||||
|
||||
for (int i = 0; i < LC_MFW_NUMITEMS; i++)
|
||||
((CColorPicker*)GetDlgItem(IDC_MF_HATSCOLOR+i))->SetColorIndex(m_pMinifig->m_Colors[i]);
|
||||
|
||||
for (int i = 0; i < LC_MFW_NUMITEMS; i++)
|
||||
{
|
||||
CComboBox* pCombo = (CComboBox*)GetDlgItem(i+IDC_MF_HATS);
|
||||
ObjArray<lcMinifigPieceInfo>& Pieces = m_pMinifig->mSettings[i];
|
||||
|
||||
for (int j = 0; j < Pieces.GetSize(); j++)
|
||||
pCombo->AddString(Pieces[j].Description);
|
||||
}
|
||||
|
||||
for (int i = 0; i < LC_MFW_NUMITEMS; i++)
|
||||
{
|
||||
CComboBox* pCombo = (CComboBox*)GetDlgItem(i + IDC_MF_HATS);
|
||||
pCombo->SetCurSel(m_pMinifig->GetSelectionIndex(i));
|
||||
}
|
||||
|
||||
for (int i = IDC_MF_HATSSPIN; i <= IDC_MF_SHOERSPIN; i++)
|
||||
((CSpinButtonCtrl*)GetDlgItem(i))->SetRange(-360, 360);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
BOOL CMinifigDlg::DestroyWindow()
|
||||
{
|
||||
if (m_pMinifigWnd)
|
||||
{
|
||||
m_pMinifigWnd->DestroyWindow();
|
||||
delete m_pMinifigWnd;
|
||||
m_pMinifigWnd = NULL;
|
||||
}
|
||||
|
||||
return CDialog::DestroyWindow();
|
||||
}
|
||||
|
||||
LONG CMinifigDlg::OnColorSelEndOK(UINT lParam, LONG wParam)
|
||||
{
|
||||
m_pMinifig->SetColor(wParam - IDC_MF_HATSCOLOR, lParam);
|
||||
m_pMinifig->Redraw();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CMinifigDlg::OnPieceSelEndOK(UINT nID)
|
||||
{
|
||||
CComboBox* Combo = (CComboBox*)GetDlgItem(nID);
|
||||
m_pMinifig->SetSelectionIndex(nID - IDC_MF_HATS, Combo->GetCurSel());
|
||||
m_pMinifig->Redraw();
|
||||
}
|
||||
|
||||
void CMinifigDlg::OnChangeAngle(UINT nID)
|
||||
{
|
||||
int index[] = { LC_MFW_HATS, LC_MFW_HATS2, LC_MFW_HEAD, LC_MFW_RARM, LC_MFW_LARM, LC_MFW_RHAND, LC_MFW_LHAND,
|
||||
LC_MFW_RHANDA, LC_MFW_LHANDA, LC_MFW_RLEG, LC_MFW_LLEG, LC_MFW_RLEGA, LC_MFW_LLEGA };
|
||||
|
||||
char tmp[65];
|
||||
GetDlgItem(nID)->GetWindowText(tmp, 65);
|
||||
|
||||
if (m_pMinifigWnd)
|
||||
{
|
||||
m_pMinifig->SetAngle(index[nID-IDC_MF_HATSANGLE], (float)strtod(tmp, NULL));
|
||||
m_pMinifig->Redraw();
|
||||
}
|
||||
}
|
73
win/Figdlg.h
73
win/Figdlg.h
|
@ -1,73 +0,0 @@
|
|||
#if !defined(AFX_FIGDLG_H__80DF3A21_90D2_11D1_A740_444553540000__INCLUDED_)
|
||||
#define AFX_FIGDLG_H__80DF3A21_90D2_11D1_A740_444553540000__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// FigDlg.h : header file
|
||||
//
|
||||
|
||||
#include "ClrPick.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMinifigDlg dialog
|
||||
|
||||
class MinifigWizard;
|
||||
|
||||
class CMinifigDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CMinifigDlg(void* param, CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CMinifigDlg)
|
||||
enum { IDD = IDD_MINIFIG };
|
||||
CColorPicker m_clrHats;
|
||||
CColorPicker m_clrHats2;
|
||||
CColorPicker m_clrHead;
|
||||
CColorPicker m_clrNeck;
|
||||
CColorPicker m_clrBody;
|
||||
CColorPicker m_clrBody2;
|
||||
CColorPicker m_clrBody3;
|
||||
CColorPicker m_clrArmLeft;
|
||||
CColorPicker m_clrArmRight;
|
||||
CColorPicker m_clrHandLeft;
|
||||
CColorPicker m_clrHandRight;
|
||||
CColorPicker m_clrToolLeft;
|
||||
CColorPicker m_clrToolRight;
|
||||
CColorPicker m_clrLegLeft;
|
||||
CColorPicker m_clrLegRight;
|
||||
CColorPicker m_clrShoeLeft;
|
||||
CColorPicker m_clrShoeRight;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMinifigDlg)
|
||||
public:
|
||||
virtual BOOL DestroyWindow();
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
CWnd* m_pMinifigWnd;
|
||||
MinifigWizard* m_pMinifig;
|
||||
|
||||
afx_msg LONG OnColorSelEndOK(UINT lParam, LONG wParam);
|
||||
void OnPieceSelEndOK(UINT nID);
|
||||
void OnChangeAngle(UINT nID);
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CMinifigDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_FIGDLG_H__80DF3A21_90D2_11D1_A740_444553540000__INCLUDED_)
|
472
win/Libdlg.cpp
472
win/Libdlg.cpp
|
@ -1,472 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "LibDlg.h"
|
||||
#include "GroupDlg.h"
|
||||
#include "Print.h"
|
||||
#include "Tools.h"
|
||||
#include "ProgDlg.h"
|
||||
#include "project.h"
|
||||
#include "pieceinf.h"
|
||||
#include "globals.h"
|
||||
#include "system.h"
|
||||
#include "lc_library.h"
|
||||
#include "lc_application.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
// Function to sort the list control.
|
||||
static int CALLBACK ListCompare(LPARAM lP1, LPARAM lP2, LPARAM lParamSort)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((lP1 < 0) || (lP2 < 0))
|
||||
return 0;
|
||||
|
||||
if ((lParamSort & ~0xF0) == 0)
|
||||
ret = strcmpi(((PieceInfo*)lP1)->m_strDescription, ((PieceInfo*)lP2)->m_strDescription);
|
||||
else
|
||||
ret = strcmpi(((PieceInfo*)lP1)->m_strName, ((PieceInfo*)lP2)->m_strName);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLibraryDlg dialog
|
||||
|
||||
CLibraryDlg::CLibraryDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CLibraryDlg::IDD, pParent)
|
||||
{
|
||||
m_SortColumn = 0;
|
||||
|
||||
//{{AFX_DATA_INIT(CLibraryDlg)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
CLibraryDlg::~CLibraryDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void CLibraryDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CLibraryDlg)
|
||||
DDX_Control(pDX, IDC_LIBDLG_TREE, m_Tree);
|
||||
DDX_Control(pDX, IDC_LIBDLG_LIST, m_List);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CLibraryDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CLibraryDlg)
|
||||
ON_NOTIFY(TVN_SELCHANGED, IDC_LIBDLG_TREE, OnSelChangedTree)
|
||||
ON_NOTIFY(LVN_COLUMNCLICK, IDC_LIBDLG_LIST, OnListColumnClick)
|
||||
//}}AFX_MSG_MAP
|
||||
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText)
|
||||
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLibraryDlg message handlers
|
||||
|
||||
BOOL CLibraryDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Add the ToolBar.
|
||||
if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_LIBRARY))
|
||||
{
|
||||
TRACE0("Failed to create toolbar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
|
||||
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
|
||||
|
||||
// We need to resize the dialog to make room for control bars.
|
||||
// First, figure out how big the control bars are.
|
||||
CRect rcClientStart;
|
||||
CRect rcClientNow;
|
||||
GetClientRect(rcClientStart);
|
||||
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, reposQuery, rcClientNow);
|
||||
|
||||
// Now move all the controls so they are in the same relative
|
||||
// position within the remaining client area as they would be
|
||||
// with no control bars.
|
||||
CPoint ptOffset(rcClientNow.left - rcClientStart.left, rcClientNow.top - rcClientStart.top);
|
||||
|
||||
CRect rcChild;
|
||||
CWnd* pwndChild = GetWindow(GW_CHILD);
|
||||
while (pwndChild)
|
||||
{
|
||||
pwndChild->GetWindowRect(rcChild);
|
||||
ScreenToClient(rcChild);
|
||||
rcChild.OffsetRect(ptOffset);
|
||||
pwndChild->MoveWindow(rcChild, FALSE);
|
||||
pwndChild = pwndChild->GetNextWindow();
|
||||
}
|
||||
|
||||
// Adjust the dialog window dimensions
|
||||
CRect rcWindow;
|
||||
GetWindowRect(rcWindow);
|
||||
rcWindow.right += rcClientStart.Width() - rcClientNow.Width();
|
||||
rcWindow.bottom += rcClientStart.Height() - rcClientNow.Height();
|
||||
MoveWindow(rcWindow, FALSE);
|
||||
|
||||
// And position the control bars
|
||||
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
|
||||
|
||||
m_TreeImages.Create(IDB_PARTICONS, 16, 0, RGB (0,128,128));
|
||||
m_Tree.SetImageList(&m_TreeImages, TVSIL_NORMAL);
|
||||
|
||||
RECT rect;
|
||||
m_List.GetWindowRect(&rect);
|
||||
m_List.InsertColumn(0, "Name", LVCFMT_LEFT, rect.right - rect.left - GetSystemMetrics(SM_CXVSCROLL) - 4 - 60, 0);
|
||||
m_List.InsertColumn(1, "Number", LVCFMT_LEFT, 60, 1);
|
||||
|
||||
UpdateList();
|
||||
UpdateTree();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case ID_LIBDLG_FILE_OPEN:
|
||||
{
|
||||
lcGetPiecesLibrary()->LoadCategories(NULL);
|
||||
UpdateTree();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_FILE_SAVE:
|
||||
{
|
||||
lcGetPiecesLibrary()->DoSaveCategories(false);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_FILE_SAVEAS:
|
||||
{
|
||||
lcGetPiecesLibrary()->DoSaveCategories(true);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_FILE_PRINTCATALOG:
|
||||
{
|
||||
PRINT_PARAMS* param = (PRINT_PARAMS*)malloc(sizeof(PRINT_PARAMS));
|
||||
param->pParent = this;
|
||||
param->pMainFrame = (CFrameWndEx*)AfxGetMainWnd();
|
||||
AfxBeginThread(PrintCatalogFunction, param);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_FILE_TEXTURES:
|
||||
{
|
||||
} break;
|
||||
|
||||
case ID_LIBDLG_CATEGORY_RESET:
|
||||
{
|
||||
if (SystemDoMessageBox("Are you sure you want to reset the categories?", LC_MB_YESNO | LC_MB_ICONQUESTION) == LC_YES)
|
||||
{
|
||||
lcGetPiecesLibrary()->ResetCategories();
|
||||
|
||||
UpdateList();
|
||||
UpdateTree();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_CATEGORY_NEW:
|
||||
{
|
||||
LC_CATEGORYDLG_OPTS Opts;
|
||||
Opts.Name = "New Category";
|
||||
Opts.Keywords = "";
|
||||
|
||||
if (SystemDoDialog(LC_DLG_EDITCATEGORY, &Opts))
|
||||
{
|
||||
lcGetPiecesLibrary()->AddCategory(Opts.Name, Opts.Keywords);
|
||||
}
|
||||
|
||||
UpdateTree();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_CATEGORY_REMOVE:
|
||||
{
|
||||
HTREEITEM Item = m_Tree.GetSelectedItem();
|
||||
|
||||
if (Item == NULL)
|
||||
break;
|
||||
|
||||
lcPiecesLibrary* Lib = lcGetPiecesLibrary();
|
||||
CString CategoryName = m_Tree.GetItemText(Item);
|
||||
int Index = Lib->FindCategoryIndex((const char*)CategoryName);
|
||||
|
||||
if (Index == -1)
|
||||
break;
|
||||
|
||||
char Msg[1024];
|
||||
const String& Name = Lib->mCategories[Index].Name;
|
||||
sprintf(Msg, "Are you sure you want to remove the '%s' category?", Name);
|
||||
|
||||
if (SystemDoMessageBox(Msg, LC_MB_YESNO | LC_MB_ICONQUESTION) == LC_YES)
|
||||
{
|
||||
Lib->RemoveCategory(Index);
|
||||
}
|
||||
|
||||
UpdateTree();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_CATEGORY_EDIT:
|
||||
{
|
||||
HTREEITEM Item = m_Tree.GetSelectedItem();
|
||||
|
||||
if (Item == NULL)
|
||||
break;
|
||||
|
||||
lcPiecesLibrary* Lib = lcGetPiecesLibrary();
|
||||
CString CategoryName = m_Tree.GetItemText(Item);
|
||||
int Index = Lib->FindCategoryIndex((const char*)CategoryName);
|
||||
|
||||
if (Index == -1)
|
||||
break;
|
||||
|
||||
LC_CATEGORYDLG_OPTS Opts;
|
||||
Opts.Name = Lib->mCategories[Index].Name;
|
||||
Opts.Keywords = Lib->mCategories[Index].Keywords;
|
||||
|
||||
if (SystemDoDialog(LC_DLG_EDITCATEGORY, &Opts))
|
||||
{
|
||||
String OldName = Lib->mCategories[Index].Name;
|
||||
Lib->SetCategory(Index, Opts.Name, Opts.Keywords);
|
||||
}
|
||||
|
||||
UpdateTree();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_PIECE_NEW:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case ID_LIBDLG_PIECE_EDIT:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return CDialog::OnCommand(wParam, lParam);
|
||||
}
|
||||
|
||||
void CLibraryDlg::UpdateList()
|
||||
{
|
||||
m_List.DeleteAllItems();
|
||||
m_List.SetRedraw(FALSE);
|
||||
|
||||
lcPiecesLibrary *Lib = lcGetPiecesLibrary();
|
||||
|
||||
HTREEITEM CategoryItem = m_Tree.GetSelectedItem();
|
||||
CString CategoryName = m_Tree.GetItemText(CategoryItem);
|
||||
int CategoryIndex = Lib->FindCategoryIndex((const char*)CategoryName);
|
||||
|
||||
if (CategoryIndex != -1)
|
||||
{
|
||||
PtrArray<PieceInfo> SinglePieces, GroupedPieces;
|
||||
|
||||
Lib->GetCategoryEntries(CategoryIndex, false, SinglePieces, GroupedPieces);
|
||||
|
||||
for (int i = 0; i < SinglePieces.GetSize(); i++)
|
||||
{
|
||||
PieceInfo* Info = SinglePieces[i];
|
||||
|
||||
LVITEM lvi;
|
||||
lvi.mask = LVIF_TEXT | LVIF_PARAM;
|
||||
lvi.iItem = 0;
|
||||
lvi.iSubItem = 0;
|
||||
lvi.lParam = (LPARAM)Info;
|
||||
lvi.pszText = Info->m_strDescription;
|
||||
int idx = m_List.InsertItem(&lvi);
|
||||
|
||||
m_List.SetItemText(idx, 1, Info->m_strName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CategoryName == "Unassigned")
|
||||
{
|
||||
// Test each piece against all categories.
|
||||
for (int i = 0; i < Lib->mPieces.GetSize(); i++)
|
||||
{
|
||||
PieceInfo* Info = Lib->mPieces[i];
|
||||
int j;
|
||||
|
||||
for (j = 0; j < Lib->mCategories.GetSize(); j++)
|
||||
{
|
||||
if (Lib->PieceInCategory(Info, Lib->mCategories[j].Keywords))
|
||||
break;
|
||||
}
|
||||
|
||||
if (j == Lib->mCategories.GetSize())
|
||||
{
|
||||
LVITEM lvi;
|
||||
lvi.mask = LVIF_TEXT | LVIF_PARAM;
|
||||
lvi.iItem = 0;
|
||||
lvi.iSubItem = 0;
|
||||
lvi.lParam = (LPARAM)Info;
|
||||
lvi.pszText = Info->m_strDescription;
|
||||
int idx = m_List.InsertItem(&lvi);
|
||||
|
||||
m_List.SetItemText(idx, 1, Info->m_strName);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (CategoryName == "Pieces")
|
||||
{
|
||||
for (int i = 0; i < Lib->mPieces.GetSize(); i++)
|
||||
{
|
||||
PieceInfo* Info = Lib->mPieces[i];
|
||||
|
||||
LVITEM lvi;
|
||||
lvi.mask = LVIF_TEXT | LVIF_PARAM;
|
||||
lvi.iItem = 0;
|
||||
lvi.iSubItem = 0;
|
||||
lvi.lParam = (LPARAM)Info;
|
||||
lvi.pszText = Info->m_strDescription;
|
||||
int idx = m_List.InsertItem(&lvi);
|
||||
|
||||
m_List.SetItemText(idx, 1, Info->m_strName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_List.SortItems((PFNLVCOMPARE)ListCompare, m_SortColumn);
|
||||
m_List.SetRedraw(TRUE);
|
||||
}
|
||||
|
||||
void CLibraryDlg::UpdateTree()
|
||||
{
|
||||
m_Tree.SetRedraw(FALSE);
|
||||
m_Tree.DeleteAllItems();
|
||||
|
||||
HTREEITEM Root = m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT, "Pieces", 0, 1, 0, 0, 0, TVI_ROOT, TVI_SORT);
|
||||
|
||||
lcPiecesLibrary *Lib = lcGetPiecesLibrary();
|
||||
for (int i = 0; i < Lib->mCategories.GetSize(); i++)
|
||||
m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM|TVIF_TEXT, Lib->mCategories[i].Name, 0, 1, 0, 0, 0, Root, TVI_SORT);
|
||||
|
||||
m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM|TVIF_TEXT, "Unassigned", 0, 1, 0, 0, 0, Root, TVI_LAST);
|
||||
|
||||
m_Tree.Expand(Root, TVE_EXPAND);
|
||||
m_Tree.SetRedraw(TRUE);
|
||||
m_Tree.Invalidate();
|
||||
}
|
||||
|
||||
void CLibraryDlg::OnSelChangedTree(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
|
||||
UpdateList();
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CLibraryDlg::OnCancel()
|
||||
{
|
||||
// Check if it's ok to close the dialog
|
||||
if (!lcGetPiecesLibrary()->SaveCategories())
|
||||
return;
|
||||
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
void CLibraryDlg::OnOK()
|
||||
{
|
||||
// Check if it's ok to close the dialog
|
||||
if (!lcGetPiecesLibrary()->SaveCategories())
|
||||
return;
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
BOOL CLibraryDlg::ContinueModal()
|
||||
{
|
||||
HTREEITEM h = m_Tree.GetSelectedItem();
|
||||
BOOL bValid = (h != m_Tree.GetRootItem()) && (h != NULL);
|
||||
|
||||
EnableControl(ID_LIBDLG_GROUP_RENAME, bValid);
|
||||
EnableControl(ID_LIBDLG_GROUP_DELETE, bValid);
|
||||
|
||||
return CDialog::ContinueModal();
|
||||
}
|
||||
|
||||
void CLibraryDlg::EnableControl(UINT nID, BOOL bEnable)
|
||||
{
|
||||
GetMenu()->GetSubMenu(1)->EnableMenuItem(nID, MF_BYCOMMAND | (bEnable ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)));
|
||||
int state = m_wndToolBar.GetToolBarCtrl().GetState(nID) & ~TBSTATE_ENABLED;
|
||||
if (bEnable)
|
||||
state |= TBSTATE_ENABLED;
|
||||
m_wndToolBar.GetToolBarCtrl().SetState(nID, state);
|
||||
}
|
||||
|
||||
BOOL CLibraryDlg::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW);
|
||||
|
||||
// allow top level routing frame to handle the message
|
||||
if (GetRoutingFrame() != NULL)
|
||||
return FALSE;
|
||||
|
||||
// need to handle both ANSI and UNICODE versions of the message
|
||||
TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
|
||||
TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
|
||||
CString cstTipText;
|
||||
UINT nID = pNMHDR->idFrom;
|
||||
|
||||
if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||
|
||||
pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
|
||||
{
|
||||
// idFrom is actually the HWND of the tool
|
||||
nID = ((UINT)(WORD)::GetDlgCtrlID((HWND)nID));
|
||||
}
|
||||
|
||||
if (nID != 0) // will be zero on a separator
|
||||
{
|
||||
cstTipText.LoadString(nID);
|
||||
}
|
||||
|
||||
// Non-UNICODE Strings only are shown in the tooltip window...
|
||||
if (pNMHDR->code == TTN_NEEDTEXTA)
|
||||
lstrcpyn(pTTTA->szText, cstTipText, (sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0])));
|
||||
else
|
||||
_mbstowcsz(pTTTW->szText, cstTipText, (sizeof(pTTTW->szText)/sizeof(pTTTW->szText[0])));
|
||||
|
||||
*pResult = 0;
|
||||
|
||||
// bring the tooltip window above other popup windows
|
||||
::SetWindowPos(pNMHDR->hwndFrom, HWND_TOP, 0, 0, 0, 0,
|
||||
SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE);
|
||||
|
||||
return TRUE; // message was handled
|
||||
}
|
||||
|
||||
void CLibraryDlg::OnListColumnClick(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
|
||||
|
||||
// Save the column index.
|
||||
m_SortColumn = pNMListView->iSubItem;
|
||||
|
||||
m_List.SortItems((PFNLVCOMPARE)ListCompare, m_SortColumn);
|
||||
|
||||
*pResult = 0;
|
||||
}
|
61
win/Libdlg.h
61
win/Libdlg.h
|
@ -1,61 +0,0 @@
|
|||
#ifndef _LIBDLG_H_
|
||||
#define _LIBDLG_H_
|
||||
|
||||
#include "array.h"
|
||||
#include "str.h"
|
||||
|
||||
class PieceInfo;
|
||||
|
||||
class CLibraryDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CLibraryDlg(CWnd* pParent = NULL); // standard constructor
|
||||
virtual ~CLibraryDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CLibraryDlg)
|
||||
enum { IDD = IDD_LIBRARY };
|
||||
CTreeCtrl m_Tree;
|
||||
CListCtrl m_List;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CLibraryDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
void EnableControl(UINT nID, BOOL bEnable);
|
||||
BOOL ContinueModal();
|
||||
void UpdateTree();
|
||||
void UpdateList();
|
||||
|
||||
CToolBar m_wndToolBar;
|
||||
CImageList m_TreeImages;
|
||||
int m_SortColumn;
|
||||
|
||||
protected:
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CLibraryDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSelChangedTree(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
virtual void OnCancel();
|
||||
virtual void OnOK();
|
||||
afx_msg void OnListColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // _LIBDLG_H_
|
|
@ -1,94 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "lc_application.h"
|
||||
#include "leocad.h"
|
||||
#include "PiecePrv.h"
|
||||
#include "Tools.h"
|
||||
#include "pieceinf.h"
|
||||
#include "globals.h"
|
||||
#include "project.h"
|
||||
#include "preview.h"
|
||||
#include "view.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPiecePreview
|
||||
|
||||
CPiecePreview::CPiecePreview()
|
||||
{
|
||||
m_Preview = NULL;
|
||||
}
|
||||
|
||||
CPiecePreview::~CPiecePreview()
|
||||
{
|
||||
delete m_Preview;
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPiecePreview, CWnd)
|
||||
//{{AFX_MSG_MAP(CPiecePreview)
|
||||
ON_WM_CREATE()
|
||||
ON_WM_DESTROY()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPiecePreview message handlers
|
||||
|
||||
int CPiecePreview::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CWnd::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
Project* project = lcGetActiveProject();
|
||||
|
||||
m_Preview = new PiecePreview(project->GetActiveView());
|
||||
m_Preview->CreateFromWindow(m_hWnd);
|
||||
m_Preview->MakeCurrent();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CPiecePreview::OnDestroy()
|
||||
{
|
||||
if (m_Preview)
|
||||
{
|
||||
m_Preview->DestroyContext();
|
||||
delete m_Preview;
|
||||
m_Preview = NULL;
|
||||
}
|
||||
|
||||
CWnd::OnDestroy();
|
||||
}
|
||||
|
||||
void CPiecePreview::SetPieceInfo(PieceInfo* pInfo)
|
||||
{
|
||||
m_Preview->SetCurrentPiece(pInfo);
|
||||
}
|
||||
|
||||
PieceInfo* CPiecePreview::GetPieceInfo() const
|
||||
{
|
||||
return m_Preview->GetCurrentPiece();
|
||||
}
|
||||
|
||||
BOOL GLWindowPreTranslateMessage (GLWindow *wnd, MSG *pMsg);
|
||||
LRESULT CPiecePreview::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (m_Preview)
|
||||
{
|
||||
MSG msg;
|
||||
msg.message = message;
|
||||
msg.wParam = wParam;
|
||||
msg.lParam = lParam;
|
||||
|
||||
if (GLWindowPreTranslateMessage(m_Preview, &msg))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return CWnd::WindowProc(message, wParam, lParam);
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
#if !defined(AFX_PIECEPRV_H__FBCDC803_4059_11D2_8202_C2FDEFF7E618__INCLUDED_)
|
||||
#define AFX_PIECEPRV_H__FBCDC803_4059_11D2_8202_C2FDEFF7E618__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// PiecePrv.h : header file
|
||||
//
|
||||
|
||||
class PieceInfo;
|
||||
class PiecePreview;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPiecePreview window
|
||||
|
||||
class CPiecePreview : public CWnd
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CPiecePreview();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
void SetPieceInfo(PieceInfo* pInfo);
|
||||
PieceInfo* GetPieceInfo () const;
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPiecePreview)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CPiecePreview();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
PiecePreview* m_Preview;
|
||||
|
||||
//{{AFX_MSG(CPiecePreview)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PIECEPRV_H__FBCDC803_4059_11D2_8202_C2FDEFF7E618__INCLUDED_)
|
115
win/Povdlg.cpp
115
win/Povdlg.cpp
|
@ -1,115 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "POVDlg.h"
|
||||
#include "tools.h"
|
||||
#include "resource.hm"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPOVDlg dialog
|
||||
|
||||
const DWORD CPOVDlg::m_nHelpIDs[] =
|
||||
{
|
||||
IDC_POVDLG_LGEO, HIDC_POVDLG_LGEO,
|
||||
IDC_POVDLG_OUTPOV, HIDC_POVDLG_OUTPOV,
|
||||
IDC_POVDLG_POVRAY, HIDC_POVDLG_POVRAY,
|
||||
IDC_POVDLG_RENDER, HIDC_POVDLG_RENDER,
|
||||
0, 0
|
||||
};
|
||||
|
||||
CPOVDlg::CPOVDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CPOVDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CPOVDlg)
|
||||
m_bRender = FALSE;
|
||||
m_strPOV = _T("");
|
||||
m_strOut = _T("");
|
||||
m_strLGEO = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CPOVDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CPOVDlg)
|
||||
DDX_Check(pDX, IDC_POVDLG_RENDER, m_bRender);
|
||||
DDX_Text(pDX, IDC_POVDLG_POVRAY, m_strPOV);
|
||||
DDX_Text(pDX, IDC_POVDLG_OUTPOV, m_strOut);
|
||||
DDX_Text(pDX, IDC_POVDLG_LGEO, m_strLGEO);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPOVDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CPOVDlg)
|
||||
ON_BN_CLICKED(IDC_POVDLG_POVBROWSE, OnPovbrowse)
|
||||
ON_BN_CLICKED(IDC_POVDLG_POVOUTBROWSE, OnPovoutbrowse)
|
||||
ON_BN_CLICKED(IDC_POVDLG_LGEOBROWSE, OnPovdlgLgeobrowse)
|
||||
ON_WM_CONTEXTMENU()
|
||||
ON_WM_HELPINFO()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPOVDlg message handlers
|
||||
|
||||
void CPOVDlg::OnOK()
|
||||
{
|
||||
UpdateData (TRUE);
|
||||
|
||||
if (m_strOut.GetLength() == 0)
|
||||
return;
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CPOVDlg::OnPovbrowse()
|
||||
{
|
||||
CFileDialog dlg(TRUE, "*.exe", m_strPOV, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
"Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||", this);
|
||||
if (dlg.DoModal() == IDOK)
|
||||
{
|
||||
UpdateData (TRUE);
|
||||
m_strPOV = dlg.GetPathName();
|
||||
UpdateData (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void CPOVDlg::OnPovoutbrowse()
|
||||
{
|
||||
CFileDialog dlg(FALSE, "*.pov", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
"POV-Ray Files (*.pov)|*.pov|All Files (*.*)|*.*||", AfxGetMainWnd());
|
||||
if (dlg.DoModal() == IDOK)
|
||||
{
|
||||
UpdateData (TRUE);
|
||||
m_strOut = dlg.GetPathName();
|
||||
UpdateData (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void CPOVDlg::OnContextMenu(CWnd* pWnd, CPoint point)
|
||||
{
|
||||
::WinHelp(pWnd->m_hWnd, theApp.m_pszHelpFilePath,
|
||||
HELP_CONTEXTMENU, (DWORD)(LPVOID)m_nHelpIDs);
|
||||
}
|
||||
|
||||
BOOL CPOVDlg::OnHelpInfo(HELPINFO* pHelpInfo)
|
||||
{
|
||||
return ::WinHelp((HWND)pHelpInfo->hItemHandle, theApp.m_pszHelpFilePath,
|
||||
HELP_WM_HELP, (DWORD)(LPVOID)m_nHelpIDs);
|
||||
}
|
||||
|
||||
void CPOVDlg::OnPovdlgLgeobrowse()
|
||||
{
|
||||
CString str;
|
||||
if (FolderBrowse(&str, _T("Select LGEO folder"), GetSafeHwnd()))
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
m_strLGEO = str;
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
}
|
156
win/Stepdlg.cpp
156
win/Stepdlg.cpp
|
@ -1,156 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "StepDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CStepDlg dialog
|
||||
|
||||
|
||||
CStepDlg::CStepDlg(CStepDlg** pointer, CWnd* pParent)
|
||||
: CDialog(CStepDlg::IDD, pParent)
|
||||
{
|
||||
m_pView = pParent;
|
||||
m_pPointer = pointer;
|
||||
|
||||
//{{AFX_DATA_INIT(CStepDlg)
|
||||
m_nStep = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CStepDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CStepDlg)
|
||||
DDX_Control(pDX, IDC_STEP_SLIDER, m_Slider);
|
||||
DDX_Text(pDX, IDC_STEP_EDIT, m_nStep);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CStepDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CStepDlg)
|
||||
ON_BN_CLICKED(IDAPPLY, OnApply)
|
||||
ON_WM_HSCROLL()
|
||||
ON_WM_DESTROY()
|
||||
ON_EN_CHANGE(IDC_STEP_EDIT, OnEditChange)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CStepDlg message handlers
|
||||
|
||||
void CStepDlg::UpdateRange(int nTime, int nTotal)
|
||||
{
|
||||
m_Slider.SetRange (1, nTotal);
|
||||
m_Slider.SetPos (nTime);
|
||||
((CSpinButtonCtrl*)GetDlgItem(IDC_STEP_SPIN))->SetRange(1, nTotal);
|
||||
m_nStep = nTime;
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
|
||||
void CStepDlg::OnCancel()
|
||||
{
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
void CStepDlg::OnOK()
|
||||
{
|
||||
UpdateData();
|
||||
m_pView->PostMessage(WM_LC_SET_STEP, m_nStep);
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
void CStepDlg::OnApply()
|
||||
{
|
||||
UpdateData();
|
||||
m_pView->PostMessage(WM_LC_SET_STEP, m_nStep);
|
||||
}
|
||||
|
||||
void CStepDlg::PostNcDestroy()
|
||||
{
|
||||
*m_pPointer = NULL;
|
||||
delete this;
|
||||
}
|
||||
|
||||
void CStepDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
m_nStep = m_Slider.GetPos();
|
||||
UpdateData(FALSE);
|
||||
|
||||
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
||||
|
||||
void CStepDlg::OnEditChange()
|
||||
{
|
||||
if (m_Slider.m_hWnd)
|
||||
{
|
||||
UpdateData();
|
||||
m_Slider.SetPos(m_nStep);
|
||||
}
|
||||
}
|
||||
|
||||
void CStepDlg::OnDestroy()
|
||||
{
|
||||
RECT rc;
|
||||
GetWindowRect(&rc);
|
||||
char buf[30];
|
||||
sprintf(buf, "%d, %d", rc.top, rc.left);
|
||||
AfxGetApp()->WriteProfileString ("Settings", "Step Dialog", buf);
|
||||
|
||||
CDialog::OnDestroy();
|
||||
}
|
||||
/*
|
||||
void CStepDlg::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
|
||||
{
|
||||
CRect rc = lpncsp->rgrc[0];
|
||||
rc.DeflateRect(2, 2, 2, 2);
|
||||
rc.top += 10;
|
||||
// rc.bottom -= 10;
|
||||
lpncsp->rgrc[0] = rc;
|
||||
}
|
||||
|
||||
void CStepDlg::OnNcPaint()
|
||||
{
|
||||
CWindowDC dc(this);
|
||||
CRect rectClient;
|
||||
GetClientRect(rectClient);
|
||||
CRect rectWindow;
|
||||
GetWindowRect(rectWindow);
|
||||
ScreenToClient(rectWindow);
|
||||
|
||||
rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top+2);
|
||||
rectWindow.bottom = rectWindow.top + 10;
|
||||
::FillRect(dc.m_hDC, rectWindow, (HBRUSH)(COLOR_ACTIVECAPTION+1));
|
||||
|
||||
CRect rectBorder;
|
||||
GetWindowRect(rectBorder);
|
||||
rectBorder.OffsetRect(-rectBorder.left, -rectBorder.top);
|
||||
|
||||
dc.Draw3dRect(rectBorder, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_3DDKSHADOW));
|
||||
rectBorder.DeflateRect(1, 1);
|
||||
dc.Draw3dRect(rectBorder, ::GetSysColor(COLOR_3DHIGHLIGHT), ::GetSysColor(COLOR_BTNSHADOW));
|
||||
|
||||
rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
|
||||
dc.ExcludeClipRect(rectClient);
|
||||
|
||||
// draw borders in non-client area
|
||||
rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
|
||||
|
||||
// erase parts not drawn
|
||||
dc.IntersectClipRect(rectWindow);
|
||||
|
||||
// erase NC background the hard way
|
||||
// HBRUSH hbr = (HBRUSH)GetClassLong(m_hWnd, GCL_HBRBACKGROUND);
|
||||
// ::FillRect(dc.m_hDC, rectWindow, hbr);
|
||||
|
||||
|
||||
ReleaseDC(&dc);
|
||||
}
|
||||
*/
|
|
@ -1,58 +0,0 @@
|
|||
#if !defined(AFX_STEPDLG_H__D8E4D902_5BCF_11D2_8202_A3A5E1B1BA04__INCLUDED_)
|
||||
#define AFX_STEPDLG_H__D8E4D902_5BCF_11D2_8202_A3A5E1B1BA04__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// StepDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CStepDlg dialog
|
||||
|
||||
class CStepDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CStepDlg(CStepDlg** pointer, CWnd* pParent); // standard constructor
|
||||
void UpdateRange(int nTime, int nTotal);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CStepDlg)
|
||||
enum { IDD = IDD_STEP };
|
||||
CSliderCtrl m_Slider;
|
||||
UINT m_nStep;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CStepDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual void PostNcDestroy();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
CWnd* m_pView;
|
||||
CStepDlg** m_pPointer;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CStepDlg)
|
||||
afx_msg void OnApply();
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
virtual void OnOK();
|
||||
afx_msg void OnDestroy();
|
||||
virtual void OnCancel();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnEditChange();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STEPDLG_H__D8E4D902_5BCF_11D2_8202_A3A5E1B1BA04__INCLUDED_)
|
|
@ -1,86 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "StepPop.h"
|
||||
#include "project.h"
|
||||
#include "globals.h"
|
||||
#include "lc_application.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CStepPopup
|
||||
|
||||
CStepPopup::CStepPopup()
|
||||
{
|
||||
}
|
||||
|
||||
CStepPopup::CStepPopup(CPoint pt, CWnd* pParentWnd)
|
||||
{
|
||||
pt.x = min (pt.x, GetSystemMetrics(SM_CXSCREEN)-100);
|
||||
pt.y = min (pt.y, GetSystemMetrics(SM_CYSCREEN)-45);
|
||||
|
||||
CString szClassName = AfxRegisterWndClass(CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW, 0, (HBRUSH)GetStockObject(LTGRAY_BRUSH),0);
|
||||
CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP|WS_DLGFRAME,
|
||||
pt.x, pt.y, 100, 45, pParentWnd->GetSafeHwnd(), 0, NULL);
|
||||
|
||||
m_Slider.Create (WS_CHILD|WS_VISIBLE|TBS_BOTH|TBS_HORZ|TBS_NOTICKS, CRect(5,10,90,30), this, 1000);
|
||||
|
||||
int from, to;
|
||||
lcGetActiveProject()->GetTimeRange(&from, &to);
|
||||
m_Slider.SetRange(1, to);
|
||||
m_Slider.SetPos(from);
|
||||
}
|
||||
|
||||
CStepPopup::~CStepPopup()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CStepPopup, CWnd)
|
||||
//{{AFX_MSG_MAP(CStepPopup)
|
||||
ON_WM_NCDESTROY()
|
||||
ON_WM_KILLFOCUS()
|
||||
ON_WM_ACTIVATEAPP()
|
||||
ON_WM_HSCROLL()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CStepPopup message handlers
|
||||
|
||||
void CStepPopup::OnNcDestroy()
|
||||
{
|
||||
AfxGetMainWnd()->SendMessage(WM_LC_POPUP_CLOSE);
|
||||
CWnd::OnNcDestroy();
|
||||
delete this;
|
||||
}
|
||||
|
||||
void CStepPopup::OnKillFocus(CWnd* pNewWnd)
|
||||
{
|
||||
CWnd::OnKillFocus(pNewWnd);
|
||||
|
||||
if (pNewWnd && (pNewWnd->m_hWnd != m_Slider.m_hWnd))
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
void CStepPopup::OnActivateApp(BOOL bActive, DWORD hTask)
|
||||
{
|
||||
CWnd::OnActivateApp(bActive, hTask);
|
||||
|
||||
if (!bActive)
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
void CStepPopup::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
int pos = m_Slider.GetPos();
|
||||
if (pos > 0)
|
||||
lcGetActiveProject()->HandleCommand(LC_VIEW_STEP_SET, pos);
|
||||
|
||||
CWnd::OnHScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
#if !defined(AFX_STEPPOP_H__105A59A6_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_)
|
||||
#define AFX_STEPPOP_H__105A59A6_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// StepPop.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CStepPopup window
|
||||
|
||||
class CStepPopup : public CWnd
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CStepPopup();
|
||||
CStepPopup(CPoint pt, CWnd* pParentWnd);
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
CSliderCtrl m_Slider;
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CStepPopup)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CStepPopup();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CStepPopup)
|
||||
afx_msg void OnNcDestroy();
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnActivateApp(BOOL bActive, DWORD hTask);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STEPPOP_H__105A59A6_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_)
|
185
win/aboutdlg.cpp
185
win/aboutdlg.cpp
|
@ -1,185 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "AboutDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
CAboutDlg::~CAboutDlg()
|
||||
{
|
||||
m_Font.DeleteObject();
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
ON_BN_CLICKED(IDC_ABTDLG_HOMEPAGE, OnHomepage)
|
||||
ON_WM_CTLCOLOR()
|
||||
ON_WM_SETCURSOR()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg message handlers
|
||||
|
||||
BOOL CAboutDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Initialize the OpenGL information box.
|
||||
CString info, tmp;
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
DescribePixelFormat(m_hViewDC, GetPixelFormat(m_hViewDC), sizeof(PIXELFORMATDESCRIPTOR), &pfd);
|
||||
|
||||
info = ("Pixel Format: ");
|
||||
if (pfd.iPixelType == PFD_TYPE_RGBA)
|
||||
info += "RGBA, ";
|
||||
else
|
||||
info += "Color Index, ";
|
||||
|
||||
if (pfd.dwFlags & PFD_DOUBLEBUFFER)
|
||||
info += "Double Buffer ";
|
||||
else
|
||||
info += "Single Buffer ";
|
||||
|
||||
if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == 0)
|
||||
info += "(Installable Client Driver)\r\n";
|
||||
else if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT))
|
||||
info += "(Mini-Client Driver)\r\n";
|
||||
else if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == PFD_GENERIC_FORMAT)
|
||||
info += "(Generic Software Driver)\r\n";
|
||||
else if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == PFD_GENERIC_ACCELERATED)
|
||||
info += "(Unknown Driver Type)\r\n";
|
||||
|
||||
tmp.Format("Color bits: %d, Depth Buffer: %d bits\r\nOpenGL Version ", pfd.cColorBits, pfd.cDepthBits);
|
||||
info += tmp;
|
||||
info += (const char*)glGetString(GL_VERSION);
|
||||
info += " (";
|
||||
info += (const char*)glGetString(GL_RENDERER);
|
||||
info += " - ";
|
||||
info += (const char*)glGetString(GL_VENDOR);
|
||||
info += ")";
|
||||
|
||||
SetDlgItemText(IDC_ABTDLG_INFO, info);
|
||||
|
||||
// Underline the homepage link.
|
||||
LOGFONT lf;
|
||||
CFont* pFont = GetDlgItem(IDC_ABTDLG_HOMEPAGE)->GetFont();
|
||||
if (pFont != NULL)
|
||||
{
|
||||
pFont->GetLogFont(&lf);
|
||||
lf.lfUnderline = TRUE;
|
||||
m_Font.DeleteObject();
|
||||
m_Font.CreateFontIndirect(&lf);
|
||||
GetDlgItem(IDC_ABTDLG_HOMEPAGE)->SetFont(&m_Font);
|
||||
}
|
||||
|
||||
// Load a "hand" cursor.
|
||||
m_hLinkCursor = LoadCursor(NULL,MAKEINTRESOURCE(IDC_HAND));
|
||||
|
||||
AdjustHomepageWindow();
|
||||
|
||||
// Fix the version number.
|
||||
SetDlgItemText(IDC_ABTDLG_VERSION, "LeoCAD Version " LC_VERSION_TEXT);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Move and resize the window so that its client area has the same size as the hyperlink text.
|
||||
// This prevents the hyperlink cursor being active when it is not over the text.
|
||||
void CAboutDlg::AdjustHomepageWindow()
|
||||
{
|
||||
CWnd *pWnd = GetDlgItem(IDC_ABTDLG_HOMEPAGE);
|
||||
ASSERT(::IsWindow(pWnd->GetSafeHwnd()));
|
||||
|
||||
// Get the current window rect
|
||||
CRect rcWnd;
|
||||
pWnd->GetWindowRect(rcWnd);
|
||||
|
||||
// For a child CWnd object, window rect is relative to the
|
||||
// upper-left corner of the parent window’s client area.
|
||||
ScreenToClient(rcWnd);
|
||||
|
||||
// Get the current client rect
|
||||
CRect rcClient;
|
||||
pWnd->GetClientRect(rcClient);
|
||||
|
||||
// Calc border size based on window and client rects
|
||||
int borderWidth = rcWnd.Width() - rcClient.Width();
|
||||
int borderHeight = rcWnd.Height() - rcClient.Height();
|
||||
|
||||
// Get the extent of window text
|
||||
CString strWndText;
|
||||
pWnd->GetWindowText(strWndText);
|
||||
|
||||
CDC* pDC = pWnd->GetDC();
|
||||
CFont* pOldFont = pDC->SelectObject(&m_Font);
|
||||
CSize Extent = pDC->GetTextExtent(strWndText);
|
||||
pDC->SelectObject(pOldFont);
|
||||
ReleaseDC(pDC);
|
||||
|
||||
// Get the text justification style
|
||||
DWORD dwStyle = pWnd->GetStyle();
|
||||
|
||||
// Recalc window size and position based on text justification
|
||||
if (dwStyle & SS_CENTERIMAGE)
|
||||
rcWnd.DeflateRect(0, (rcWnd.Height() - Extent.cy) / 2);
|
||||
else
|
||||
rcWnd.bottom = rcWnd.top + Extent.cy;
|
||||
|
||||
if (dwStyle & SS_CENTER)
|
||||
rcWnd.DeflateRect((rcWnd.Width() - Extent.cx) / 2, 0);
|
||||
else if (dwStyle & SS_RIGHT)
|
||||
rcWnd.left = rcWnd.right - Extent.cx;
|
||||
else // SS_LEFT
|
||||
rcWnd.right = rcWnd.left + Extent.cx;
|
||||
|
||||
// Move and resize the window
|
||||
pWnd->MoveWindow(rcWnd.left, rcWnd.top, rcWnd.Width() + borderWidth, rcWnd.Height() + borderHeight);
|
||||
}
|
||||
|
||||
HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
||||
{
|
||||
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
|
||||
|
||||
if (pWnd->GetDlgCtrlID() == IDC_ABTDLG_HOMEPAGE)
|
||||
pDC->SetTextColor(RGB(0, 0, 255));
|
||||
|
||||
return hbr;
|
||||
}
|
||||
|
||||
BOOL CAboutDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
|
||||
{
|
||||
if (pWnd->GetDlgCtrlID() == IDC_ABTDLG_HOMEPAGE)
|
||||
{
|
||||
if (m_hLinkCursor)
|
||||
::SetCursor(m_hLinkCursor);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return CDialog::OnSetCursor(pWnd, nHitTest, message);
|
||||
}
|
||||
|
||||
void CAboutDlg::OnHomepage()
|
||||
{
|
||||
ShellExecute(::GetDesktopWindow(), _T("open"), _T("http://www.leocad.org"), NULL, NULL, SW_NORMAL);
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
#ifndef __ABOUTDLG_H__
|
||||
#define __ABOUTDLG_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// AboutDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
HDC m_hViewDC;
|
||||
CAboutDlg();
|
||||
virtual ~CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAboutDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnHomepage();
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
void AdjustHomepageWindow();
|
||||
|
||||
CFont m_Font; // Underlined font.
|
||||
HCURSOR m_hLinkCursor; // Hand cursor.
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif //__ABOUTDLG_H__
|
130
win/arraydlg.cpp
130
win/arraydlg.cpp
|
@ -1,130 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "ArrayDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CArrayDlg dialog
|
||||
|
||||
|
||||
CArrayDlg::CArrayDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CArrayDlg::IDD, pParent)
|
||||
{
|
||||
m_bInitDone = FALSE;
|
||||
|
||||
//{{AFX_DATA_INIT(CArrayDlg)
|
||||
m_n1DCount = 10;
|
||||
m_n2DCount = 1;
|
||||
m_n3DCount = 1;
|
||||
m_nArrayDimension = 0;
|
||||
m_nTotal = 10;
|
||||
m_f2DX = 0.0f;
|
||||
m_f2DY = 0.0f;
|
||||
m_f2DZ = 0.0f;
|
||||
m_f3DX = 0.0f;
|
||||
m_f3DY = 0.0f;
|
||||
m_f3DZ = 0.0f;
|
||||
m_fMoveX = 0.0f;
|
||||
m_fMoveY = 0.0f;
|
||||
m_fMoveZ = 0.0f;
|
||||
m_fRotateX = 0.0f;
|
||||
m_fRotateY = 0.0f;
|
||||
m_fRotateZ = 0.0f;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CArrayDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CArrayDlg)
|
||||
DDX_Text(pDX, IDC_ARRAY_1D_COUNT, m_n1DCount);
|
||||
DDX_Text(pDX, IDC_ARRAY_2D_COUNT, m_n2DCount);
|
||||
DDX_Text(pDX, IDC_ARRAY_3D_COUNT, m_n3DCount);
|
||||
DDX_Radio(pDX, IDC_ARRAY_1D, m_nArrayDimension);
|
||||
DDX_Text(pDX, IDC_ARRAY_TOTAL, m_nTotal);
|
||||
DDX_Text(pDX, IDC_ARRAY_2D_X, m_f2DX);
|
||||
DDX_Text(pDX, IDC_ARRAY_2D_Y, m_f2DY);
|
||||
DDX_Text(pDX, IDC_ARRAY_2D_Z, m_f2DZ);
|
||||
DDX_Text(pDX, IDC_ARRAY_3D_X, m_f3DX);
|
||||
DDX_Text(pDX, IDC_ARRAY_3D_Y, m_f3DY);
|
||||
DDX_Text(pDX, IDC_ARRAY_3D_Z, m_f3DZ);
|
||||
DDX_Text(pDX, IDC_ARRAY_MOVE_X, m_fMoveX);
|
||||
DDX_Text(pDX, IDC_ARRAY_MOVE_Y, m_fMoveY);
|
||||
DDX_Text(pDX, IDC_ARRAY_MOVE_Z, m_fMoveZ);
|
||||
DDX_Text(pDX, IDC_ARRAY_ROTATE_X, m_fRotateX);
|
||||
DDX_Text(pDX, IDC_ARRAY_ROTATE_Y, m_fRotateY);
|
||||
DDX_Text(pDX, IDC_ARRAY_ROTATE_Z, m_fRotateZ);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CArrayDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CArrayDlg)
|
||||
ON_BN_CLICKED(IDC_ARRAY_1D, OnArrayDimension)
|
||||
ON_BN_CLICKED(IDC_ARRAY_2D, OnArrayDimension)
|
||||
ON_BN_CLICKED(IDC_ARRAY_3D, OnArrayDimension)
|
||||
ON_EN_CHANGE(IDC_ARRAY_1D_COUNT, OnChangeArrayCount)
|
||||
ON_EN_CHANGE(IDC_ARRAY_2D_COUNT, OnChangeArrayCount)
|
||||
ON_EN_CHANGE(IDC_ARRAY_3D_COUNT, OnChangeArrayCount)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CArrayDlg message handlers
|
||||
|
||||
BOOL CArrayDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
UINT IDs[15] = { IDC_ARRAY_1D_COUNT_SPIN, IDC_ARRAY_2D_COUNT_SPIN, IDC_ARRAY_3D_COUNT_SPIN,
|
||||
IDC_ARRAY_2D_X_SPIN, IDC_ARRAY_2D_Y_SPIN, IDC_ARRAY_2D_Z_SPIN,
|
||||
IDC_ARRAY_3D_X_SPIN, IDC_ARRAY_3D_Y_SPIN, IDC_ARRAY_3D_Z_SPIN,
|
||||
IDC_ARRAY_MOVE_X_SPIN, IDC_ARRAY_ROTATE_X_SPIN, IDC_ARRAY_MOVE_Y_SPIN,
|
||||
IDC_ARRAY_ROTATE_Y_SPIN, IDC_ARRAY_MOVE_Z_SPIN, IDC_ARRAY_ROTATE_Z_SPIN };
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
((CSpinButtonCtrl*)GetDlgItem(IDs[i]))->SetRange(1, 1000);
|
||||
for (int i = 3; i < 15; i++)
|
||||
((CSpinButtonCtrl*)GetDlgItem(IDs[i]))->SetRange(-1000, 1000);
|
||||
|
||||
m_bInitDone = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CArrayDlg::OnArrayDimension()
|
||||
{
|
||||
if (!IsWindow(m_hWnd))
|
||||
return;
|
||||
|
||||
UpdateData();
|
||||
for (UINT u = IDC_ARRAY_2D_COUNT; u <= IDC_ARRAY_2D_Z; u++)
|
||||
GetDlgItem(u)->EnableWindow(m_nArrayDimension > 0);
|
||||
for (UINT u = IDC_ARRAY_2D_X_SPIN; u <= IDC_ARRAY_2D_Z_SPIN; u++)
|
||||
GetDlgItem(u)->EnableWindow(m_nArrayDimension > 0);
|
||||
for (UINT u = IDC_ARRAY_3D_COUNT; u <= IDC_ARRAY_3D_Z; u++)
|
||||
GetDlgItem(u)->EnableWindow(m_nArrayDimension > 1);
|
||||
for (UINT u = IDC_ARRAY_3D_X_SPIN; u <= IDC_ARRAY_3D_Z_SPIN; u++)
|
||||
GetDlgItem(u)->EnableWindow(m_nArrayDimension > 1);
|
||||
OnChangeArrayCount();
|
||||
}
|
||||
|
||||
void CArrayDlg::OnChangeArrayCount()
|
||||
{
|
||||
if (!m_bInitDone)
|
||||
return;
|
||||
|
||||
UpdateData();
|
||||
m_nTotal = m_n1DCount;
|
||||
if (m_nArrayDimension > 0)
|
||||
m_nTotal *= m_n2DCount;
|
||||
if (m_nArrayDimension > 1)
|
||||
m_nTotal *= m_n3DCount;
|
||||
UpdateData(FALSE);
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
#if !defined(AFX_ARRAYDLG_H__4DF55C82_5A43_11D2_8202_B3F55E19C71F__INCLUDED_)
|
||||
#define AFX_ARRAYDLG_H__4DF55C82_5A43_11D2_8202_B3F55E19C71F__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// ArrayDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CArrayDlg dialog
|
||||
|
||||
class CArrayDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CArrayDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CArrayDlg)
|
||||
enum { IDD = IDD_ARRAY };
|
||||
UINT m_n1DCount;
|
||||
UINT m_n2DCount;
|
||||
UINT m_n3DCount;
|
||||
int m_nArrayDimension;
|
||||
UINT m_nTotal;
|
||||
float m_f2DX;
|
||||
float m_f2DY;
|
||||
float m_f2DZ;
|
||||
float m_f3DX;
|
||||
float m_f3DY;
|
||||
float m_f3DZ;
|
||||
float m_fMoveX;
|
||||
float m_fMoveY;
|
||||
float m_fMoveZ;
|
||||
float m_fRotateX;
|
||||
float m_fRotateY;
|
||||
float m_fRotateZ;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CArrayDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
BOOL m_bInitDone;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CArrayDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnArrayDimension();
|
||||
afx_msg void OnChangeArrayCount();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_ARRAYDLG_H__4DF55C82_5A43_11D2_8202_B3F55E19C71F__INCLUDED_)
|
|
@ -1,52 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "basewnd.h"
|
||||
|
||||
BaseWnd::BaseWnd (BaseWnd *parent, int menu_count)
|
||||
{
|
||||
m_pMenuItems = new BaseMenuItem[menu_count];
|
||||
m_pParent = parent;
|
||||
}
|
||||
|
||||
BaseWnd::~BaseWnd ()
|
||||
{
|
||||
delete [] m_pMenuItems;
|
||||
}
|
||||
|
||||
static HCURSOR g_hcurWaitCursorRestore; // old cursor to restore after wait cursor
|
||||
|
||||
void BaseWnd::BeginWait ()
|
||||
{
|
||||
HCURSOR hcurPrev = SetCursor (LoadCursor (NULL, IDC_WAIT));
|
||||
g_hcurWaitCursorRestore = hcurPrev;
|
||||
}
|
||||
|
||||
void BaseWnd::EndWait ()
|
||||
{
|
||||
SetCursor (g_hcurWaitCursorRestore);
|
||||
}
|
||||
|
||||
int BaseWnd::MessageBox (const char* text, const char* caption, int flags)
|
||||
{
|
||||
return m_pXID->MessageBox (text, caption, flags);
|
||||
}
|
||||
|
||||
void BaseWnd::ShowMenuItem (int id, bool show)
|
||||
{
|
||||
/*
|
||||
CBMPMenu* pMenu = (CBMPMenu*)GetMainMenu(0);
|
||||
CMenu* pMenu = pFrame->GetMenu();
|
||||
return pMenu->GetSubMenu(nIndex);
|
||||
*/
|
||||
}
|
||||
|
||||
void BaseWnd::EnableMenuItem (int id, bool enable)
|
||||
{
|
||||
}
|
||||
|
||||
void BaseWnd::CheckMenuItem (int id, bool check)
|
||||
{
|
||||
}
|
||||
|
||||
void BaseWnd::SetMenuItemText (int id, const char *text)
|
||||
{
|
||||
}
|
129
win/cadbar.cpp
129
win/cadbar.cpp
|
@ -1,129 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "CADBar.h"
|
||||
#include "StepPop.h"
|
||||
#include "project.h"
|
||||
#include "lc_application.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[]=__FILE__;
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
#define ID_STATUS_PROGRESS 17234
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCADStatusBar, CMFCStatusBar)
|
||||
//{{AFX_MSG_MAP(CCADStatusBar)
|
||||
ON_WM_LBUTTONDOWN()
|
||||
ON_WM_RBUTTONDOWN()
|
||||
ON_WM_SIZE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CCADStatusBar::CCADStatusBar()
|
||||
{
|
||||
m_pPopup = NULL;
|
||||
m_nProgressWidth = 150;
|
||||
m_bProgressVisible = FALSE;
|
||||
}
|
||||
|
||||
CCADStatusBar::~CCADStatusBar()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CCADStatusBar::Create(CWnd *pParentWnd, DWORD dwStyle, UINT nID)
|
||||
{
|
||||
// Default creation
|
||||
BOOL bCreatedOK = CMFCStatusBar::Create(pParentWnd,dwStyle,nID);
|
||||
|
||||
if (bCreatedOK)
|
||||
{
|
||||
// Also create the progress bar
|
||||
m_Progress.Create(WS_CHILD | WS_EX_STATICEDGE | PBS_SMOOTH, CRect(0,0,m_nProgressWidth,10), this, ID_STATUS_PROGRESS);
|
||||
}
|
||||
|
||||
return bCreatedOK;
|
||||
}
|
||||
|
||||
void CCADStatusBar::OnLButtonDown(UINT nFlags, CPoint point)
|
||||
{
|
||||
CRect rect;
|
||||
|
||||
GetItemRect(CommandToIndex(ID_INDICATOR_STEP), rect);
|
||||
if (rect.PtInRect(point))
|
||||
{
|
||||
ClientToScreen(rect);
|
||||
m_pPopup = new CStepPopup(CPoint(rect.left, rect.top), this);
|
||||
}
|
||||
|
||||
GetItemRect(CommandToIndex(ID_INDICATOR_SNAP), rect);
|
||||
if (rect.PtInRect(point))
|
||||
{
|
||||
ClientToScreen(&point);
|
||||
|
||||
CMenu PopupMenus;
|
||||
PopupMenus.LoadMenu(IDR_POPUPS);
|
||||
|
||||
CMFCPopupMenu* Popup = new CMFCPopupMenu();
|
||||
Popup->Create(AfxGetMainWnd(), point.x, point.y, PopupMenus.GetSubMenu(7)->Detach());
|
||||
}
|
||||
|
||||
CMFCStatusBar::OnLButtonDown(nFlags, point);
|
||||
}
|
||||
|
||||
void CCADStatusBar::OnRButtonDown(UINT nFlags, CPoint point)
|
||||
{
|
||||
CRect rect;
|
||||
GetItemRect(CommandToIndex(ID_INDICATOR_STEP), rect);
|
||||
if (rect.PtInRect(point))
|
||||
AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_VIEW_STEP_CHOOSE);
|
||||
|
||||
CMFCStatusBar::OnRButtonDown(nFlags, point);
|
||||
}
|
||||
|
||||
void CCADStatusBar::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
CMFCStatusBar::OnSize(nType, cx, cy);
|
||||
|
||||
if (m_bProgressVisible)
|
||||
AdjustProgressBarPosition();
|
||||
}
|
||||
|
||||
BOOL CCADStatusBar::ShowProgressBar(BOOL bShow)
|
||||
{
|
||||
// Save old visible status
|
||||
BOOL bOldVisible = m_bProgressVisible;
|
||||
|
||||
if ((bOldVisible != bShow) && ::IsWindow(m_Progress.m_hWnd))
|
||||
{
|
||||
// Show/hide
|
||||
m_Progress.ShowWindow(bShow ? SW_SHOWNA : SW_HIDE);
|
||||
m_bProgressVisible = bShow;
|
||||
|
||||
// If just shown, make sure it's in the right position
|
||||
if (bShow)
|
||||
{
|
||||
AdjustProgressBarPosition();
|
||||
RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
|
||||
}
|
||||
}
|
||||
|
||||
return bOldVisible;
|
||||
}
|
||||
|
||||
void CCADStatusBar::AdjustProgressBarPosition()
|
||||
{
|
||||
// Make sure the progress bar is created
|
||||
if(!::IsWindow(m_Progress.m_hWnd))
|
||||
return;
|
||||
|
||||
CRect Rect;
|
||||
GetItemRect(0, Rect);
|
||||
m_Progress.SetWindowPos(NULL, Rect.right - m_nProgressWidth, Rect.top,
|
||||
m_nProgressWidth, Rect.Height(), SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
56
win/cadbar.h
56
win/cadbar.h
|
@ -1,56 +0,0 @@
|
|||
// CADBar.h: interface for the CCADStatusBar class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CADBAR_H__105A59A3_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_)
|
||||
#define AFX_CADBAR_H__105A59A3_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CCADStatusBar : public CMFCStatusBar
|
||||
{
|
||||
public:
|
||||
CCADStatusBar();
|
||||
virtual ~CCADStatusBar();
|
||||
virtual BOOL Create(CWnd *pParentWnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, UINT nID = AFX_IDW_STATUS_BAR);
|
||||
|
||||
BOOL IsProgressBarVisible() const
|
||||
{ return m_bProgressVisible; }
|
||||
void SetProgressBarWidth(int nWidth)
|
||||
{ m_nProgressWidth = nWidth; }
|
||||
BOOL ShowProgressBar(BOOL bShow = TRUE);
|
||||
|
||||
void SetProgressBarRange(int nLower, int nUpper)
|
||||
{ m_Progress.SetRange(nLower,nUpper); }
|
||||
int SetProgressBarPos(int nPos)
|
||||
{ return m_Progress.SetPos(nPos); }
|
||||
int SetProgressBarStep(int nStep)
|
||||
{ return m_Progress.SetStep(nStep); }
|
||||
int StepProgressBar()
|
||||
{ return m_Progress.StepIt(); }
|
||||
|
||||
protected:
|
||||
void AdjustProgressBarPosition();
|
||||
|
||||
public:
|
||||
CWnd* m_pPopup;
|
||||
|
||||
protected:
|
||||
// Progress Bar variables.
|
||||
CProgressCtrl m_Progress;
|
||||
int m_nProgressWidth;
|
||||
BOOL m_bProgressVisible;
|
||||
|
||||
protected:
|
||||
//{{AFX_MSG(CCADStatusBar)
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_CADBAR_H__105A59A3_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_)
|
|
@ -1,42 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "categdlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCategoryDlg dialog
|
||||
|
||||
|
||||
CCategoryDlg::CCategoryDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CCategoryDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CCategoryDlg)
|
||||
m_Keywords = _T("");
|
||||
m_Name = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CCategoryDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CCategoryDlg)
|
||||
DDX_Text(pDX, IDC_CATDLG_KEYWORDS, m_Keywords);
|
||||
DDX_Text(pDX, IDC_CATDLG_NAME, m_Name);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCategoryDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CCategoryDlg)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCategoryDlg message handlers
|
|
@ -1,47 +0,0 @@
|
|||
#if !defined(AFX_CATEGDLG_H__DD3E0D88_ADD7_48A4_9B0E_99637F2010AB__INCLUDED_)
|
||||
#define AFX_CATEGDLG_H__DD3E0D88_ADD7_48A4_9B0E_99637F2010AB__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// categdlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCategoryDlg dialog
|
||||
|
||||
class CCategoryDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CCategoryDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CCategoryDlg)
|
||||
enum { IDD = IDD_CATEGORY };
|
||||
CString m_Keywords;
|
||||
CString m_Name;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CCategoryDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CCategoryDlg)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CATEGDLG_H__DD3E0D88_ADD7_48A4_9B0E_99637F2010AB__INCLUDED_)
|
|
@ -1,55 +0,0 @@
|
|||
#ifndef _CLRPICK_H_
|
||||
#define _CLRPICK_H_
|
||||
|
||||
#include "ClrPopup.h"
|
||||
|
||||
class CColorPicker : public CButton
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CColorPicker();
|
||||
DECLARE_DYNCREATE(CColorPicker);
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
int GetColorIndex();
|
||||
void SetColorIndex(int nColor);
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CColorPicker)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CColorPicker();
|
||||
|
||||
protected:
|
||||
void SetWindowSize();
|
||||
|
||||
// protected attributes
|
||||
protected:
|
||||
BOOL m_bActive; // Is the dropdown active?
|
||||
CRect m_ArrowRect;
|
||||
int m_nColor;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CColorPicker)
|
||||
afx_msg BOOL OnClicked();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
afx_msg LONG OnSelEndOK(UINT lParam, LONG wParam);
|
||||
afx_msg LONG OnSelEndCancel(UINT lParam, LONG wParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif // _CLRPICK_H_
|
|
@ -1,88 +0,0 @@
|
|||
#ifndef _CLRPOPUP_H_
|
||||
#define _CLRPOPUP_H_
|
||||
|
||||
// CColorPopup messages
|
||||
#define CPN_SELENDOK WM_USER + 1001 // Color Picker end OK
|
||||
#define CPN_SELENDCANCEL WM_USER + 1002 // Color Picker end (cancelled)
|
||||
|
||||
// forward declaration
|
||||
class CColorPicker;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CColorPopup window
|
||||
|
||||
struct CColorPopupCell
|
||||
{
|
||||
CRect Rect;
|
||||
COLORREF Color;
|
||||
int ColorIndex;
|
||||
};
|
||||
|
||||
class CColorPopup : public CWnd
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CColorPopup();
|
||||
CColorPopup(CPoint p, int nColor, CWnd* pParentWnd, bool IgnoreMouse);
|
||||
void Initialise();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
BOOL Create(CPoint p, int nColor, CWnd* pParentWnd);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CColorPopup)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CColorPopup();
|
||||
|
||||
protected:
|
||||
void SetWindowSize();
|
||||
void CalculateLayout();
|
||||
void CreateToolTips();
|
||||
void ChangeSelection(int nIndex);
|
||||
void EndSelection(int nMessage);
|
||||
void DrawCell(CDC* pDC, int nIndex);
|
||||
|
||||
// protected attributes
|
||||
protected:
|
||||
int m_nNumColumns, m_nNumRows;
|
||||
int m_nBoxSize, m_nMargin;
|
||||
int m_nCurrentSel;
|
||||
int m_nChosenColorSel;
|
||||
CRect m_WindowRect;
|
||||
CFont m_Font;
|
||||
CPalette m_Palette;
|
||||
int m_nInitialColor, m_nColor;
|
||||
CToolTipCtrl m_ToolTip;
|
||||
CWnd* m_pParent;
|
||||
bool m_IgnoreMouse;
|
||||
|
||||
CArray<CRect, const CRect&> mGroups;
|
||||
CArray<CColorPopupCell, const CColorPopupCell&> mCells;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CColorPopup)
|
||||
afx_msg void OnNcDestroy();
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg BOOL OnQueryNewPalette();
|
||||
afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnActivateApp(BOOL bActive, DWORD hTask);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif // _CLRPOPUP_H_
|
233
win/disabtab.cpp
233
win/disabtab.cpp
|
@ -1,233 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////
|
||||
// CTabCtrlWithDisable 1998 Microsoft Systems Journal.
|
||||
// If this program works, it was written by Paul DiLascia.
|
||||
// If not, I don't know who wrote it.
|
||||
//
|
||||
// CTabCtrlWithDisable implements a CTabCtrl with tabs that you can disable.
|
||||
|
||||
#include "lc_global.h"
|
||||
#include "DisabTab.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC(CTabCtrlWithDisable, CTabCtrl)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CTabCtrlWithDisable, CTabCtrl)
|
||||
//{{AFX_MSG_MAP(CTabCtrlWithDisable)
|
||||
//}}AFX_MSG_MAP
|
||||
ON_NOTIFY_REFLECT_EX(TCN_SELCHANGING, OnSelChanging)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
CTabCtrlWithDisable::CTabCtrlWithDisable()
|
||||
{
|
||||
m_bPrintOnly = FALSE;
|
||||
}
|
||||
|
||||
CTabCtrlWithDisable::~CTabCtrlWithDisable()
|
||||
{
|
||||
}
|
||||
|
||||
// Subclass the tab control: also make ownder-draw
|
||||
BOOL CTabCtrlWithDisable::SubclassDlgItem(UINT nID, CWnd* pParent)
|
||||
{
|
||||
if (!CTabCtrl::SubclassDlgItem(nID, pParent))
|
||||
return FALSE;
|
||||
|
||||
ModifyStyle(0, TCS_OWNERDRAWFIXED);
|
||||
|
||||
// If first tab is disabled, go to next enabled tab
|
||||
if (!IsTabEnabled(0))
|
||||
{
|
||||
int iTab = NextEnabledTab(0, TRUE);
|
||||
SetActiveTab(iTab);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Draw the tab: mimic SysTabControl32, except use gray if tab is disabled
|
||||
void CTabCtrlWithDisable::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
|
||||
{
|
||||
DRAWITEMSTRUCT& ds = *lpDrawItemStruct;
|
||||
|
||||
int iItem = ds.itemID;
|
||||
|
||||
// Get tab item info
|
||||
char text[128];
|
||||
TCITEM tci;
|
||||
tci.mask = TCIF_TEXT;
|
||||
tci.pszText = text;
|
||||
tci.cchTextMax = sizeof(text);
|
||||
GetItem(iItem, &tci);
|
||||
|
||||
// use draw item DC
|
||||
CDC dc;
|
||||
dc.Attach(ds.hDC);
|
||||
|
||||
dc.FillSolidRect(&ds.rcItem, GetSysColor(COLOR_3DFACE));
|
||||
|
||||
// calculate text rectangle and color
|
||||
CRect rc = ds.rcItem;
|
||||
rc += CPoint(0,3); // ?? by trial and error
|
||||
|
||||
// draw the text
|
||||
OnDrawText(dc, rc, text, !IsTabEnabled(iItem));
|
||||
|
||||
dc.Detach();
|
||||
}
|
||||
|
||||
// Draw tab text. You can override to use different color/font.
|
||||
void CTabCtrlWithDisable::OnDrawText(CDC& dc, CRect rc, CString sText, BOOL bDisabled)
|
||||
{
|
||||
if (bDisabled)
|
||||
rc += CPoint(1,1);
|
||||
dc.SetBkMode(TRANSPARENT);
|
||||
dc.SetTextColor(GetSysColor(bDisabled ? COLOR_3DHILIGHT : COLOR_BTNTEXT));
|
||||
dc.DrawText(sText, &rc, DT_CENTER|DT_VCENTER);
|
||||
|
||||
if (bDisabled)
|
||||
{
|
||||
// disabled: draw again shifted northwest for shadow effect
|
||||
rc -= CPoint(1,1);
|
||||
dc.SetTextColor(GetSysColor(COLOR_GRAYTEXT));
|
||||
dc.DrawText(sText, &rc, DT_CENTER|DT_VCENTER);
|
||||
}
|
||||
}
|
||||
|
||||
// Selection is changing: disallow if tab is disabled
|
||||
BOOL CTabCtrlWithDisable::OnSelChanging(NMHDR* pnmh, LRESULT* pRes)
|
||||
{
|
||||
// Figure out index of new tab we are about to go to, as opposed
|
||||
// to the current one we're at. Believe it or not, Windows doesn't
|
||||
// pass this info
|
||||
TC_HITTESTINFO htinfo;
|
||||
GetCursorPos(&htinfo.pt);
|
||||
ScreenToClient(&htinfo.pt);
|
||||
int iNewTab = HitTest(&htinfo);
|
||||
|
||||
BOOL bDisallowChange = (iNewTab >= 0 && !IsTabEnabled(iNewTab));
|
||||
*pRes = bDisallowChange;
|
||||
|
||||
// If change disallowed, return TRUE and stop processing; otherwise
|
||||
// (change allowed) return FALSE to let MFC continue routing the message,
|
||||
// so Windows will send PSN_KILLACTIVE to de-activate current prop page.
|
||||
return bDisallowChange;
|
||||
}
|
||||
|
||||
// Trap arrow-left key to skip disabled tabs.
|
||||
// This is the only way to know where we're coming from--ie from
|
||||
// arrow-left (prev) or arrow-right (next).
|
||||
BOOL CTabCtrlWithDisable::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
if (pMsg->message == WM_KEYDOWN &&
|
||||
(pMsg->wParam == VK_LEFT || pMsg->wParam == VK_RIGHT))
|
||||
{
|
||||
int iNewTab = (pMsg->wParam == VK_LEFT) ?
|
||||
PrevEnabledTab(GetCurSel(), FALSE) :
|
||||
NextEnabledTab(GetCurSel(), FALSE);
|
||||
if (iNewTab >= 0)
|
||||
SetActiveTab(iNewTab);
|
||||
return TRUE;
|
||||
}
|
||||
return CTabCtrl::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
// Translate parent property sheet message. Translates Control-Tab and
|
||||
// Control-Shift-Tab keys. These are normally handled by the property
|
||||
// sheet, so you must call this function from your prop sheet's
|
||||
// PreTranslateMessage function.
|
||||
BOOL CTabCtrlWithDisable::TranslatePropSheetMsg(MSG* pMsg)
|
||||
{
|
||||
WPARAM key = pMsg->wParam;
|
||||
if (pMsg->message == WM_KEYDOWN && GetAsyncKeyState(VK_CONTROL) < 0 &&
|
||||
(key == VK_TAB || key == VK_PRIOR || key == VK_NEXT))
|
||||
{
|
||||
int iNewTab = (key==VK_PRIOR || GetAsyncKeyState(VK_SHIFT) < 0) ?
|
||||
PrevEnabledTab(GetCurSel(), TRUE) :
|
||||
NextEnabledTab(GetCurSel(), TRUE);
|
||||
if (iNewTab >= 0)
|
||||
SetActiveTab(iNewTab);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Helper to set the active page, when moving backwards (left-arrow and
|
||||
// Control-Shift-Tab). Must simulate Windows messages to tell parent I
|
||||
// am changing the tab; SetCurSel does not do this!!
|
||||
//
|
||||
// In normal operation, this fn will always succeed, because I don't call it
|
||||
// unless I already know IsTabEnabled() = TRUE; but if you call SetActiveTab
|
||||
// with a random value, it could fail.
|
||||
BOOL CTabCtrlWithDisable::SetActiveTab(UINT iNewTab)
|
||||
{
|
||||
// send the parent TCN_SELCHANGING
|
||||
NMHDR nmh;
|
||||
nmh.hwndFrom = m_hWnd;
|
||||
nmh.idFrom = GetDlgCtrlID();
|
||||
nmh.code = TCN_SELCHANGING;
|
||||
|
||||
if (GetParent()->SendMessage(WM_NOTIFY, nmh.idFrom, (LPARAM)&nmh) >=0)
|
||||
{
|
||||
// OK to change: set the new tab
|
||||
SetCurSel(iNewTab);
|
||||
|
||||
// send parent TCN_SELCHANGE
|
||||
nmh.code = TCN_SELCHANGE;
|
||||
GetParent()->SendMessage(WM_NOTIFY, nmh.idFrom, (LPARAM)&nmh);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Return the index of the next enabled tab after a given index, or -1 if none
|
||||
// (0 = first tab).
|
||||
// If bWrap is TRUE, wrap from beginning to end; otherwise stop at zero.
|
||||
int CTabCtrlWithDisable::NextEnabledTab(int iCurrentTab, BOOL bWrap)
|
||||
{
|
||||
int nTabs = GetItemCount();
|
||||
for (int iTab = iCurrentTab+1; iTab != iCurrentTab; iTab++)
|
||||
{
|
||||
if (iTab >= nTabs)
|
||||
{
|
||||
if (!bWrap)
|
||||
return -1;
|
||||
iTab = 0;
|
||||
}
|
||||
|
||||
if (IsTabEnabled(iTab))
|
||||
return iTab;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Return the index of the previous enabled tab before a given index, or -1.
|
||||
// (0 = first tab).
|
||||
// If bWrap is TRUE, wrap from beginning to end; otherwise stop at zero.
|
||||
int CTabCtrlWithDisable::PrevEnabledTab(int iCurrentTab, BOOL bWrap)
|
||||
{
|
||||
for (int iTab = iCurrentTab-1; iTab != iCurrentTab; iTab--)
|
||||
{
|
||||
if (iTab < 0)
|
||||
{
|
||||
if (!bWrap)
|
||||
return -1;
|
||||
iTab = GetItemCount() - 1;
|
||||
}
|
||||
|
||||
if (IsTabEnabled(iTab))
|
||||
return iTab;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
BOOL CTabCtrlWithDisable::IsTabEnabled(int iTab)
|
||||
{
|
||||
if (m_bPrintOnly && (iTab != 4))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////
|
||||
// 1998 Microsoft Systems Journal.
|
||||
// If this code works, it was written by Paul DiLascia.
|
||||
// If not, I don't know who wrote it.
|
||||
// Compiles with Visual C++ 5.0 on Windows 95
|
||||
// See DisabTab.cpp
|
||||
//
|
||||
class CTabCtrlWithDisable : public CTabCtrl
|
||||
{
|
||||
DECLARE_DYNAMIC(CTabCtrlWithDisable)
|
||||
public:
|
||||
BOOL m_bPrintOnly;
|
||||
CTabCtrlWithDisable();
|
||||
virtual ~CTabCtrlWithDisable();
|
||||
|
||||
// functions you must implement/call
|
||||
BOOL IsTabEnabled(int iTab); // you must override
|
||||
BOOL TranslatePropSheetMsg(MSG* pMsg); // call from prop sheet
|
||||
BOOL SubclassDlgItem(UINT nID, CWnd* pParent); // non-virtual override
|
||||
|
||||
// helpers
|
||||
int NextEnabledTab(int iTab, BOOL bWrap); // get next enabled tab
|
||||
int PrevEnabledTab(int iTab, BOOL bWrap); // get prev enabled tab
|
||||
BOOL SetActiveTab(UINT iNewTab); // set tab (fail if disabled)
|
||||
|
||||
protected:
|
||||
//{{AFX_MSG(CTabCtrlWithDisable)
|
||||
//}}AFX_MSG
|
||||
afx_msg BOOL OnSelChanging(NMHDR* pNmh, LRESULT* pRes);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
// MFC overrides
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
|
||||
// override to draw text only; eg, colored text or different font
|
||||
virtual void OnDrawText(CDC& dc, CRect rc, CString sText, BOOL bDisabled);
|
||||
};
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
//
|
||||
// CDynamicSplitterWnd is a helper class built on top of the standard CSplitterWnd class
|
||||
// to make it easier to dynamically split windows at run time.
|
||||
//
|
||||
|
||||
#include "lc_global.h"
|
||||
#include "dynsplit.h"
|
||||
|
||||
BOOL CDynamicSplitterWnd::AttachWindow(CWnd* Wnd, int Row, int Col)
|
||||
{
|
||||
// Make sure the splitter window was created.
|
||||
if (!IsWindow(m_hWnd))
|
||||
{
|
||||
ASSERT(0);
|
||||
TRACE(_T("Create splitter before attaching windows to panes"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Make sure the row and col indices are within bounds.
|
||||
if (Row >= GetRowCount() || Col >= GetColumnCount())
|
||||
{
|
||||
ASSERT(0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Is the window to be attached a valid one.
|
||||
if (Wnd == NULL || (!IsWindow(Wnd->m_hWnd)))
|
||||
{
|
||||
ASSERT(0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Wnd->SetDlgCtrlID(IdFromRowCol(Row, Col));
|
||||
Wnd->SetParent(this);
|
||||
Wnd->ShowWindow(SW_SHOW);
|
||||
Wnd->InvalidateRect(NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CDynamicSplitterWnd::DetachWindow(int Row, int Col)
|
||||
{
|
||||
// Make sure the splitter window was created.
|
||||
if (!IsWindow(m_hWnd))
|
||||
{
|
||||
ASSERT(0);
|
||||
TRACE(_T("Create splitter before attaching windows to panes"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Make sure the row and col indices are within bounds.
|
||||
if (Row >= GetRowCount() || Col >= GetColumnCount())
|
||||
{
|
||||
ASSERT(0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CWnd* pWnd = GetPane(Row, Col);
|
||||
if (pWnd == NULL || (!IsWindow(pWnd->m_hWnd)))
|
||||
{
|
||||
ASSERT(0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Set the parent window handle to NULL
|
||||
// so that this child window is not destroyed
|
||||
// when the parent (splitter) is destroyed
|
||||
pWnd->SetParent(NULL);
|
||||
|
||||
//Hide the window
|
||||
pWnd->ShowWindow(SW_HIDE);
|
||||
pWnd->UpdateWindow();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CDynamicSplitterWnd::GetViewRowCol(CWnd* Window, int* Row, int* Col)
|
||||
{
|
||||
for (*Row = 0; *Row < GetRowCount(); (*Row)++)
|
||||
{
|
||||
for (*Col = 0; *Col < GetColumnCount(); (*Col)++)
|
||||
{
|
||||
if (GetPane(*Row, *Col) == Window)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(0);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef _DYNSPLIT_H_
|
||||
#define _DYNSPLIT_H_
|
||||
|
||||
class CDynamicSplitterWnd : public CSplitterWndEx
|
||||
{
|
||||
public:
|
||||
BOOL AttachWindow(CWnd* Wnd, int Row, int Col);
|
||||
BOOL DetachWindow(int Row, int Col);
|
||||
void GetViewRowCol(CWnd* Window, int* Row, int* Col);
|
||||
};
|
||||
|
||||
#endif // _DYNSPLIT_H_
|
|
@ -1,45 +0,0 @@
|
|||
/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE /* optional */
|
||||
#define USE_SETMODE /* Microsoft has setmode() */
|
||||
#undef NEED_SIGNAL_CATCHER
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
|
@ -1,122 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E4253912-37B8-C33E-42BB-4D178F0BBE9C}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>jpeglib</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</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>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jaricom.c" />
|
||||
<ClCompile Include="jcapimin.c" />
|
||||
<ClCompile Include="jcapistd.c" />
|
||||
<ClCompile Include="jcarith.c" />
|
||||
<ClCompile Include="jccoefct.c" />
|
||||
<ClCompile Include="jccolor.c" />
|
||||
<ClCompile Include="jcdctmgr.c" />
|
||||
<ClCompile Include="jchuff.c" />
|
||||
<ClCompile Include="jcinit.c" />
|
||||
<ClCompile Include="jcmainct.c" />
|
||||
<ClCompile Include="jcmarker.c" />
|
||||
<ClCompile Include="jcmaster.c" />
|
||||
<ClCompile Include="jcomapi.c" />
|
||||
<ClCompile Include="jcparam.c" />
|
||||
<ClCompile Include="jcprepct.c" />
|
||||
<ClCompile Include="jcsample.c" />
|
||||
<ClCompile Include="jctrans.c" />
|
||||
<ClCompile Include="jdapimin.c" />
|
||||
<ClCompile Include="jdapistd.c" />
|
||||
<ClCompile Include="jdarith.c" />
|
||||
<ClCompile Include="jdatadst.c" />
|
||||
<ClCompile Include="jdatasrc.c" />
|
||||
<ClCompile Include="jdcoefct.c" />
|
||||
<ClCompile Include="jdcolor.c" />
|
||||
<ClCompile Include="jddctmgr.c" />
|
||||
<ClCompile Include="jdhuff.c" />
|
||||
<ClCompile Include="jdinput.c" />
|
||||
<ClCompile Include="jdmainct.c" />
|
||||
<ClCompile Include="jdmarker.c" />
|
||||
<ClCompile Include="jdmaster.c" />
|
||||
<ClCompile Include="jdmerge.c" />
|
||||
<ClCompile Include="jdpostct.c" />
|
||||
<ClCompile Include="jdsample.c" />
|
||||
<ClCompile Include="jdtrans.c" />
|
||||
<ClCompile Include="jerror.c" />
|
||||
<ClCompile Include="jfdctflt.c" />
|
||||
<ClCompile Include="jfdctfst.c" />
|
||||
<ClCompile Include="jfdctint.c" />
|
||||
<ClCompile Include="jidctflt.c" />
|
||||
<ClCompile Include="jidctfst.c" />
|
||||
<ClCompile Include="jidctint.c" />
|
||||
<ClCompile Include="jmemmgr.c" />
|
||||
<ClCompile Include="jmemnobs.c" />
|
||||
<ClCompile Include="jquant1.c" />
|
||||
<ClCompile Include="jquant2.c" />
|
||||
<ClCompile Include="jutils.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="jconfig.h" />
|
||||
<ClInclude Include="jdct.h" />
|
||||
<ClInclude Include="jerror.h" />
|
||||
<ClInclude Include="jinclude.h" />
|
||||
<ClInclude Include="jmemsys.h" />
|
||||
<ClInclude Include="jmorecfg.h" />
|
||||
<ClInclude Include="jpegint.h" />
|
||||
<ClInclude Include="jpeglib.h" />
|
||||
<ClInclude Include="jversion.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jaricom.c" />
|
||||
<ClCompile Include="jcapimin.c" />
|
||||
<ClCompile Include="jcapistd.c" />
|
||||
<ClCompile Include="jcarith.c" />
|
||||
<ClCompile Include="jccoefct.c" />
|
||||
<ClCompile Include="jccolor.c" />
|
||||
<ClCompile Include="jcdctmgr.c" />
|
||||
<ClCompile Include="jchuff.c" />
|
||||
<ClCompile Include="jcinit.c" />
|
||||
<ClCompile Include="jcmainct.c" />
|
||||
<ClCompile Include="jcmarker.c" />
|
||||
<ClCompile Include="jcmaster.c" />
|
||||
<ClCompile Include="jcomapi.c" />
|
||||
<ClCompile Include="jcparam.c" />
|
||||
<ClCompile Include="jcprepct.c" />
|
||||
<ClCompile Include="jcsample.c" />
|
||||
<ClCompile Include="jctrans.c" />
|
||||
<ClCompile Include="jdapimin.c" />
|
||||
<ClCompile Include="jdapistd.c" />
|
||||
<ClCompile Include="jdarith.c" />
|
||||
<ClCompile Include="jdatadst.c" />
|
||||
<ClCompile Include="jdatasrc.c" />
|
||||
<ClCompile Include="jdcoefct.c" />
|
||||
<ClCompile Include="jdcolor.c" />
|
||||
<ClCompile Include="jddctmgr.c" />
|
||||
<ClCompile Include="jdhuff.c" />
|
||||
<ClCompile Include="jdinput.c" />
|
||||
<ClCompile Include="jdmainct.c" />
|
||||
<ClCompile Include="jdmarker.c" />
|
||||
<ClCompile Include="jdmaster.c" />
|
||||
<ClCompile Include="jdmerge.c" />
|
||||
<ClCompile Include="jdpostct.c" />
|
||||
<ClCompile Include="jdsample.c" />
|
||||
<ClCompile Include="jdtrans.c" />
|
||||
<ClCompile Include="jerror.c" />
|
||||
<ClCompile Include="jfdctflt.c" />
|
||||
<ClCompile Include="jfdctfst.c" />
|
||||
<ClCompile Include="jfdctint.c" />
|
||||
<ClCompile Include="jidctflt.c" />
|
||||
<ClCompile Include="jidctfst.c" />
|
||||
<ClCompile Include="jidctint.c" />
|
||||
<ClCompile Include="jmemmgr.c" />
|
||||
<ClCompile Include="jmemnobs.c" />
|
||||
<ClCompile Include="jquant1.c" />
|
||||
<ClCompile Include="jquant2.c" />
|
||||
<ClCompile Include="jutils.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="jpegint.h" />
|
||||
<ClInclude Include="jpeglib.h" />
|
||||
<ClInclude Include="jversion.h" />
|
||||
<ClInclude Include="jconfig.h" />
|
||||
<ClInclude Include="jdct.h" />
|
||||
<ClInclude Include="jerror.h" />
|
||||
<ClInclude Include="jinclude.h" />
|
||||
<ClInclude Include="jmemsys.h" />
|
||||
<ClInclude Include="jmorecfg.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
111
win/keyedit.cpp
111
win/keyedit.cpp
|
@ -1,111 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "keyedit.h"
|
||||
#include "keyboard.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CKeyEdit
|
||||
|
||||
CKeyEdit::CKeyEdit()
|
||||
{
|
||||
m_Key = 0;
|
||||
m_Control = false;
|
||||
m_Shift = false;
|
||||
}
|
||||
|
||||
CKeyEdit::~CKeyEdit()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CKeyEdit, CEdit)
|
||||
//{{AFX_MSG_MAP(CKeyEdit)
|
||||
ON_WM_KEYDOWN()
|
||||
ON_WM_KEYUP()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CKeyEdit message handlers
|
||||
|
||||
void CKeyEdit::ResetKey()
|
||||
{
|
||||
m_Key = 0;
|
||||
m_Control = false;
|
||||
m_Shift = false;
|
||||
|
||||
SetWindowText("");
|
||||
}
|
||||
|
||||
void CKeyEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
|
||||
CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
|
||||
}
|
||||
|
||||
void CKeyEdit::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
|
||||
CEdit::OnKeyUp(nChar, nRepCnt, nFlags);
|
||||
}
|
||||
|
||||
BOOL CKeyEdit::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
if (pMsg->message == WM_KEYDOWN)
|
||||
{
|
||||
// If the keys are for the dialog box or Windows, pass them.
|
||||
if ((pMsg->wParam == VK_TAB) || (pMsg->wParam == VK_ESCAPE))
|
||||
{
|
||||
// DoErasingStuff (hHotKeyEdit);
|
||||
// return CEdit::PreTranslateMessage(pMsg);
|
||||
}
|
||||
/*
|
||||
else if (pMsg->wParam == VK_BACK && !Control && !Shift)
|
||||
{
|
||||
// If backspace, then erase the edit control and disable the Assign button.
|
||||
// DoErasingStuff (hHotKeyEdit);
|
||||
// EnableWindow (GetDlgItem (GetParent (hHotKeyEdit), IDD_INSTALL), FALSE);
|
||||
SetWindowText("");
|
||||
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
else
|
||||
{
|
||||
CString Text;
|
||||
|
||||
m_Control = (GetKeyState(VK_CONTROL) < 0);
|
||||
m_Shift = (GetKeyState(VK_SHIFT) < 0);
|
||||
|
||||
if (m_Control)
|
||||
Text += "Ctrl+";
|
||||
|
||||
if (m_Shift)
|
||||
Text += "Shift+";
|
||||
|
||||
const char* KeyName = GetKeyName(pMsg->wParam);
|
||||
|
||||
if (KeyName)
|
||||
{
|
||||
Text += KeyName;
|
||||
m_Key = pMsg->wParam;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Key = 0;
|
||||
}
|
||||
|
||||
SetWindowText(Text);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return CEdit::PreTranslateMessage(pMsg);
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
#if !defined(AFX_KEYEDIT_H__E567D1C8_2DC3_4E8F_BA7D_CF628525F55C__INCLUDED_)
|
||||
#define AFX_KEYEDIT_H__E567D1C8_2DC3_4E8F_BA7D_CF628525F55C__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// keyedit.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CKeyEdit window
|
||||
|
||||
class CKeyEdit : public CEdit
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CKeyEdit();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
char m_Key;
|
||||
bool m_Control;
|
||||
bool m_Shift;
|
||||
|
||||
void ResetKey();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CKeyEdit)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CKeyEdit();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CKeyEdit)
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_KEYEDIT_H__E567D1C8_2DC3_4E8F_BA7D_CF628525F55C__INCLUDED_)
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef _LC_CONFIG_H_
|
||||
#define _LC_CONFIG_H_
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#define LC_WINDOWS
|
||||
|
||||
#define LC_POINTER_TO_INT(p) ((lcint32)(p))
|
||||
|
||||
typedef signed __int8 lcint8;
|
||||
typedef unsigned __int8 lcuint8;
|
||||
typedef signed __int16 lcint16;
|
||||
typedef unsigned __int16 lcuint16;
|
||||
typedef signed __int32 lcint32;
|
||||
typedef unsigned __int32 lcuint32;
|
||||
typedef signed __int64 lcint64;
|
||||
typedef unsigned __int64 lcuint64;
|
||||
|
||||
#define LC_LITTLE_ENDIAN
|
||||
|
||||
#define LC_HAVE_3DSFTK
|
||||
#define LC_HAVE_JPEGLIB
|
||||
#define LC_HAVE_PNGLIB
|
||||
|
||||
#endif // _LC_CONFIG_H_
|
|
@ -1,105 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{03C3A022-452E-40B3-BFD3-095713E5FFA2}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libpng</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</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>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../zlib</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../zlib</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="png.c" />
|
||||
<ClCompile Include="pngerror.c" />
|
||||
<ClCompile Include="pngget.c" />
|
||||
<ClCompile Include="pngmem.c" />
|
||||
<ClCompile Include="pngpread.c" />
|
||||
<ClCompile Include="pngread.c" />
|
||||
<ClCompile Include="pngrio.c" />
|
||||
<ClCompile Include="pngrtran.c" />
|
||||
<ClCompile Include="pngrutil.c" />
|
||||
<ClCompile Include="pngset.c" />
|
||||
<ClCompile Include="pngtrans.c" />
|
||||
<ClCompile Include="pngwio.c" />
|
||||
<ClCompile Include="pngwrite.c" />
|
||||
<ClCompile Include="pngwtran.c" />
|
||||
<ClCompile Include="pngwutil.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="png.h" />
|
||||
<ClInclude Include="pngconf.h" />
|
||||
<ClInclude Include="pngpriv.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
55
win/povdlg.h
55
win/povdlg.h
|
@ -1,55 +0,0 @@
|
|||
#if !defined(AFX_POVDLG_H__17968F81_BCE9_11D1_A742_444553540000__INCLUDED_)
|
||||
#define AFX_POVDLG_H__17968F81_BCE9_11D1_A742_444553540000__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// POVDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPOVDlg dialog
|
||||
|
||||
class CPOVDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CPOVDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPOVDlg)
|
||||
enum { IDD = IDD_EXPORTPOV };
|
||||
BOOL m_bRender;
|
||||
CString m_strPOV;
|
||||
CString m_strOut;
|
||||
CString m_strLGEO;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CPOVDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
static const DWORD m_nHelpIDs[];
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CPOVDlg)
|
||||
virtual void OnOK();
|
||||
afx_msg void OnPovbrowse();
|
||||
afx_msg void OnPovoutbrowse();
|
||||
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
|
||||
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
|
||||
afx_msg void OnPovdlgLgeobrowse();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_POVDLG_H__17968F81_BCE9_11D1_A742_444553540000__INCLUDED_)
|
181
win/progdlg.cpp
181
win/progdlg.cpp
|
@ -1,181 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "ProgDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CProgressDlg dialog
|
||||
|
||||
CProgressDlg::CProgressDlg(LPCTSTR pszTitle)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CProgressDlg)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
|
||||
m_nMinValue = 0;
|
||||
m_nMaxValue = 100;
|
||||
m_nPrevPos = 0;
|
||||
m_nPrevPercent = 0;
|
||||
m_strTitle = pszTitle;
|
||||
m_bCancel = FALSE;
|
||||
m_bParentDisabled = FALSE;
|
||||
}
|
||||
|
||||
CProgressDlg::~CProgressDlg()
|
||||
{
|
||||
if(m_hWnd != NULL)
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
BOOL CProgressDlg::Create(CWnd* pParent)
|
||||
{
|
||||
m_pParentWnd = CWnd::GetSafeOwner(pParent);
|
||||
|
||||
if((m_pParentWnd != NULL) && m_pParentWnd->IsWindowEnabled())
|
||||
{
|
||||
m_pParentWnd->EnableWindow(FALSE);
|
||||
m_bParentDisabled = TRUE;
|
||||
}
|
||||
|
||||
if(!CDialog::Create(CProgressDlg::IDD, pParent))
|
||||
{
|
||||
ReEnableParent();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CProgressDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CProgressDlg)
|
||||
DDX_Control(pDX, IDC_PRGDLG_PROGRESS, m_Progress);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CProgressDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CProgressDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CProgressDlg message handlers
|
||||
|
||||
void CProgressDlg::OnCancel()
|
||||
{
|
||||
m_bCancel = TRUE;
|
||||
}
|
||||
|
||||
BOOL CProgressDlg::CheckCancelButton()
|
||||
{
|
||||
// Process all pending messages
|
||||
PumpMessages();
|
||||
|
||||
BOOL bResult = m_bCancel;
|
||||
m_bCancel = FALSE;
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
void CProgressDlg::PumpMessages()
|
||||
{
|
||||
// Must call Create() before using the dialog
|
||||
ASSERT(m_hWnd!=NULL);
|
||||
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
if(!IsDialogMessage(&msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CProgressDlg::StepIt()
|
||||
{
|
||||
PumpMessages();
|
||||
return SetPos(m_nPrevPos + 1);
|
||||
}
|
||||
|
||||
int CProgressDlg::SetPos(int nPos)
|
||||
{
|
||||
CString strTitle;
|
||||
int nPercentage;
|
||||
|
||||
m_nPrevPos = nPos;
|
||||
|
||||
if (m_nMaxValue > m_nMinValue)
|
||||
nPercentage = (nPos*100)/(m_nMaxValue - m_nMinValue);
|
||||
else
|
||||
nPercentage = 0;
|
||||
|
||||
if ((nPercentage != m_nPrevPercent) || (nPos == 1))
|
||||
{
|
||||
m_nPrevPercent = nPercentage;
|
||||
strTitle.Format(_T("%s [%d%%]"), m_strTitle, nPercentage);
|
||||
SetWindowText(strTitle);
|
||||
}
|
||||
|
||||
return m_Progress.SetPos(nPos);
|
||||
}
|
||||
|
||||
void CProgressDlg::SetRange(int nLower, int nUpper)
|
||||
{
|
||||
ASSERT(0 <= nLower && nLower <= 65535);
|
||||
ASSERT(0 <= nUpper && nUpper <= 65535);
|
||||
|
||||
m_Progress.SetRange(nLower, nUpper);
|
||||
m_nMaxValue = nUpper;
|
||||
m_nMinValue = nLower;
|
||||
}
|
||||
|
||||
BOOL CProgressDlg::DestroyWindow()
|
||||
{
|
||||
ReEnableParent();
|
||||
return CDialog::DestroyWindow();
|
||||
}
|
||||
|
||||
void CProgressDlg::ReEnableParent()
|
||||
{
|
||||
if(m_bParentDisabled && (m_pParentWnd != NULL))
|
||||
m_pParentWnd->EnableWindow(TRUE);
|
||||
m_bParentDisabled = FALSE;
|
||||
}
|
||||
|
||||
BOOL CProgressDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_Progress.ModifyStyle(0, PBS_SMOOTH);
|
||||
m_Progress.SetRange(m_nMinValue, m_nMaxValue);
|
||||
m_Progress.SetStep(1);
|
||||
SetPos(m_nMinValue);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CProgressDlg::SetStatus(LPCTSTR lpszMessage)
|
||||
{
|
||||
ASSERT(m_hWnd);
|
||||
CWnd *pWndStatus = GetDlgItem(IDC_PRGDLG_TEXT);
|
||||
|
||||
ASSERT(pWndStatus != NULL);
|
||||
pWndStatus->SetWindowText(lpszMessage);
|
||||
}
|
||||
|
||||
void CProgressDlg::SetSubStatus(LPCTSTR lpszMessage)
|
||||
{
|
||||
ASSERT(m_hWnd);
|
||||
CWnd *pWndStatus = GetDlgItem(IDC_PRGDLG_TEXT2);
|
||||
|
||||
ASSERT(pWndStatus != NULL);
|
||||
pWndStatus->SetWindowText(lpszMessage);
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
#if !defined(AFX_PROGDLG_H__7DBF6C04_6356_11D2_8202_82A791333B5C__INCLUDED_)
|
||||
#define AFX_PROGDLG_H__7DBF6C04_6356_11D2_8202_82A791333B5C__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// ProgDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CProgressDlg dialog
|
||||
|
||||
class CProgressDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
void SetStatus(LPCTSTR lpszMessage);
|
||||
void SetSubStatus(LPCTSTR lpszMessage);
|
||||
BOOL Create(CWnd *pParent);
|
||||
void SetRange(int nLower, int nUpper);
|
||||
int SetPos(int nPos);
|
||||
int StepIt();
|
||||
BOOL CheckCancelButton();
|
||||
CProgressDlg(LPCTSTR pszTitle);
|
||||
~CProgressDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CProgressDlg)
|
||||
enum { IDD = IDD_PROGRESS };
|
||||
CProgressCtrl m_Progress;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CProgressDlg)
|
||||
public:
|
||||
virtual BOOL DestroyWindow();
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
BOOL m_bParentDisabled;
|
||||
void ReEnableParent();
|
||||
CWnd* m_pParentWnd;
|
||||
int m_nMaxValue;
|
||||
int m_nMinValue;
|
||||
CString m_strTitle;
|
||||
int m_nPrevPercent;
|
||||
int m_nPrevPos;
|
||||
void PumpMessages();
|
||||
BOOL m_bCancel;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CProgressDlg)
|
||||
virtual void OnCancel();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_PROGDLG_H__7DBF6C04_6356_11D2_8202_82A791333B5C__INCLUDED_)
|
257
win/splitter.cpp
257
win/splitter.cpp
|
@ -1,257 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "resource.h"
|
||||
#include "Splitter.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CySplitterWnd
|
||||
|
||||
CySplitterWnd::CySplitterWnd()
|
||||
{
|
||||
}
|
||||
|
||||
CySplitterWnd::~CySplitterWnd()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CySplitterWnd::BindWithControl(CWnd *parent, DWORD ctrlId)
|
||||
{
|
||||
m_Parent = parent;
|
||||
|
||||
SubclassWindow(m_Parent->GetDlgItem(ctrlId)->GetSafeHwnd());
|
||||
|
||||
// Make sure to get mouse message from the dialog window
|
||||
DWORD style = GetStyle();
|
||||
::SetWindowLong(GetSafeHwnd(), GWL_STYLE, style | SS_NOTIFY);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CySplitterWnd::Unbind(void)
|
||||
{
|
||||
DetachAllPanes();
|
||||
UnsubclassWindow();
|
||||
}
|
||||
|
||||
void CySplitterWnd::SetMinHeight(int above, int below)
|
||||
{
|
||||
m_minAbove = above;
|
||||
m_minBelow = below;
|
||||
}
|
||||
|
||||
BOOL CySplitterWnd::AttachAsAbovePane(DWORD ctrlId)
|
||||
{
|
||||
m_aboveIds.Add(ctrlId);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CySplitterWnd::AttachAsBelowPane(DWORD ctrlId)
|
||||
{
|
||||
m_belowIds.Add(ctrlId);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CySplitterWnd::DetachAllPanes(void)
|
||||
{
|
||||
m_aboveIds.RemoveAll();
|
||||
m_belowIds.RemoveAll();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CySplitterWnd::RecalcLayout(void)
|
||||
{
|
||||
CWnd *pane;
|
||||
RECT rcBar, rcPane;
|
||||
|
||||
GetWindowRect(&rcBar);
|
||||
m_Parent->ScreenToClient(&rcBar);
|
||||
|
||||
int i;
|
||||
DWORD id;
|
||||
|
||||
for (i=0; i<m_aboveIds.GetSize(); i++) {
|
||||
id = m_aboveIds.GetAt(i);
|
||||
pane = m_Parent->GetDlgItem(id);
|
||||
pane->GetWindowRect(&rcPane);
|
||||
m_Parent->ScreenToClient(&rcPane);
|
||||
rcPane.bottom = rcBar.top - 1;
|
||||
pane->MoveWindow(&rcPane, FALSE);
|
||||
}
|
||||
|
||||
for (i=0; i<m_belowIds.GetSize(); i++) {
|
||||
id = m_belowIds.GetAt(i);
|
||||
pane = m_Parent->GetDlgItem(id);
|
||||
pane->GetWindowRect(&rcPane);
|
||||
m_Parent->ScreenToClient(&rcPane);
|
||||
rcPane.top = rcBar.bottom + 1;
|
||||
pane->MoveWindow(&rcPane, FALSE);
|
||||
}
|
||||
|
||||
m_Parent->Invalidate();
|
||||
}
|
||||
|
||||
BOOL CySplitterWnd::GetMouseClipRect(LPRECT rectClip, CPoint point)
|
||||
{
|
||||
RECT rectOrg, rectTarget, rectParent, rectPane;
|
||||
int i;
|
||||
DWORD id;
|
||||
|
||||
GetWindowRect(&rectOrg);
|
||||
m_Parent->GetClientRect(&rectParent);
|
||||
m_Parent->ClientToScreen(&rectParent);
|
||||
|
||||
rectTarget = rectOrg;
|
||||
rectTarget.top = rectParent.top + m_minAbove;
|
||||
for (i=0; i<m_aboveIds.GetSize(); i++) {
|
||||
id = m_aboveIds.GetAt(i);
|
||||
m_Parent->GetDlgItem(id)->GetWindowRect(&rectPane);
|
||||
if (rectTarget.top < rectPane.top + m_minAbove) {
|
||||
rectTarget.top = rectPane.top + m_minAbove;
|
||||
}
|
||||
}
|
||||
|
||||
rectTarget.bottom = rectParent.bottom - m_minBelow;
|
||||
for (i=0; i<m_belowIds.GetSize(); i++) {
|
||||
id = m_belowIds.GetAt(i);
|
||||
m_Parent->GetDlgItem(id)->GetWindowRect(&rectPane);
|
||||
if (rectTarget.bottom > rectPane.bottom - m_minBelow) {
|
||||
rectTarget.bottom = rectPane.bottom - m_minBelow;
|
||||
}
|
||||
}
|
||||
|
||||
if (rectTarget.top >= rectTarget.bottom) {
|
||||
TRACE("No room to drag the y-splitter bar");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
rectClip->left = rectOrg.left;
|
||||
rectClip->right = rectOrg.right;
|
||||
rectClip->top = rectTarget.top + point.y;
|
||||
rectClip->bottom = rectTarget.bottom - (rectOrg.bottom - rectOrg.top - point.y) + 1;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CySplitterWnd, CWnd)
|
||||
//{{AFX_MSG_MAP(CySplitterWnd)
|
||||
ON_WM_LBUTTONDOWN()
|
||||
ON_WM_SETCURSOR()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CySplitterWnd message handlers
|
||||
|
||||
BOOL CySplitterWnd::OnSetCursor(CWnd* /*pWnd*/, UINT /*nHitTest*/, UINT /*message*/)
|
||||
{
|
||||
// TODO: Add your message handler code here and/or call default
|
||||
::SetCursor(AfxGetApp()->LoadCursor(IDC_VSPLITBAR));
|
||||
return TRUE;
|
||||
|
||||
//return CWnd::OnSetCursor(pWnd, nHitTest, message);
|
||||
}
|
||||
|
||||
void CySplitterWnd::OnLButtonDown(UINT /*nFlags*/, CPoint point)
|
||||
{
|
||||
// TODO: Add your message handler code here and/or call default
|
||||
|
||||
// don't handle if capture already set
|
||||
if (::GetCapture() != NULL) return;
|
||||
|
||||
// don't handle if no room to drag
|
||||
RECT rectMouseClip;
|
||||
if (!GetMouseClipRect(&rectMouseClip, point)) return;
|
||||
::ClipCursor(&rectMouseClip);
|
||||
|
||||
// set capture to the window which received this message
|
||||
SetCapture();
|
||||
ASSERT(this == CWnd::GetCapture());
|
||||
|
||||
// get DC for drawing
|
||||
CDC* pDrawDC;
|
||||
pDrawDC = m_Parent->GetDC();
|
||||
ASSERT_VALID(pDrawDC);
|
||||
|
||||
int curX, curY;
|
||||
int xDiff, yDiff;
|
||||
CRect rectOrg, rectCur, rectOld;
|
||||
CSize sizeBar;
|
||||
|
||||
GetWindowRect(rectOrg);
|
||||
sizeBar = CSize(rectOrg.Width(), rectOrg.Height());
|
||||
|
||||
m_Parent->ScreenToClient(rectOrg);
|
||||
pDrawDC->DrawDragRect(&rectOrg, sizeBar, NULL, sizeBar);
|
||||
rectOld = rectCur = rectOrg;
|
||||
xDiff = yDiff = 0;
|
||||
|
||||
// get messages until capture lost or cancelled/accepted
|
||||
for (;;) {
|
||||
MSG msg;
|
||||
VERIFY(::GetMessage(&msg, NULL, 0, 0));
|
||||
|
||||
if (CWnd::GetCapture() != this)
|
||||
break;
|
||||
|
||||
switch (msg.message) {
|
||||
// handle movement/accept messages
|
||||
case WM_MOUSEMOVE:
|
||||
// handle resize cases (and part of move)
|
||||
curX = (int)(short)LOWORD(msg.lParam);
|
||||
curY = (int)(short)HIWORD(msg.lParam);
|
||||
|
||||
xDiff = curX - point.x;
|
||||
yDiff = curY - point.y;
|
||||
|
||||
rectCur = rectOrg;
|
||||
rectCur.top += yDiff;
|
||||
rectCur.bottom += yDiff;
|
||||
pDrawDC->DrawDragRect(&rectCur, sizeBar, &rectOld, sizeBar);
|
||||
rectOld = rectCur;
|
||||
|
||||
break;
|
||||
|
||||
// handle cancel messages
|
||||
case WM_KEYDOWN:
|
||||
if (msg.wParam != VK_ESCAPE)
|
||||
break;
|
||||
case WM_RBUTTONDOWN:
|
||||
yDiff = 0;
|
||||
case WM_LBUTTONUP:
|
||||
goto ExitLoop;
|
||||
|
||||
// just dispatch rest of the messages
|
||||
default:
|
||||
DispatchMessage(&msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ExitLoop:
|
||||
pDrawDC->DrawDragRect(&rectCur, sizeBar, NULL, sizeBar);
|
||||
|
||||
m_Parent->ReleaseDC(pDrawDC);
|
||||
ReleaseCapture();
|
||||
::ClipCursor(NULL);
|
||||
|
||||
if (yDiff == 0)
|
||||
{
|
||||
m_Parent->SendMessage(WM_LC_SPLITTER_MOVED, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// move the splitter bar & re-position the attached panes if necessary
|
||||
MoveWindow(rectCur, FALSE);
|
||||
RecalcLayout();
|
||||
|
||||
m_Parent->SendMessage(WM_LC_SPLITTER_MOVED, yDiff, GetDlgCtrlID());
|
||||
|
||||
//CWnd::OnLButtonDown(nFlags, point);
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
// Splitter.h : header file
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_XYSPLITTERWND_H__8E3E5264_02A9_11D2_BF99_000021000B7C__INCLUDED_)
|
||||
#define AFX_XYSPLITTERWND_H__8E3E5264_02A9_11D2_BF99_000021000B7C__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CySplitterWnd : public CWnd
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CySplitterWnd();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
BOOL BindWithControl(CWnd *parent, DWORD ctrlId);
|
||||
void Unbind(void);
|
||||
|
||||
void SetMinHeight(int above, int below);
|
||||
|
||||
BOOL AttachAsAbovePane(DWORD ctrlId);
|
||||
BOOL AttachAsBelowPane(DWORD ctrlId);
|
||||
BOOL DetachAllPanes(void);
|
||||
void RecalcLayout(void);
|
||||
|
||||
protected:
|
||||
BOOL GetMouseClipRect(LPRECT rectClip, CPoint point);
|
||||
|
||||
CWnd *m_Parent;
|
||||
CDWordArray m_aboveIds, m_belowIds;
|
||||
int m_minAbove, m_minBelow;
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CySplitterWnd)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CySplitterWnd();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CySplitterWnd)
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_XYSPLITTERWND_H__8E3E5264_02A9_11D2_BF99_000021000B7C__INCLUDED_)
|
|
@ -1,5 +0,0 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// LeoCAD.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "lc_global.h"
|
|
@ -1,50 +0,0 @@
|
|||
#include "lc_global.h"
|
||||
#include "leocad.h"
|
||||
#include "transdlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CTransformDlg dialog
|
||||
|
||||
|
||||
CTransformDlg::CTransformDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CTransformDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CTransformDlg)
|
||||
m_GlobalX = 0.0f;
|
||||
m_GlobalY = 0.0f;
|
||||
m_GlobalZ = 0.0f;
|
||||
m_OffsetX = 0.0f;
|
||||
m_OffsetY = 0.0f;
|
||||
m_OffsetZ = 0.0f;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CTransformDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CTransformDlg)
|
||||
DDX_Text(pDX, IDC_TRANSDLG_GX, m_GlobalX);
|
||||
DDX_Text(pDX, IDC_TRANSDLG_GY, m_GlobalY);
|
||||
DDX_Text(pDX, IDC_TRANSDLG_GZ, m_GlobalZ);
|
||||
DDX_Text(pDX, IDC_TRANSDLG_OX, m_OffsetX);
|
||||
DDX_Text(pDX, IDC_TRANSDLG_OY, m_OffsetY);
|
||||
DDX_Text(pDX, IDC_TRANSDLG_OZ, m_OffsetZ);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CTransformDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CTransformDlg)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CTransformDlg message handlers
|
|
@ -1,51 +0,0 @@
|
|||
#if !defined(AFX_TRANSDLG_H__FF6D1B48_BEEA_4A5F_9A00_48FD3ABE72C4__INCLUDED_)
|
||||
#define AFX_TRANSDLG_H__FF6D1B48_BEEA_4A5F_9A00_48FD3ABE72C4__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// transdlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CTransformDlg dialog
|
||||
|
||||
class CTransformDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CTransformDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CTransformDlg)
|
||||
enum { IDD = IDD_TRANSFORM };
|
||||
float m_GlobalX;
|
||||
float m_GlobalY;
|
||||
float m_GlobalZ;
|
||||
float m_OffsetX;
|
||||
float m_OffsetY;
|
||||
float m_OffsetZ;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CTransformDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CTransformDlg)
|
||||
// NOTE: the ClassWizard will add member functions here
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_TRANSDLG_H__FF6D1B48_BEEA_4A5F_9A00_48FD3ABE72C4__INCLUDED_)
|
|
@ -1,157 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A7D39990-9822-4302-9709-08D03ADF1170}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>.\Debug/zlib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Debug/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Debug\zlib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Debug/zlib.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeaderOutputFile>.\Release/zlib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Release/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\Release\zlib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\Release/zlib.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="adler32.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="compress.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="crc32.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="deflate.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="inffast.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="inflate.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="inftrees.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="trees.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="uncompr.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="zutil.c">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="deflate.h" />
|
||||
<ClInclude Include="inffast.h" />
|
||||
<ClInclude Include="inffixed.h" />
|
||||
<ClInclude Include="inftrees.h" />
|
||||
<ClInclude Include="trees.h" />
|
||||
<ClInclude Include="zconf.h" />
|
||||
<ClInclude Include="zlib.h" />
|
||||
<ClInclude Include="zutil.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
Loading…
Reference in a new issue