Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2008
    Posts
    46

    Grin changing grid alignment and read order?

    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?

  2. #2
    Join Date
    Feb 2010
    Posts
    35

    Lightbulb Changing Grid and other objects alignment and read order to Right

    Insert this codes in Global Function(for Ams 8)

    Code:
    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
    Code:
    Right2Left()
    Last edited by hamseda04; 07-05-2011 at 12:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts