Jump to content

Listview column text direction


Anas
 Share

Recommended Posts

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 here
RegExp tutorial: enough to get started
PCRE 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)

Link to comment
Share on other sites

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 here
RegExp tutorial: enough to get started
PCRE 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)

Link to comment
Share on other sites

#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

 

Link to comment
Share on other sites

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 here
RegExp tutorial: enough to get started
PCRE 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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 here
RegExp tutorial: enough to get started
PCRE 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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 here
RegExp tutorial: enough to get started
PCRE 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)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...