Commit bb927ba0 authored by 刘乐's avatar 刘乐

1, ui框架搭建

parent 6d69c949
......@@ -135,6 +135,17 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/DuiLib.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>copy /y $(ProjectDir)*.h $(OutDir)..\include\
copy /y $(ProjectDir)Core\*.h $(OutDir)..\include\Core
copy /y $(ProjectDir)Control\*.h $(OutDir)..\include\Control
copy /y $(ProjectDir)Layout\*.h $(OutDir)..\include\Layout
copy /y $(ProjectDir)Utils\*.h $(OutDir)..\include\Utils
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
......
#pragma once
/* -------- ÊäÈë½ÚÃû³Æ ---------- */
#define s_TITLE "[TITL"
#define s_JUNCTIONS "[JUNC"
#define s_RESERVOIRS "[RESE"
#define s_TANKS "[TANK"
#define s_PIPES "[PIPE"
#define s_PUMPS "[PUMP"
#define s_VALVES "[VALV"
#define s_CONTROLS "[CONT"
#define s_RULES "[RULE"
#define s_DEMANDS "[DEMA"
#define s_SOURCES "[SOUR"
#define s_EMITTERS "[EMIT"
#define s_PATTERNS "[PATT"
#define s_CURVES "[CURV"
#define s_QUALITY "[QUAL"
#define s_STATUS "[STAT"
#define s_ROUGHNESS "[ROUG"
#define s_ENERGY "[ENER"
#define s_REACTIONS "[REAC"
#define s_MIXING "[MIXI"
#define s_REPORT "[REPO"
#define s_TIMES "[TIME"
#define s_OPTIONS "[OPTI"
#define s_COORDS "[COOR"
#define s_VERTICES "[VERT"
#define s_LABELS "[LABE"
#define s_BACKDROP "[BACK"
#define s_TAGS "[TAGS"
#define s_END "[END"
......@@ -141,6 +141,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>pandaLog.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
......@@ -149,6 +150,7 @@
<ClInclude Include="CivInpObserver.h" />
<ClInclude Include="CivInpSubject.h" />
<ClInclude Include="CivInpVector.h" />
<ClInclude Include="CivTypes.h" />
<ClInclude Include="pandaInpCore.h" />
</ItemGroup>
<ItemGroup>
......
......@@ -50,5 +50,8 @@
<ClInclude Include="pandaInpCore.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="CivTypes.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
#pragma once
class ComputerExamineUI : public CContainerUI
{
public:
ComputerExamineUI()
{
CDialogBuilder builder;
CContainerUI* pComputerExamine = static_cast<CContainerUI*>(builder.Create(_T("ComputerExamine.xml"), (UINT)0));
if( pComputerExamine ) {
this->Add(pComputerExamine);
}
else {
this->RemoveAll();
return;
}
}
};
class CDialogBuilderCallbackEx : public IDialogBuilderCallback
{
public:
CControlUI* CreateControl(LPCTSTR pstrClass)
{
if( _tcscmp(pstrClass, _T("ComputerExamine")) == 0 ) return new ComputerExamineUI;
return NULL;
}
};
\ No newline at end of file
#include "MainFrameWnd.h"
MainFrameWnd::MainFrameWnd()
{
}
MainFrameWnd::~MainFrameWnd()
{
}
\ No newline at end of file
#pragma once
#include "UIlib.h"
class MainFrameWnd:public WindowImplBase
{
public:
MainFrameWnd();
~MainFrameWnd();
LPCTSTR GetWindowClassName() const;
virtual void OnFinalMessage(HWND hWnd);
virtual void InitWindow();
virtual LRESULT ResponseDefaultKeyEvent(WPARAM wParam);
virtual CDuiString GetSkinFile();
virtual CDuiString GetSkinFolder();
virtual UILIB_RESOURCETYPE GetResourceType() const;
virtual CControlUI* CreateControl(LPCTSTR pstrClass);
virtual LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
virtual LRESULT HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
virtual LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
virtual LPCTSTR GetResourceID() const;
DWORD GetBkColor();
void SetBkColor(DWORD dwBackColor);
protected:
void Notify(TNotifyUI& msg);
void OnPrepare(TNotifyUI& msg);
void OnExit(TNotifyUI& msg);
void OnTimer(TNotifyUI& msg);
private:
void UpdateFriendsList();
void UpdateGroupsList();
void UpdateMicroBlogList();
private:
int bk_image_index_;
FriendListItemInfo myself_info_;
std::vector<FriendListItemInfo> friends_;
SkinChangedObserver skin_changed_observer_;
};
#include <iostream>
#include <windows.h>
#include <objbase.h>
#include <zmouse.h>
int main(char* argc, char** argv)
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
{
std::cout << "hello world" << std::endl;
/*CPaintManagerUI::SetInstance(hInstance);
CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
CPaintManagerUI::SetResourceZip(_T("360SafeRes.zip"));
HRESULT Hr = ::CoInitialize(NULL);
if (FAILED(Hr)) return 0;
C360SafeFrameWnd* pFrame = new C360SafeFrameWnd();
if (pFrame == NULL) return 0;
pFrame->Create(NULL, _T("360ȫʿ"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 800, 572);
pFrame->CenterWindow();
::ShowWindow(*pFrame, SW_SHOW);
CPaintManagerUI::MessageLoop();
::CoUninitialize();*/
return 0;
}
\ No newline at end of file
......@@ -75,6 +75,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\hModelProgram\Program\</OutDir>
<IntDir>..\temp\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
......@@ -130,19 +132,26 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;UILIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(OUTDIR)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>DuiLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OUTDIR)..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="MainFrameWnd.cpp" />
<ClCompile Include="PandaWater.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="MainFrameWnd.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
......
......@@ -18,5 +18,13 @@
<ClCompile Include="PandaWater.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="MainFrameWnd.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="MainFrameWnd.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -138,6 +138,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>$(OutDir)..\lib\$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment