[NEW_FEATURE] Add 2 new plugins APIs: NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR & NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR

[NEW_FEATURE] Make internal docking dialog match/follow the selected theme's background and foreground colors.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1259 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-07-16 11:20:58 +00:00
parent e9ada08611
commit f3407442db
14 changed files with 240 additions and 32 deletions

View File

@ -395,6 +395,15 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
// VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot) // VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot)
// Disable or enable extension column of doc switcher // Disable or enable extension column of doc switcher
#define NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR (NPPMSG + 90)
// INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0)
// Return: current editor default foreground color. You should convert the returned value in COLORREF
#define NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR (NPPMSG + 91)
// INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0)
// Return: current editor default background color. You should convert the returned value in COLORREF
#define RUNCOMMAND_USER (WM_USER + 3000) #define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)

View File

@ -654,12 +654,25 @@ LRESULT Notepad_plus::init(HWND hwnd)
default : // hide & undocked default : // hide & undocked
break; break;
} }
// UserDefine Dialog
//
// Menu & toolbar for UserDefine Dialog
//
checkMenuItem(IDM_LANG_USER_DLG, uddShow); checkMenuItem(IDM_LANG_USER_DLG, uddShow);
_toolBar.setCheck(IDM_LANG_USER_DLG, uddShow); _toolBar.setCheck(IDM_LANG_USER_DLG, uddShow);
//launch the plugin dlg memorized at the last session //
// Initialize the default forground & background color
//
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
int i = globalStyles.getStylerIndexByID(STYLE_DEFAULT);
Style & style = globalStyles.getStyler(i);
(NppParameters::getInstance())->setCurrentDefaultFgColor(style._fgColor);
(NppParameters::getInstance())->setCurrentDefaultBgColor(style._bgColor);
//
// launch the plugin dlg memorized at the last session
//
DockingManagerData &dmd = nppGUI._dockingData; DockingManagerData &dmd = nppGUI._dockingData;
_dockingManager.setDockedContSize(CONT_LEFT , nppGUI._dockingData._leftWidth); _dockingManager.setDockedContSize(CONT_LEFT , nppGUI._dockingData._leftWidth);
@ -5026,7 +5039,14 @@ void Notepad_plus::launchClipboardHistoryPanel()
data.pszName = title; data.pszName = title;
} }
::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data);
COLORREF fgColor = (NppParameters::getInstance())->getCurrentDefaultFgColor();
COLORREF bgColor = (NppParameters::getInstance())->getCurrentDefaultBgColor();
_pClipboardHistoryPanel->setBackgroundColor(bgColor);
_pClipboardHistoryPanel->setForegroundColor(fgColor);
} }
_pClipboardHistoryPanel->display(); _pClipboardHistoryPanel->display();
} }
@ -5061,6 +5081,12 @@ void Notepad_plus::launchFileSwitcherPanel()
data.pszName = title; data.pszName = title;
} }
::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data);
COLORREF fgColor = (NppParameters::getInstance())->getCurrentDefaultFgColor();
COLORREF bgColor = (NppParameters::getInstance())->getCurrentDefaultBgColor();
_pFileSwitcherPanel->setBackgroundColor(bgColor);
_pFileSwitcherPanel->setForegroundColor(fgColor);
} }
_pFileSwitcherPanel->display(); _pFileSwitcherPanel->display();
} }
@ -5096,7 +5122,14 @@ void Notepad_plus::launchAnsiCharPanel()
data.pszName = title; data.pszName = title;
} }
::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data);
COLORREF fgColor = (NppParameters::getInstance())->getCurrentDefaultFgColor();
COLORREF bgColor = (NppParameters::getInstance())->getCurrentDefaultBgColor();
_pAnsiCharPanel->setBackgroundColor(bgColor);
_pAnsiCharPanel->setForegroundColor(fgColor);
} }
_pAnsiCharPanel->display(); _pAnsiCharPanel->display();
} }
@ -5136,6 +5169,12 @@ void Notepad_plus::launchProjectPanel(int cmdID, ProjectPanel ** pProjPanel, int
data.pszName = title; data.pszName = title;
} }
::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data);
COLORREF fgColor = (NppParameters::getInstance())->getCurrentDefaultFgColor();
COLORREF bgColor = (NppParameters::getInstance())->getCurrentDefaultBgColor();
(*pProjPanel)->setBackgroundColor(bgColor);
(*pProjPanel)->setForegroundColor(fgColor);
} }
(*pProjPanel)->display(); (*pProjPanel)->display();
} }
@ -5217,9 +5256,16 @@ void Notepad_plus::launchFunctionList()
} }
::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data);
COLORREF fgColor = (NppParameters::getInstance())->getCurrentDefaultFgColor();
COLORREF bgColor = (NppParameters::getInstance())->getCurrentDefaultBgColor();
_pFuncList->setBackgroundColor(bgColor);
_pFuncList->setForegroundColor(fgColor);
} }
_pFuncList->display(); _pFuncList->display();
_pFuncList->reload(); _pFuncList->reload();
_pEditView->getFocus(); _pEditView->getFocus();
} }

View File

@ -31,8 +31,12 @@
#include "TaskListDlg.h" #include "TaskListDlg.h"
#include "ImageListSet.h" #include "ImageListSet.h"
#include "ShortcutMapper.h" #include "ShortcutMapper.h"
#include "ansiCharPanel.h"
#include "clipboardHistoryPanel.h"
#include "VerticalFileSwitcher.h" #include "VerticalFileSwitcher.h"
#include "ProjectPanel.h"
#include "documentMap.h" #include "documentMap.h"
#include "functionListPanel.h"
#define WM_DPICHANGED 0x02E0 #define WM_DPICHANGED 0x02E0
@ -1401,6 +1405,54 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
drawTabbarColoursFromStylerArray(); drawTabbarColoursFromStylerArray();
// Update default fg/bg colors in Parameters for both internal/plugins docking dialog
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
int i = globalStyles.getStylerIndexByID(STYLE_DEFAULT);
Style & style = globalStyles.getStyler(i);
(NppParameters::getInstance())->setCurrentDefaultFgColor(style._fgColor);
(NppParameters::getInstance())->setCurrentDefaultBgColor(style._bgColor);
// Set default fg/bg colors on internal docking dialog
if (_pFuncList)
{
_pFuncList->setBackgroundColor(style._bgColor);
_pFuncList->setForegroundColor(style._fgColor);
}
if (_pAnsiCharPanel)
{
_pAnsiCharPanel->setBackgroundColor(style._bgColor);
_pAnsiCharPanel->setForegroundColor(style._fgColor);
}
if (_pFileSwitcherPanel)
{
_pFileSwitcherPanel->setBackgroundColor(style._bgColor);
_pFileSwitcherPanel->setForegroundColor(style._fgColor);
}
if (_pClipboardHistoryPanel)
{
_pClipboardHistoryPanel->setBackgroundColor(style._bgColor);
_pClipboardHistoryPanel->setForegroundColor(style._fgColor);
}
if (_pProjectPanel_1)
{
_pProjectPanel_1->setBackgroundColor(style._bgColor);
_pProjectPanel_1->setForegroundColor(style._fgColor);
}
if (_pProjectPanel_2)
{
_pProjectPanel_2->setBackgroundColor(style._bgColor);
_pProjectPanel_2->setForegroundColor(style._fgColor);
}
if (_pProjectPanel_3)
{
_pProjectPanel_3->setBackgroundColor(style._bgColor);
_pProjectPanel_3->setForegroundColor(style._fgColor);
}
// Notify plugins of update to styles xml // Notify plugins of update to styles xml
SCNotification scnN; SCNotification scnN;
scnN.nmhdr.code = NPPN_WORDSTYLESUPDATED; scnN.nmhdr.code = NPPN_WORDSTYLESUPDATED;
@ -1907,6 +1959,18 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return TRUE; return TRUE;
} }
case NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR:
case NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR:
{
return (Message == NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR?(NppParameters::getInstance())->getCurrentDefaultFgColor():(NppParameters::getInstance())->getCurrentDefaultBgColor());
/*
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
int i = globalStyles.getStylerIndexByID(STYLE_DEFAULT);
Style & style = globalStyles.getStyler(i);
return (Message == NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR?style._fgColor:style._bgColor);
*/
}
case NPPM_SHOWDOCSWITCHER: case NPPM_SHOWDOCSWITCHER:
{ {
BOOL toShow = lParam; BOOL toShow = lParam;

View File

@ -1090,9 +1090,6 @@ struct FindHistory {
bool _isFolderFollowDoc; bool _isFolderFollowDoc;
}; };
#ifdef UNICODE
class LocalizationSwitcher { class LocalizationSwitcher {
friend class NppParameters; friend class NppParameters;
public : public :
@ -1133,7 +1130,6 @@ private :
wstring _nativeLangPath; wstring _nativeLangPath;
string _fileName; string _fileName;
}; };
#endif
class ThemeSwitcher { class ThemeSwitcher {
friend class NppParameters; friend class NppParameters;
@ -1507,17 +1503,14 @@ public:
bool _isFindReplacing; // an on the fly variable for find/replace functions bool _isFindReplacing; // an on the fly variable for find/replace functions
void safeWow64EnableWow64FsRedirection(BOOL Wow64FsEnableRedirection); void safeWow64EnableWow64FsRedirection(BOOL Wow64FsEnableRedirection);
#ifdef UNICODE
LocalizationSwitcher & getLocalizationSwitcher() { LocalizationSwitcher & getLocalizationSwitcher() {
return _localizationSwitcher; return _localizationSwitcher;
}; };
#endif
ThemeSwitcher & getThemeSwitcher() { ThemeSwitcher & getThemeSwitcher() {
return _themeSwitcher; return _themeSwitcher;
}; };
vector<generic_string> & getBlackList() {return _blacklist;}; vector<generic_string> & getBlackList() {return _blacklist;};
bool isInBlackList(TCHAR *fn) { bool isInBlackList(TCHAR *fn) {
for (size_t i = 0, len = _blacklist.size(); i < len ; ++i) for (size_t i = 0, len = _blacklist.size(); i < len ; ++i)
@ -1550,6 +1543,22 @@ public:
void writeSettingsFilesOnCloudForThe1stTime(CloudChoice choice); void writeSettingsFilesOnCloudForThe1stTime(CloudChoice choice);
COLORREF getCurrentDefaultBgColor() const {
return _currentDefaultBgColor;
};
COLORREF getCurrentDefaultFgColor() const {
return _currentDefaultFgColor;
};
void setCurrentDefaultBgColor(COLORREF c) {
_currentDefaultBgColor = c;
};
void setCurrentDefaultFgColor(COLORREF c) {
_currentDefaultFgColor = c;
};
DPIManager _dpiManager; DPIManager _dpiManager;
private: private:
@ -1651,6 +1660,9 @@ private:
NativeLangSpeaker *_pNativeLangSpeaker; NativeLangSpeaker *_pNativeLangSpeaker;
COLORREF _currentDefaultBgColor;
COLORREF _currentDefaultFgColor;
static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *, int, LPARAM lParam) { static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *, int, LPARAM lParam) {
vector<generic_string> *pStrVect = (vector<generic_string> *)lParam; vector<generic_string> *pStrVect = (vector<generic_string> *)lParam;
size_t vectSize = pStrVect->size(); size_t vectSize = pStrVect->size();

View File

@ -299,6 +299,7 @@ public :
void execSavedCommand(int cmd, int intValue, generic_string stringValue); void execSavedCommand(int cmd, int intValue, generic_string stringValue);
void setStatusbarMessage(const generic_string & msg, FindStatus staus); void setStatusbarMessage(const generic_string & msg, FindStatus staus);
protected : protected :
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
void addText2Combo(const TCHAR * txt2add, HWND comboID, bool isUTF8 = false); void addText2Combo(const TCHAR * txt2add, HWND comboID, bool isUTF8 = false);

View File

@ -49,11 +49,11 @@ public:
DockingDlgInterface::init(hInst, hPere); DockingDlgInterface::init(hInst, hPere);
_ppEditView = ppEditView; _ppEditView = ppEditView;
}; };
/*
virtual void display(bool toShow = true) const { virtual void display(bool toShow = true) const {
DockingDlgInterface::display(toShow); DockingDlgInterface::display(toShow);
}; };
*/
void setParent(HWND parent2set){ void setParent(HWND parent2set){
_hParent = parent2set; _hParent = parent2set;
}; };
@ -61,6 +61,14 @@ public:
void switchEncoding(); void switchEncoding();
void insertChar(unsigned char char2insert) const; void insertChar(unsigned char char2insert) const;
virtual void setBackgroundColor(int bgColour) const {
ListView_SetBkColor(_listView.getHSelf(), bgColour);
ListView_SetTextBkColor(_listView.getHSelf(), bgColour);
};
virtual void setForegroundColor(int fgColour) const {
ListView_SetTextColor(_listView.getHSelf(), fgColour);
};
protected: protected:
virtual BOOL CALLBACK AnsiCharPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK AnsiCharPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -31,11 +31,9 @@
#include "ScintillaEditView.h" #include "ScintillaEditView.h"
#include "clipboardFormats.h" #include "clipboardFormats.h"
#ifdef UNICODE
#define CLIPBOARD_TEXTFORMAT CF_UNICODETEXT #define CLIPBOARD_TEXTFORMAT CF_UNICODETEXT
#else #define MAX_DISPLAY_LENGTH 64
#define CLIPBOARD_TEXTFORMAT CF_TEXT
#endif
ClipboardData ClipboardHistoryPanel::getClipboadData() ClipboardData ClipboardHistoryPanel::getClipboadData()
{ {
@ -174,11 +172,28 @@ void ClipboardHistoryPanel::addToClipboadHistory(ClipboardData cbd)
} }
_clipboardDataVector.insert(_clipboardDataVector.begin(), cbd); _clipboardDataVector.insert(_clipboardDataVector.begin(), cbd);
StringArray sa(cbd, 64); StringArray sa(cbd, MAX_DISPLAY_LENGTH);
TCHAR *displayStr = (TCHAR *)sa.getPointer(); TCHAR *displayStr = (TCHAR *)sa.getPointer();
::SendDlgItemMessage(_hSelf, IDC_LIST_CLIPBOARD, LB_INSERTSTRING, 0, (LPARAM)displayStr); ::SendDlgItemMessage(_hSelf, IDC_LIST_CLIPBOARD, LB_INSERTSTRING, 0, (LPARAM)displayStr);
} }
void ClipboardHistoryPanel::drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
//printStr(TEXT("OK"));
COLORREF fgColor = _lbFgColor == -1?black:_lbFgColor; // fg black by default
COLORREF bgColor = _lbBgColor == -1?white:_lbBgColor; // bg white by default
StringArray sa(_clipboardDataVector[lpDrawItemStruct->itemID], MAX_DISPLAY_LENGTH);
TCHAR *ptStr = (TCHAR *)sa.getPointer();
//printStr(ptStr);
::SetTextColor(lpDrawItemStruct->hDC, fgColor);
::SetBkColor(lpDrawItemStruct->hDC, bgColor);
::DrawText(lpDrawItemStruct->hDC, ptStr, lstrlen(ptStr), &(lpDrawItemStruct->rcItem), DT_SINGLELINE | DT_VCENTER | DT_LEFT);
}
BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
@ -221,7 +236,6 @@ BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LP
int i = ::SendDlgItemMessage(_hSelf, IDC_LIST_CLIPBOARD, LB_GETCURSEL, 0, 0); int i = ::SendDlgItemMessage(_hSelf, IDC_LIST_CLIPBOARD, LB_GETCURSEL, 0, 0);
if (i != LB_ERR) if (i != LB_ERR)
{ {
#ifdef UNICODE
int codepage = (*_ppEditView)->getCurrentBuffer()->getEncoding(); int codepage = (*_ppEditView)->getCurrentBuffer()->getEncoding();
if (codepage == -1) if (codepage == -1)
{ {
@ -242,14 +256,6 @@ BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LP
(*_ppEditView)->execute(SCI_ADDTEXT, strlen(c), (LPARAM)c); (*_ppEditView)->execute(SCI_ADDTEXT, strlen(c), (LPARAM)c);
(*_ppEditView)->getFocus(); (*_ppEditView)->getFocus();
delete [] c; delete [] c;
#else
ByteArray ba(_clipboardDataVector[i]);
char *str = (char *)ba.getPointer();
(*_ppEditView)->execute(SCI_REPLACESEL, 0, (LPARAM)"");
(*_ppEditView)->execute(SCI_ADDTEXT, strlen(str), (LPARAM)str);
(*_ppEditView)->getFocus();
#endif
} }
} }
return TRUE; return TRUE;
@ -277,9 +283,21 @@ BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LP
break; break;
} }
*/ */
case WM_CTLCOLORLISTBOX:
{
if (_lbBgColor != -1)
return (LRESULT)::CreateSolidBrush((COLORREF)_lbBgColor);
break;
}
case WM_DRAWITEM:
{
drawItem((DRAWITEMSTRUCT *)lParam);
break;
}
default : default :
return DockingDlgInterface::run_dlgProc(message, wParam, lParam); return DockingDlgInterface::run_dlgProc(message, wParam, lParam);
} }
return DockingDlgInterface::run_dlgProc(message, wParam, lParam); return DockingDlgInterface::run_dlgProc(message, wParam, lParam);
} }

View File

@ -68,16 +68,17 @@ public:
class ClipboardHistoryPanel : public DockingDlgInterface { class ClipboardHistoryPanel : public DockingDlgInterface {
public: public:
ClipboardHistoryPanel(): DockingDlgInterface(IDD_CLIPBOARDHISTORY_PANEL), _ppEditView(NULL), _hwndNextCbViewer(NULL) {}; ClipboardHistoryPanel(): DockingDlgInterface(IDD_CLIPBOARDHISTORY_PANEL), _ppEditView(NULL), _hwndNextCbViewer(NULL), _lbBgColor(-1), _lbFgColor(-1) {};
void init(HINSTANCE hInst, HWND hPere, ScintillaEditView **ppEditView) { void init(HINSTANCE hInst, HWND hPere, ScintillaEditView **ppEditView) {
DockingDlgInterface::init(hInst, hPere); DockingDlgInterface::init(hInst, hPere);
_ppEditView = ppEditView; _ppEditView = ppEditView;
}; };
/*
virtual void display(bool toShow = true) const { virtual void display(bool toShow = true) const {
DockingDlgInterface::display(toShow); DockingDlgInterface::display(toShow);
}; };
*/
void setParent(HWND parent2set){ void setParent(HWND parent2set){
_hParent = parent2set; _hParent = parent2set;
@ -88,6 +89,15 @@ public:
void addToClipboadHistory(ClipboardData cbd); void addToClipboadHistory(ClipboardData cbd);
int getClipboardDataIndex(ClipboardData cbd); int getClipboardDataIndex(ClipboardData cbd);
virtual void setBackgroundColor(COLORREF bgColour) {
_lbBgColor = bgColour;
};
virtual void setForegroundColor(COLORREF fgColour) {
_lbFgColor = fgColour;
};
void drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected: protected:
virtual BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
@ -95,5 +105,8 @@ private:
ScintillaEditView **_ppEditView; ScintillaEditView **_ppEditView;
std::vector<ClipboardData> _clipboardDataVector; std::vector<ClipboardData> _clipboardDataVector;
HWND _hwndNextCbViewer; HWND _hwndNextCbViewer;
int _lbBgColor;
int _lbFgColor;
}; };
#endif // CLIPBOARDHISTORYPANEL_H #endif // CLIPBOARDHISTORYPANEL_H

View File

@ -35,5 +35,5 @@ EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE
CAPTION "Clipboard History" CAPTION "Clipboard History"
FONT 8, "MS Sans Serif", 0, 0, 0x0 FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN BEGIN
LISTBOX IDC_LIST_CLIPBOARD,50,44,78,120,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP LISTBOX IDC_LIST_CLIPBOARD,50,44,78,120,LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
END END

View File

@ -75,6 +75,12 @@ public:
virtual void destroy() { virtual void destroy() {
}; };
virtual void setBackgroundColor(COLORREF) {
};
virtual void setForegroundColor(COLORREF) {
};
virtual void display(bool toShow = true) const { virtual void display(bool toShow = true) const {
::SendMessage(_hParent, toShow?NPPM_DMMSHOW:NPPM_DMMHIDE, 0, (LPARAM)_hSelf); ::SendMessage(_hParent, toShow?NPPM_DMMSHOW:NPPM_DMMHIDE, 0, (LPARAM)_hSelf);
}; };

View File

@ -102,6 +102,13 @@ public:
DockingDlgInterface::display(toShow); DockingDlgInterface::display(toShow);
}; };
virtual void setBackgroundColor(COLORREF bgColour) {
TreeView_SetBkColor(_treeView.getHSelf(), bgColour);
};
virtual void setForegroundColor(COLORREF fgColour) {
TreeView_SetTextColor(_treeView.getHSelf(), fgColour);
};
void setParent(HWND parent2set){ void setParent(HWND parent2set){
_hParent = parent2set; _hParent = parent2set;
}; };
@ -116,7 +123,7 @@ public:
void searchFuncAndSwitchView(); void searchFuncAndSwitchView();
protected: protected:
virtual BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
private: private:
HWND _hToolbarMenu; HWND _hToolbarMenu;

View File

@ -103,6 +103,13 @@ public:
}; };
void checkIfNeedSave(const TCHAR *title); void checkIfNeedSave(const TCHAR *title);
virtual void setBackgroundColor(COLORREF bgColour) {
TreeView_SetBkColor(_treeView.getHSelf(), bgColour);
};
virtual void setForegroundColor(COLORREF fgColour) {
TreeView_SetTextColor(_treeView.getHSelf(), fgColour);
};
protected: protected:
TreeView _treeView; TreeView _treeView;
HIMAGELIST _hImaLst; HIMAGELIST _hImaLst;

View File

@ -95,6 +95,14 @@ public:
_fileListView.reload(); _fileListView.reload();
}; };
virtual void setBackgroundColor(COLORREF bgColour) {
_fileListView.setBackgroundColor(bgColour);
};
virtual void setForegroundColor(COLORREF fgColour) {
_fileListView.setForegroundColor(fgColour);
};
protected: protected:
virtual BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -71,6 +71,15 @@ public:
std::vector<SwitcherFileInfo> getSelectedFiles(bool reverse = false) const; std::vector<SwitcherFileInfo> getSelectedFiles(bool reverse = false) const;
void reload(); void reload();
void setBackgroundColor(COLORREF bgColour) {
ListView_SetBkColor(_hSelf, bgColour);
ListView_SetTextBkColor(_hSelf, bgColour);
};
void setForegroundColor(COLORREF fgColour) {
ListView_SetTextColor(_hSelf, fgColour);
};
protected: protected:
HIMAGELIST _hImaLst; HIMAGELIST _hImaLst;
WNDPROC _defaultProc; WNDPROC _defaultProc;