[nvda-addons] a suggestion for eMule about the columns order

  • From: Alberto Buffolino <a.buffolino@xxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Tue, 13 Aug 2013 00:16:52 +0200

Hi all and particularly Noelia,
in these days, I installed 1.0-dev version of eMule appModule, to see if there are changes about the columns order question. Apparently, no changes... then Chris explained to me the procedure with ctrl+shift+l, right click, and the activation of all headers. And ok, at that point all works... and you can repeat the procedure on another list. Boooring. But I could have a workaround, which would reduce drastically user interaction.
Note: I tested the following only on XP.
Starting from a list without all headers activated, from NVDA console, I noted that the strange order is reflected on _columnOrderArray variable of List class. In a normal list, in explorer for example, this variable is a c_long_Array_x, where x is the number of columns, and its content is, tipically, a serie of c_int 0, 1, 2, ..., x-1, so in this order.
In eMule, the serie is more strange, 12, 13, 0, 1, 2, ..., ecc, for example.
Now, I don't understand the entire process, but reading the sources, I realised that you can override the _get__columnOrderArray() method, which will provide a _columnOrderArray built ad hoc.
So:
-----
from NVDAObjects.IAccessible.sysListView32 import List
from ctypes import * # for c_int

class AppModule(appModuleHandler.AppModule):

        def chooseNVDAObjectOverlayClasses(self, obj, clsList):
                if obj.role==controlTypes.ROLE_LIST:
                        clsList.insert(0, FixedList)

class FixedList(List):

        def _get__columnOrderArray(self):
                limit=super(FixedList, self).columnCount
                myCoa=(c_int *limit)()
                for n in range(0,limit):
                        myCoa[n]=n
                return myCoa
-----
In reality, this works also with a normal Python list, so:
                myCoa=[n for n in range(0,limit)]
but ok, it's a question of elegance, one line instead three.
Now, if I understand correctly, this affects only NVDA vision, in other words, on screen eMule would show a different number of columns, and in other order. In theory, reading _get__columnOrderArray method in the sources, it would be possible to make equivalent screen and NVDA vision, forcing the list to assume a passed order using watchdog and LVM_SETCOLUMNORDERARRAY message (see the method source and the link below), and I successfully did in another program (Snarfer), but in this case it seems problematic, I don't understand the cause. Ah, this is the link, with all messages of List View:
http://msdn.microsoft.com/en-gb/library/ms670560.aspx
However, it must be said, NVDA does not support totally List View; I mean, the problem about to show also the deactivated/hidden columns is not a prerogative of only eMule. Working with watchdog and various messages of List View, it's probably possible to fix this and other problems, and (I suspect) to make NVDA capable to order, hide and manipulate lists as JAWS.
Ok, end of the conference. :)
I hope it's useful.
Alberto
----------------------------------------------------------------

NVDA add-ons Central: A list for discussing NVDA add-ons

To post a message, send an email to nvda-addons@xxxxxxxxxxxxx.

To unsubscribe, send an email with the subject line of "unsubscribe" (without 
quotes) to nvda-addons-request@xxxxxxxxxxxxx.

If you have questions for list moderators, please send a message to 
nvda-addons-moderators@xxxxxxxxxxxxx.

Community addons can be found here: http://addons.nvda-project.org

Other related posts: