Fixed UI issue for RTL layout
1. For RTL languages such as hebrew, "Close" button goes beyond the dialog. 2. Few Text is chopped (specially ". matches newline" and "Regular expression") Closes #2337
This commit is contained in:
parent
b849edc924
commit
a7c87b8e72
|
@ -310,6 +310,9 @@ void FindReplaceDlg::fillFindHistory()
|
||||||
::SendDlgItemMessage(_hSelf, IDDIRECTIONDOWN, BM_SETCHECK, BST_CHECKED, 0);
|
::SendDlgItemMessage(_hSelf, IDDIRECTIONDOWN, BM_SETCHECK, BST_CHECKED, 0);
|
||||||
::SendDlgItemMessage(_hSelf, IDDIRECTIONUP, BM_SETCHECK, BST_UNCHECKED, 0);
|
::SendDlgItemMessage(_hSelf, IDDIRECTIONUP, BM_SETCHECK, BST_UNCHECKED, 0);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDDIRECTIONUP), (BOOL)false);
|
::EnableWindow(::GetDlgItem(_hSelf, IDDIRECTIONUP), (BOOL)false);
|
||||||
|
|
||||||
|
// If the search mode from history is regExp then enable the checkbox (. matches newline)
|
||||||
|
::EnableWindow(GetDlgItem(_hSelf, IDREDOTMATCHNL), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nppParams->isTransparentAvailable())
|
if (nppParams->isTransparentAvailable())
|
||||||
|
@ -684,14 +687,15 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
||||||
p.y = arc.top;
|
p.y = arc.top;
|
||||||
::ScreenToClient(_hSelf, &p);
|
::ScreenToClient(_hSelf, &p);
|
||||||
|
|
||||||
|
p = getTopPoint(::GetDlgItem(_hSelf, IDCANCEL), !_isRTL);
|
||||||
_replaceClosePos.left = p.x;
|
_replaceClosePos.left = p.x;
|
||||||
_replaceClosePos.top = p.y;
|
_replaceClosePos.top = p.y;
|
||||||
|
|
||||||
p = getTopPoint(::GetDlgItem(_hSelf, IDREPLACEALL));
|
p = getTopPoint(::GetDlgItem(_hSelf, IDREPLACEALL), !_isRTL);
|
||||||
_findInFilesClosePos.left = p.x;
|
_findInFilesClosePos.left = p.x;
|
||||||
_findInFilesClosePos.top = p.y;
|
_findInFilesClosePos.top = p.y;
|
||||||
|
|
||||||
p = getTopPoint(::GetDlgItem(_hSelf, IDCANCEL));
|
p = getTopPoint(::GetDlgItem(_hSelf, IDCANCEL), !_isRTL);
|
||||||
_findClosePos.left = p.x;
|
_findClosePos.left = p.x;
|
||||||
_findClosePos.top = p.y + 10;
|
_findClosePos.top = p.y + 10;
|
||||||
|
|
||||||
|
@ -766,12 +770,12 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
||||||
nbSelected = 0;
|
nbSelected = 0;
|
||||||
}
|
}
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_IN_SELECTION_CHECK), nbSelected);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_IN_SELECTION_CHECK), nbSelected);
|
||||||
// uncheck if the control is disable
|
// uncheck if the control is disable
|
||||||
if (!nbSelected)
|
if (!nbSelected)
|
||||||
{
|
{
|
||||||
checkVal = BST_UNCHECKED;
|
checkVal = BST_UNCHECKED;
|
||||||
_options._isInSelection = false;
|
_options._isInSelection = false;
|
||||||
}
|
}
|
||||||
::SendDlgItemMessage(_hSelf, IDC_IN_SELECTION_CHECK, BM_SETCHECK, checkVal, 0);
|
::SendDlgItemMessage(_hSelf, IDC_IN_SELECTION_CHECK, BM_SETCHECK, checkVal, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -787,6 +791,17 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
||||||
(NppParameters::getInstance())->removeTransparent(_hSelf);
|
(NppParameters::getInstance())->removeTransparent(_hSelf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// At very first time (when find dlg is launched), search mode is Normal.
|
||||||
|
// In that case, ". Matches newline" should be disabled as it applicable on for Regex
|
||||||
|
if (isCheckedOrNot(IDREGEXP))
|
||||||
|
{
|
||||||
|
::EnableWindow(GetDlgItem(_hSelf, IDREDOTMATCHNL), true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::EnableWindow(GetDlgItem(_hSelf, IDREDOTMATCHNL), false);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2500,8 +2515,8 @@ void FindReplaceDlg::doDialog(DIALOG_TYPE whichType, bool isRTL, bool toShow)
|
||||||
{
|
{
|
||||||
if (!isCreated())
|
if (!isCreated())
|
||||||
{
|
{
|
||||||
create(IDD_FIND_REPLACE_DLG, isRTL);
|
|
||||||
_isRTL = isRTL;
|
_isRTL = isRTL;
|
||||||
|
create(IDD_FIND_REPLACE_DLG, isRTL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (whichType == FINDINFILES_DLG)
|
if (whichType == FINDINFILES_DLG)
|
||||||
|
|
|
@ -42,7 +42,7 @@ BEGIN
|
||||||
RTEXT "Rep&lace with :",ID_STATICTEXT_REPLACE,6,40,75,8
|
RTEXT "Rep&lace with :",ID_STATICTEXT_REPLACE,6,40,75,8
|
||||||
COMBOBOX IDREPLACEWITH,83,38,178,50,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
|
COMBOBOX IDREPLACEWITH,83,38,178,50,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
|
||||||
RTEXT "Filter&s :",IDD_FINDINFILES_FILTERS_STATIC,27,58,53,8
|
RTEXT "Filter&s :",IDD_FINDINFILES_FILTERS_STATIC,27,58,53,8
|
||||||
COMBOBOX IDD_FINDINFILES_FILTERS_COMBO,83,56,125,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
|
COMBOBOX IDD_FINDINFILES_FILTERS_COMBO,83,56,178,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
|
||||||
RTEXT "Dir&ectory :",IDD_FINDINFILES_DIR_STATIC,7,76,40,8
|
RTEXT "Dir&ectory :",IDD_FINDINFILES_DIR_STATIC,7,76,40,8
|
||||||
COMBOBOX IDD_FINDINFILES_DIR_COMBO,49,74,190,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
|
COMBOBOX IDD_FINDINFILES_DIR_COMBO,49,74,190,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
|
||||||
PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,245,74,15,13
|
PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,245,74,15,13
|
||||||
|
@ -81,10 +81,10 @@ BEGIN
|
||||||
PUSHBUTTON "Close",IDCANCEL,268,98,90,14
|
PUSHBUTTON "Close",IDCANCEL,268,98,90,14
|
||||||
GROUPBOX "",IDC_TRANSPARENT_GRPBOX,258,131,99,48
|
GROUPBOX "",IDC_TRANSPARENT_GRPBOX,258,131,99,48
|
||||||
CONTROL "Transparenc&y",IDC_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,254,131,80,10
|
CONTROL "Transparenc&y",IDC_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,254,131,80,10
|
||||||
CONTROL "On losing focus",IDC_TRANSPARENT_LOSSFOCUS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,268,143,86,10
|
CONTROL "On losing focus",IDC_TRANSPARENT_LOSSFOCUS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,268,143,85,10
|
||||||
CONTROL "Always",IDC_TRANSPARENT_ALWAYS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,268,155,83,10
|
CONTROL "Always",IDC_TRANSPARENT_ALWAYS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,268,155,85,10
|
||||||
CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,271,166,53,10
|
CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,265,166,85,10
|
||||||
CONTROL "&. matches newline",IDREDOTMATCHNL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,167,67,9
|
CONTROL "&. matches newline",IDREDOTMATCHNL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,167,68,9
|
||||||
END
|
END
|
||||||
|
|
||||||
IDB_INCREMENTAL_BG BITMAP "../icons/incrementalBg.bmp"
|
IDB_INCREMENTAL_BG BITMAP "../icons/incrementalBg.bmp"
|
||||||
|
@ -128,7 +128,7 @@ BEGIN
|
||||||
CONTROL "&Normal",IDNORMAL_FIFOLDER,"Button",BS_AUTORADIOBUTTON | WS_GROUP,12,143,126,10
|
CONTROL "&Normal",IDNORMAL_FIFOLDER,"Button",BS_AUTORADIOBUTTON | WS_GROUP,12,143,126,10
|
||||||
CONTROL "E&xtended (\\n, \\r, \\t, \\0, \\x...)",IDEXTENDED_FIFOLDER, "Button",BS_AUTORADIOBUTTON,12,155,145,10
|
CONTROL "E&xtended (\\n, \\r, \\t, \\0, \\x...)",IDEXTENDED_FIFOLDER, "Button",BS_AUTORADIOBUTTON,12,155,145,10
|
||||||
CONTROL "Re&gular expression",IDREGEXP_FIFOLDER,"Button",BS_AUTORADIOBUTTON,12,167,78,10
|
CONTROL "Re&gular expression",IDREGEXP_FIFOLDER,"Button",BS_AUTORADIOBUTTON,12,167,78,10
|
||||||
CONTROL "&. matches newline",IDREDOTMATCHNL_FIFOLDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,167,67,9
|
CONTROL "&. matches newline",IDREDOTMATCHNL_FIFOLDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,167,68,9
|
||||||
PUSHBUTTON "Find all",IDOK,268,20,90,14,WS_GROUP
|
PUSHBUTTON "Find all",IDOK,268,20,90,14,WS_GROUP
|
||||||
PUSHBUTTON "Close",IDCANCEL,268,38,90,14
|
PUSHBUTTON "Close",IDCANCEL,268,38,90,14
|
||||||
END
|
END
|
||||||
|
|
Loading…
Reference in New Issue