Anas Posted February 11, 2018 Posted February 11, 2018 Hi, Is it possible to set a different text direction/layout (not alignment) for a Listview column? Thanks.
Zedna Posted February 11, 2018 Posted February 11, 2018 Yes but it's quite complicated. Search this forum for "listView ownerdraw" Resources UDF ResourcesEx UDF AutoIt Forum Search
jchd Posted February 12, 2018 Posted February 12, 2018 Are you talking about Unicode text direction or something else entirely? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Anas Posted February 12, 2018 Author Posted February 12, 2018 Yes, to correctly display a left-to-right text in a column that is part of a right-to-left GUI/Listview (and vice versa).
jchd Posted February 12, 2018 Posted February 12, 2018 For me at least writing Urdu or Hebrew text (both RTL) in standard (LTR by default) listview works. I used the help file example for GUICtrlCreateListView and my locale is FR-fr. Can you post code showing failure? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Anas Posted February 12, 2018 Author Posted February 12, 2018 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> GUICreate("RTL GUI", 170, 100, -1, -1, -1, $WS_EX_LAYOUTRTL) $LV = GUICtrlCreateListView('Items', 10, 10, 150, 80) GUICtrlCreateListViewItem('C (50 of 200)', $LV) GUICtrlCreateListViewItem('14-DA-E9-0F-82-8B', $LV) _GUICtrlListView_JustifyColumn($LV, 0, 1) _GUICtrlListView_SetColumnWidth($LV, 0, 140) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd
jchd Posted February 16, 2018 Posted February 16, 2018 What happens for you when you don't force text direction (RtoL nor LtoR)? Just writing RtoL ou LtoR text should work. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Anas Posted February 19, 2018 Author Posted February 19, 2018 Where did I force it? The "_GUICtrlListView_JustifyColumn" doesn't affect the text direction, so you can delete it and get the same results. And if you mean the GUI's extended style "$WS_EX_LAYOUTRTL", then the issues shown in the example will happen to the RTL text instead of the LTR text.
jchd Posted February 20, 2018 Posted February 20, 2018 Is this what you want? GUICreate("RTL GUI", 170, 100, -1, -1, -1) ;, $WS_EX_LAYOUTRTL) $LV = GUICtrlCreateListView('Items', 10, 10, 150, 80) GUICtrlCreateListViewItem('C (50 of 200)', $LV) GUICtrlCreateListViewItem('14-DA-E9-0F-82-8B', $LV) _GUICtrlListView_JustifyColumn($LV, 0, 0) _GUICtrlListView_SetColumnWidth($LV, 0, 140) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Note that both RTL and LTR text display correctly when no layout direction is specified: GUICreate("RTL GUI", 470, 400, -1, -1, -1) ;, $WS_EX_LAYOUTRTL) $LV = GUICtrlCreateListView('Items', 10, 10, 350, 380) GUICtrlCreateListViewItem('French: voici mon texte', $LV) GUICtrlCreateListViewItem('Hebrew: הנה הטקסט שלי', $LV) GUICtrlCreateListViewItem('Arabic: هنا هو نصي', $LV) GUICtrlCreateListViewItem('Chinese: 这是我的文字', $LV) GUICtrlCreateListViewItem('Urdu: یہاں میرا متن ہے', $LV) _GUICtrlListView_JustifyColumn($LV, 0, 1) _GUICtrlListView_SetColumnWidth($LV, 0, 240) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Anas Posted February 20, 2018 Author Posted February 20, 2018 That's because you started/ended the RTL text with letters. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> GUICreate("RTL GUI", 470, 400, -1, -1, -1);, $WS_EX_LAYOUTRTL) $LV = GUICtrlCreateListView('Items', 10, 10, 350, 380) GUICtrlCreateListViewItem('25 من 100 وحدة', $LV) GUICtrlCreateListViewItem('135/م/124', $LV) GUICtrlCreateListViewItem('معطل (بتاريخ 1436/2/24)', $LV) _GUICtrlListView_JustifyColumn($LV, 0, 1) _GUICtrlListView_SetColumnWidth($LV, 0, 240) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Besides, almost all the GUI info and controls are RTL, so I need the "$WS_EX_LAYOUTRTL" extended style.
jchd Posted February 20, 2018 Posted February 20, 2018 When you need to mix RTL and LTR text you need to use Unicode codepoints to force desired direction. Use 0x202A (LEFT-TO-RIGHT EMBEDDING), 0x202B (RIGHT-TO-LEFT EMBEDDING) and 0x202C (POP DIRECTIONAL FORMATTING), or more directively 0x202D (LEFT-TO-RIGHT OVERRIDE) and 0x202E (RIGHT-TO-LEFT OVERRIDE). I'm not sure how codepoints 0x206E (NATIONAL DIGIT SHAPES) and 0x206F (NATIONAL DIGIT SHAPES) combine with RTL vs. LTR. Refer to the Unicode standard (Unicode BiDi algorithm isn't particularly simple). Also I believe the rendering also depends on your current locale setting unless overrides are used. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Anas Posted February 20, 2018 Author Posted February 20, 2018 That's more useful than setting the entire column/control text direction. Thanks jchd.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now