Merge pull request #4417 from RaiKoHoff/Dev_Master

Fixing some minor issues for RC2
This commit is contained in:
Rainer Kottenhoff 2022-12-28 18:56:00 +01:00 committed by GitHub
commit 11eb839792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 179 additions and 184 deletions

View File

@ -324,7 +324,7 @@ Operator=fore:#F651F6
Property Name=fore:#A9D1F5
ESC Sequence=fore:#3DE966
URL/IRI=fore:#0000FF
Compact IRI=fore:#D137C1
Compact IRI=fore:#A9D1F5
Parsing Error=fore:#F2F20D; back:#F75C5E; eolfilled
[Julia Script]
Comment=fore:#7E9E7C

View File

@ -1732,8 +1732,8 @@ bool OpenWithDlg(HWND hwnd, LPCWSTR lpstrFile)
Path_GetDisplayName(chDispayName, COUNTOF(chDispayName), hpthFileName, NULL, true);
dliOpenWith.strDisplayName = chDispayName;
if (IDOK == ThemedDialogBoxParam(Globals.hLngResContainer,MAKEINTRESOURCE(IDD_MUI_OPENWITH),
hwnd,OpenWithDlgProc,(LPARAM)&dliOpenWith)) {
if (IsYesOkay(ThemedDialogBoxParam(Globals.hLngResContainer,MAKEINTRESOURCE(IDD_MUI_OPENWITH),
hwnd,OpenWithDlgProc,(LPARAM)&dliOpenWith))) {
Path_Sanitize(hpthFileName);
if (Path_IsLnkFile(hpthFileName)) {
@ -1988,8 +1988,8 @@ bool FavoritesDlg(HWND hwnd, HPATHL hpath_in_out)
dliFavorite.strDisplayName = StrgWriteAccessBuf(hstrDisplayName, INTERNET_MAX_URL_LENGTH);
bool res = false;
if (IDOK == ThemedDialogBoxParam(Globals.hLngResContainer,MAKEINTRESOURCE(IDD_MUI_FAVORITES),
hwnd,FavoritesDlgProc,(LPARAM)&dliFavorite)) {
if (IsYesOkay(ThemedDialogBoxParam(Globals.hLngResContainer,MAKEINTRESOURCE(IDD_MUI_FAVORITES),
hwnd,FavoritesDlgProc,(LPARAM)&dliFavorite))) {
Path_Sanitize(hpthFileName);
Path_Swap(hpath_in_out, hpthFileName);
res = true;
@ -2138,7 +2138,7 @@ bool AddToFavDlg(HWND hwnd, const HPATHL hTargetPth)
hwnd,
AddToFavDlgProc, (LPARAM)szDisplayName);
if (iResult == IDOK) {
if (IsYesOkay(iResult)) {
StringCchCat(szDisplayName, COUNTOF(szDisplayName), L".lnk");
if (!Path_CreateFavLnk(szDisplayName, hTargetPth, Settings.FavoritesDir)) {
InfoBoxLng(MB_ICONWARNING,NULL,IDS_MUI_FAV_FAILURE);
@ -2541,7 +2541,7 @@ CASE_WM_CTLCOLOR_SET:
}
// Ask...
LONG const answer = (LOWORD(wParam) == IDOK) ? InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_ERR_MRUDLG)
LONG const answer = IsYesOkay(wParam) ? InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_ERR_MRUDLG)
: ((iCur == lvi.iItem) ? IDNO : IDYES);
if (IsYesOkay(answer)) {
@ -2586,8 +2586,8 @@ CASE_WM_CTLCOLOR_SET:
//
bool FileMRUDlg(HWND hwnd, HPATHL hFilePath_out)
{
return (IDOK == ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_FILEMRU),
hwnd, FileMRUDlgProc, (LPARAM)hFilePath_out));
return (IsYesOkay(ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_FILEMRU),
hwnd, FileMRUDlgProc, (LPARAM)hFilePath_out)));
}
@ -2764,17 +2764,14 @@ CASE_WM_CTLCOLOR_SET:
//
bool ChangeNotifyDlg(HWND hwnd)
{
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_CHANGENOTIFY),
hwnd,
ChangeNotifyDlgProc,
0);
INT_PTR iResult;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_CHANGENOTIFY),
hwnd,
ChangeNotifyDlgProc,
0);
return (iResult == IDOK) ? true : false;
return IsYesOkay(iResult);
}
@ -2882,16 +2879,13 @@ CASE_WM_CTLCOLOR_SET:
//
bool ColumnWrapDlg(HWND hwnd,UINT uidDlg, UINT *iNumber)
{
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(uidDlg),
hwnd,
ColumnWrapDlgProc,(LPARAM)iNumber);
INT_PTR iResult;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(uidDlg),
hwnd,
ColumnWrapDlgProc,(LPARAM)iNumber);
return (iResult == IDOK) ? true : false;
return IsYesOkay(iResult);
}
@ -3035,17 +3029,13 @@ CASE_WM_CTLCOLOR_SET:
//
bool WordWrapSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
{
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(uidDlg),
hwnd,
WordWrapSettingsDlgProc,(LPARAM)iNumber);
INT_PTR iResult;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(uidDlg),
hwnd,
WordWrapSettingsDlgProc,(LPARAM)iNumber);
return (iResult == IDOK) ? true : false;
return IsYesOkay(iResult);
}
@ -3204,7 +3194,7 @@ bool LongLineSettingsDlg(HWND hwnd,UINT uidDlg, LPWSTR pColList)
hwnd,
LongLineSettingsDlgProc, (LPARAM)pColList);
return (iResult == IDOK) ? true : false;
return IsYesOkay(iResult);
}
@ -3347,17 +3337,13 @@ CASE_WM_CTLCOLOR_SET:
//
bool TabSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
{
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(uidDlg),
hwnd,
TabSettingsDlgProc,(LPARAM)iNumber);
INT_PTR iResult;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(uidDlg),
hwnd,
TabSettingsDlgProc,(LPARAM)iNumber);
return (iResult == IDOK) ? true : false;
return IsYesOkay(iResult);
}
@ -3558,23 +3544,22 @@ CASE_WM_CTLCOLOR_SET:
//
bool SelectDefEncodingDlg(HWND hwnd, cpi_enc_t* pidREncoding)
{
INT_PTR iResult;
ENCODEDLG dd = { 0 };
dd.bRecodeOnly = false;
dd.idEncoding = *pidREncoding;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_DEFENCODING),
hwnd,
SelectDefEncodingDlgProc,
(LPARAM)&dd);
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_DEFENCODING),
hwnd,
SelectDefEncodingDlgProc,
(LPARAM)&dd);
if (iResult == IDOK) {
if (IsYesOkay(iResult)) {
*pidREncoding = dd.idEncoding;
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -3756,25 +3741,23 @@ CASE_WM_CTLCOLOR_SET:
//
bool SelectEncodingDlg(HWND hwnd, cpi_enc_t* pidREncoding)
{
INT_PTR iResult;
ENCODEDLG dd = { 0 };
dd.bRecodeOnly = false;
dd.idEncoding = *pidREncoding;
dd.cxDlg = Settings.EncodingDlgSizeX;
dd.cyDlg = Settings.EncodingDlgSizeY;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_ENCODING),
hwnd,
SelectEncodingDlgProc,
(LPARAM)&dd);
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_ENCODING),
hwnd,
SelectEncodingDlgProc,
(LPARAM)&dd);
Settings.EncodingDlgSizeX = dd.cxDlg;
Settings.EncodingDlgSizeY = dd.cyDlg;
if (iResult == IDOK) {
if (IsYesOkay(iResult)) {
*pidREncoding = dd.idEncoding;
return TRUE;
}
@ -3788,25 +3771,23 @@ bool SelectEncodingDlg(HWND hwnd, cpi_enc_t* pidREncoding)
//
bool RecodeDlg(HWND hwnd, cpi_enc_t* pidREncoding)
{
INT_PTR iResult = 0;
ENCODEDLG dd = { 0 };
dd.bRecodeOnly = true;
dd.idEncoding = *pidREncoding;
dd.cxDlg = Settings.RecodeDlgSizeX;
dd.cyDlg = Settings.RecodeDlgSizeY;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_RECODE),
hwnd,
SelectEncodingDlgProc,
(LPARAM)&dd);
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_RECODE),
hwnd,
SelectEncodingDlgProc,
(LPARAM)&dd);
Settings.RecodeDlgSizeX = dd.cxDlg;
Settings.RecodeDlgSizeY = dd.cyDlg;
if (iResult == IDOK) {
if (IsYesOkay(iResult)) {
*pidREncoding = dd.idEncoding;
return TRUE;
}
@ -3931,7 +3912,7 @@ bool SelectDefLineEndingDlg(HWND hwnd, LPARAM piOption)
SelectDefLineEndingDlgProc,
piOption);
return (iResult == IDOK);
return IsYesOkay(iResult);
}
@ -4043,12 +4024,12 @@ CASE_WM_CTLCOLOR_SET:
//
bool WarnLineEndingDlg(HWND hwnd, EditFileIOStatus* fioStatus)
{
const INT_PTR iResult = ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_WARNLINEENDS),
hwnd,
WarnLineEndingDlgProc,
(LPARAM)fioStatus);
return (iResult == IDOK);
INT_PTR const iResult = ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_WARNLINEENDS),
hwnd,
WarnLineEndingDlgProc,
(LPARAM)fioStatus);
return IsYesOkay(iResult);
}
@ -4196,12 +4177,12 @@ CASE_WM_CTLCOLOR_SET:
//
bool WarnIndentationDlg(HWND hwnd, EditFileIOStatus* fioStatus)
{
const INT_PTR iResult = ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_WARNINDENTATION),
hwnd,
WarnIndentationDlgProc,
(LPARAM)fioStatus);
return (iResult == IDOK);
INT_PTR const iResult = ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_WARNINDENTATION),
hwnd,
WarnIndentationDlgProc,
(LPARAM)fioStatus);
return IsYesOkay(iResult);
}
@ -4366,13 +4347,13 @@ static INT_PTR CALLBACK AutoSaveBackupSettingsDlgProc(HWND hwnd, UINT umsg, WPAR
bool AutoSaveBackupSettingsDlg(HWND hwnd)
{
const INT_PTR iResult = ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_AUTOSAVE_BACKUP),
hwnd,
AutoSaveBackupSettingsDlgProc,
0);
INT_PTR const iResult = ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_AUTOSAVE_BACKUP),
hwnd,
AutoSaveBackupSettingsDlgProc,
0);
return (iResult == IDOK);
return IsYesOkay(iResult);
}

View File

@ -81,13 +81,13 @@ DWORD MsgBoxLastError(LPCWSTR lpszMessage, DWORD dwErrID);
LONG InfoBoxLng(UINT uType, LPCWSTR lpstrSetting, UINT uidMsg, ...);
#define INFOBOX_ANSW(_R_) LOWORD(_R_)
#define INFOBOX_MODE(_R_) HIWORD(_R_)
inline bool IsYesOkay(LONG answ) {
inline bool IsYesOkay(INT_PTR answ) {
return ((LOWORD(answ) == IDOK) || (LOWORD(answ) == IDYES));
}
inline bool IsRetryContinue(LONG answ) {
inline bool IsRetryContinue(INT_PTR answ) {
return ((LOWORD(answ) == IDRETRY) || (LOWORD(answ) == IDCONTINUE));
}
inline bool IsNoCancel(LONG answ) {
inline bool IsNoCancel(INT_PTR answ) {
return ((LOWORD(answ) == IDNO) || (LOWORD(answ) == IDCANCEL));
}

View File

@ -475,7 +475,7 @@ static LPCH EditReInterpretText(LPCCH pchSource, const int szSrc, cpi_enc_t from
bool EditConvertText(HWND hwnd, cpi_enc_t encSource, cpi_enc_t encDest)
{
if ((encSource == encDest) || (Encoding_SciCP == encDest)) {
return false;
return true;
}
if (!(Encoding_IsValid(encSource) && Encoding_IsValid(encDest))) {
return false;
@ -1184,6 +1184,11 @@ bool EditLoadFile(
bool const bCacheWholeDocument = okay && ((liFileSize.HighPart == 0) && (liFileSize.LowPart <= (DWORD)(2 * (1<<20))));
SciCall_SetLayoutCache(bCacheWholeDocument ? SC_CACHE_DOCUMENT : SC_CACHE_PAGE); // beware of memory consumption !
// TODO: Optimization ?
// SCI_SETCHARACTERCATEGORYOPTIMIZATION(int countCharacters)
// SCI_GETCHARACTERCATEGORYOPTIMIZATION → int
// SCI_SETIDLESTYLING(int idleStyling)
bool const bLargerThan2GB = okay && ((liFileSize.HighPart > 0) || (liFileSize.LowPart >= (DWORD)INT32_MAX)); // 'int'
if (!okay || bLargerThan2GB) {
if (!okay) {
@ -7427,6 +7432,7 @@ int EditReplaceAllInRange(HWND hwnd, LPEDITFINDREPLACE lpefr, DocPos iStartPos,
}
int iCount = 0;
UndoTransActionBegin();
while ((iPos >= 0LL) && (start <= iEndPos)) {
DocLn const lnCnt = bRegexStartOfLine ? SciCall_GetLineCount() : 0;
@ -7449,6 +7455,7 @@ int EditReplaceAllInRange(HWND hwnd, LPEDITFINDREPLACE lpefr, DocPos iStartPos,
*enlargement = (iEndPos - iOrigEndPos);
SciCall_SetTargetRange(_saveTargetBeg_, _saveTargetEnd_ + *enlargement); //restore
return iCount;
}
@ -7464,9 +7471,7 @@ bool EditReplaceAll(HWND hwnd, LPEDITFINDREPLACE lpefr, bool bShowInfo)
DocPos enlargement = 0;
BeginWaitCursorUID(true, IDS_MUI_SB_REPLACE_ALL);
UndoTransActionBegin();
Globals.iReplacedOccurrences = EditReplaceAllInRange(hwnd, lpefr, start, end, &enlargement);
EndUndoTransAction();
EndWaitCursor();
WCHAR wchOcc[64] = { L'\0' };
@ -7502,7 +7507,9 @@ bool EditReplaceAllInSelection(HWND hwnd, LPEDITFINDREPLACE lpefr, bool bShowInf
const DocPos anchorPos = SciCall_GetAnchor();
DocPos enlargement = 0;
BeginWaitCursorUID(true, IDS_MUI_SB_REPLACE_ALL);
Globals.iReplacedOccurrences = EditReplaceAllInRange(hwnd, lpefr, start, end, &enlargement);
EndWaitCursor();
if (Globals.iReplacedOccurrences > 0) {
if (currPos < anchorPos) {
@ -8433,11 +8440,8 @@ CASE_WM_CTLCOLOR_SET:
//
bool EditLinenumDlg(HWND hwnd)
{
if (IDOK == ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_LINENUM),
GetParent(hwnd), EditLinenumDlgProc, (LPARAM)hwnd)) {
return true;
}
return false;
return IsYesOkay(ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_LINENUM),
GetParent(hwnd), EditLinenumDlgProc, (LPARAM)hwnd));
}
@ -8679,19 +8683,16 @@ static INT_PTR CALLBACK EditModifyLinesDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
//
// EditModifyLinesDlg()
//
bool EditModifyLinesDlg(HWND hwnd, PENCLOSESELDATA pEnclData) {
INT_PTR iResult;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_MODIFYLINES),
hwnd,
EditModifyLinesDlgProc,
(LPARAM)pEnclData);
return (iResult == IDOK) ? true : false;
bool EditModifyLinesDlg(HWND hwnd, PENCLOSESELDATA pEnclData)
{
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_MODIFYLINES),
hwnd,
EditModifyLinesDlgProc,
(LPARAM)pEnclData);
return IsYesOkay(iResult);
}
@ -8799,18 +8800,14 @@ CASE_WM_CTLCOLOR_SET:
//
bool EditAlignDlg(HWND hwnd,int *piAlignMode)
{
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_ALIGN),
hwnd,
EditAlignDlgProc,
(LPARAM)piAlignMode);
INT_PTR iResult;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_ALIGN),
hwnd,
EditAlignDlgProc,
(LPARAM)piAlignMode);
return (iResult == IDOK) ? true : false;
return IsYesOkay(iResult);
}
@ -8902,19 +8899,16 @@ CASE_WM_CTLCOLOR_SET:
//
// EditEncloseSelectionDlg()
//
bool EditEncloseSelectionDlg(HWND hwnd, PENCLOSESELDATA pEnclData) {
INT_PTR iResult;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_ENCLOSESELECTION),
hwnd,
EditEncloseSelectionDlgProc,
(LPARAM)pEnclData);
return (iResult == IDOK) ? true : false;
bool EditEncloseSelectionDlg(HWND hwnd, PENCLOSESELDATA pEnclData)
{
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_ENCLOSESELECTION),
hwnd,
EditEncloseSelectionDlgProc,
(LPARAM)pEnclData);
return IsYesOkay(iResult);
}
@ -9084,21 +9078,19 @@ CASE_WM_CTLCOLOR_SET:
//
bool EditInsertTagDlg(HWND hwnd, PENCLOSESELDATA pEnclData, UINT* pRepeat)
{
INT_PTR iResult = 0;
TAGSDATA data = { 0 };
data.pwsz1 = pEnclData->pwsz1;
data.pwsz2 = pEnclData->pwsz2;
data.repeat = 1;
iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_INSERTTAG),
hwnd,
EditInsertTagDlgProc,
(LPARAM)&data);
INT_PTR const iResult = ThemedDialogBoxParam(
Globals.hLngResContainer,
MAKEINTRESOURCEW(IDD_MUI_INSERTTAG),
hwnd,
EditInsertTagDlgProc,
(LPARAM)&data);
if (iResult == IDOK) {
if (IsYesOkay(iResult)) {
*pRepeat = data.repeat;
return true;
}
@ -9344,8 +9336,7 @@ bool EditSortDlg(HWND hwnd,int* piSortFlags)
EditSortDlgProc,
(LPARAM)piSortFlags);
return (iResult == IDOK) ? true : false;
return IsYesOkay(iResult);
}

View File

@ -2316,8 +2316,8 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl)
SciCall_SetEOLMode(Settings.DefaultEOLMode);
SciCall_SetPasteConvertEndings(true);
SciCall_UsePopUp(SC_POPUP_TEXT);
SciCall_SetScrollWidth(1);
SciCall_SetScrollWidthTracking(true);
// SciCall_SetScrollWidth(2000);
SciCall_SetMultipleSelection(true);
SciCall_SetMultiPaste(SC_MULTIPASTE_EACH); // paste into rectangular selection
@ -6169,12 +6169,14 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
case IDM_VIEW_TOGGLETB:
Settings.ToolBarTheme = (Settings.ToolBarTheme + 1) % 3;
SendMessage(hwnd, WM_THEMECHANGED, 0, 0);
CreateBars(hwnd, Globals.hInstance);
UpdateUI();
break;
case IDM_VIEW_LOADTHEMETB:
if (SelectExternalToolBar(hwnd)) {
SendMessage(hwnd, WM_THEMECHANGED, 0, 0);
CreateBars(hwnd, Globals.hInstance);
UpdateUI();
}
break;
@ -8828,9 +8830,10 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
break;
case STATUS_EOLMODE: {
int const eol_mode = (SciCall_GetEOLMode() + 2) % 3;
int const eol_cmd = (eol_mode == SC_EOL_CRLF) ? IDM_LINEENDINGS_CRLF :
((eol_mode == SC_EOL_CR) ? IDM_LINEENDINGS_CR : IDM_LINEENDINGS_LF);
int const eol_mode = (SciCall_GetEOLMode() + 1) % 3;
// skip unusual CR-only mode; should be explicitly set by menu or dialog only, so:
int const eol_cmd = (eol_mode == SC_EOL_CRLF) ? IDM_LINEENDINGS_CRLF : IDM_LINEENDINGS_LF;
//~((eol_mode == SC_EOL_CR) ? IDM_LINEENDINGS_CR : IDM_LINEENDINGS_LF);
PostWMCommand(hwnd, eol_cmd);
}
break;
@ -10169,6 +10172,9 @@ static void _UpdateStatusbarDelayed(bool bForceRedraw)
Settings.ShowStatusbar = false;
}
SendMessage(Globals.hwndStatus, WM_SETREDRAW, FALSE, 0);
SIZE const size = _StatusCalcTextSize(Globals.hwndStatus, L"X");
SendMessage(Globals.hwndStatus, SB_SETMINHEIGHT, MAKEWPARAM(size.cy + 2, 0), 0);
@ -10181,7 +10187,10 @@ static void _UpdateStatusbarDelayed(bool bForceRedraw)
}
}
PostMessage(Globals.hwndStatus, WM_SIZE, 0, 0);
SendMessage(Globals.hwndStatus, WM_SETREDRAW, TRUE, 0);
InvalidateRect(Globals.hwndStatus, NULL, TRUE);
//PostMessage(Globals.hwndStatus, WM_SIZE, 0, 0);
}
// --------------------------------------------------------------------------
@ -11504,7 +11513,7 @@ bool FileSave(FileSaveFlags fSaveFlags)
INT_PTR const answer = (Settings.MuteMessageBeep) ?
InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_READONLY_SAVE, Path_FindFileName(Paths.CurrentFile)) :
MessageBoxLng(MB_YESNO | MB_ICONWARNING, IDS_MUI_READONLY_SAVE, Path_Get(Paths.CurrentFile));
if ((IDOK == answer) || (IDYES == answer)) {
if (IsYesOkay(answer)) {
fSaveFlags |= FSF_SaveAs;
} else {
return false;
@ -11608,7 +11617,7 @@ bool FileSave(FileSaveFlags fSaveFlags)
INT_PTR const answer = (Settings.MuteMessageBeep) ?
InfoBoxLng(MB_YESNO | MB_ICONSHIELD, NULL, IDS_MUI_ERR_ACCESSDENIED, currentFileName, _W(SAPPNAME)) :
MessageBoxLng(MB_YESNO | MB_ICONSHIELD, IDS_MUI_ERR_ACCESSDENIED, Path_Get(Paths.CurrentFile), _W(SAPPNAME));
if ((IDOK == answer) || (IDYES == answer)) {
if (IsYesOkay(answer)) {
if (DoElevatedRelaunch(&fioStatus, true)) {
CloseApplication();
} else {

View File

@ -198,8 +198,8 @@ LRESULT MsgUahMenuBar(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam);
int DisableDocChangeNotification();
void EnableDocChangeNotification(const int evm);
#define LimitNotifyEvents() { int _evm_ = 0; __try { _evm_ = DisableDocChangeNotification();
#define RestoreNotifyEvents() ;} __finally { EnableDocChangeNotification(_evm_); } }
#define LimitNotifyEvents() { int _evm_ = 0; __try { _evm_ = DisableDocChangeNotification(); SendMessage(Globals.hwndEdit, WM_SETREDRAW, FALSE, 0);
#define RestoreNotifyEvents() ;} __finally { EnableDocChangeNotification(_evm_); SendMessage(Globals.hwndEdit, WM_SETREDRAW, TRUE, 0); InvalidateRect(Globals.hwndEdit, NULL, TRUE); } }
// ----------------------------------------------------------------------------
@ -212,6 +212,8 @@ void EnableDocChangeNotification(const int evm);
#define BeginWaitCursor(cond, text) { \
if (cond) { \
SciCall_SetCursor(SC_CURSORWAIT); \
SciCall_SetVScrollbar(false); \
SciCall_SetHScrollbar(false); \
StatusSetText(Globals.hwndStatus, STATUS_HELP, (text)); \
} \
LimitNotifyEvents()
@ -219,17 +221,20 @@ void EnableDocChangeNotification(const int evm);
#define BeginWaitCursorUID(cond, uid) { \
if (cond) { \
SciCall_SetCursor(SC_CURSORWAIT); \
SciCall_SetVScrollbar(false); \
SciCall_SetHScrollbar(false); \
StatusSetTextID(Globals.hwndStatus, STATUS_HELP, (uid)); \
} \
LimitNotifyEvents()
#define EndWaitCursor() \
SciCall_SetCursor(SC_CURSORNORMAL); \
POINT pt; \
GetCursorPos(&pt); \
SetCursorPos(pt.x, pt.y); \
RestoreNotifyEvents(); \
UpdateStatusbar(true); \
#define EndWaitCursor() \
RestoreNotifyEvents(); \
SciCall_SetCursor(SC_CURSORNORMAL); \
POINT pt; GetCursorPos(&pt); \
SetCursorPos(pt.x, pt.y); \
SciCall_SetHScrollbar(true); \
SciCall_SetVScrollbar(true); \
UpdateStatusbar(true); \
}
// ----------------------------------------------------------------------------

View File

@ -133,7 +133,7 @@ CASE_WM_CTLCOLOR_SET:
#endif
case WM_COMMAND:
if (LOWORD(wParam) == IDOK) {
if (IsYesOkay(wParam)) {
}
break;
@ -645,7 +645,7 @@ CASE_WM_CTLCOLOR_SET:
#endif
case WM_COMMAND:
if (LOWORD(wParam) == IDOK) {
if (IsYesOkay(wParam)) {
BOOL bError = FALSE;
int const iZoom = (int)SendDlgItemMessage(hwnd, 31, UDM_GETPOS32, 0, (LPARAM)&bError);
Settings.PrintZoom = bError ? Defaults.PrintZoom : iZoom;

View File

@ -802,8 +802,6 @@ inline void Sci_RedrawScrollbars()
SciCall_SetVScrollbar(true);
}
#define Sci_ReplaceTarget(M,L,T) (((M) == SCI_REPLACETARGET) ? SciCall_ReplaceTarget((L),(T)) : SciCall_ReplaceTargetRe((L),(T)))
// if iRangeEnd == -1 : apply style from iRangeStart to document end
#define Sci_ColouriseAll() SciCall_Colourise(0, -1)
@ -877,7 +875,6 @@ inline int Sci_GetCurrentEOL_W(LPWCH eol)
}
// ----------------------------------------------------------------------------
inline DocPos Sci_GetSelectionStartEx()
{
if (!Sci_IsMultiSelection()) {
@ -912,6 +909,18 @@ inline DocPos Sci_GetSelectionEndEx()
}
// ----------------------------------------------------------------------------
inline DocPos Sci_ReplaceTarget(const int mode, const DocPos length, const char* text)
{
if (mode == SCI_REPLACETARGETRE) {
return SciCall_ReplaceTargetRe(length, text);
}
if (SciCall_GetChangeHistory() == SC_CHANGE_HISTORY_DISABLED) {
return SciCall_ReplaceTarget(length, text);
}
return SciCall_ReplaceTargetMinimal(length, text);
}
// ----------------------------------------------------------------------------
//=============================================================================

View File

@ -31,7 +31,7 @@ EDITLEXER lexJSON =
{ {SCE_JSON_PROPERTYNAME}, IDS_LEX_STR_63364, L"Property Name", L"fore:#002697", L"" },
{ {SCE_JSON_ESCAPESEQUENCE}, IDS_LEX_STR_63366, L"ESC Sequence", L"fore:#0B982E", L"" },
{ {SCE_JSON_URI}, IDS_LEX_STR_63380, L"URL/IRI", L"fore:#0000FF", L"" },
{ {SCE_JSON_COMPACTIRI}, IDS_LEX_STR_63381, L"Compact IRI", L"fore:#D137C1", L"" },
{ {SCE_JSON_COMPACTIRI}, IDS_LEX_STR_63381, L"Compact IRI", L"fore:#002697", L"" },
{ {SCE_JSON_ERROR}, IDS_LEX_STR_63252, L"Parsing Error", L"fore:#FFFF00; back:#A02020; eolfilled", L"" },
EDITLEXER_SENTINEL
}

View File

@ -5174,9 +5174,9 @@ void Style_SelectLexerDlg(HWND hwnd)
{
PEDITLEXER selectedLexer = s_pLexCurrent;
if (IDOK == ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_STYLESELECT),
GetParent(hwnd), Style_SelectLexerDlgProc, (LPARAM)&selectedLexer)) {
if (IsYesOkay(ThemedDialogBoxParam(Globals.hLngResContainer,
MAKEINTRESOURCE(IDD_MUI_STYLESELECT),
GetParent(hwnd), Style_SelectLexerDlgProc, (LPARAM)&selectedLexer))) {
Style_SetLexer(Globals.hwndEdit, selectedLexer);
}
}

View File

@ -443,16 +443,16 @@ CASE_WM_CTLCOLOR_SET:
// set passphrases for output
bool GetFileKey(HWND hwnd)
{
return (IDOK == ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_PASSWORDS),
GetParent(hwnd), SetKeysDlgProc, (LPARAM)hwnd));
return (IsYesOkay(ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_PASSWORDS),
GetParent(hwnd), SetKeysDlgProc, (LPARAM)hwnd)));
}
// set passphrases for file being input
bool ReadFileKey(HWND hwnd, bool master)
{
masterKeyAvailable = master;
return (IDOK == ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_READPW),
GetParent(hwnd), GetKeysDlgProc, (LPARAM)hwnd));
return (IsYesOkay(ThemedDialogBoxParam(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_READPW),
GetParent(hwnd), GetKeysDlgProc, (LPARAM)hwnd)));
}