added rtl support
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5212 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
8e1b521859
commit
f1b8604bcb
6 changed files with 22 additions and 1 deletions
|
@ -18,6 +18,10 @@ Function nsDialogsIO
|
|||
InitPluginsDir
|
||||
File /oname=$PLUGINSDIR\io.ini "${NSISDIR}\Examples\InstallOptions\test.ini"
|
||||
|
||||
${If} ${Cmd} `MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Test the right-to-left version?" IDYES`
|
||||
WriteINIStr $PLUGINSDIR\io.ini Settings RTL 1
|
||||
${EndIf}
|
||||
|
||||
StrCpy $0 $PLUGINSDIR\io.ini
|
||||
|
||||
Call CreateDialogFromINI
|
||||
|
|
|
@ -5,6 +5,7 @@ files = Split("""
|
|||
input.c
|
||||
nsDialogs.c
|
||||
nsis.c
|
||||
rtl.c
|
||||
""")
|
||||
|
||||
resources = Split("""
|
||||
|
|
|
@ -16,7 +16,8 @@ enum nsControlType
|
|||
NSCTL_LISTBOX,
|
||||
NSCTL_RICHEDIT,
|
||||
NSCTL_RICHEDIT2,
|
||||
NSCTL_STATIC
|
||||
NSCTL_STATIC,
|
||||
NSCTL_TREE
|
||||
};
|
||||
|
||||
struct nsDialogCallbacks
|
||||
|
@ -52,6 +53,8 @@ struct nsDialog
|
|||
|
||||
WNDPROC parentOriginalWndproc;
|
||||
|
||||
BOOL rtl;
|
||||
|
||||
struct nsDialogCallbacks callbacks;
|
||||
|
||||
unsigned controlCount;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "input.h"
|
||||
#include "defs.h"
|
||||
#include "nsis.h"
|
||||
#include "rtl.h"
|
||||
|
||||
extern struct nsDialog g_dialog;
|
||||
|
||||
|
@ -73,5 +74,7 @@ int NSDFUNC PopPlacement(int *x, int *y, int *width, int *height)
|
|||
|
||||
*height = ConvertPlacement(buf, dialogHeight, 1);
|
||||
|
||||
ConvertPosToRTL(x, *width, dialogWidth);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "defs.h"
|
||||
#include "nsis.h"
|
||||
#include "input.h"
|
||||
#include "rtl.h"
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
struct nsDialog g_dialog;
|
||||
|
@ -143,6 +144,8 @@ void __declspec(dllexport) Create(HWND hwndParent, int string_size, char *variab
|
|||
|
||||
g_dialog.parentOriginalWndproc = (WNDPROC) SetWindowLong(hwndParent, DWL_DLGPROC, (long) ParentProc);
|
||||
|
||||
g_dialog.rtl = FALSE;
|
||||
|
||||
g_dialog.controlCount = 0;
|
||||
g_dialog.controls = (struct nsControl*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 0);
|
||||
|
||||
|
@ -211,6 +214,10 @@ void __declspec(dllexport) CreateItem(HWND hwndParent, int string_size, char *va
|
|||
else
|
||||
g_dialog.controls[id].type = NSCTL_UNKNOWN;
|
||||
|
||||
// apply rtl to style
|
||||
|
||||
ConvertStyleToRTL(g_dialog.controls[id].type, &style, &exStyle);
|
||||
|
||||
// create item's window
|
||||
|
||||
hwItem = CreateWindowEx(
|
||||
|
|
|
@ -304,6 +304,9 @@ Function CreateDialogFromINI
|
|||
nsDialogs::Create /NOUNLOAD $R0
|
||||
Pop $R9
|
||||
|
||||
ReadINIStr $R0 $0 Settings RTL
|
||||
nsDialogs::SetRTL /NOUNLOAD $R0
|
||||
|
||||
ReadINIStr $R0 $0 Settings NumFields
|
||||
|
||||
${DEBUG} "NumFields = $R0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue