From: <sag...@us...> - 2014-03-24 02:34:53
|
Revision: 3944 http://sourceforge.net/p/modplug/code/3944 Author: saga-games Date: 2014-03-24 02:34:43 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Imp] Make CTreeCtrlW::GetItemTextW behave like the MFC counterpart regarding string length. [Imp] Plugin selection dialog: Show full path in "scan folder" dialog [Imp] Plugin selection dialog: Widen buttons a bit to avoid wraparound when clicking "scan folder" button [Fix] Plugin bridge: dfx scrubby crashed on init. Modified Paths: -------------- trunk/OpenMPT/common/mptPathString.h trunk/OpenMPT/mptrack/CTreeCtrl.h trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/pluginBridge/Bridge.cpp Modified: trunk/OpenMPT/common/mptPathString.h =================================================================== --- trunk/OpenMPT/common/mptPathString.h 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/common/mptPathString.h 2014-03-24 02:34:43 UTC (rev 3944) @@ -146,6 +146,7 @@ #endif static PathString FromUTF8(const std::string &path) { return PathString(mpt::ToWide(mpt::CharsetUTF8, path)); } static PathString FromWide(const std::wstring &path) { return PathString(path); } + static PathString FromWide(const wchar_t *path) { return PathString(path); } RawPathString AsNative() const { return path; } static PathString FromNative(const RawPathString &path) { return PathString(path); } #if defined(_MFC_VER) Modified: trunk/OpenMPT/mptrack/CTreeCtrl.h =================================================================== --- trunk/OpenMPT/mptrack/CTreeCtrl.h 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/mptrack/CTreeCtrl.h 2014-03-24 02:34:43 UTC (rev 3944) @@ -94,25 +94,27 @@ #endif // UNICODE - std::wstring GetItemTextW(HTREEITEM item) const + CStringW GetItemTextW(HTREEITEM item) const { #ifdef UNICODE return GetItemText(item); #else - WCHAR name[MAX_PATH]; // Maximum displayed text length according to documentation. TVITEMW tvi; - MemsetZero(tvi); tvi.hItem = item; tvi.mask = TVIF_TEXT; - tvi.pszText = name; - tvi.cchTextMax = CountOf(name); - if(GetItem(&tvi)) + CStringW str; + int nLen = 128; + int nRes; + do { - return tvi.pszText; - } else - { - return std::wstring(); - } + nLen *= 2; + tvi.pszText = str.GetBufferSetLength(nLen); + tvi.cchTextMax = nLen; + ::SendMessage(m_hWnd, TVM_GETITEMW, 0, (LPARAM)&tvi); + nRes = wcslen(tvi.pszText); + } while (nRes >= nLen - 1); + str.ReleaseBuffer(); + return str; #endif // UNICODE } Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-03-24 02:34:43 UTC (rev 3944) @@ -619,7 +619,7 @@ } else if(!mpt::PathString::CompareNoCase(fileName.GetFileExt(), MPT_PATHSTRING(".dll"))) { CWnd *text = pluginScanDlg.GetDlgItem(IDC_SCANTEXT); - std::wstring scanStr = std::wstring(L"Scanning Plugin...\n") + wfd.cFileName; + std::wstring scanStr = L"Scanning Plugin...\n" + fileName.ToWide(); SetWindowTextW(text->m_hWnd, scanStr.c_str()); MSG msg; while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) @@ -702,19 +702,19 @@ if (m_treePlugins) { - m_treePlugins.MoveWindow(8, 36, cx - 104, cy - 88, FALSE); + m_treePlugins.MoveWindow(8, 36, cx - 109, cy - 88, FALSE); GetDlgItem(IDC_STATIC_VSTNAMEFILTER)->MoveWindow(8, 11, 40, 21, FALSE); - GetDlgItem(IDC_NAMEFILTER)->MoveWindow(40, 8, cx - 136, 21, FALSE); + GetDlgItem(IDC_NAMEFILTER)->MoveWindow(40, 8, cx - 141, 21, FALSE); GetDlgItem(IDC_TEXT_CURRENT_VSTPLUG)->MoveWindow(8, cy - 45, cx - 22, 20, FALSE); m_chkBridge.MoveWindow(8, cy - 25, 110, 20, FALSE); m_chkShare.MoveWindow(120, cy - 25, cx - 128, 20, FALSE); - const int rightOff = cx - 85; // Offset of right button column - GetDlgItem(IDOK)->MoveWindow( rightOff, 8, 75, 23, FALSE); - GetDlgItem(IDCANCEL)->MoveWindow( rightOff, 39, 75, 23, FALSE); - GetDlgItem(IDC_BUTTON1)->MoveWindow(rightOff, cy - 133, 75, 23, FALSE); - GetDlgItem(IDC_BUTTON3)->MoveWindow(rightOff, cy - 105, 75, 23, FALSE); - GetDlgItem(IDC_BUTTON2)->MoveWindow(rightOff, cy - 77, 75, 23, FALSE); + const int rightOff = cx - 90; // Offset of right button column + GetDlgItem(IDOK)->MoveWindow( rightOff, 8, 80, 23, FALSE); + GetDlgItem(IDCANCEL)->MoveWindow( rightOff, 39, 80, 23, FALSE); + GetDlgItem(IDC_BUTTON1)->MoveWindow(rightOff, cy - 133, 80, 23, FALSE); + GetDlgItem(IDC_BUTTON3)->MoveWindow(rightOff, cy - 105, 80, 23, FALSE); + GetDlgItem(IDC_BUTTON2)->MoveWindow(rightOff, cy - 77, 80, 23, FALSE); Invalidate(); } } Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-24 02:34:43 UTC (rev 3944) @@ -735,7 +735,7 @@ info.hSamples = InsertItem(_T("Samples"), IMAGE_FOLDER, IMAGE_FOLDER, info.hSong, TVI_LAST); } else if(hintFlagPart & (HINT_MODGENERAL|HINT_MODTYPE)) { - if(name != GetItemTextW(tvi.hItem)) + if(name.c_str() != GetItemTextW(info.hSong)) { SetItemText(info.hSong, name.c_str()); } Modified: trunk/OpenMPT/pluginBridge/Bridge.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/Bridge.cpp 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/pluginBridge/Bridge.cpp 2014-03-24 02:34:43 UTC (rev 3944) @@ -260,8 +260,11 @@ // Copy AEffect to shared memory. void PluginBridge::UpdateEffectStruct() { - if(otherPtrSize == 4) + if(nativeEffect == nullptr) { + return; + } else if(otherPtrSize == 4) + { sharedMem->effect32.FromNative(*nativeEffect); } else if(otherPtrSize == 8) { @@ -861,7 +864,7 @@ MPT_FALLTHROUGH; case audioMasterIOChanged: // We need to be sure that the new values are known to the master. - if(!processing) + if(!processing && nativeEffect != nullptr) { UpdateEffectStruct(); CreateProcessingFile(dispatchData); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |