TreeView and ListView bdRightToLeft

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #38273
    minou
    Participant

    issue text reverser (mirror)

    Code:

    procedure ChangeControlLayout(Control: TWinControl; ArabicLayout: Boolean); overload;
    var
        OldLong: LongWord;
    begin
        OldLong := GetWindowLong(Control.Handle, GWL_EXSTYLE);
        if ArabicLayout then begin
            Control.BiDiMode := bdLeftToRight;
            SetWindowLong(Control.Handle, GWL_EXSTYLE, OldLong or WS_EX_LAYOUTRTL);
            end
        else
            SetWindowLong(Control.Handle, GWL_EXSTYLE, OldLong and not WS_EX_LAYOUTRTL);
        Control.Repaint;
    end;
    
    procedure ChangeControlLayout(ControlHandle: LongWord; ArabicLayout: Boolean); overload;
    var
        OldLong: LongWord;
    begin
        OldLong := GetWindowLong(ControlHandle, GWL_EXSTYLE);
        if ArabicLayout then
            SetWindowLong(ControlHandle, GWL_EXSTYLE, OldLong or WS_EX_LAYOUTRTL)
        else
            SetWindowLong(ControlHandle, GWL_EXSTYLE, OldLong and not WS_EX_LAYOUTRTL);
        UpdateWindow(ControlHandle);
    end;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
    //TreeView
    ChangeControlLayout(tv1, True);
    ChangeControlLayout(FindWindowEx(tv1.Handle, 0, nil, nil), True);
    //ListView
    ChangeControlLayout(lv1, True);
    ChangeControlLayout(FindWindowEx(lv1.Handle, 0, nil, nil), True);
    
    end;
    • This topic was modified 5 years, 1 month ago by Support.
    #59569
    Support
    Keymaster

    Thank you for the information

    #59599
    Mahmoud
    Participant

    are you going to support bidi righttoleft in treeview and listview in near future

    'Support' wrote:

    Thank you for the information

    #59601
    Support
    Keymaster

    I will try to make this feature soon, but I can't say how quickly it will be.

    #59689
    Support
    Keymaster

    Mahmoud, do you know why “BiDiMode := bdLeftToRight;” is required there?

    #59709
    Mahmoud
    Participant

    because its mirror control

    am i wrong

    thanks for caring

    'Support' wrote:

    Mahmoud, do you know why “BiDiMode := bdLeftToRight;” is required there?

    #59717
    Support
    Keymaster

    I see, yes.

    This way can't be used, unfortunately, because icons and checkboxes are mirrored also.

    I will research it more, maybe some solutions exist already.

    #59857
    Mahmoud
    Participant

    any news on supporting right to left

    'Support' wrote:

    I see, yes.

    This way can't be used, unfortunately, because icons and checkboxes are mirrored also.

    I will research it more, maybe some solutions exist already.

    #61171
    Mahmoud
    Participant

    hello is there is any updates
    thanks in advance

    #61531
    Support
    Keymaster

    Hello
    Sorry, solution is not found yet.
    The WS_EX_LAYOUTRTL window style doesn’t work properly.

    #68443
    Mahmoud
    Participant

    hello any news ??

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.