k1ngk1ng
07-31-2009, 06:59 PM
hi
i'm using persian laguage(Farsi) and i need to set grid properties to these:
read order: "Right to left"
alignment : "Right"
what can i do dears?:huh
hamseda04
07-05-2011, 01:53 PM
Insert this codes in Global Function(for Ams 8)
function GetWindowLong(hWnd, nIndex)
return tonumber(DLL.CallFunction("User32.dll", "GetWindowLongA", hWnd..", "..nIndex, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL))
end
function SetWindowLong(hWnd, nIndex, dwNewLong)
return tonumber(DLL.CallFunction("User32.dll", "SetWindowLongA", hWnd..", "..nIndex..", "..dwNewLong, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL))
end
function Right2Left()
local Object_hwnd
local ExStyle
local Type
local WS_EX_LAYOUTRTL = 4194304
-- For Window
Object_hwnd = Application.GetWndHandle()
ExStyle = GetWindowLong(Object_hwnd ,-20)
SetWindowLong(Object_hwnd, -20, ExStyle + WS_EX_LAYOUTRTL)
objects = Page.EnumerateObjects()
if objects ~= nil then
Application.SetRedraw(false)
for index, object in pairs (objects) do
Type = Page.GetObjectType(object)
-- For ComboBox
if Type == OBJECT_COMBOBOX then
Object_hwnd = ComboBox.GetProperties(object).WindowHandle
ExStyle = GetWindowLong(Object_hwnd ,-20)
SetWindowLong(Object_hwnd, -20, ExStyle + WS_EX_LAYOUTRTL)
ComboBox.SetProperties(object, {ReadOrder = READ_RIGHT_TO_LEFT})
-- For Input
elseif Type == OBJECT_INPUT then
Input.SetProperties(object, {ReadOrder = READ_RIGHT_TO_LEFT, Alignment = ALIGN_RIGHT})
-- For ListBox
elseif Type == OBJECT_LISTBOX then
Object_hwnd = ListBox.GetProperties(object).WindowHandle
ExStyle = GetWindowLong(Object_hwnd ,-20)
SetWindowLong(Object_hwnd, -20, ExStyle + WS_EX_LAYOUTRTL)
ListBox.SetProperties(object, {ReadOrder = READ_RIGHT_TO_LEFT})
-- For RadioButton
elseif Type == OBJECT_RADIOBUTTON then
RadioButton.SetProperties(object, {TextAlignment = ALIGN_RIGHT, ReadOrder = READ_RIGHT_TO_LEFT, ButtonAlignment = BTN_ALIGN_RIGHT})
-- For Tree
elseif Type == OBJECT_TREE then
Object_hwnd = Tree.GetProperties(object).WindowHandle
ExStyle = GetWindowLong(Object_hwnd ,-20)
SetWindowLong(Object_hwnd, -20, ExStyle + WS_EX_LAYOUTRTL)
Tree.SetProperties(object, {ReadOrder = READ_RIGHT_TO_LEFT})
elseif Type == OBJECT_GRID then
Object_hwnd = Grid.GetProperties(object).WindowHandle
ExStyle = GetWindowLong(Object_hwnd ,-20)
SetWindowLong(Object_hwnd, -20, ExStyle + WS_EX_LAYOUTRTL)
Grid.SetProperties(object, {ReadOrder = READ_RIGHT_TO_LEFT})
end
end
Application.SetRedraw(true)
end
end
----------
Insert this codes in on show
Right2Left()
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.