Skip to content

Commit

Permalink
Initialize RTL support, see XhmikosR/notepad2-mod#217 for a better on…
Browse files Browse the repository at this point in the history
…e for Arabic.
  • Loading branch information
zufuliu committed Oct 28, 2018
1 parent 58e5baf commit 8ff4f41
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 45 deletions.
6 changes: 6 additions & 0 deletions metapath/src/Dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ static INT_PTR CALLBACK GeneralPageProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
EnableWindow(GetDlgItem(hwnd, IDC_SAVESETTINGS), FALSE);
}

if (bWindowLayoutRTL) {
CheckDlgButton(hwnd, IDC_RTL_LAYOUT, BST_CHECKED);
}

if (bSingleClick) {
CheckDlgButton(hwnd, IDC_SINGLECLICK, BST_CHECKED);
}
Expand Down Expand Up @@ -647,6 +651,7 @@ static INT_PTR CALLBACK GeneralPageProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
bSaveSettings = IsButtonChecked(hwnd, IDC_SAVESETTINGS);
}

bWindowLayoutRTL = IsButtonChecked(hwnd, IDC_RTL_LAYOUT);
bSingleClick = IsButtonChecked(hwnd, IDC_SINGLECLICK);
bTrackSelect = IsButtonChecked(hwnd, IDC_TRACKSELECT);
bFullRowSelect = IsButtonChecked(hwnd, IDC_FULLROWSELECT);
Expand Down Expand Up @@ -1688,6 +1693,7 @@ INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPa
SetWindowPos(GetDlgItem(hwnd, IDC_RESIZEGRIP3), NULL, cxClient - cGrip, cyClient - cGrip, cGrip, cGrip, SWP_NOZORDER);

HWND hwndLV = GetDlgItem(hwnd, IDC_OPENWITHDIR);
InitWindowCommon(hwndLV);
//SetExplorerTheme(hwndLV);
ListView_SetExtendedListViewStyle(hwndLV, /*LVS_EX_FULLROWSELECT | */LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);
ListView_InsertColumn(hwndLV, 0, &lvc);
Expand Down
7 changes: 7 additions & 0 deletions metapath/src/Dialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
*/
#define APPM_CENTER_MESSAGE_BOX (WM_APP + 1)

extern BOOL bWindowLayoutRTL;
NP2_inline void InitWindowCommon(HWND hwnd) {
if (bWindowLayoutRTL) {
SetWindowLayoutRTL(hwnd, TRUE);
}
}

int ErrorMessage(int iLevel, UINT uIdMsg, ...);
BOOL GetDirectory(HWND hwndParent, int iTitle, LPWSTR pszFolder, LPCWSTR pszBase);
BOOL GetDirectory2(HWND hwndParent, int iTitle, LPWSTR pszFolder, int iBase);
Expand Down
9 changes: 9 additions & 0 deletions metapath/src/Helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,15 @@ void SetWindowTransparentMode(HWND hwnd, BOOL bTransparentMode) {
}
}

void SetWindowLayoutRTL(HWND hwnd, BOOL bRTL) {
const LONG_PTR exStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
if (bRTL) {
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exStyle | WS_EX_LAYOUTRTL);
} else {
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exStyle & ~WS_EX_LAYOUTRTL);
}
}

//=============================================================================
//
// Toolbar_Get/SetButtons()
Expand Down
1 change: 1 addition & 0 deletions metapath/src/Helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ void SnapToDefaultButton(HWND hwndBox);
void MakeBitmapButton(HWND hwnd, int nCtlId, HINSTANCE hInstance, UINT uBmpId);
void DeleteBitmapButton(HWND hwnd, int nCtlId);
void SetWindowTransparentMode(HWND hwnd, BOOL bTransparentMode);
void SetWindowLayoutRTL(HWND hwnd, BOOL bRTL);

#define StatusSetSimple(hwnd, b) SendMessage(hwnd, SB_SIMPLE, (b), 0)
#define StatusSetText(hwnd, nPart, lpszText) SendMessage(hwnd, SB_SETTEXT, (nPart), (LPARAM)(lpszText))
Expand Down
13 changes: 11 additions & 2 deletions metapath/src/metapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ int iEscFunction;
BOOL bFocusEdit;
BOOL bAlwaysOnTop;
static BOOL bTransparentMode;
BOOL bWindowLayoutRTL;
BOOL bMinimizeToTray;
BOOL fUseRecycleBin;
BOOL fNoConfirmDelete;
Expand Down Expand Up @@ -722,6 +723,7 @@ LRESULT MsgCreate(HWND hwnd, WPARAM wParam, LPARAM lParam) {
SetWindowLongPtr(hwndDirList, GWL_EXSTYLE, GetWindowLongPtr(hwndDirList, GWL_EXSTYLE) & ~WS_EX_CLIENTEDGE);
SetWindowPos(hwndDirList, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
}
InitWindowCommon(hwndDirList);

const DWORD dwDriveBoxStyle = bShowDriveBox ? (WS_DRIVEBOX | WS_VISIBLE) : WS_DRIVEBOX;
hwndDriveBox = CreateWindowEx(
Expand Down Expand Up @@ -1745,9 +1747,14 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
hwnd, FindTargetDlgProc, 0);
break;

case IDM_VIEW_OPTIONS:
case IDM_VIEW_OPTIONS: {
const BOOL back = bWindowLayoutRTL;
OptionsPropSheet(hwnd, g_hInstance);
break;
if (back != bWindowLayoutRTL) {
SetWindowLayoutRTL(hwndDirList, bWindowLayoutRTL);
}
}
break;

case IDM_SORT_NAME:
nSortFlags = DS_NAME;
Expand Down Expand Up @@ -2361,6 +2368,7 @@ void LoadSettings(void) {
bAlwaysOnTop = IniSectionGetBool(pIniSection, L"AlwaysOnTop", 0);
bMinimizeToTray = IniSectionGetBool(pIniSection, L"MinimizeToTray", 0);
bTransparentMode = IniSectionGetBool(pIniSection, L"TransparentMode", 0);
bWindowLayoutRTL = IniSectionGetBool(pIniSection, L"WindowLayoutRTL", 0);

iEscFunction = IniSectionGetInt(pIniSection, L"EscFunction", 0);
iEscFunction = clamp_i(iEscFunction, 0, 2);
Expand Down Expand Up @@ -2547,6 +2555,7 @@ void SaveSettings(BOOL bSaveSettingsNow) {
IniSectionSetBoolEx(pIniSection, L"AlwaysOnTop", bAlwaysOnTop, 0);
IniSectionSetBoolEx(pIniSection, L"MinimizeToTray", bMinimizeToTray, 0);
IniSectionSetBoolEx(pIniSection, L"TransparentMode", bTransparentMode, 0);
IniSectionSetBoolEx(pIniSection, L"WindowLayoutRTL", bWindowLayoutRTL, 0);
IniSectionSetBoolEx(pIniSection, L"EscFunction", iEscFunction, 0);

IniSectionSetIntEx(pIniSection, L"StartupDirectory", iStartupDir, 1);
Expand Down
62 changes: 22 additions & 40 deletions metapath/src/metapath.rc
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
CAPTION "New Directory"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Enter the name for the new directory:",IDC_STATIC,7,7,
158,8
LTEXT "Enter the name for the new directory:",IDC_STATIC,7,7,158,8
EDITTEXT IDC_NEWDIR,7,22,158,13,ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,59,45,50,14,WS_DISABLED
PUSHBUTTON "Cancel",IDCANCEL,115,45,50,14
Expand All @@ -342,10 +341,8 @@ BEGIN
PUSHBUTTON "",IDC_BROWSEDESTINATION,210,48,13,13
CONTROL "<a>Clear Recent History</a>",IDC_EMPTY_MRU,"SysLink",WS_TABSTOP,154,37,70,10
LTEXT "Action:",IDC_STATIC,7,72,24,8
CONTROL "&Copy",IDC_FUNCCOPY,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,35,71,33,10
CONTROL "&Move",IDC_FUNCMOVE,"Button",BS_AUTORADIOBUTTON,68,71,
33,10
CONTROL "&Copy",IDC_FUNCCOPY,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,35,71,33,10
CONTROL "&Move",IDC_FUNCMOVE,"Button",BS_AUTORADIOBUTTON,68,71,33,10
DEFPUSHBUTTON "OK",IDOK,117,74,50,14,WS_DISABLED
PUSHBUTTON "Cancel",IDCANCEL,173,74,50,14
SCROLLBAR IDC_RESIZEGRIP2,7,78,10,10
Expand All @@ -360,25 +357,23 @@ BEGIN
ICON IDI_OPTIONS,IDC_STATIC,10,10,20,20
LTEXT "Specify general program settings for metapath.",
IDC_STATIC,40,15,200,8
CONTROL "Use &RTL Layout.",
IDC_RTL_LAYOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,34,190,10
CONTROL "&Allow only single mouse-click to open objects.",
IDC_SINGLECLICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
46,190,10
IDC_SINGLECLICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,46,190,10
CONTROL "&Enable track selection.",IDC_TRACKSELECT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,10,58,100,10
CONTROL "Enable &full row selection.",IDC_FULLROWSELECT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,10,70,120,10
CONTROL "Always a&ctivate target window when a file is opened.",
IDC_FOCUSEDIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
82,220,10
IDC_FOCUSEDIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,82,220,10
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,100,205,1
CONTROL "&Keep metapath window always on top.",IDC_ALWAYSONTOP,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,109,150,10
CONTROL "&Minimize to system tray (click to reactivate).",
IDC_MINIMIZETOTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
10,121,200,10
IDC_MINIMIZETOTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,121,200,10
CONTROL "&Try to reuse existing window when metapath is started.",
IDC_REUSEWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
133,220,10
IDC_REUSEWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,133,220,10
CONTROL "<a>Clear window position history</a>",IDC_CLEARWINPOS,"SysLink",WS_TABSTOP,20,145,103,12
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,161,205,1
CONTROL "&Save settings on exit.",IDC_SAVESETTINGS,"Button",
Expand All @@ -402,17 +397,13 @@ BEGIN
BS_AUTORADIOBUTTON,114,58,90,10
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,76,205,1
CONTROL "&Clear read-only attribute of saved files.",
IDC_CLEARREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
10,85,172,10
IDC_CLEARREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,85,172,10
CONTROL "Rename copied files on &name collisions.",
IDC_RENAMEONCOLLISION,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,10,97,164,10
IDC_RENAMEONCOLLISION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,97,164,10
CONTROL "&Move deleted files to the recycle bin.",
IDC_USERECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
10,109,160,10
IDC_USERECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,109,160,10
CONTROL "&Don't confirm file delete (not recommended).",
IDC_NOCONFIRMDELETE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,10,121,184,10
IDC_NOCONFIRMDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,121,184,10
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,139,205,1
CONTROL "Enable ""&Esc"" key to...",IDC_ESCFUNCTION,"Button",
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,148,104,10
Expand All @@ -429,25 +420,21 @@ CAPTION "Items"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_ITEMS,IDC_STATIC,10,10,21,20
LTEXT "Appearance of items in directory list.",IDC_STATIC,40,
15,160,8
LTEXT "Appearance of items in directory list.",IDC_STATIC,40,15,160,8
GROUPBOX "Colors",IDC_STATIC,10,41,205,134
LTEXT "Use this text color when NO FILTER is SET:",IDC_STATIC,
20,54,170,8
LTEXT "Use this text color when NO FILTER is SET:",IDC_STATIC,20,54,170,8
CONTROL "Default &windows color.",IDC_COLOR_DEF1,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,20,68,96,10
CONTROL "Custom &color:",IDC_COLOR_CUST1,"Button",
BS_AUTORADIOBUTTON,20,82,60,10
EDITTEXT IDC_COLOR_SAMP1,85,80,30,14,ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "Pick Color...",IDC_COLOR_PICK1,120,80,60,14
LTEXT "Use this text color when a FILTER is ACTIVE:",
IDC_STATIC,20,105,180,8
LTEXT "Use this text color when a FILTER is ACTIVE:",IDC_STATIC,20,105,180,8
CONTROL "D&efault windows color.",IDC_COLOR_DEF2,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,20,120,95,10
CONTROL "C&ustom color:",IDC_COLOR_CUST2,"Button",
BS_AUTORADIOBUTTON,20,133,60,10
EDITTEXT IDC_COLOR_SAMP2,86,130,30,14,ES_AUTOHSCROLL |
WS_DISABLED
EDITTEXT IDC_COLOR_SAMP2,86,130,30,14,ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "Pick Color...",IDC_COLOR_PICK2,120,130,60,14
END

Expand All @@ -458,10 +445,8 @@ CAPTION "Locations"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_PROGS,IDC_STATIC,10,10,20,20
LTEXT "Specify external programs and paths.",IDC_STATIC,40,15,
180,8
LTEXT "&Default ""Quick View"" program (Ctrl+Q):",IDC_STATIC,
10,41,180,8
LTEXT "Specify external programs and paths.",IDC_STATIC,40,15,180,8
LTEXT "&Default ""Quick View"" program (Ctrl+Q):",IDC_STATIC,10,41,180,8
EDITTEXT IDC_QUICKVIEW,10,52,191,13,ES_AUTOHSCROLL
PUSHBUTTON "",IDC_BROWSE_Q,203,52,13,13,BS_BITMAP
LTEXT "&Favorites Folder (F11):",IDC_STATIC,10,76,120,8
Expand All @@ -476,8 +461,7 @@ CAPTION "Target Application"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Don't use any specific target application, simply launch the selected file.",
IDC_LAUNCH,"Button",BS_AUTORADIOBUTTON | WS_GROUP |
WS_TABSTOP,7,7,260,10
IDC_LAUNCH,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,7,260,10
CONTROL "Use the following target application:",IDC_TARGET,
"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,21,160,10
LTEXT "Specify the action if the target applicatoin is already running:",
Expand All @@ -486,11 +470,9 @@ BEGIN
PUSHBUTTON "",IDC_BROWSE,250,35,15,14,BS_BITMAP
LTEXT "Message:",IDC_STATIC,20,120,32,8
CONTROL "None, run target application each time a file is opened.",
IDC_ALWAYSRUN,"Button",BS_AUTORADIOBUTTON | WS_GROUP |
WS_TABSTOP,7,78,240,10
IDC_ALWAYSRUN,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,78,240,10
CONTROL "Send a file open message to target application window:",
IDC_SENDDROPMSG,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
7,92,194,10
IDC_SENDDROPMSG,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,92,194,10
CONTROL "Execute the following DDE command:",IDC_USEDDE,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,7,106,160,10
LTEXT "Application:",IDC_STATIC,128,120,46,8
Expand Down
1 change: 1 addition & 0 deletions metapath/src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#define IDC_ESCEXIT 109
#define IDD_FINDWIN 109
#define IDC_DDEAPP 109
#define IDC_RTL_LAYOUT 109
#define IDC_NEW_PAGE_TEXT 109
#define IDC_NEW_PAGE_LINK 110
#define IDPP_GENERAL 110
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
* Support [adding Notepad2 to Windows explorer context menu](https://github.com/zufuliu/notepad2/wiki/Open-with-Notepad2)
* Per-Monitor DPI-Aware, improved high DPI display
* Support rendering using Direct2D DirectWrite, and switch between GDI and Direct2D
* Support bidirectional, useful for Arabic and Hebrew
* Experimental support for RTL layout (GDI) and bidirectional (Direct2D), useful for Arabic and Hebrew
* Support using fractional font size
* Support Inline IME
* Extra support for drag and drop file from Visual Studio, Android Studio, IntelliJ IDEA, etc.
Expand Down
4 changes: 4 additions & 0 deletions src/Dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ static INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
ResizeDlg_Init(hwnd, cxOpenWithDlg, cyOpenWithDlg, IDC_RESIZEGRIP3);

HWND hwndLV = GetDlgItem(hwnd, IDC_OPENWITHDIR);
InitWindowCommon(hwndLV);
//SetExplorerTheme(hwndLV);
ListView_SetExtendedListViewStyle(hwndLV, /*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);

Expand Down Expand Up @@ -668,6 +669,7 @@ static INT_PTR CALLBACK FavoritesDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LP
ResizeDlg_Init(hwnd, cxFavoritesDlg, cyFavoritesDlg, IDC_RESIZEGRIP3);

HWND hwndLV = GetDlgItem(hwnd, IDC_FAVORITESDIR);
InitWindowCommon(hwndLV);
//SetExplorerTheme(hwndLV);
ListView_SetExtendedListViewStyle(hwndLV, /*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);
ListView_InsertColumn(hwndLV, 0, &lvc);
Expand Down Expand Up @@ -958,6 +960,7 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR

LVCOLUMN lvc = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
HWND hwndLV = GetDlgItem(hwnd, IDC_FILEMRU);
InitWindowCommon(hwndLV);

LPICONTHREADINFO lpit = (LPVOID)GlobalAlloc(GPTR, sizeof(ICONTHREADINFO));
SetProp(hwnd, L"it", (HANDLE)lpit);
Expand Down Expand Up @@ -1725,6 +1728,7 @@ static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wPara
ListView_SetImageList(GetDlgItem(hwnd, IDC_ENCODINGLIST), himl, LVSIL_SMALL);

HWND hwndLV = GetDlgItem(hwnd, IDC_ENCODINGLIST);
InitWindowCommon(hwndLV);
//SetExplorerTheme(hwndLV);
ListView_SetExtendedListViewStyle(hwndLV, /*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);
ListView_InsertColumn(hwndLV, 0, &lvc);
Expand Down
7 changes: 7 additions & 0 deletions src/Dialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
*/
#define APPM_CENTER_MESSAGE_BOX (WM_APP + 1)

extern BOOL bWindowLayoutRTL;
NP2_inline void InitWindowCommon(HWND hwnd) {
if (bWindowLayoutRTL) {
SetWindowLayoutRTL(hwnd, TRUE);
}
}

int MsgBox(int iType, UINT uIdMsg, ...);
void DisplayCmdLineHelp(HWND hwnd);
void OpenHelpLink(HWND hwnd, int cmd);
Expand Down
9 changes: 9 additions & 0 deletions src/Helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,15 @@ void SetWindowTransparentMode(HWND hwnd, BOOL bTransparentMode) {
}
}

void SetWindowLayoutRTL(HWND hwnd, BOOL bRTL) {
const LONG_PTR exStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
if (bRTL) {
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exStyle | WS_EX_LAYOUTRTL);
} else {
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exStyle & ~WS_EX_LAYOUTRTL);
}
}

//=============================================================================
//
// CenterDlgInParentEx()
Expand Down
3 changes: 2 additions & 1 deletion src/Helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ NP2_inline BOOL StrToFloat(LPCWSTR str, float *value) {
NP2_inline BOOL CRTStrToInt(LPCWSTR str, int *value) {
LPWSTR end;
*value = (int)wcstol(str, &end, 10);
return str != end;
return str != end;
}

// str MUST NOT be NULL, can be empty
Expand Down Expand Up @@ -365,6 +365,7 @@ BOOL SetWindowTitle(HWND hwnd, UINT uIDAppName, BOOL bIsElevated, UINT uIDUntitl
LPCWSTR lpszFile, int iFormat, BOOL bModified,
UINT uIDReadOnly, BOOL bReadOnly, LPCWSTR lpszExcerpt);
void SetWindowTransparentMode(HWND hwnd, BOOL bTransparentMode);
void SetWindowLayoutRTL(HWND hwnd, BOOL bRTL);

void CenterDlgInParentEx(HWND hDlg, HWND hParent);
NP2_inline void CenterDlgInParent(HWND hDlg) {
Expand Down

0 comments on commit 8ff4f41

Please sign in to comment.