From 3d442cc5e31ee2129226c89a8a213485d87941aa Mon Sep 17 00:00:00 2001 From: Benson <1035069088@qq.com> Date: Tue, 28 Nov 2017 00:22:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=20=E6=9B=B4=E6=8D=A2SOUI=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E5=A4=8D=E5=B0=8Fbug=201=E3=80=81=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2SOUI=E7=89=88=E6=9C=AC=EF=BC=88=E4=BB=8E2.2->2.6.3.1(2?= =?UTF-8?q?017/11/10=E7=89=88=E6=9C=AC)=EF=BC=89=202=E3=80=81=E6=B6=88?= =?UTF-8?q?=E9=99=A4warnning=203=E3=80=81=E4=BF=AE=E5=A4=8D=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E9=A2=84=E8=A7=88=20=E6=9F=90=E4=BA=9B=E6=AD=8C?= =?UTF-8?q?=E6=9B=B2=E6=AD=8C=E8=AF=8D=E6=BB=9A=E5=8A=A8=E5=BB=B6=E6=97=B6?= =?UTF-8?q?bug=204=E3=80=81=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=88=A4=E6=96=AD=E5=87=BA=E9=94=99bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BesLyric/BesLyric.cpp | Bin 7288 -> 7576 bytes BesLyric/BesLyric.vcxproj | 5 +- BesLyric/Define.h | 20 ++++--- BesLyric/MainDlg.cpp | 6 +- BesLyric/controlEx/LyricListView.h | 72 +++++++++++------------ BesLyric/entity/LyricSearcherFactory.h | 2 +- BesLyric/entity/MusicPlayer.cpp | 8 ++- BesLyric/entity/SearchLyricThread.cpp | 2 +- BesLyric/entity/SearcherGecimi.cpp | 1 - BesLyric/entity/SearcherNetEaseCloud.cpp | 3 +- BesLyric/entity/SendLoginThread.cpp | 4 +- BesLyric/entity/SendLoginThread.h | 6 +- BesLyric/res/resource.h | Bin 48380 -> 48668 bytes BesLyric/stdafx.h | 18 ++++++ BesLyric/uires/xml/dlg_main.xml | 2 +- BesLyric/utility/SplitFile.cpp | 4 +- BesLyric/utility/UrlEncoding.cpp | 2 +- BesLyric/utility/WinDialog.cpp | 20 +++++-- BesLyric/utility/WinDialog.h | 2 + BesLyric/utility/WinFile.cpp | 8 +-- BesLyric/utility/WinFile.h | 2 +- 21 files changed, 113 insertions(+), 74 deletions(-) diff --git a/BesLyric/BesLyric.cpp b/BesLyric/BesLyric.cpp index 68e371b503e917f2bab0695446c827b52b707ea3..31b26e7bacf2a3999ed09326e501cca939e43975 100644 GIT binary patch delta 172 zcmexiF~fR87UN_dMj2K;20ezD&CQI8!pxiuoRgzP6-C1tG8yt1QW)|X${Cy)au^aB ziW!P0bBn6VTQhJn=mX)4oSs0R?6ckCK^Yy(lfU`#GH?N9K)N+K5jxh3sxt$1Oui{9 zD+AH@Jk_H}Cq0S67l~CcaWZTc I6K`Sz02wF|X8-^I diff --git a/BesLyric/BesLyric.vcxproj b/BesLyric/BesLyric.vcxproj index 2f69fb5..4fb374a 100644 --- a/BesLyric/BesLyric.vcxproj +++ b/BesLyric/BesLyric.vcxproj @@ -54,7 +54,7 @@ true Level3 $(SOUIPATH)\config;$(SOUIPATH)\components;$(SOUIPATH)\SOUI\include;$(SOUIPATH)\utilities\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;STRICT;_DEBUG;%(PreprocessorDefinitions) MultiThreadedDebug true Disabled @@ -74,7 +74,7 @@ true Level3 $(SOUIPATH)\config;$(SOUIPATH)\components;$(SOUIPATH)\SOUI\include;$(SOUIPATH)\utilities\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) MultiThreaded true @@ -83,6 +83,7 @@ true $(ProjectDir)lib\json\;$(SOUIPATH)\bin;%(AdditionalLibraryDirectories) utilities.lib;soui.lib;%(AdditionalDependencies);lib_json_release.lib + /LTCG %(AdditionalOptions) diff --git a/BesLyric/Define.h b/BesLyric/Define.h index f6dbc31..371ccaf 100644 --- a/BesLyric/Define.h +++ b/BesLyric/Define.h @@ -65,15 +65,17 @@ typedef struct _PATH_STATE bool isInited; }PATH_STATE; -enum ENCODING_TYPE //文件编码类型 -{ - ASCII, - UNICODE_LITTLE_ENDIAN, - UNICODE_BIG_ENDIAN, - UTF_8, - UTF_8_NO_BOM, - OTHER -}; +namespace ENCODING_TYPE{ + enum encoding_type //文件编码类型 + { + ASCII, + UNICODE_LITTLE_ENDIAN, + UNICODE_BIG_ENDIAN, + UTF_8, + UTF_8_NO_BOM, + OTHER + }; +}//为了避免 warning (nonstandard extension used: enum 'ENCODING_TYPE' used in qualified name) 而定义的命名空间 //储存获取的单个歌词信息 struct LyricInfo diff --git a/BesLyric/MainDlg.cpp b/BesLyric/MainDlg.cpp index 569cb3a..d0e4885 100644 --- a/BesLyric/MainDlg.cpp +++ b/BesLyric/MainDlg.cpp @@ -258,9 +258,9 @@ void CMainDlg::OnSize(UINT nType, CSize size) //璁剧疆绋嬪簭绐楀彛鐨勮儗鏅浘鐗 void CMainDlg::setBackSkin() { - SSkinImgList * pSkin = sobj_cast(GETSKIN(_T("skin_bkimg"))); - SASSERT(pSkin); - FindChildByID(R.id.img_skin_layer)->SetAttribute(L"skin",_T("skin_bkimg")); + //SSkinImgList * pSkin = sobj_cast(GETSKIN(_T("skin_bkimg"))); + //SASSERT(pSkin); + //FindChildByID(R.id.img_skin_layer)->SetAttribute(L"skin",_T("skin_bkimg")); //COLORREF crAvg = SDIBHelper::CalcAvarageColor(pSkin->GetImage()); //DoColorize(crAvg); diff --git a/BesLyric/controlEx/LyricListView.h b/BesLyric/controlEx/LyricListView.h index e50a37f..85f5413 100644 --- a/BesLyric/controlEx/LyricListView.h +++ b/BesLyric/controlEx/LyricListView.h @@ -13,42 +13,42 @@ class CLyricListView: public SMCListView //在窗口大小发生改变时,改变每一个项的宽度 void OnSize(UINT nType, CSize size) { - SHDITEM item; - item.mask = 0 | SHDI_TEXT| SHDI_WIDTH| SHDI_LPARAM| SHDI_SORTFLAG| SHDI_ORDER; - item.cchTextMax = MAX_BUFFER_SIZE/2; - - int count = m_pHeader->GetItemCount(); - vector items(count,item); //存储项信息 - vector pszText(count, nullptr); //存储项字符串指针 - - //获取项的信息 - for(int i=0; iGetItem(i, &items[i]); - } - - //设置修改后的各个项的宽度 - items[0].cx = 30; - items[3].cx = 100; - items[4].cx = 200; - - int nWidthLeft = (size.cx - 30 - items[0].cx - items[3].cx - items[4].cx); - items[1].cx = nWidthLeft * 2 / 3; - items[2].cx = nWidthLeft * 1 / 3; - - //删除原来所有的项 - m_pHeader->DeleteAllItems(); - - //添加修改宽度后的项 - for(int i=0; iInsertItem(i,items[i].pszText, items[i].cx, items[i].stFlag, items[i].lParam); - - for(int i=0; iGetItemCount(); + //vector items(count,item); //存储项信息 + //vector pszText(count, nullptr); //存储项字符串指针 + // + ////获取项的信息 + //for(int i=0; iGetItem(i, &items[i]); + //} + + ////设置修改后的各个项的宽度 + //items[0].cx = 30; + //items[3].cx = 100; + //items[4].cx = 200; + + //int nWidthLeft = (size.cx - 30 - items[0].cx - items[3].cx - items[4].cx); + //items[1].cx = nWidthLeft * 2 / 3; + //items[2].cx = nWidthLeft * 1 / 3; + + ////删除原来所有的项 + //m_pHeader->DeleteAllItems(); + // + ////添加修改宽度后的项 + //for(int i=0; iInsertItem(i,items[i].pszText, items[i].cx, items[i].stFlag, items[i].lParam); + // + //for(int i=0; isetVolumn(this->m_nVolumn); + if(milliSecondPosition < 200) + milliSecondPosition = 200; //经过调试发现,有些歌曲在滚动预览时,滚动出现延迟(估计是 MCI获取 歌曲位置时返回了一个偏小的值) + //进一步调试发现,当 play(n) 中 n 小于约59毫秒,是出现这种情况的一个必要条件 + //所以,当这里设置初始播放位置总是大于59毫秒(这里设置为200毫秒),来避免这种情况 + //设置为从200毫秒播放,基本不影响歌词制作 + m_mciPlay.dwCallback=(DWORD)this->m_hdlHostWnd; m_mciPlay.dwFrom = (DWORD)milliSecondPosition; //播放起始位置ms为单位 mciSendCommand(m_mciOpen.wDeviceID, MCI_PLAY, MCI_NOTIFY|MCI_FROM, (DWORD)(LPVOID)&m_mciPlay); diff --git a/BesLyric/entity/SearchLyricThread.cpp b/BesLyric/entity/SearchLyricThread.cpp index 66afee8..7384fef 100644 --- a/BesLyric/entity/SearchLyricThread.cpp +++ b/BesLyric/entity/SearchLyricThread.cpp @@ -46,7 +46,7 @@ DWORD WINAPI CSearchLyricThread::ProcSearch(LPVOID pParam) SStringW strResultTip = L""; int nTotalCount = 0; - for( int i= 0; i < (int)SEARCH_FROM::UNDEFINED; i++) //遍历每一种定义的歌词获取方式 + for( int i= 0; i < (int)SF_UNDEFINED; i++) //遍历每一种定义的歌词获取方式 { pSearcher = nullptr;//在 CreateSearcher 中对 SOUI智能指针取 地址& 前,先置为空(释放上一次分配的堆对象) CLyricSearcherFactory::CreateSearcher((SEARCH_FROM)i, pSearcher); diff --git a/BesLyric/entity/SearcherGecimi.cpp b/BesLyric/entity/SearcherGecimi.cpp index 8999e6d..88fc3a4 100644 --- a/BesLyric/entity/SearcherGecimi.cpp +++ b/BesLyric/entity/SearcherGecimi.cpp @@ -68,7 +68,6 @@ void SearcherGecimi::GetOneLyricInfoFromLyricBuffer(wstring strLyricBuffer,Lyric wstring strPlaneText = L""; wstring strLabelText = L"";; - WCHAR szTimeBuf[MAX_BUFFER_SIZE/2]; for(auto iter = vecTimeLineInfo.begin(); iter != vecTimeLineInfo.end(); iter++) { strPlaneText += iter->m_strLine; diff --git a/BesLyric/entity/SearcherNetEaseCloud.cpp b/BesLyric/entity/SearcherNetEaseCloud.cpp index a7e11ad..cf32ec4 100644 --- a/BesLyric/entity/SearcherNetEaseCloud.cpp +++ b/BesLyric/entity/SearcherNetEaseCloud.cpp @@ -41,7 +41,7 @@ bool SearcherNetEaseCloud::SearchLyric(SStringW strSong, SStringW strArtist, vec char szID[MAX_BUFFER_SIZE]; //获取id对应的歌词 - if(!httpRequest.Get("music.163.com/api/song/lyric",string("os=osx&id=") + itoa( iter->nID,szID, 10) + string("&lv=-1&kv=-1&tv=-1"), strLyricJson)) + if(!httpRequest.Get("music.163.com/api/song/lyric",string("os=osx&id=") + _itoa( iter->nID,szID, 10) + string("&lv=-1&kv=-1&tv=-1"), strLyricJson)) { m_strLastResult = L"网络连接失败,无法获取歌词内容数据"; return false; @@ -128,7 +128,6 @@ void SearcherNetEaseCloud::GetOneLyricInfoFromLyricBuffer(wstring strLyricBuffer wstring strPlaneText = L""; wstring strLabelText = L"";; - WCHAR szTimeBuf[MAX_BUFFER_SIZE/2]; for(auto iter = vecTimeLineInfo.begin(); iter != vecTimeLineInfo.end(); iter++) { strPlaneText += iter->m_strLine; diff --git a/BesLyric/entity/SendLoginThread.cpp b/BesLyric/entity/SendLoginThread.cpp index f0cc0de..827d489 100644 --- a/BesLyric/entity/SendLoginThread.cpp +++ b/BesLyric/entity/SendLoginThread.cpp @@ -9,7 +9,7 @@ using namespace SOUI; //开始线程 -bool SendLoginThread::Start(bool bAnonymity) +bool SendLoginThread::Start(BOOL bAnonymity) { //启动线程 if(m_handleThread != NULL) @@ -40,7 +40,7 @@ DWORD WINAPI SendLoginThread::ThreadProc(LPVOID pParam) } //发送登录信息(ip地址) -void SendLoginThread::SendLoginInfo(bool bAnonymity) +void SendLoginThread::SendLoginInfo(BOOL bAnonymity) { //获得ip地址 //DownloadFile(L"https://whatismyipaddress.com/",L"E://git//BesLyric//Release//ip.txt"); diff --git a/BesLyric/entity/SendLoginThread.h b/BesLyric/entity/SendLoginThread.h index 949fef2..dc18627 100644 --- a/BesLyric/entity/SendLoginThread.h +++ b/BesLyric/entity/SendLoginThread.h @@ -37,7 +37,7 @@ class SendLoginThread : public Singleton SendLoginThread():m_handleThread(NULL){} //开始线程 - bool Start(bool bAnonymity); + bool Start(BOOL bAnonymity); private: @@ -45,11 +45,11 @@ class SendLoginThread : public Singleton static DWORD WINAPI ThreadProc(LPVOID pParam); //发送登录信息(ip地址) - void SendLoginInfo(bool bAnonymity); + void SendLoginInfo(BOOL bAnonymity); private: HANDLE m_handleThread; /* 当前线程句柄 */ - bool m_bAnonymity; /* 线程循环标记 */ + BOOL m_bAnonymity; /* 线程循环标记 */ }; diff --git a/BesLyric/res/resource.h b/BesLyric/res/resource.h index 617f2bda3e138600d4006cb07e2f9875ba5aacdc..470620f94b8f4a73c8d0835f014370df1f1f539d 100644 GIT binary patch delta 1315 zcmZvcUuaWz6vywxg_xC4YUfJ1-2HYJ zM{%3$#*l4H8J!=fPNX=;#*k6EReTT`;?s~KVaN~>5g+zYd?-bPfe-t&*3pM?Ilu4u zeb4Wld+#~tcb@*U>HO18)Ag@pl#G&7b}K<8EZ05q2}s%X>&_pyzc!+jrS)B9Oc_y* zDj!JweYxt2PYKDhyOmuW+4(YucQ_XAZTDzf|K~V6i?8C3dT~SzW}_ylvPoNBJ>4AR z`il;xvfC&(oBZN6Sjh{nH+w0)=i)-MhBp>qxjDp4%*2kxScw_@9t#p}3E*iF%(NIx zw3s|;@nIg>#+??8rnrfS>s*XCG8OmWY&BVoM@Y2#2(;=fwi+C7wK3WZ9=8TLF41oD zQE6-7!Wjp_qKe*bvUJ9cqg`XVJ-|IvWv){_-QlCN-O2n}eRa!ZhmGAKKU?zOeAmG3 z4wd5mIO1Hbv}-)vA7g%hfK+FQ^rRO{a*Lf|Zcf&(+5KHjxVr??T_Nth=_X`rtVnLD zUn60M5&kOn4QTvfM>u6$nB68*wwuLcE~>g!zUpqG)Gb)*4l+F}`EHGP!oo-heoB~B zeJIno)yav3&gPyVcO{qW(XqRnR1z-2Jw7f=neOqhIqBnp#AH(7Nj5N_^mF#(YK~=9 z+`S(DOj`8ydI|Lk&PzNl@u9>U?+A=OFU~$eSxQ5%gHDNm^;x8UsA7IV#X7K$bDy{o z2URXgy)y1Zq*NUJekun-r24~H{esK=Cf9aVakxvvIS`h45Tpl8?)R_eL2zpzx*k)* zIv8D#sqwSapU12o^fMc*W7%}B)hIXUqjAvW_TY10mBy6(=fV1QAB}S;Ht#nkj`&I7Jv7sR1fP+4rwe)?$~gE%B5{swGPt5b=;TxOT$5|5rYfEE~-al z?nVT|BVis%xh3^z+QhfVjW;ddmk#k!TCgm|opw=9S5c9AQ%2V5at+Ry%BhS&G2`W~ z#48yOMpiJFak44vWhNWo)||F}ed>6ewbpvZ9@U9wYjA)0tZy!jHgalI;K&IUMF AeEJ7{@c|f=DJoLKi}~TrMsP*V~W<7t-LeASOnQG0_;`VqVOPF$U*e7^8$D zqwFbKjqlm~plrco4pT;Ob#uze&lztF4Wb8DKa(MVX=Q)@Ex&L#X zbN{mC^6!>4%j<4kUY8YPPM6c&)VXzUi@cz_`Q2OJzQL(o&)Je;PqLXMPJ((?`|OnZ zY&`87<&`&7n;)ge7wzF2YgBsfVCQ|(pa=)FeewAv! zs~(a$7SmA3gB;R$Am%F}mD)Ws?E?}=p&l9^7`U?_p$(|)4=B_Hr$2P!8I))Y*ttE} zO=8f_uY(%9f{q~#{g9KdhB}!ZveVjSV<{}LJ>(+Or8IL(Smi;NgWpBH7LE`dR_ntK zbQh=Tw#B_ll5^M z`h?7>U|7(Wuu&JR2>v3tD`I6r>~q(EKWXJ6;b&t)BQxQv`&%(iO8h+G!#UE4HtFDC zQl&oW7ItOMM1C-3AeEEoneqtB67?yKS@iH*`0H-le^N9a{lIdRC5ZK zIdL^2mh&=h5j%M=Yk52F*V>T_X8z18Y!+KNE*P7ww-mPGE{Lu#xY#Oq|8G4BV^O92 zjz(L+O0}qAofn>pZmRPNArXi3qil%UMyZX)*BvBEG94usj+&W6k$+tBu~vI=r&cx> zu5l{XlJCBFSu()|J4Xu +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif + #define DLL_SOUI #include #include @@ -31,3 +35,17 @@ extern int _MessageBox(HWND hwnd,LPCTSTR content, LPCTSTR tiltle, UINT uType); //浠呯敤浜庢祴璇曟椂锛屽揩閫熷啓鍑 寮规鎻愮ず鐨勪唬鐮 : MB("content"); void MB(LPCTSTR content); +//绂佺敤绗笁鏂瑰簱鐨勮鍛 +//#pragma warning(disable:4127) +//#pragma warning(disable:4244) +//#pragma warning(disable:4311) +//#pragma warning(disable:4312) +//#pragma warning(disable:4512) +//#pragma warning(disable:4571) +//#pragma warning(disable:4640) +//#pragma warning(disable:4706) +//#pragma warning(disable:4710) +//#pragma warning(disable:4800) +//#pragma warning(disable:4804) +//#pragma warning(disable:4820) +#pragma warning(disable:4996) //鍦ㄨ繖閲屾秷闄soncpp 搴撲腑鐨勮鍛 diff --git a/BesLyric/uires/xml/dlg_main.xml b/BesLyric/uires/xml/dlg_main.xml index d94ea60..0cee41c 100644 --- a/BesLyric/uires/xml/dlg_main.xml +++ b/BesLyric/uires/xml/dlg_main.xml @@ -6,7 +6,7 @@ > - + @string/title diff --git a/BesLyric/utility/SplitFile.cpp b/BesLyric/utility/SplitFile.cpp index b3fdee7..b0a1674 100644 --- a/BesLyric/utility/SplitFile.cpp +++ b/BesLyric/utility/SplitFile.cpp @@ -61,7 +61,7 @@ bool CSplitFile::SplitFile(wstring strSrcFile, wstring strToPath, wstring strToN while( (nSize = fread(pBlockData, sizeof(char),nBlockSize, pFile))) { char szBuffer[MAX_BUFFER_SIZE]; - string strFileNameA = strTargetFileNamePreA+ "." + itoa(nCount++, szBuffer, 10) + SERVER_FILE_EXTENTION_A; + string strFileNameA = strTargetFileNamePreA+ "." + _itoa(nCount++, szBuffer, 10) + SERVER_FILE_EXTENTION_A; FILE *pFileTarget; ret = fopen_s(& pFileTarget, strFileNameA.c_str(), "wb"); @@ -205,7 +205,7 @@ bool CSplitFile::MergeToOneFile(wstring strMergedFilePathName,wstring strTarget { // char szBuffer[MAX_BUFFER_SIZE]; - string strFileNameA = strTargetFileNamePreA+ "." + itoa(i, szBuffer, 10) + SERVER_FILE_EXTENTION_A; + string strFileNameA = strTargetFileNamePreA+ "." + _itoa(i, szBuffer, 10) + SERVER_FILE_EXTENTION_A; FILE *pFileSplited; ret = fopen_s(& pFileSplited, strFileNameA.c_str(), "rb"); diff --git a/BesLyric/utility/UrlEncoding.cpp b/BesLyric/utility/UrlEncoding.cpp index 444226c..8a7fabb 100644 --- a/BesLyric/utility/UrlEncoding.cpp +++ b/BesLyric/utility/UrlEncoding.cpp @@ -195,7 +195,7 @@ string CUrlEncodinig::UrlGB2312Decode(string str) { string output=""; char tmp[2]; - int i=0,idx=0,ndx,len=str.length(); + int i=0,idx=0,len=str.length(); while(i *line // 从文件中读取歌词,并将非空行加入到 maker.m_vLyricOrigin 向量中 while(fgetws(line,MAX_WCHAR_COUNT_OF_LINE,encodingFile.m_pf)) { - line[MAX_CHAR_COUNT_OF_LINE]='\0';//保证在最后一个字符处截断字符串 + line[MAX_WCHAR_COUNT_OF_LINE]='\0';//保证在最后一个字符处截断字符串 //由变长字符转换为 unicode 宽字节字符 //MultiByteToWideChar(CP_ACP,MB_COMPOSITE,_line,strlen(_line)+1,line,MAX_WCHAR_COUNT_OF_LINE+1); @@ -429,7 +429,7 @@ bool FileHelper::IsDirectory(SStringW path) { //查找panelFloder是否存在 WIN32_FIND_DATA FindFileData; - BOOL bValue = false; + bool bValue = false; HANDLE hFind = FindFirstFile(path, &FindFileData); if ((hFind != INVALID_HANDLE_VALUE) && (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { diff --git a/BesLyric/utility/WinFile.h b/BesLyric/utility/WinFile.h index 8206e50..b52f8da 100644 --- a/BesLyric/utility/WinFile.h +++ b/BesLyric/utility/WinFile.h @@ -56,7 +56,7 @@ class File{ LPCTSTR m_lpszMode; /* 打开文件的模式 */ FILE *m_pf; /* 存放当前打开文件的指针*/ - ENCODING_TYPE m_encodingType; /* 存放文件编码格式 */ + ENCODING_TYPE::encoding_type m_encodingType; /* 存放文件编码格式 */ }; From ec3e9da747c98b761781736fa7a006b243ff8bb5 Mon Sep 17 00:00:00 2001 From: Benson <1035069088@qq.com> Date: Tue, 28 Nov 2017 00:56:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B7=9F=E6=8D=A2SOUI=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E4=BF=AE=E6=94=B9MCListView=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=A1=A8=E5=A4=B4=E8=AE=A1=E7=AE=97=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=8C=E9=80=82=E5=BA=94=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BesLyric/controlEx/LyricListView.h | 64 ++++++++++++++---------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/BesLyric/controlEx/LyricListView.h b/BesLyric/controlEx/LyricListView.h index 85f5413..4ecf753 100644 --- a/BesLyric/controlEx/LyricListView.h +++ b/BesLyric/controlEx/LyricListView.h @@ -13,42 +13,36 @@ class CLyricListView: public SMCListView //在窗口大小发生改变时,改变每一个项的宽度 void OnSize(UINT nType, CSize size) { - //SHDITEM item; - //item.mask = 0 | SHDI_TEXT| SHDI_WIDTH| SHDI_LPARAM| SHDI_SORTFLAG| SHDI_ORDER; + SHDITEM item; + item.mask = 0 | SHDI_TEXT| SHDI_WIDTH| SHDI_LPARAM| SHDI_SORTFLAG| SHDI_ORDER; //item.cchTextMax = MAX_BUFFER_SIZE/2; - // - //int count = m_pHeader->GetItemCount(); - //vector items(count,item); //存储项信息 - //vector pszText(count, nullptr); //存储项字符串指针 - // - ////获取项的信息 - //for(int i=0; iGetItem(i, &items[i]); - //} - - ////设置修改后的各个项的宽度 - //items[0].cx = 30; - //items[3].cx = 100; - //items[4].cx = 200; - - //int nWidthLeft = (size.cx - 30 - items[0].cx - items[3].cx - items[4].cx); - //items[1].cx = nWidthLeft * 2 / 3; - //items[2].cx = nWidthLeft * 1 / 3; - - ////删除原来所有的项 - //m_pHeader->DeleteAllItems(); - // - ////添加修改宽度后的项 - //for(int i=0; iInsertItem(i,items[i].pszText, items[i].cx, items[i].stFlag, items[i].lParam); - // - //for(int i=0; iGetItemCount(); + vector items(count,item); //存储项信息 + + //获取项的信息 + for(int i=0; iGetItem(i, &items[i]); + items[i].text.SetCtxProvider(this); + items[i].text.TranslateText(); //获得执行翻译得到翻译文本 + } + + //设置修改后的各个项的宽度 + items[0].cx = 30; + items[3].cx = 100; + items[4].cx = 200; + + int nWidthLeft = (size.cx - 30 - items[0].cx - items[3].cx - items[4].cx); + items[1].cx = nWidthLeft * 2 / 3; + items[2].cx = nWidthLeft * 1 / 3; + + //删除原来所有的项 + m_pHeader->DeleteAllItems(); + + //添加修改宽度后的项 + for(int i=0; iInsertItem(i,items[i].text.GetText(), items[i].cx, items[i].stFlag, items[i].lParam); SMCListView::OnSize(nType, size); }