diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index 44b1c1ce..519de712 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -29,6 +29,11 @@ #ifndef M30_IDE_COMMUN_H #define M30_IDE_COMMUN_H +#include +#include + +#include + const bool dirUp = true; const bool dirDown = false; diff --git a/PowerEditor/src/MISC/Common/precompiledHeaders.h b/PowerEditor/src/MISC/Common/precompiledHeaders.h index 96bbf5c3..3ad68618 100644 --- a/PowerEditor/src/MISC/Common/precompiledHeaders.h +++ b/PowerEditor/src/MISC/Common/precompiledHeaders.h @@ -70,14 +70,12 @@ #include #pragma warning(pop) #include - -#ifdef UNICODE #include -#endif + // Notepad++ #include "Common.h" #include "Window.h" #include "StaticDialog.h" -#endif PRECOMPILEHEADER_H +#endif //PRECOMPILEHEADER_H diff --git a/PowerEditor/src/MISC/PluginsManager/PluginInterface.h b/PowerEditor/src/MISC/PluginsManager/PluginInterface.h index 8328f8d1..63f01c88 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginInterface.h +++ b/PowerEditor/src/MISC/PluginsManager/PluginInterface.h @@ -77,8 +77,8 @@ extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *); extern "C" __declspec(dllexport) void beNotified(SCNotification *); extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam); -#ifdef UNICODE +// This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore extern "C" __declspec(dllexport) BOOL isUnicode(); -#endif //UNICODE + #endif //PLUGININTERFACE_H diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index a618c82b..74d75cdd 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1970,11 +1970,8 @@ void Notepad_plus::deleteMarkedLines(bool isMarked) void Notepad_plus::pasteToMarkedLines() { int clipFormat; -#ifdef UNICODE clipFormat = CF_UNICODETEXT; -#else - clipFormat = CF_TEXT; -#endif + BOOL canPaste = ::IsClipboardFormatAvailable(clipFormat); if (!canPaste) return; @@ -4565,9 +4562,7 @@ bool Notepad_plus::str2Cliboard(const TCHAR *str2cpy) len2Allocate *= sizeof(TCHAR); unsigned int cilpboardFormat = CF_TEXT; -#ifdef UNICODE cilpboardFormat = CF_UNICODETEXT; -#endif HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate); if (hglbCopy == NULL) @@ -5546,7 +5541,6 @@ Quote quotes[nbQuote] = { {"Bob Gray", "Writing in C or C++ is like running a chain saw with all the safety guards removed."}, {"Roberto Waltman", "In the one and only true way. The object-oriented version of \"Spaghetti code\" is, of course, \"Lasagna code\". (Too many layers)"}, {"Gavin Russell Baker", "C++ : Where friends have access to your private members."}, -{"Alanna", "Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders."}, {"Linus Torvalds", "Software is like sex: It's better when it's free."}, {"Cult of vi", "Emacs is a great operating system, lacking only a decent editor."}, {"Church of Emacs", "vi has two modes - \"beep repeatedly\" and \"break everything\"."}, @@ -5642,7 +5636,7 @@ Quote quotes[nbQuote] = { {"Anonymous #81", "A male engineering student was crossing a road one day when a frog called out to him and said, \"If you kiss me, I'll turn into a beautiful princess.\" He bent over, picked up the frog, and put it in his pocket.\n\nThe frog spoke up again and said, \"If you kiss me and turn me back into a beautiful princess, I will stay with you for one week.\" The engineering student took the frog out of his pocket, smiled at it; and returned it to his pocket.\n\nThe frog then cried out, \"If you kiss me and turn me back into a princess, I'll stay with you and do ANYTHING you want.\" Again the boy took the frog out, smiled at it, and put it back into his pocket.\n\nFinally, the frog asked, \"What is the matter? I've told you I'm a beautiful princess, that I'll stay with you for a week and do anything you want. Why won't you kiss me?\" The boy said, \"Look I'm an engineer. I don't have time for a girlfriend, but a talking frog is cool.\"\n"}, {"Anonymous #82", "Programmers never die.\nThey just go offline."}, {"Anonymous #83", "Copy from one, it's plagiarism.\nCopy from two, it's research."}, -//{"Anonymous #84", ""}, +{"Anonymous #84", "Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders."}, {"Anonymous #85", "Race, religion, ethnic pride and nationalism etc... does nothing but teach you how to hate people that you've never met."}, {"Anonymous #86", "Farts are just the ghosts of the things we eat."}, {"Anonymous #87", "I promised I would never kill someone who had my blood.\nBut that mosquito made me break my word."}, diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index dc543550..c0cff90a 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -32,6 +32,7 @@ #include "ScintillaEditView.h" #include "keys.h" #include "localization.h" +#include "localizationString.h" #include "UserDefineDialog.h" #include "../src/sqlite/sqlite3.h" @@ -496,8 +497,6 @@ static int getKwClassFromName(const TCHAR *str) { return -1; }; -#ifdef UNICODE -#include "localizationString.h" wstring LocalizationSwitcher::getLangFromXmlFileName(const wchar_t *fn) const { @@ -541,8 +540,6 @@ bool LocalizationSwitcher::switchToLang(wchar_t *lang2switch) const return ::CopyFileW(langPath.c_str(), _nativeLangPath.c_str(), FALSE) != FALSE; } -#endif - generic_string ThemeSwitcher::getThemeFromXmlFileName(const TCHAR *xmlFullPath) const { @@ -1843,9 +1840,7 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins if (!root) return false; -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); -#endif TiXmlNodeA *contextMenuRoot = root->FirstChildElement("ScintillaContextMenu"); if (contextMenuRoot) @@ -1859,13 +1854,9 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins generic_string folderName; generic_string displayAs; -#ifdef UNICODE folderName = folderNameA?wmc->char2wchar(folderNameA, SC_CP_UTF8):TEXT(""); displayAs = displayAsA?wmc->char2wchar(displayAsA, SC_CP_UTF8):TEXT(""); -#else - folderName = folderNameA?folderNameA:""; - displayAs = displayAsA?displayAsA:""; -#endif + int id; const char *idStr = (childNode->ToElement())->Attribute("id", &id); if (idStr) @@ -1879,13 +1870,9 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins generic_string menuEntryName; generic_string menuItemName; -#ifdef UNICODE menuEntryName = menuEntryNameA?wmc->char2wchar(menuEntryNameA, SC_CP_UTF8):TEXT(""); menuItemName = menuItemNameA?wmc->char2wchar(menuItemNameA, SC_CP_UTF8):TEXT(""); -#else - menuEntryName = menuEntryNameA?menuEntryNameA:""; - menuItemName = menuItemNameA?menuItemNameA:""; -#endif + if (menuEntryName != TEXT("") && menuItemName != TEXT("")) { int nbMenuEntry = ::GetMenuItemCount(mainMenuHadle); @@ -1949,13 +1936,9 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins generic_string pluginName; generic_string pluginCmdName; -#ifdef UNICODE pluginName = pluginNameA?wmc->char2wchar(pluginNameA, SC_CP_UTF8):TEXT(""); pluginCmdName = pluginCmdNameA?wmc->char2wchar(pluginCmdNameA, SC_CP_UTF8):TEXT(""); -#else - pluginName = pluginNameA?pluginNameA:""; - pluginCmdName = pluginCmdNameA?pluginCmdNameA:""; -#endif + // if plugin menu existing plls the value of PluginEntryName and PluginCommandItemName are valid if (pluginsMenu && pluginName != TEXT("") && pluginCmdName != TEXT("")) { @@ -6417,3 +6400,62 @@ void NppParameters::safeWow64EnableWow64FsRedirection(BOOL Wow64FsEnableRedirect } } + +Date::Date(const TCHAR *dateStr) +{ + // timeStr should be Notepad++ date format : YYYYMMDD + assert(dateStr); + if (lstrlen(dateStr) == 8) + { + generic_string ds(dateStr); + generic_string yyyy(ds, 0, 4); + generic_string mm(ds, 4, 2); + generic_string dd(ds, 6, 2); + + int y = generic_atoi(yyyy.c_str()); + int m = generic_atoi(mm.c_str()); + int d = generic_atoi(dd.c_str()); + + if ((y > 0 && y <= 9999) && (m > 0 && m <= 12) && (d > 0 && d <= 31)) + { + _year = y; + _month = m; + _day = d; + return; + } + } + now(); +} + +// The constructor which makes the date of number of days from now +// nbDaysFromNow could be negative if user want to make a date in the past +// if the value of nbDaysFromNow is 0 then the date will be now +Date::Date(int nbDaysFromNow) +{ + const time_t oneDay = (60 * 60 * 24); + + time_t rawtime; + tm* timeinfo; + + time(&rawtime); + rawtime += (nbDaysFromNow * oneDay); + + timeinfo = localtime(&rawtime); + + _year = timeinfo->tm_year + 1900; + _month = timeinfo->tm_mon + 1; + _day = timeinfo->tm_mday; +} + +void Date::now() +{ + time_t rawtime; + tm* timeinfo; + + time(&rawtime); + timeinfo = localtime(&rawtime); + + _year = timeinfo->tm_year + 1900; + _month = timeinfo->tm_mon + 1; + _day = timeinfo->tm_mday; +} diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 283d8ebf..eae35abb 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -69,7 +69,7 @@ #include "dpiManager.h" #endif //DPIMANAGER_H - +#include #include class NativeLangSpeaker; @@ -402,13 +402,6 @@ public: Style & getStyler(int index) { assert(index >= 0 && index < SCE_STYLE_ARRAY_SIZE); - /* - if (index < 0 || index >= SCE_STYLE_ARRAY_SIZE) - { - Style s; - return s; - } - */ return _styleArray[index]; }; @@ -416,7 +409,6 @@ public: void addStyler(int styleID, TiXmlNode *styleNode); void addStyler(int styleID, const TCHAR *styleName) { - //ZeroMemory(&_styleArray[_nbStyler], sizeof(Style));; _styleArray[styleID]._styleID = styleID; _styleArray[styleID]._styleDesc = styleName; _styleArray[styleID]._fgColor = black; @@ -605,61 +597,14 @@ public: _day = day; }; - Date(const TCHAR *dateStr) { // timeStr should be Notepad++ date format : YYYYMMDD - assert(dateStr); - if (lstrlen(dateStr) == 8) - { - generic_string ds(dateStr); - generic_string yyyy(ds, 0, 4); - generic_string mm(ds, 4, 2); - generic_string dd(ds, 6, 2); - - int y = generic_atoi(yyyy.c_str()); - int m = generic_atoi(mm.c_str()); - int d = generic_atoi(dd.c_str()); - - if ((y > 0 && y <= 9999) && (m > 0 && m <= 12) && (d > 0 && d <= 31)) - { - _year = y; - _month = m; - _day = d; - return; - } - } - now(); - }; + Date(const TCHAR *dateStr); // The constructor which makes the date of number of days from now // nbDaysFromNow could be negative if user want to make a date in the past // if the value of nbDaysFromNow is 0 then the date will be now - Date(int nbDaysFromNow) - { - const time_t oneDay = (60 * 60 * 24); + Date(int nbDaysFromNow); - time_t rawtime; - tm* timeinfo; - - time(&rawtime); - rawtime += (nbDaysFromNow * oneDay); - - timeinfo = localtime(&rawtime); - - _year = timeinfo->tm_year+1900; - _month = timeinfo->tm_mon+1; - _day = timeinfo->tm_mday; - } - - void now() { - time_t rawtime; - tm* timeinfo; - - time(&rawtime); - timeinfo = localtime(&rawtime); - - _year = timeinfo->tm_year+1900; - _month = timeinfo->tm_mon+1; - _day = timeinfo->tm_mday; - }; + void now(); generic_string toString() { // Return Notepad++ date format : YYYYMMDD TCHAR dateStr[8+1]; diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index ca01118b..2d071afe 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -345,7 +345,6 @@ bool AutoCompletion::showWordComplete(bool autoInsert) words += TEXT(" "); } - // UNICODE TO DO _pEditView->execute(SCI_AUTOCSETSEPARATOR, WPARAM(' ')); _pEditView->execute(SCI_AUTOCSETIGNORECASE, _ignoreCase); _pEditView->showAutoComletion(curPos - startPos, words.c_str()); diff --git a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp index 1bc5b0df..3fa21f67 100644 --- a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp @@ -25,7 +25,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "SmartHighlighter.h" #include "ScintillaEditView.h" #include "FindReplaceDlg.h" diff --git a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h index 63dd48eb..ea8cf17c 100644 --- a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h +++ b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h @@ -56,6 +56,11 @@ distribution. #define TIXMLA_OSTREAM TiXmlOutStreamA #endif +#include +#include +#include +#include + class TiXmlDocumentA; class TiXmlElementA; class TiXmlCommentA; diff --git a/PowerEditor/src/TinyXml/tinyxml.h b/PowerEditor/src/TinyXml/tinyxml.h index d3730a51..7e2313ce 100644 --- a/PowerEditor/src/TinyXml/tinyxml.h +++ b/PowerEditor/src/TinyXml/tinyxml.h @@ -50,14 +50,18 @@ distribution. #define TIXML_STRING generic_string #define TIXML_ISTREAM std::basic_istream #define TIXML_OSTREAM std::basic_ostream - - #else #include "tinystr.h" #define TIXML_STRING TiXmlString #define TIXML_OSTREAM TiXmlOutStream #endif +#include + +#include + +#include "Common.h" + class TiXmlDocument; class TiXmlElement; class TiXmlComment; diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp index a2e63a7a..3218ac2c 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp @@ -26,7 +26,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + +#include +#include + #include "AboutDlg.h" #include "Parameters.h" @@ -39,17 +42,11 @@ BOOL CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) HWND compileDateHandle = ::GetDlgItem(_hSelf, IDC_BUILD_DATETIME); generic_string buildTime = TEXT("Build time : "); -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); buildTime += wmc->char2wchar(__DATE__, CP_ACP); buildTime += TEXT(" - "); buildTime += wmc->char2wchar(__TIME__, CP_ACP); -#else - buildTime += __DATE__; - buildTime += TEXT(" - "); - buildTime += __TIME__; -#endif ::SendMessage(compileDateHandle, WM_SETTEXT, 0, (LPARAM)buildTime.c_str()); ::EnableWindow(compileDateHandle, FALSE); diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h index 1dd602dc..8f7760c5 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h @@ -37,6 +37,8 @@ #include "resource.h" #endif// RESOURCE_H +#include "StaticDialog.h" + #define LICENCE_TXT \ TEXT("This program is free software; you can redistribute it and/or \ modify it under the terms of the GNU General Public License \ diff --git a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h index 776bc466..6a818b50 100644 --- a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h +++ b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h @@ -29,6 +29,9 @@ #ifndef URLCTRL_INCLUDED #define URLCTRL_INCLUDED +#include "Window.h" +#include "Common.h" + class URLCtrl : public Window { public: URLCtrl():_hfUnderlined(0),_hCursor(0), _msgDest(NULL), _cmdID(0), _oldproc(NULL), \ diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h index c0c7de4e..99de6462 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h @@ -36,6 +36,9 @@ #include "Docking.h" #endif //DOCKING_H +#include +#include + class DockingDlgInterface : public StaticDialog { public: @@ -49,7 +52,7 @@ public: StaticDialog::init(hInst, parent); TCHAR temp[MAX_PATH]; ::GetModuleFileName((HMODULE)hInst, temp, MAX_PATH); - _moduleName = PathFindFileName(temp); + _moduleName = ::PathFindFileName(temp); }; void create(tTbData * data, bool isRTL = false){ diff --git a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h index 04298a5f..84343b75 100644 --- a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h +++ b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h @@ -29,6 +29,8 @@ #ifndef IMAGE_LIST_H #define IMAGE_LIST_H +#include + const int nbMax = 45; #define IDI_SEPARATOR_ICON -1 diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp index 9d9fcf30..ff5f093f 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include + #include "FileDialog.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h index df2507d7..11711be7 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h @@ -29,6 +29,9 @@ #ifndef FILE_DIALOG_H #define FILE_DIALOG_H +#include "Common.h" +#include "Notepad_plus_msgs.h" + const int nbExtMax = 256; const int extLenMax = 64; @@ -72,8 +75,6 @@ private: OPENFILENAME _ofn; winVer _winVersion; - - //TCHAR _extArray[nbExtMax][extLenMax]; int _nbExt; int _extTypeIndex; static FileDialog *staticThis; diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp index f1d9f912..9573cea9 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "Splitter.h" bool Splitter::_isHorizontalRegistered = false; diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.h b/PowerEditor/src/WinControls/SplitterContainer/Splitter.h index 17d822d6..a2827181 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.h +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.h @@ -33,6 +33,8 @@ #include "resource.h" #endif //RESOURCE_H +#include "Window.h" + #define SV_HORIZONTAL 0x00000001 #define SV_VERTICAL 0x00000002 #define SV_FIXED 0x00000004 diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp index d85b8f11..c9fe2471 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "SplitterContainer.h" bool SplitterContainer::_isRegistered = false; diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp index b665e2d0..b6035d2e 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp @@ -25,8 +25,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include +#include +#include "StaticDialog.h" void StaticDialog::goToCenter() { diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h index d6f04c4e..f4e37456 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h @@ -33,6 +33,8 @@ #include "Notepad_plus_msgs.h" #endif //NOTEPAD_PLUS_MSGS_H +#include "Window.h" + typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD); enum PosAlign{ALIGNPOS_LEFT, ALIGNPOS_RIGHT, ALIGNPOS_TOP, ALIGNPOS_BOTTOM}; diff --git a/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp b/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp index 131555e9..49245b59 100644 --- a/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp +++ b/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "StatusBar.h" //#define IDC_STATUSBAR 789 @@ -85,3 +86,17 @@ void StatusBar::adjustParts(int clientWidth) // Tell the status bar to create the window parts. ::SendMessage(_hSelf, SB_SETPARTS, (WPARAM)_nbParts, (LPARAM)_lpParts); } + +bool StatusBar::setText(const TCHAR *str, int whichPart) +{ + if (whichPart > _nbParts) + return false; + _lastSetText = str; + return (::SendMessage(_hSelf, SB_SETTEXT, whichPart, (LPARAM)_lastSetText.c_str()) == TRUE); +} + +bool StatusBar::setOwnerDrawText(const TCHAR *str) +{ + _lastSetText = str; + return (::SendMessage(_hSelf, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)_lastSetText.c_str()) == TRUE); +} \ No newline at end of file diff --git a/PowerEditor/src/WinControls/StatusBar/StatusBar.h b/PowerEditor/src/WinControls/StatusBar/StatusBar.h index 704d6fba..9f2c2cad 100644 --- a/PowerEditor/src/WinControls/StatusBar/StatusBar.h +++ b/PowerEditor/src/WinControls/StatusBar/StatusBar.h @@ -33,6 +33,9 @@ #define _WIN32_IE 0x0600 #endif //_WIN32_IE +#include "Window.h" +#include "Common.h" + class StatusBar : public Window { public : @@ -73,18 +76,8 @@ public : return Window::getHeight(); }; - bool setText(const TCHAR *str, int whichPart) { - if (whichPart > _nbParts) - return false; - _lastSetText = str; - return (::SendMessage(_hSelf, SB_SETTEXT, whichPart, (LPARAM)_lastSetText.c_str()) == TRUE); - }; - - bool setOwnerDrawText(const TCHAR *str) { - _lastSetText = str; - return (::SendMessage(_hSelf, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)_lastSetText.c_str()) == TRUE); - }; - + bool setText(const TCHAR *str, int whichPart); + bool setOwnerDrawText(const TCHAR *str); void adjustParts(int clientWidth); private : diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index 63046ead..c9e87ea4 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -33,6 +33,9 @@ #include "Notepad_plus_msgs.h" #endif //NOTEPAD_PLUS_MSGS_H +#include "Window.h" +#include "ImageListSet.h" + #define REBAR_BAR_TOOLBAR 0 #define REBAR_BAR_SEARCH 1 @@ -45,8 +48,6 @@ using namespace std; enum toolBarStatusType {/*TB_HIDE, */TB_SMALL, TB_LARGE, TB_STANDARD}; -#include "ImageListSet.h" - typedef struct { UINT message; // identification of icon in tool bar (menu ID) diff --git a/PowerEditor/src/WinControls/Window.h b/PowerEditor/src/WinControls/Window.h index 937266b3..3e760aa5 100644 --- a/PowerEditor/src/WinControls/Window.h +++ b/PowerEditor/src/WinControls/Window.h @@ -29,6 +29,8 @@ #ifndef WINDOW_CONTROL_H #define WINDOW_CONTROL_H +#include + class Window { public: diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index 411b035e..3ffb964f 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -422,7 +422,6 @@ bool WindowsDlg::changeDlgLang() { if (!_dlgNode) return false; -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); int nativeLangEncoding = CP_ACP; TiXmlDeclarationA *declaration = _dlgNode->GetDocument()->FirstChild()->ToDeclaration(); @@ -432,18 +431,13 @@ bool WindowsDlg::changeDlgLang() EncodingMapper *em = EncodingMapper::getInstance(); nativeLangEncoding = em->getEncodingFromString(encodingStr); } -#endif // Set Title const char *titre = (_dlgNode->ToElement())->Attribute("title"); if (titre && titre[0]) { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, nativeLangEncoding); ::SetWindowText(_hSelf, nameW); -#else - ::SetWindowText(_hSelf, titre); -#endif } // Set the text of child control @@ -460,12 +454,8 @@ bool WindowsDlg::changeDlgLang() HWND hItem = ::GetDlgItem(_hSelf, id); if (hItem) { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(name, nativeLangEncoding); ::SetWindowText(hItem, nameW); -#else - ::SetWindowText(hItem, name); -#endif } } } diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.cpp b/PowerEditor/src/WinControls/shortcut/shortcut.cpp index 4c0a52c3..335deabf 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.cpp +++ b/PowerEditor/src/WinControls/shortcut/shortcut.cpp @@ -611,19 +611,10 @@ recordedMacroStep::recordedMacroStep(int iMessage, long wParam, long lParam, int case IDD_FINDINFILES_DIR_COMBO: case IDD_FINDINFILES_FILTERS_COMBO: { -#ifdef UNICODE char *ch = reinterpret_cast(lParameter); TCHAR tch[2]; ::MultiByteToWideChar(codepage, 0, ch, -1, tch, 2); sParameter = *tch; -#else - char ch = *reinterpret_cast(lParameter); - TCHAR tch = ch; - sParameter = tch; - - // dummy call - codepage = 0; -#endif MacroType = mtUseSParameter; lParameter = 0; } @@ -644,17 +635,11 @@ void recordedMacroStep::PlayBack(Window* pNotepad, ScintillaEditView *pEditView) else { long lParam = lParameter; -#ifdef UNICODE char ansiBuffer[3]; -#endif if (MacroType == mtUseSParameter) { -#ifdef UNICODE ::WideCharToMultiByte(pEditView->execute(SCI_GETCODEPAGE), 0, sParameter.c_str(), -1, ansiBuffer, 3, NULL, NULL); lParam = reinterpret_cast(ansiBuffer); -#else - lParam = reinterpret_cast(sParameter.c_str()); -#endif } pEditView->execute(message, wParameter, lParam); diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.h b/PowerEditor/src/WinControls/shortcut/shortcut.h index a67940bf..41748865 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.h +++ b/PowerEditor/src/WinControls/shortcut/shortcut.h @@ -37,6 +37,8 @@ #include "Scintilla.h" #endif //SCINTILLA_H +#include "StaticDialog.h" + using namespace std; const size_t nameLenMax = 64;