diff --git a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp index 1d2943de3..fe8e8b28f 100644 --- a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp @@ -100,9 +100,13 @@ intptr_t CALLBACK SharedParametersDialog::run_dlgProc(UINT Message, WPARAM wPara { switch (Message) { - case WM_INITDIALOG : + case WM_INITDIALOG: { // initControls(); + + // Allow tab switch between main dialog and subdialogs + const auto exStyle = ::GetWindowLongPtr(_hSelf, GWL_EXSTYLE); + ::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, exStyle | WS_EX_CONTROLPARENT); return TRUE; } @@ -147,14 +151,20 @@ intptr_t CALLBACK FolderStyleDialog::run_dlgProc(UINT Message, WPARAM wParam, LP { switch (Message) { - case WM_INITDIALOG : + case WM_INITDIALOG: { _pageLink.init(_hInst, _hSelf); _pageLink.create(::GetDlgItem(_hSelf, IDC_WEB_HELP_LINK), TEXT("https://ivan-radic.github.io/udl-documentation/")); + return SharedParametersDialog::run_dlgProc(Message, wParam, lParam); + } + + case WM_DPICHANGED_AFTERPARENT: + { + _pageLink.destroy(); return TRUE; } - case WM_COMMAND : + case WM_COMMAND: { switch (wParam) { @@ -264,7 +274,7 @@ intptr_t CALLBACK KeyWordsStyleDialog::run_dlgProc(UINT Message, WPARAM wParam, { switch (Message) { - case WM_INITDIALOG : + case WM_INITDIALOG: { // extend Keyword edit boxes to hold 128k of TCHARs ::SendMessage(::GetDlgItem(_hSelf,IDC_KEYWORD1_EDIT), EM_LIMITTEXT, WPARAM(128*1024), 0); @@ -276,10 +286,10 @@ intptr_t CALLBACK KeyWordsStyleDialog::run_dlgProc(UINT Message, WPARAM wParam, ::SendMessage(::GetDlgItem(_hSelf,IDC_KEYWORD7_EDIT), EM_LIMITTEXT, WPARAM(128*1024), 0); ::SendMessage(::GetDlgItem(_hSelf,IDC_KEYWORD8_EDIT), EM_LIMITTEXT, WPARAM(128*1024), 0); - return TRUE; + return SharedParametersDialog::run_dlgProc(Message, wParam, lParam); } - case WM_COMMAND : + case WM_COMMAND: { switch (wParam) { @@ -1144,6 +1154,14 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA return TRUE; } + case WM_DPICHANGED: + { + DPIManagerV2::setDpiWP(wParam); + setPositionDpi(lParam); + + return TRUE; + } + case WM_COMMAND: { if (HIWORD(wParam) == EN_CHANGE) @@ -1171,9 +1189,13 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA const int selTabIdx = _ctrlTab.getNextOrPrevTabIdx(LOWORD(wParam) == IDC_NEXT_TAB); _ctrlTab.activateAt(selTabIdx); _ctrlTab.clickedUpdate(); + ::SetFocus(_ctrlTab.getHSelf()); return TRUE; } + + default: + return FALSE; } } else @@ -1543,11 +1565,11 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA return FALSE; } -intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) +intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { - case WM_INITDIALOG : + case WM_INITDIALOG: { NppDarkMode::autoSubclassAndThemeChildControls(_hSelf); @@ -1619,7 +1641,15 @@ intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) return TRUE; } - case WM_COMMAND : + case WM_DPICHANGED: + { + DPIManagerV2::setDpiWP(wParam); + setPositionDpi(lParam); + + return TRUE; + } + + case WM_COMMAND: { switch (wParam) { @@ -1728,7 +1758,7 @@ void StylerDlg::move2CtrlRight(HWND hwndDlg, int ctrlID, HWND handle2Move, int h RECT rc{}; ::GetWindowRect(::GetDlgItem(hwndDlg, ctrlID), &rc); - p.x = rc.right + NppParameters::getInstance()._dpiManager.scaleX(5); + p.x = rc.right + DPIManagerV2::scale(5, hwndDlg); p.y = rc.top + ((rc.bottom - rc.top) / 2) - handle2MoveHeight / 2; ::ScreenToClient(hwndDlg, &p); @@ -1811,12 +1841,9 @@ intptr_t CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPA dlg->_pBgColour->setEnabled(isBgEnabled); ::SendDlgItemMessage(hwnd, IDC_STYLER_CHECK_BG_TRANSPARENT, BM_SETCHECK, !isBgEnabled, 0); - int w = nppParam._dpiManager.scaleX(25); - int h = nppParam._dpiManager.scaleY(25); - - dlg->move2CtrlRight(hwnd, IDC_STYLER_FG_STATIC, dlg->_pFgColour->getHSelf(), w, h); - dlg->move2CtrlRight(hwnd, IDC_STYLER_BG_STATIC, dlg->_pBgColour->getHSelf(), w, h); - + const int moveSize = DPIManagerV2::scale(25, hwnd); + dlg->move2CtrlRight(hwnd, IDC_STYLER_FG_STATIC, dlg->_pFgColour->getHSelf(), moveSize, moveSize); + dlg->move2CtrlRight(hwnd, IDC_STYLER_BG_STATIC, dlg->_pBgColour->getHSelf(), moveSize, moveSize); dlg->_pFgColour->display(); dlg->_pBgColour->display(); @@ -1863,7 +1890,18 @@ intptr_t CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPA return TRUE; } - case WM_COMMAND : + case WM_DPICHANGED: + { + const int moveSize = DPIManagerV2::scale(25, hwnd); + dlg->move2CtrlRight(hwnd, IDC_STYLER_FG_STATIC, dlg->_pFgColour->getHSelf(), moveSize, moveSize); + dlg->move2CtrlRight(hwnd, IDC_STYLER_BG_STATIC, dlg->_pBgColour->getHSelf(), moveSize, moveSize); + + DPIManagerV2::setPositionDpi(lParam, hwnd, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); + + return TRUE; + } + + case WM_COMMAND: { if (dlg == nullptr) return FALSE; diff --git a/PowerEditor/src/ScintillaComponent/UserDefineDialog.rc b/PowerEditor/src/ScintillaComponent/UserDefineDialog.rc index 86dacea8e..c65df758c 100644 --- a/PowerEditor/src/ScintillaComponent/UserDefineDialog.rc +++ b/PowerEditor/src/ScintillaComponent/UserDefineDialog.rc @@ -23,35 +23,35 @@ IDD_FOLDER_STYLE_DLG DIALOGEX 36, 44, 466, 415 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - GROUPBOX "Documentation", IDC_WEB_HELP_DESCGROUP_STATIC, 12, 14, 210, 49 + GROUPBOX "Documentation",IDC_WEB_HELP_DESCGROUP_STATIC,12,14,210,49 CTEXT "https://ivan-radic.github.io/udl-documentation/",IDC_WEB_HELP_LINK,19,35,200,13 - PUSHBUTTON "Styler",IDC_DEFAULT_STYLER,87,94,54,13 + PUSHBUTTON "Styler",IDC_DEFAULT_STYLER,87,94,54,14 GROUPBOX "Default style",IDC_DEFAULT_DESCGROUP_STATIC,12,71,210,49 CONTROL "Fold &compact (fold empty lines too)",IDC_FOLDER_FOLD_COMPACT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,143,152,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,143,152,10 EDITTEXT IDC_FOLDER_IN_COMMENT_OPEN_EDIT,252,62,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_COMMENT_MIDDLE_EDIT,252,99,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_COMMENT_CLOSE_EDIT,252,137,190,22,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_FOLDER_IN_COMMENT_STYLER,252,30,54,13 + PUSHBUTTON "Styler",IDC_FOLDER_IN_COMMENT_STYLER,252,30,54,14 LTEXT "Open:",IDC_FOLDER_IN_COMMENT_OPEN_STATIC,252,53,113,8 - LTEXT "Middle:",IDC_FOLDER_IN_COMMENT_MIDDLE_STATIC,252,89,113,9 - LTEXT "Close:",IDC_FOLDER_IN_COMMENT_CLOSE_STATIC,252,126,113,9 + LTEXT "Middle:",IDC_FOLDER_IN_COMMENT_MIDDLE_STATIC,252,89,113,8 + LTEXT "Close:",IDC_FOLDER_IN_COMMENT_CLOSE_STATIC,252,126,113,8 GROUPBOX "Folding in comment style",IDC_FOLDER_IN_COMMENT_DESCGROUP_STATIC,241,14,210,156,BS_CENTER EDITTEXT IDC_FOLDER_IN_CODE1_OPEN_EDIT,22,236,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE1_MIDDLE_EDIT,22,273,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE1_CLOSE_EDIT,22,311,190,22,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_FOLDER_IN_CODE1_STYLER,22,203,54,13 - LTEXT "Open:",IDC_FOLDER_IN_CODE1_OPEN_STATIC,23,224,113,9 - LTEXT "Middle:",IDC_FOLDER_IN_CODE1_MIDDLE_STATIC,23,262,113,9 - LTEXT "Close:",IDC_FOLDER_IN_CODE1_CLOSE_STATIC,23,299,113,9 + PUSHBUTTON "Styler",IDC_FOLDER_IN_CODE1_STYLER,22,203,54,14 + LTEXT "Open:",IDC_FOLDER_IN_CODE1_OPEN_STATIC,23,224,113,8 + LTEXT "Middle:",IDC_FOLDER_IN_CODE1_MIDDLE_STATIC,23,262,113,8 + LTEXT "Close:",IDC_FOLDER_IN_CODE1_CLOSE_STATIC,23,299,113,8 GROUPBOX "Folding in code 1 style",IDC_FOLDER_IN_CODE1_DESCGROUP_STATIC,12,186,210,156,BS_CENTER EDITTEXT IDC_FOLDER_IN_CODE2_OPEN_EDIT,253,236,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE2_MIDDLE_EDIT,253,273,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE2_CLOSE_EDIT,253,311,190,22,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_FOLDER_IN_CODE2_STYLER,253,202,54,13 - LTEXT "Open:",IDC_FOLDER_IN_CODE2_OPEN_STATIC,253,224,113,9 - LTEXT "Middle:",IDC_FOLDER_IN_CODE2_MIDDLE_STATIC,253,261,113,9 - LTEXT "Close:",IDC_FOLDER_IN_CODE2_CLOSE_STATIC,253,298,113,9 + PUSHBUTTON "Styler",IDC_FOLDER_IN_CODE2_STYLER,253,202,54,14 + LTEXT "Open:",IDC_FOLDER_IN_CODE2_OPEN_STATIC,253,224,113,8 + LTEXT "Middle:",IDC_FOLDER_IN_CODE2_MIDDLE_STATIC,253,261,113,8 + LTEXT "Close:",IDC_FOLDER_IN_CODE2_CLOSE_STATIC,253,298,113,8 GROUPBOX "Folding in code 2 style (separators needed)",IDC_FOLDER_IN_CODE2_DESCGROUP_STATIC,242,186,210,156,BS_CENTER END @@ -61,22 +61,22 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN EDITTEXT IDC_OPERATOR1_EDIT,15,31,205,19,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_OPERATOR2_EDIT,247,31,206,19,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_OPERATOR_STYLER,14,12,54,13 + PUSHBUTTON "Styler",IDC_OPERATOR_STYLER,14,12,54,14 GROUPBOX "Operators style",IDC_OPERATOR_DESCGROUP_STATIC,8,3,451,55,BS_CENTER - RTEXT "Operators 1",IDC_OPERATOR1_STATIC,142,20,75,10,0,WS_EX_RIGHT - RTEXT "Operators 2 (separators required)",IDC_OPERATOR2_STATIC,328,20,124,10,0,WS_EX_RIGHT + RTEXT "Operators 1",IDC_OPERATOR1_STATIC,142,20,75,8 + RTEXT "Operators 2 (separators required)",IDC_OPERATOR2_STATIC,328,20,124,8 EDITTEXT IDC_DELIMITER1_BOUNDARYOPEN_EDIT,72,88,144,12,ES_MULTILINE | WS_VSCROLL - EDITTEXT IDC_DELIMITER1_ESCAPE_EDIT,72,108,144,12,ES_MULTILINE | WS_VSCROLL + EDITTEXT IDC_DELIMITER1_ESCAPE_EDIT,72,107,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER1_BOUNDARYCLOSE_EDIT,72,126,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER1_STYLER,162,71,54,13 + PUSHBUTTON "Styler",IDC_DELIMITER1_STYLER,162,71,54,14 RTEXT "Open:",IDC_DELIMITER1_BOUNDARYOPEN_STATIC,12,90,56,8 RTEXT "Escape:",IDC_DELIMITER1_ESCAPE_STATIC,12,109,56,8 RTEXT "Close:",IDC_DELIMITER1_BOUNDARYCLOSE_STATIC,12,127,56,8 GROUPBOX "Delimiter 1 style",IDC_DELIMITER1_DESCGROUP_STATIC,8,63,212,82,BS_LEFT EDITTEXT IDC_DELIMITER2_BOUNDARYOPEN_EDIT,309,88,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER2_ESCAPE_EDIT,309,107,144,12,ES_MULTILINE | WS_VSCROLL - EDITTEXT IDC_DELIMITER2_BOUNDARYCLOSE_EDIT,309,125,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER2_STYLER,399,71,54,13 + EDITTEXT IDC_DELIMITER2_BOUNDARYCLOSE_EDIT,309,126,144,12,ES_MULTILINE | WS_VSCROLL + PUSHBUTTON "Styler",IDC_DELIMITER2_STYLER,399,71,54,14 RTEXT "Open:",IDC_DELIMITER2_BOUNDARYOPEN_STATIC,251,90,56,8 RTEXT "Escape:",IDC_DELIMITER2_ESCAPE_STATIC,251,109,56,8 RTEXT "Close:",IDC_DELIMITER2_BOUNDARYCLOSE_STATIC,251,127,56,8 @@ -84,7 +84,7 @@ BEGIN EDITTEXT IDC_DELIMITER3_BOUNDARYOPEN_EDIT,72,174,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER3_ESCAPE_EDIT,72,193,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER3_BOUNDARYCLOSE_EDIT,72,212,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER3_STYLER,162,156,54,13 + PUSHBUTTON "Styler",IDC_DELIMITER3_STYLER,162,156,54,14 RTEXT "Open:",IDC_DELIMITER3_BOUNDARYOPEN_STATIC,12,176,56,8 RTEXT "Escape:",IDC_DELIMITER3_ESCAPE_STATIC,12,195,56,8 RTEXT "Close:",IDC_DELIMITER3_BOUNDARYCLOSE_STATIC,12,214,56,8 @@ -92,15 +92,15 @@ BEGIN EDITTEXT IDC_DELIMITER4_BOUNDARYOPEN_EDIT,309,174,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER4_ESCAPE_EDIT,309,193,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER4_BOUNDARYCLOSE_EDIT,309,212,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER4_STYLER,399,156,54,13 + PUSHBUTTON "Styler",IDC_DELIMITER4_STYLER,399,156,54,14 RTEXT "Open:",IDC_DELIMITER4_BOUNDARYOPEN_STATIC,251,176,56,8 RTEXT "Escape:",IDC_DELIMITER4_ESCAPE_STATIC,251,195,56,8 RTEXT "Close:",IDC_DELIMITER4_BOUNDARYCLOSE_STATIC,251,214,56,8 GROUPBOX "Delimiter 4 style",IDC_DELIMITER4_DESCGROUP_STATIC,245,148,212,82,BS_LEFT EDITTEXT IDC_DELIMITER5_BOUNDARYOPEN_EDIT,72,259,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER5_ESCAPE_EDIT,72,278,144,12,ES_MULTILINE | WS_VSCROLL - EDITTEXT IDC_DELIMITER5_BOUNDARYCLOSE_EDIT,72,298,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER5_STYLER,162,242,54,13 + EDITTEXT IDC_DELIMITER5_BOUNDARYCLOSE_EDIT,72,297,144,12,ES_MULTILINE | WS_VSCROLL + PUSHBUTTON "Styler",IDC_DELIMITER5_STYLER,162,242,54,14 RTEXT "Open:",IDC_DELIMITER5_BOUNDARYOPEN_STATIC,12,260,56,8 RTEXT "Escape:",IDC_DELIMITER5_ESCAPE_STATIC,12,279,56,8 RTEXT "Close:",IDC_DELIMITER5_BOUNDARYCLOSE_STATIC,12,299,56,8 @@ -108,7 +108,7 @@ BEGIN EDITTEXT IDC_DELIMITER6_BOUNDARYOPEN_EDIT,309,259,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER6_ESCAPE_EDIT,309,278,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER6_BOUNDARYCLOSE_EDIT,309,297,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER6_STYLER,399,242,54,13 + PUSHBUTTON "Styler",IDC_DELIMITER6_STYLER,399,242,54,14 RTEXT "Open:",IDC_DELIMITER6_BOUNDARYOPEN_STATIC,251,261,56,8 RTEXT "Escape:",IDC_DELIMITER6_ESCAPE_STATIC,251,280,56,8 RTEXT "Close:",IDC_DELIMITER6_BOUNDARYCLOSE_STATIC,251,299,56,8 @@ -116,7 +116,7 @@ BEGIN EDITTEXT IDC_DELIMITER7_BOUNDARYOPEN_EDIT,72,345,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER7_ESCAPE_EDIT,72,364,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER7_BOUNDARYCLOSE_EDIT,72,383,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER7_STYLER,162,328,54,13 + PUSHBUTTON "Styler",IDC_DELIMITER7_STYLER,162,328,54,14 RTEXT "Open:",IDC_DELIMITER7_BOUNDARYOPEN_STATIC,251,347,56,8 RTEXT "Escape:",IDC_DELIMITER7_ESCAPE_STATIC,251,365,56,8 RTEXT "Close:",IDC_DELIMITER7_BOUNDARYCLOSE_STATIC,251,384,56,8 @@ -124,7 +124,7 @@ BEGIN EDITTEXT IDC_DELIMITER8_BOUNDARYOPEN_EDIT,309,345,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER8_ESCAPE_EDIT,309,364,144,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_DELIMITER8_BOUNDARYCLOSE_EDIT,309,383,144,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_DELIMITER8_STYLER,399,328,54,13 + PUSHBUTTON "Styler",IDC_DELIMITER8_STYLER,399,328,54,14 RTEXT "Open:",IDC_DELIMITER8_BOUNDARYOPEN_STATIC,12,346,56,8 RTEXT "Escape:",IDC_DELIMITER8_ESCAPE_STATIC,12,365,56,8 RTEXT "Close:",IDC_DELIMITER8_BOUNDARYCLOSE_STATIC,12,385,56,8 @@ -137,36 +137,36 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN EDITTEXT IDC_KEYWORD1_EDIT,19,44,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "1st group",IDC_KEYWORD1_DESCGROUP_STATIC,9,17,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD1_STYLER,19,27,53,13 - CONTROL "Prefix mode",IDC_KEYWORD1_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,31,68,13 + PUSHBUTTON "Styler",IDC_KEYWORD1_STYLER,19,27,53,14 + CONTROL "Prefix mode",IDC_KEYWORD1_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,31,68,10 EDITTEXT IDC_KEYWORD2_EDIT,262,44,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "2nd group",IDC_KEYWORD2_DESCGROUP_STATIC,252,17,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD2_STYLER,262,26,53,13 - CONTROL "Prefix mode",IDC_KEYWORD2_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,31,68,13 + PUSHBUTTON "Styler",IDC_KEYWORD2_STYLER,262,26,53,14 + CONTROL "Prefix mode",IDC_KEYWORD2_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,31,68,10 EDITTEXT IDC_KEYWORD3_EDIT,19,138,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "3rd group",IDC_KEYWORD3_DESCGROUP_STATIC,10,111,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD3_STYLER,19,120,53,13 - CONTROL "Prefix mode",IDC_KEYWORD3_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,125,68,13 + PUSHBUTTON "Styler",IDC_KEYWORD3_STYLER,19,120,53,14 + CONTROL "Prefix mode",IDC_KEYWORD3_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,125,68,10 EDITTEXT IDC_KEYWORD4_EDIT,262,138,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "4th group",IDC_KEYWORD4_DESCGROUP_STATIC,252,111,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD4_STYLER,262,120,53,13 - CONTROL "Prefix mode",IDC_KEYWORD4_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,125,68,13 + PUSHBUTTON "Styler",IDC_KEYWORD4_STYLER,262,120,53,14 + CONTROL "Prefix mode",IDC_KEYWORD4_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,125,68,10 EDITTEXT IDC_KEYWORD5_EDIT,19,233,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "5th group",IDC_KEYWORD5_DESCGROUP_STATIC,10,206,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD5_STYLER,19,215,53,13 - CONTROL "Prefix mode",IDC_KEYWORD5_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,220,68,13 + PUSHBUTTON "Styler",IDC_KEYWORD5_STYLER,19,215,53,14 + CONTROL "Prefix mode",IDC_KEYWORD5_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,220,68,10 EDITTEXT IDC_KEYWORD6_EDIT,262,233,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "6th group",IDC_KEYWORD6_DESCGROUP_STATIC,252,206,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD6_STYLER,262,215,53,13 - CONTROL "Prefix mode",IDC_KEYWORD6_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,220,68,13 + PUSHBUTTON "Styler",IDC_KEYWORD6_STYLER,262,215,53,14 + CONTROL "Prefix mode",IDC_KEYWORD6_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,220,68,10 EDITTEXT IDC_KEYWORD7_EDIT,19,329,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "7th group",IDC_KEYWORD7_DESCGROUP_STATIC,10,302,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD7_STYLER,19,311,53,13 - CONTROL "Prefix mode",IDC_KEYWORD7_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,315,72,13 + PUSHBUTTON "Styler",IDC_KEYWORD7_STYLER,19,311,53,14 + CONTROL "Prefix mode",IDC_KEYWORD7_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,315,72,10 EDITTEXT IDC_KEYWORD8_EDIT,262,329,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL GROUPBOX "8th group",IDC_KEYWORD8_DESCGROUP_STATIC,252,302,200,85,BS_CENTER - PUSHBUTTON "Styler",IDC_KEYWORD8_STYLER,262,311,53,13 - CONTROL "Prefix mode",IDC_KEYWORD8_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,315,72,13 + PUSHBUTTON "Styler",IDC_KEYWORD8_STYLER,262,311,53,14 + CONTROL "Prefix mode",IDC_KEYWORD8_PREFIX_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,332,315,72,10 END IDD_COMMENT_STYLE_DLG DIALOGEX 36, 44, 466, 415 @@ -175,34 +175,34 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN GROUPBOX "Line comment position",IDC_COMMENTLINE_POSITION_STATIC,11,7,156,57 CONTROL "Allow folding of comments",IDC_FOLDING_OF_COMMENTS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,14,131,8 - CONTROL "Allow anywhere",IDC_ALLOW_ANYWHERE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,33,22,121,8 - CONTROL "Force at beginning of line",IDC_FORCE_AT_BOL,"Button",BS_AUTORADIOBUTTON,33,34,121,8 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,14,131,10 + CONTROL "Allow anywhere",IDC_ALLOW_ANYWHERE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,33,22,121,10 + CONTROL "Force at beginning of line",IDC_FORCE_AT_BOL,"Button",BS_AUTORADIOBUTTON,33,34,121,10 CONTROL "Allow preceding whitespace",IDC_ALLOW_WHITESPACE, - "Button",BS_AUTORADIOBUTTON,33,46,121,8 + "Button",BS_AUTORADIOBUTTON,33,46,121,10 EDITTEXT IDC_COMMENTLINE_OPEN_EDIT,85,105,138,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_COMMENTLINE_CONTINUE_EDIT,85,124,138,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_COMMENTLINE_CLOSE_EDIT,85,144,138,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_COMMENTLINE_STYLER,169,85,54,13 - RTEXT "Open:",IDC_COMMENTLINE_OPEN_STATIC,12,105,71,9 - RTEXT "Continue character:",IDC_COMMENTLINE_CONTINUE_STATIC,12,126,71,9 - RTEXT "Close:",IDC_COMMENTLINE_CLOSE_STATIC,12,145,71,9 + PUSHBUTTON "Styler",IDC_COMMENTLINE_STYLER,169,85,54,14 + RTEXT "Open:",IDC_COMMENTLINE_OPEN_STATIC,12,105,71,8 + RTEXT "Continue character:",IDC_COMMENTLINE_CONTINUE_STATIC,12,126,71,8 + RTEXT "Close:",IDC_COMMENTLINE_CLOSE_STATIC,12,145,71,8 GROUPBOX "Comment line style",IDC_COMMENTLINE_DESCGROUP_STATIC,10,71,219,94,BS_CENTER EDITTEXT IDC_COMMENT_OPEN_EDIT,312,112,138,12,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_COMMENT_CLOSE_EDIT,312,140,138,12,ES_MULTILINE | WS_VSCROLL - PUSHBUTTON "Styler",IDC_COMMENT_STYLER,396,85,54,13 - RTEXT "Open:",IDC_COMMENT_OPEN_STATIC,242,113,67,9 - RTEXT "Close:",IDC_COMMENT_CLOSE_STATIC,242,141,68,9 + PUSHBUTTON "Styler",IDC_COMMENT_STYLER,396,85,54,14 + RTEXT "Open:",IDC_COMMENT_OPEN_STATIC,242,113,67,8 + RTEXT "Close:",IDC_COMMENT_CLOSE_STATIC,242,141,68,8 GROUPBOX "Comment style",IDC_COMMENT_DESCGROUP_STATIC,238,71,219,94,BS_CENTER GROUPBOX "Number style",IDC_NUMBER_DESCGROUP_STATIC,10,174,447,190,BS_CENTER - PUSHBUTTON "Styler",IDC_NUMBER_STYLER,376,185,54,13 - RTEXT "Prefix 1:",IDC_NUMBER_PREFIX1_STATIC,14,204,45,13 - RTEXT "Prefix 2:",IDC_NUMBER_PREFIX2_STATIC,245,204,45,13 - RTEXT "Extras 1:",IDC_NUMBER_EXTRAS1_STATIC,14,235,45,13 - RTEXT "Extras 2:",IDC_NUMBER_EXTRAS2_STATIC,245,235,45,13 - RTEXT "Suffix 1:",IDC_NUMBER_SUFFIX1_STATIC,14,266,45,13 - RTEXT "Suffix 2:",IDC_NUMBER_SUFFIX2_STATIC,245,266,45,13 - RTEXT "Range:",IDC_NUMBER_RANGE_STATIC,14,298,45,13 + PUSHBUTTON "Styler",IDC_NUMBER_STYLER,376,185,54,14 + RTEXT "Prefix 1:",IDC_NUMBER_PREFIX1_STATIC,14,204,45,8 + RTEXT "Prefix 2:",IDC_NUMBER_PREFIX2_STATIC,245,204,45,8 + RTEXT "Extras 1:",IDC_NUMBER_EXTRAS1_STATIC,14,235,45,8 + RTEXT "Extras 2:",IDC_NUMBER_EXTRAS2_STATIC,245,235,45,8 + RTEXT "Suffix 1:",IDC_NUMBER_SUFFIX1_STATIC,14,266,45,8 + RTEXT "Suffix 2:",IDC_NUMBER_SUFFIX2_STATIC,245,266,45,8 + RTEXT "Range:",IDC_NUMBER_RANGE_STATIC,14,298,45,8 EDITTEXT IDC_NUMBER_PREFIX1_EDIT,63,204,136,21,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_NUMBER_PREFIX2_EDIT,294,204,136,21,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_NUMBER_EXTRAS1_EDIT,63,235,136,21,ES_MULTILINE | WS_VSCROLL @@ -211,9 +211,9 @@ BEGIN EDITTEXT IDC_NUMBER_SUFFIX2_EDIT,295,266,136,21,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_NUMBER_RANGE_EDIT,63,298,136,21,ES_MULTILINE | WS_VSCROLL GROUPBOX "Decimal separator",IDC_DECIMAL_SEPARATOR_STATIC,295,299,136,53,BS_CENTER - CONTROL "Dot",IDC_DOT_RADIO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,319,310,59,8 - CONTROL "Comma",IDC_COMMA_RADIO,"Button",BS_AUTORADIOBUTTON,319,322,59,8 - CONTROL "Both",IDC_BOTH_RADIO,"Button",BS_AUTORADIOBUTTON,319,335,59,8 + CONTROL "Dot",IDC_DOT_RADIO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,319,310,59,10 + CONTROL "Comma",IDC_COMMA_RADIO,"Button",BS_AUTORADIOBUTTON,319,322,59,10 + CONTROL "Both",IDC_BOTH_RADIO,"Button",BS_AUTORADIOBUTTON,319,335,59,10 END IDD_GLOBAL_USERDEFINE_DLG DIALOGEX 0, 0, 490, 470 @@ -257,39 +257,39 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,100,280,50,14 PUSHBUTTON "Cancel",IDCANCEL,172,280,50,14 - CONTROL "Bold",IDC_STYLER_CHECK_BOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,23,90,13 - CONTROL "Italic",IDC_STYLER_CHECK_ITALIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,37,90,13 - CONTROL "Underline",IDC_STYLER_CHECK_UNDERLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,51,90,13 + CONTROL "Bold",IDC_STYLER_CHECK_BOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,23,90,10 + CONTROL "Italic",IDC_STYLER_CHECK_ITALIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,37,90,10 + CONTROL "Underline",IDC_STYLER_CHECK_UNDERLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,51,90,10 COMBOBOX IDC_STYLER_COMBO_FONT_NAME,65,29,104,80,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_STYLER_COMBO_FONT_SIZE,65,49,104,77,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Foreground color:",IDC_STYLER_FG_STATIC,14,75,75,11 - CONTROL "Transparent",IDC_STYLER_CHECK_FG_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,92,78,13 - RTEXT "Background color:",IDC_STYLER_BG_STATIC,153,75,75,11 - CONTROL "Transparent",IDC_STYLER_CHECK_BG_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,92,78,13 - CONTROL "Delimiter 1",IDC_STYLER_CHECK_NESTING_DELIMITER1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,132,76,13 - CONTROL "Delimiter 2",IDC_STYLER_CHECK_NESTING_DELIMITER2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,149,76,13 - CONTROL "Delimiter 3",IDC_STYLER_CHECK_NESTING_DELIMITER3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,166,76,13 - CONTROL "Comment",IDC_STYLER_CHECK_NESTING_COMMENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,132,76,13 + RTEXT "Foreground color:",IDC_STYLER_FG_STATIC,14,75,75,8 + CONTROL "Transparent",IDC_STYLER_CHECK_FG_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,92,78,10 + RTEXT "Background color:",IDC_STYLER_BG_STATIC,153,75,75,8 + CONTROL "Transparent",IDC_STYLER_CHECK_BG_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,92,78,10 + CONTROL "Delimiter 1",IDC_STYLER_CHECK_NESTING_DELIMITER1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,132,76,10 + CONTROL "Delimiter 2",IDC_STYLER_CHECK_NESTING_DELIMITER2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,149,76,10 + CONTROL "Delimiter 3",IDC_STYLER_CHECK_NESTING_DELIMITER3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,166,76,10 + CONTROL "Comment",IDC_STYLER_CHECK_NESTING_COMMENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,132,76,10 CONTROL "Comment line",IDC_STYLER_CHECK_NESTING_COMMENT_LINE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,149,76,13 - CONTROL "Keyword 1",IDC_STYLER_CHECK_NESTING_KEYWORD1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,132,76,13 - CONTROL "Keyword 2",IDC_STYLER_CHECK_NESTING_KEYWORD2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,149,76,13 - CONTROL "Keyword 3",IDC_STYLER_CHECK_NESTING_KEYWORD3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,166,76,13 - CONTROL "Keyword 4",IDC_STYLER_CHECK_NESTING_KEYWORD4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,183,76,13 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,149,76,10 + CONTROL "Keyword 1",IDC_STYLER_CHECK_NESTING_KEYWORD1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,132,76,10 + CONTROL "Keyword 2",IDC_STYLER_CHECK_NESTING_KEYWORD2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,149,76,10 + CONTROL "Keyword 3",IDC_STYLER_CHECK_NESTING_KEYWORD3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,166,76,10 + CONTROL "Keyword 4",IDC_STYLER_CHECK_NESTING_KEYWORD4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,183,76,10 GROUPBOX "Nesting",IDC_STYLER_STATIC_NESTING_GROUP,14,116,295,157 GROUPBOX "Font options",IDC_STYLER_STATIC_FONT_OPTIONS,14,15,295,95 - CONTROL "Delimiter 4",IDC_STYLER_CHECK_NESTING_DELIMITER4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,183,76,13 - CONTROL "Delimiter 5",IDC_STYLER_CHECK_NESTING_DELIMITER5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,200,76,13 - CONTROL "Delimiter 6",IDC_STYLER_CHECK_NESTING_DELIMITER6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,217,76,13 - CONTROL "Delimiter 7",IDC_STYLER_CHECK_NESTING_DELIMITER7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,234,76,13 - CONTROL "Delimiter 8",IDC_STYLER_CHECK_NESTING_DELIMITER8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,251,76,13 - CONTROL "Keyword 5",IDC_STYLER_CHECK_NESTING_KEYWORD5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,200,76,13 - CONTROL "Keyword 6",IDC_STYLER_CHECK_NESTING_KEYWORD6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,217,76,13 - CONTROL "Keyword 7",IDC_STYLER_CHECK_NESTING_KEYWORD7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,234,76,13 - CONTROL "Keyword 8",IDC_STYLER_CHECK_NESTING_KEYWORD8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,251,76,13 - RTEXT "Name:",IDC_STYLER_NAME_STATIC,26,30,36,12 - RTEXT "Size:",IDC_STYLER_SIZE_STATIC,25,50,36,12 - CONTROL "Operators 1",IDC_STYLER_CHECK_NESTING_OPERATORS1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,166,76,13 - CONTROL "Operators 2",IDC_STYLER_CHECK_NESTING_OPERATORS2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,183,76,13 - CONTROL "Numbers",IDC_STYLER_CHECK_NESTING_NUMBERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,200,76,13 + CONTROL "Delimiter 4",IDC_STYLER_CHECK_NESTING_DELIMITER4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,183,76,10 + CONTROL "Delimiter 5",IDC_STYLER_CHECK_NESTING_DELIMITER5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,200,76,10 + CONTROL "Delimiter 6",IDC_STYLER_CHECK_NESTING_DELIMITER6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,217,76,10 + CONTROL "Delimiter 7",IDC_STYLER_CHECK_NESTING_DELIMITER7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,234,76,10 + CONTROL "Delimiter 8",IDC_STYLER_CHECK_NESTING_DELIMITER8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,251,76,10 + CONTROL "Keyword 5",IDC_STYLER_CHECK_NESTING_KEYWORD5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,200,76,10 + CONTROL "Keyword 6",IDC_STYLER_CHECK_NESTING_KEYWORD6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,217,76,10 + CONTROL "Keyword 7",IDC_STYLER_CHECK_NESTING_KEYWORD7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,234,76,10 + CONTROL "Keyword 8",IDC_STYLER_CHECK_NESTING_KEYWORD8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,251,76,10 + RTEXT "Name:",IDC_STYLER_NAME_STATIC,26,30,36,8 + RTEXT "Size:",IDC_STYLER_SIZE_STATIC,25,50,36,8 + CONTROL "Operators 1",IDC_STYLER_CHECK_NESTING_OPERATORS1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,166,76,10 + CONTROL "Operators 2",IDC_STYLER_CHECK_NESTING_OPERATORS2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,183,76,10 + CONTROL "Numbers",IDC_STYLER_CHECK_NESTING_NUMBERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,200,76,10 END diff --git a/PowerEditor/src/dpiManagerV2.h b/PowerEditor/src/dpiManagerV2.h index 706a98492..421916011 100644 --- a/PowerEditor/src/dpiManagerV2.h +++ b/PowerEditor/src/dpiManagerV2.h @@ -94,6 +94,14 @@ public: return scale(x, USER_DEFAULT_SCREEN_DPI, dpi); } + static int scale(int x, HWND hWnd) { + return scale(x, getDpiForWindow(hWnd), USER_DEFAULT_SCREEN_DPI); + } + + static int unscale(int x, HWND hWnd) { + return scale(x, USER_DEFAULT_SCREEN_DPI, getDpiForWindow(hWnd)); + } + int scale(int x) { return scale(x, _dpi); }