Skip to content

Commit 7b82bc9

Browse files
committed
Reverted changes to themed controls - it wasn't working
1 parent 081f336 commit 7b82bc9

File tree

7 files changed

+21
-232
lines changed

7 files changed

+21
-232
lines changed

MUSHclient.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,9 +1184,6 @@ void CMUSHclientApp::RestoreColumnConfiguration (LPCTSTR strName,
11841184

11851185
} // end of RestoreColumnConfiguration
11861186

1187-
extern HMODULE HModUXT;
1188-
#define THEMEGLUE_FREE() if (HModUXT != NULL) { FreeLibrary(HModUXT); HModUXT = NULL; }
1189-
11901187
int CMUSHclientApp::ExitInstance()
11911188
{
11921189
if (!bWine)
@@ -1221,8 +1218,6 @@ int CMUSHclientApp::ExitInstance()
12211218
if (db)
12221219
sqlite3_close(db);
12231220

1224-
THEMEGLUE_FREE ();
1225-
12261221
bc_free_numbers (); // free zero, one, two
12271222

12281223
// free the resources DLL

TextView.cpp

Lines changed: 18 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,138 +1718,24 @@ pCmdUI->Enable ();
17181718
}
17191719

17201720

1721-
#if _MSC_VER < 1400
1722-
1723-
#define VERSION_6 MAKELONG(0, 6)
1724-
1725-
// from Worstje
1726-
1727-
void CTextView::Serialize(CArchive& ar)
1728-
// Read and write CTextView object to archive, with length prefix.
1729-
{
1730-
ASSERT_VALID(this);
1731-
ASSERT(m_hWnd != NULL);
1732-
if (ar.IsStoring())
1733-
{
1734-
UINT nLen = GetBufferLength();
1735-
ar << (DWORD)nLen;
1736-
WriteToArchive(ar);
1737-
}
1738-
else
1739-
{
1740-
DWORD dwLen;
1741-
ar >> dwLen;
1742-
if (dwLen > GetEditCtrl().GetLimitText())
1743-
// Larger than edit control limit. Call SetLimitText() to set your own max size.
1744-
// Refer to documentation for EM_LIMITTEXT for max sizes for your target OS.
1745-
AfxThrowArchiveException(CArchiveException::badIndex);
1746-
UINT nLen = (UINT)dwLen;
1747-
ReadFromArchive(ar, nLen);
1748-
}
1749-
ASSERT_VALID(this);
1750-
}
1751-
1752-
void CTextView::ReadFromArchive(CArchive& ar, UINT nLen)
1753-
// Read certain amount of text from the file, assume at least nLen
1754-
// characters (not bytes) are in the file.
1755-
{
1756-
ASSERT_VALID(this);
1757-
1758-
LPVOID hText = LocalAlloc(LMEM_MOVEABLE, (nLen+1)*sizeof(TCHAR));
1759-
1760-
//LPVOID hText = LocalAlloc(LMEM_MOVEABLE, static_cast<UINT>(::ATL::AtlMultiplyThrow(static_cast<UINT>(nLen+1),static_cast<UINT>(sizeof(TCHAR)))));
1761-
if (hText == NULL)
1762-
AfxThrowMemoryException();
1763-
1764-
LPTSTR lpszText = (LPTSTR)LocalLock(hText);
1765-
ASSERT(lpszText != NULL);
1766-
if (ar.Read(lpszText, nLen*sizeof(TCHAR)) != nLen*sizeof(TCHAR))
1767-
{
1768-
LocalUnlock(hText);
1769-
LocalFree(hText);
1770-
AfxThrowArchiveException(CArchiveException::endOfFile);
1771-
}
1772-
// Replace the editing edit buffer with the newly loaded data
1773-
lpszText[nLen] = '\0';
1774-
1775-
1776-
#ifndef _UNICODE
1777-
if (_AfxGetComCtlVersion() >= VERSION_6)
1778-
{
1779-
// set the text with SetWindowText, then free
1780-
BOOL bResult = ::SetWindowText(m_hWnd, lpszText);
1781-
LocalUnlock(hText);
1782-
LocalFree(hText);
1783-
1784-
// make sure that SetWindowText was successful
1785-
if (!bResult || ::GetWindowTextLength(m_hWnd) < (int)nLen)
1786-
AfxThrowMemoryException();
1787-
1788-
// remove old shadow buffer
1789-
delete[] m_pShadowBuffer;
1790-
m_pShadowBuffer = NULL;
1791-
m_nShadowSize = 0;
1792-
1793-
ASSERT_VALID(this);
1794-
return;
1795-
}
1796-
#endif
1797-
1798-
LocalUnlock(hText);
1799-
HLOCAL hOldText = GetEditCtrl().GetHandle();
1800-
ASSERT(hOldText != NULL);
1801-
LocalFree(hOldText);
1802-
GetEditCtrl().SetHandle((HLOCAL)hText);
1803-
Invalidate();
1804-
ASSERT_VALID(this);
1805-
}
1806-
1807-
void CTextView::WriteToArchive(CArchive& ar)
1808-
// Write just the text to an archive, no length prefix.
1809-
{
1810-
ASSERT_VALID(this);
1811-
LPCTSTR lpszText = LockBuffer();
1812-
ASSERT(lpszText != NULL);
1813-
UINT nLen = GetBufferLength();
1814-
TRY
1815-
{
1816-
ar.Write(lpszText, nLen*sizeof(TCHAR));
1817-
}
1818-
CATCH_ALL(e)
1819-
{
1820-
UnlockBuffer();
1821-
THROW_LAST();
1822-
}
1823-
END_CATCH_ALL
1824-
UnlockBuffer();
1825-
ASSERT_VALID(this);
1826-
}
1827-
1828-
#endif // _MSC_VER < 1400
1829-
18301721
void CTextView::SerializeRaw(CArchive& ar)
1831-
// Read/Write object as stand-alone file.
1722+
// Read/Write object as stand-alone file.
18321723
{
1833-
ASSERT_VALID(this);
1834-
if (ar.IsStoring())
1835-
{
1836-
WriteToArchive(ar);
1837-
}
1838-
else
1839-
{
1840-
CFile* pFile = ar.GetFile();
1841-
ASSERT(pFile->GetPosition() == 0);
1842-
ULONGLONG nFileSize = pFile->GetLength();
1843-
if (nFileSize/sizeof(TCHAR) > GetEditCtrl().GetLimitText())
1844-
{
1845-
// Larger than edit control limit. Call SetLimitText() to set your own max size.
1846-
// Refer to documentation for EM_LIMITTEXT for max sizes for your target OS.
1847-
AfxMessageBox(AFX_IDP_FILE_TOO_LARGE);
1848-
AfxThrowUserException();
1849-
}
1850-
// ReadFromArchive takes the number of characters as argument
1851-
ReadFromArchive(ar, (UINT)nFileSize/sizeof(TCHAR));
1852-
}
1853-
ASSERT_VALID(this);
1854-
}
1724+
ASSERT_VALID(this);
1725+
1726+
if (ar.IsStoring())
1727+
{
1728+
WriteToArchive(ar);
1729+
}
1730+
else
1731+
{
1732+
CFile* pFile = ar.GetFile();
1733+
ASSERT(pFile->GetPosition() == 0);
1734+
DWORD nFileSize = pFile->GetLength();
1735+
// ReadFromArchive takes the number of characters as argument
1736+
ReadFromArchive(ar, (UINT)nFileSize/sizeof(TCHAR));
1737+
}
1738+
ASSERT_VALID(this);
1739+
} /* end of CTextView::SerializeRaw */
1740+
18551741

TextView.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ class CTextView : public CEditView
5151
const int sourcelen,
5252
CString & result,
5353
int & count);
54-
55-
#if _MSC_VER < 1400
56-
virtual void Serialize(CArchive& ar);
57-
virtual void ReadFromArchive(CArchive& ar, UINT nLen);
58-
virtual void WriteToArchive(CArchive& ar);
59-
#endif // _MSC_VER < 1400
6054

6155
// ClassWizard generated virtual function overrides
6256
//{{AFX_VIRTUAL(CTextView)

dialogs/world_prefs/TreePropertySheet.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ static char THIS_FILE[] = __FILE__;
1717
#define SPACEBOTTOM 15
1818
#define CAPTIONHEIGHT 20
1919

20-
HMODULE HModUXT = NULL;
21-
#include "themeglue.h"
2220

2321
/////////////////////////////////////////////////////////////////////////////
2422
// CTreePropertySheet
@@ -274,8 +272,6 @@ BOOL CTreePropertySheet::OnInitDialog()
274272
{
275273
CPropertySheet::OnInitDialog();
276274

277-
ThemeGlue_EnableThemeDialogTexture(m_hWnd, ETDT_ENABLETAB);
278-
279275
if(m_bSpecialCaption) {
280276
CRect rcWindow;
281277

dialogs/world_prefs/themeglue.h

Lines changed: 0 additions & 68 deletions
This file was deleted.

install/mushclient.nsi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ Section "-MUSHclient program (required)"
8585
File "Readme.txt" ; in install directory
8686

8787
File "..\WinRel\mushclient.exe"
88-
File "..\MUSHclient.exe.manifest"
88+
; File "..\MUSHclient.exe.manifest"
89+
8990
File "..\WinRel\lua5.1.dll"
9091
File "..\lua5.1.lib"
9192
File "..\mushclient.HLP"
@@ -501,7 +502,7 @@ Section Uninstall
501502

502503
; program
503504
Delete "$INSTDIR\MUSHclient.exe"
504-
Delete "$INSTDIR\MUSHclient.exe.manifest"
505+
; Delete "$INSTDIR\MUSHclient.exe.manifest"
505506
Delete "$INSTDIR\StatusBar.exe"
506507
Delete "$INSTDIR\lua5.1.dll"
507508
Delete "$INSTDIR\lua5.1.lib"

stdafx.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -854,18 +854,3 @@ typedef struct
854854
#define BIF_NEWDIALOGSTYLE 0x00000040
855855
#endif
856856

857-
/* Manifest instructions for the linker.
858-
* Originally there is an '#IFDEF _UNICODE' statement around these pragmas, but we don't compile as _UNICODE.
859-
* Research shows this #IFDEF seems to exist by default due to a bug in CEditView in MBCS mode, but I do not
860-
* believe this bug can affect us at present as it involves 'loading from files'. Testing thus far seems to
861-
* confirm there is no different behaviour in/around the command window with this enabled. -JW
862-
*/
863-
#if _MSC_VER > 1400 // doesn't work with Visual Studio 6
864-
#if defined _M_IX86
865-
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
866-
#elif defined _M_X64
867-
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
868-
#else
869-
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
870-
#endif
871-
#endif // _MSC_VER > 1400

0 commit comments

Comments
 (0)