本文整理汇总了C++中NppParameters::getEnableThemeDlgTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ NppParameters::getEnableThemeDlgTexture方法的具体用法?C++ NppParameters::getEnableThemeDlgTexture怎么用?C++ NppParameters::getEnableThemeDlgTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NppParameters
的用法示例。
在下文中一共展示了NppParameters::getEnableThemeDlgTexture方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_dlgProc
INT_PTR CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
{
HWND compileDateHandle = ::GetDlgItem(_hSelf, IDC_BUILD_DATETIME);
generic_string buildTime = TEXT("Build time : ");
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
buildTime += wmc->char2wchar(__DATE__, CP_ACP);
buildTime += TEXT(" - ");
buildTime += wmc->char2wchar(__TIME__, CP_ACP);
::SendMessage(compileDateHandle, WM_SETTEXT, 0, (LPARAM)buildTime.c_str());
::EnableWindow(compileDateHandle, FALSE);
HWND licenceEditHandle = ::GetDlgItem(_hSelf, IDC_LICENCE_EDIT);
::SendMessage(licenceEditHandle, WM_SETTEXT, 0, (LPARAM)LICENCE_TXT);
_emailLink.init(_hInst, _hSelf);
//_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("mailto:[email protected]"));
_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("https://notepad-plus-plus.org/contributors"));
_pageLink.init(_hInst, _hSelf);
_pageLink.create(::GetDlgItem(_hSelf, IDC_HOME_ADDR), TEXT("https://notepad-plus-plus.org/"));
getClientRect(_rc);
NppParameters *pNppParam = NppParameters::getInstance();
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
if (enableDlgTheme)
{
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
redraw();
}
return TRUE;
}
case WM_DRAWITEM :
{
HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_CHAMELEON), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE);
//HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_JESUISCHARLIE), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE);
DRAWITEMSTRUCT *pdis = (DRAWITEMSTRUCT *)lParam;
::DrawIconEx(pdis->hDC, 0, 0, hIcon, 64, 64, 0, NULL, DI_NORMAL);
return TRUE;
}
case WM_COMMAND :
{
switch (wParam)
{
case IDCANCEL :
case IDOK :
display(false);
return TRUE;
default :
break;
}
}
case WM_DESTROY :
{
return TRUE;
}
}
return FALSE;
}
示例2: run_dlgProc
INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
{
switch (message)
{
case WM_INITDIALOG :
{
switchTo(activeText);
::SendDlgItemMessage(_hSelf, IDC_COL_DEC_RADIO, BM_SETCHECK, TRUE, 0);
goToCenter();
NppParameters *pNppParam = NppParameters::getInstance();
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
if (enableDlgTheme)
{
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
redraw();
}
return TRUE;
}
case WM_COMMAND :
{
switch (wParam)
{
case IDCANCEL : // Close
display(false);
return TRUE;
case IDOK :
{
(*_ppEditView)->execute(SCI_BEGINUNDOACTION);
const int stringSize = 1024;
TCHAR str[stringSize];
bool isTextMode = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_RADIO, BM_GETCHECK, 0, 0));
if (isTextMode)
{
::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_EDIT, WM_GETTEXT, stringSize, (LPARAM)str);
display(false);
if ((*_ppEditView)->execute(SCI_SELECTIONISRECTANGLE) || (*_ppEditView)->execute(SCI_GETSELECTIONS) > 1)
{
ColumnModeInfos colInfos = (*_ppEditView)->getColumnModeSelectInfo();
std::sort(colInfos.begin(), colInfos.end(), SortInPositionOrder());
(*_ppEditView)->columnReplace(colInfos, str);
std::sort(colInfos.begin(), colInfos.end(), SortInSelectOrder());
(*_ppEditView)->setMultiSelections(colInfos);
}
else
{
int cursorPos = (*_ppEditView)->execute(SCI_GETCURRENTPOS);
int cursorCol = (*_ppEditView)->execute(SCI_GETCOLUMN, cursorPos);
int cursorLine = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, cursorPos);
int endPos = (*_ppEditView)->execute(SCI_GETLENGTH);
int endLine = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, endPos);
int lineAllocatedLen = 1024;
TCHAR *line = new TCHAR[lineAllocatedLen];
for (int i = cursorLine ; i <= endLine ; ++i)
{
int lineBegin = (*_ppEditView)->execute(SCI_POSITIONFROMLINE, i);
int lineEnd = (*_ppEditView)->execute(SCI_GETLINEENDPOSITION, i);
int lineEndCol = (*_ppEditView)->execute(SCI_GETCOLUMN, lineEnd);
int lineLen = lineEnd - lineBegin + 1;
if (lineLen > lineAllocatedLen)
{
delete [] line;
line = new TCHAR[lineLen];
}
(*_ppEditView)->getGenericText(line, lineLen, lineBegin, lineEnd);
generic_string s2r(line);
if (lineEndCol < cursorCol)
{
generic_string s_space(cursorCol - lineEndCol, ' ');
s2r.append(s_space);
s2r.append(str);
}
else
{
int posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
int posRelative2Start = posAbs2Start - lineBegin;
s2r.insert(posRelative2Start, str);
}
(*_ppEditView)->replaceTarget(s2r.c_str(), lineBegin, lineEnd);
}
delete [] line;
}
}
else
{
int initialNumber = ::GetDlgItemInt(_hSelf, IDC_COL_INITNUM_EDIT, NULL, TRUE);
int increaseNumber = ::GetDlgItemInt(_hSelf, IDC_COL_INCREASENUM_EDIT, NULL, TRUE);
int repeat = ::GetDlgItemInt(_hSelf, IDC_COL_REPEATNUM_EDIT, NULL, TRUE);
if (repeat == 0)
//.........这里部分代码省略.........
示例3: run_dlgProc
INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message)
{
case WM_INITDIALOG :
{
NppParameters *nppParamInst = NppParameters::getInstance();
_hCheckBold = ::GetDlgItem(_hSelf, IDC_BOLD_CHECK);
_hCheckItalic = ::GetDlgItem(_hSelf, IDC_ITALIC_CHECK);
_hCheckUnderline = ::GetDlgItem(_hSelf, IDC_UNDERLINE_CHECK);
_hFontNameCombo = ::GetDlgItem(_hSelf, IDC_FONT_COMBO);
_hFontSizeCombo = ::GetDlgItem(_hSelf, IDC_FONTSIZE_COMBO);
_hSwitch2ThemeCombo = ::GetDlgItem(_hSelf, IDC_SWITCH2THEME_COMBO);
_hFgColourStaticText = ::GetDlgItem(_hSelf, IDC_FG_STATIC);
_hBgColourStaticText = ::GetDlgItem(_hSelf, IDC_BG_STATIC);
_hFontNameStaticText = ::GetDlgItem(_hSelf, IDC_FONTNAME_STATIC);
_hFontSizeStaticText = ::GetDlgItem(_hSelf, IDC_FONTSIZE_STATIC);
_hStyleInfoStaticText = ::GetDlgItem(_hSelf, IDC_STYLEDESCRIPTION_STATIC);
colourHooker.setColour(RGB(0xFF, 0x00, 0x00));
colourHooker.hookOn(_hStyleInfoStaticText);
_currentThemeIndex = -1;
int defaultThemeIndex = 0;
ThemeSwitcher & themeSwitcher = nppParamInst->getThemeSwitcher();
for(size_t i = 0 ; i < themeSwitcher.size() ; ++i)
{
pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(i);
int j = static_cast<int32_t>(::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, (LPARAM)themeInfo.first.c_str()));
if (! themeInfo.second.compare( nppParamInst->getNppGUI()._themeName ) )
{
_currentThemeIndex = j;
_themeName.assign(themeInfo.second);
}
if (! themeInfo.first.compare(TEXT("Default")) )
{
defaultThemeIndex = j;
}
}
if (_currentThemeIndex == -1)
{
_currentThemeIndex = defaultThemeIndex;
}
::SendMessage(_hSwitch2ThemeCombo, CB_SETCURSEL, _currentThemeIndex, 0);
for(int i = 0 ; i < sizeof(fontSizeStrs)/(3*sizeof(TCHAR)) ; ++i)
::SendMessage(_hFontSizeCombo, CB_ADDSTRING, 0, (LPARAM)fontSizeStrs[i]);
const std::vector<generic_string> & fontlist = (NppParameters::getInstance())->getFontList();
for (size_t i = 0, len = fontlist.size() ; i < len ; ++i)
{
auto j = ::SendMessage(_hFontNameCombo, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str());
::SendMessage(_hFontNameCombo, CB_SETITEMDATA, j, (LPARAM)fontlist[i].c_str());
}
_pFgColour = new ColourPicker;
_pBgColour = new ColourPicker;
_pFgColour->init(_hInst, _hSelf);
_pBgColour->init(_hInst, _hSelf);
POINT p1, p2;
alignWith(_hFgColourStaticText, _pFgColour->getHSelf(), PosAlign::right, p1);
alignWith(_hBgColourStaticText, _pBgColour->getHSelf(), PosAlign::right, p2);
p1.x = p2.x = ((p1.x > p2.x)?p1.x:p2.x) + 10;
p1.y -= 4; p2.y -= 4;
::MoveWindow((HWND)_pFgColour->getHSelf(), p1.x, p1.y, 25, 25, TRUE);
::MoveWindow((HWND)_pBgColour->getHSelf(), p2.x, p2.y, 25, 25, TRUE);
_pFgColour->display();
_pBgColour->display();
::EnableWindow(::GetDlgItem(_hSelf, IDOK), _isDirty);
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), FALSE/*!_isSync*/);
ETDTProc enableDlgTheme = (ETDTProc)nppParamInst->getEnableThemeDlgTexture();
if (enableDlgTheme)
{
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
redraw();
}
updateGlobalOverrideCtrls();
setVisualFromStyleList();
goToCenter();
loadLangListFromNppParam();
return TRUE;
}
case WM_DESTROY:
{
_pFgColour->destroy();
_pBgColour->destroy();
delete _pFgColour;
delete _pBgColour;
return TRUE;
//.........这里部分代码省略.........
示例4: run_dlgProc
BOOL CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
{
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);
HWND licenceEditHandle = ::GetDlgItem(_hSelf, IDC_LICENCE_EDIT);
::SendMessage(licenceEditHandle, WM_SETTEXT, 0, (LPARAM)LICENCE_TXT);
_emailLink.init(_hInst, _hSelf);
_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("mailto:[email protected]"));
_pageLink.init(_hInst, _hSelf);
_pageLink.create(::GetDlgItem(_hSelf, IDC_HOME_ADDR), TEXT("http://notepad-plus.sourceforge.net/"));
//_onLineHelp.init(_hInst, _hSelf);
//_onLineHelp.create(::GetDlgItem(_hSelf, IDC_ONLINEHELP_ADDR), TEXT("http://notepad-plus.sourceforge.net/uk/generalFAQ.php"));
getClientRect(_rc);
NppParameters *pNppParam = NppParameters::getInstance();
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
if (enableDlgTheme)
{
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
redraw();
}
return TRUE;
}
case WM_DRAWITEM :
{
HICON hIcon = ::LoadIcon(_hInst, MAKEINTRESOURCE(IDI_M30ICON));
DRAWITEMSTRUCT *pdis = (DRAWITEMSTRUCT *)lParam;
::DrawIcon(pdis->hDC, 0, 0, hIcon);
return TRUE;
}
case WM_COMMAND :
{
switch (wParam)
{
case IDCANCEL :
case IDOK :
display(false);
return TRUE;
default :
break;
}
}
case WM_DESTROY :
{
return TRUE;
}
}
return FALSE;
}
示例5: run_dlgProc
BOOL CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
{
switch (message)
{
case WM_INITDIALOG :
{
switchTo(activeText);
::SendDlgItemMessage(_hSelf, IDC_COL_DEC_RADIO, BM_SETCHECK, TRUE, 0);
goToCenter();
NppParameters *pNppParam = NppParameters::getInstance();
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
if (enableDlgTheme)
{
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
redraw();
}
return TRUE;
}
case WM_COMMAND :
{
switch (wParam)
{
case IDCANCEL : // Close
display(false);
return TRUE;
case IDOK :
{
(*_ppEditView)->execute(SCI_BEGINUNDOACTION);
const int stringSize = 1024;
TCHAR str[stringSize];
bool isTextMode = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_RADIO, BM_GETCHECK, 0, 0));
if (isTextMode)
{
::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_EDIT, WM_GETTEXT, stringSize, (LPARAM)str);
display(false);
if ((*_ppEditView)->execute(SCI_SELECTIONISRECTANGLE) || (*_ppEditView)->execute(SCI_GETSELECTIONS) > 1)
{
ColumnModeInfos colInfos = (*_ppEditView)->getColumnModeSelectInfo();
// It's all right here. It's used as intended.
//lint -e864 (Info -- Expression involving variable 'colInfos' possibly depends on order of evaluation)
std::sort(colInfos.begin(), colInfos.end(), SortInPositionOrder());
(*_ppEditView)->columnReplace(colInfos, str);
std::sort(colInfos.begin(), colInfos.end(), SortInSelectOrder());
(*_ppEditView)->setMultiSelections(colInfos);
//lint +e864
}
else
{
int cursorPos = (*_ppEditView)->execute(SCI_GETCURRENTPOS);
int cursorCol = (*_ppEditView)->execute(SCI_GETCOLUMN, cursorPos);
int cursorLine = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, cursorPos);
int endPos = (*_ppEditView)->execute(SCI_GETLENGTH);
int endLine = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, endPos);
int lineAllocatedLen = 1024;
TCHAR *line = new TCHAR[lineAllocatedLen];
for (int i = cursorLine ; i <= endLine ; i++)
{
int lineBegin = (*_ppEditView)->execute(SCI_POSITIONFROMLINE, i);
int lineEnd = (*_ppEditView)->execute(SCI_GETLINEENDPOSITION, i);
int lineEndCol = (*_ppEditView)->execute(SCI_GETCOLUMN, lineEnd);
int lineLen = lineEnd - lineBegin + 1;
if (lineLen > lineAllocatedLen)
{
delete [] line;
line = new TCHAR[lineLen];
}
(*_ppEditView)->getGenericText(line, lineBegin, lineEnd);
generic_string s2r(line);
if (lineEndCol < cursorCol)
{
generic_string s_space(cursorCol - lineEndCol, ' ');
s2r.append(s_space);
s2r.append(str);
}
else
{
int posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
int posRelative2Start = posAbs2Start - lineBegin;
s2r.insert(posRelative2Start, str);
}
(*_ppEditView)->replaceTarget(s2r.c_str(), lineBegin, lineEnd);
}
delete [] line;
}
}
else
{
int initialNumber = ::GetDlgItemInt(_hSelf, IDC_COL_INITNUM_EDIT, NULL, TRUE);
//.........这里部分代码省略.........
示例6: run_dlgProc
BOOL CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
{
switchTo(activeText);
::SendDlgItemMessage(_hSelf, IDC_COL_DEC_RADIO, BM_SETCHECK, TRUE, 0);
goToCenter();
NppParameters *pNppParam = NppParameters::getInstance();
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
if (enableDlgTheme)
{
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
redraw();
}
return TRUE;
}
case WM_COMMAND :
{
switch (wParam)
{
case IDCANCEL : // Close
display(false);
return TRUE;
case IDOK :
{
(*_ppEditView)->execute(SCI_BEGINUNDOACTION);
char str[1024];
bool isTextMode = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_RADIO, BM_GETCHECK, 0, 0));
if (isTextMode)
{
::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_EDIT, WM_GETTEXT, sizeof(str), (LPARAM)str);
display(false);
if ((*_ppEditView)->execute(SCI_SELECTIONISRECTANGLE))
{
ColumnModeInfo colInfos = (*_ppEditView)->getColumnModeSelectInfo();
(*_ppEditView)->columnReplace(colInfos, str);
(*_ppEditView)->execute(SCI_SETCURRENTPOS,colInfos[colInfos.size()-1].second);
//(*_ppEditView)->execute(SCI_SETSEL, colInfos[0].first, colInfos[colInfos.size()-1].second);
//(*_ppEditView)->execute(SCI_SETSELECTIONMODE, 1);
}
else
{
int cursorPos = (*_ppEditView)->execute(SCI_GETCURRENTPOS);
int cursorCol = (*_ppEditView)->execute(SCI_GETCOLUMN, cursorPos);
int cursorLine = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, cursorPos);
int endPos = (*_ppEditView)->execute(SCI_GETLENGTH);
int endLine = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, endPos);
int lineAllocatedLen = 1024;
char *line = new char[lineAllocatedLen];
for (int i = cursorLine ; i <= endLine ; i++)
{
int lineBegin = (*_ppEditView)->execute(SCI_POSITIONFROMLINE, i);
int lineEnd = (*_ppEditView)->execute(SCI_GETLINEENDPOSITION, i);
int lineEndCol = (*_ppEditView)->execute(SCI_GETCOLUMN, lineEnd);
int lineLen = lineEnd - lineBegin + 1;
if (lineLen > lineAllocatedLen)
{
delete [] line;
line = new char[lineLen];
}
(*_ppEditView)->getText(line, lineBegin, lineEnd);
string s2r(line);
if (lineEndCol < cursorCol)
{
string s_space(cursorCol - lineEndCol, ' ');
s2r.append(s_space);
s2r.append(str);
}
else
{
int posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
int posRelative2Start = posAbs2Start - lineBegin;
s2r.insert(posRelative2Start, str);
}
(*_ppEditView)->execute(SCI_SETTARGETSTART, lineBegin);
(*_ppEditView)->execute(SCI_SETTARGETEND, lineEnd);
(*_ppEditView)->execute(SCI_REPLACETARGET, -1, (LPARAM)s2r.c_str());
}
delete [] line;
}
}
else
{
int initialNumber = ::GetDlgItemInt(_hSelf, IDC_COL_INITNUM_EDIT, NULL, TRUE);
//.........这里部分代码省略.........