码迷,mamicode.com
首页 > Windows程序 > 详细

TeamTalk初学笔记2---关于win-client【第一篇】

时间:2015-09-08 12:45:38      阅读:1064      评论:0      收藏:0      [点我收藏+]

标签:

        为了直观的修改TT客户端页面,我花了很多时间在网上寻找UIDesigner设计工具。最后实在是找不到了,就找了同事帮忙,他climb over the wall(这个词都成敏感词汇了?博客里居然不准用)之后终于帮我下载到了。

以下是Duilib的一些网址,很多都需要climb over the wall后才能访问。

官网: www.duilib.com

论坛: bbs.duilib.com

qq: 153787916(1),79145400(2)1507570(3

google code项目托管地址: http://code.google.com/p/duilib/

svn: http://duilib.googlecode.com/svn/trunk/

新浪微博: http://weibo.com/duilib

腾讯微博: http://t.qq.com/duilib

         客户端的具体页面布局xml文件在VS工具中的目录如图1所示:


技术分享

1

这些xml源代码文件放在文件夹E:\tools\mogu.io\TeamTalk-master\win-client\bin\teamtalk\gui\下面。

修改举例:详细信息页面的用户名显示不全,我用UIDesigner工具打开了UserDetailInfoDialog.xml这个页面,并将width改为了80。如图2

技术分享

2

接下来具体分析一下win-client的源码包:VS打开后,如图3,红色标注的我在第一篇博客里面讲到过的涉及采用到其他第三方库。这里就先不去深入学习了,后面涉及到那块就学哪块吧。

技术分享

3

接下来重点讲一下其他部分:

Sln_define:解决方案的全局性配置(GlobalConfig.h)和全局变量(GlobalDefine.h)的定义。

Utility顾名思义:公用模块,如图4

技术分享

4

  1. CppSQLite3是对SQLiteAPI进行了二次封装的类。

参考资料:http://blog.csdn.net/stan1989/article/details/8589293

http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite/

  1. IniOperation:对ini文件进行读写操作的API的封装。

  2. Md5:对md5加密算法的封装。

  3. Multilingual:多语言支持包,当前只有一个从win-client\bin\teamtalk\chinese.ini文件里面取中文翻译的函数。

  4. TTThread:多线程的封装(创建、销毁、挂起等)。

  5. utilCommonAPI:常规的自定义公用函数

    原作者 快刀kuaidao@mogujie.com 同志,一个函数的注释也没有,还好都可以顾名思义,我注释了如下,不对的地方请网友指正

    //二进制转十六进制再转字符串

    CString binToHexToCString(const unsigned char * data, size_t len)


    //获取md5字符串

    CString getMd5CString(const char* pSrc, size_t length)


    //获取当前进程已加载模块的文件的完整路径

    CString getAppPath()


    //获取当前进程已加载模块的文件的父路径

    CString getParentAppPath()


    //创建路径中的全部文件夹

    BOOL createAllDirectories(CString & csDir)

     

    //基于BKDR的哈希算法

    UInt32 hash_BKDR(const char* str)

     

    //消息泵(抽取消息、翻译消息、分发消息)

    void messagePump()

     

    //将空间单位转换为人类可读的单位

    std::string getHumanReadableSizeString(double size)

     

    //文件是否存在

    BOOL isFileExist(IN const LPCTSTR csFileName)

     

    //注册dll控件

    BOOL registerDll(const CString& sFilePath)

     

    //线程等待函数(这里500ms作为判断时间)

    BOOL waitSingleObject(HANDLE handle, Int32 timeout)

  6. utilstrCodingAPI:自定义的字符串编码公用函数

    //32位整型转字符串

    CString int32ToCString(Int32 n)

     

//字符串转32位整型(要求输入的参数字符串是符合int范围[-2147483648, 2147483647])

Int32    cstringToInt32(LPCTSTR buff)

 

//无符号32位整型转字符串

std::string uint32ToString(UInt32 n)

 

//字符串转32位整型(不做参数检查)

Int32 stringToInt32(const std::string& src)

 

//utf8转字符串

CString utf8ToCString(const char* src)

 

//字符串转utf8

std::string cStringToUtf8(const CString& src)

 

//宽字符转窄字符

const std::string ws2s(const std::wstring& src)

 

//窄字符转宽字符

const std::wstring s2ws(const std::string& src)

 

//是否包含中文

BOOL isIncludeChinese(const std::string& str)

 

//获取第一个字母

std::string GetFirstLetter(const char* strChs)

 

//汉字转首字母拼音

CString HZ2FirstPY(IN std::string szHZ)

 

//汉字转拼音

char* ConvertChineseUnicodeToPyt(wchar_t* chrstr)

 

//整句翻译成拼音

 CString HZ2AllPY(IN CString szHZ)

 

//拆分字符串

    Int32 splitString(__in std::wstring src, __in std::vector<std::wstring> _vecSpliter,

     __out std::vector<std::wstring> &_splitList)

 

TeamTalk初学笔记2---关于win-client【第一篇】

标签:

原文地址:http://my.oschina.net/pmxz3/blog/502711

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!