On Fri, Jun 10, 2011 at 9:31 AM, <[email protected]> wrote:
> The attached program uses the ListView control. The "Show Item" button is
> enabled when an item in the list is selected. After the button is pressed,
> it is disabled.
>
> The following behaviors may be bugs (code or documentation):
Thanks for bringing these up Oliver. I'm going to answer off the top
of my head.
> 1. Select an item, then press the "Show Item" button. The selected item
> *appears* to be de-selected. However, when focus is put on the ListView by
> clicking on a column header, the selection re-appears. I expected the item
> to remain shown as selected even when focus is not on the ListView control
> (e.g. as in a File Explorer window with a file selected then you click say
> "search"). It could be that this behavior is mandated by the underlying
> Windows control, and hence ooDialog can do nothing about it. If not, it's a
> possible bug or a possible future enhancement.
A list-view has a style that controls this. It is documented for a
User dialog as one of the style options in createListView.
SHOWSELALWAYS
Specifies that a selected item remains selected when the list-view loses focus.
When using a resource editor, you would need to look at the styles
offered by the resoucre editor to find the one that matches. (Exactly
what a resource editor calls that style, is up to the resource
editor.)
You can find out all the styles for any control that Windows makes
available and descriptions of the style in the MSDN documentation. Do
a google search of: "MSDN list-view" and that should take you to the
documentation. Then follow list-view reference -> constants ->
windows styles.
Around the time of ooDialog 3.2.0, many of the styles for the controls
were not available in ooDialog. Since then many more styles have been
added, but this is still not complete. Eventually I would like all
the styles for any control supported in ooDialog to be available.
> 2. ~insertColumnPX
>
> The first param, column number, seems to be ignored. It seems to be the
> sequence with which ~insertColumnPX is invoked that counts. Code in the
> attached is:
>
> lvItems~insertColumnPX(6,"Number",60,"LEFT")
> lvItems~insertColumnPX(5,"Name",150,"LEFT")
> lvItems~insertColumnPX(3,"Zip",50,"LEFT")
>
> The columns are inserted at positions 0, 1, 2.
This behavior is governed by Windows. You can not insert a column
that is past the next column position. So, in your first insert,
there is no column 5, so the Windows operarting system puts the column
at column 0. Then in your second insert, there is no column 4 so
Windows inserts it at the first available column. And so on.
If you would do this you would see that the param is used:
lvItems~insertColumnPX(0,"Number",60,"LEFT")
lvItems~insertColumnPX(1,"Name",150,"LEFT")
lvItems~insertColumnPX(2,"Zip",50,"LEFT")
lvItems~insertColumnPX(3,"Number-01",60,"LEFT")
lvItems~insertColumnPX(1,"Name-01",150,"LEFT")
lvItems~insertColumnPX(2,"Zip-01",50,"LEFT")
In the last 2 inserts the columns would be put where you specified.
> 3. ~addRow
>
> The first param (item) does not seem to work - the following code adds the
> rows into the first three lines of the report-style list rather than into
> lines 5, 4, and 3 ('item' is zero-based):
>
> lvItems~addRow(4, ,"CU025","Slodget, case of 24", "RG22 5XL")
> lvItems~addRow(3, ,"DX210","Driblet, 5in, 10-pack, pick-up only",
> "021956")
> lvItems~addRow(2, ,"CU003","Widget, 5in")
>
> Note: the style of the ListView control is set to "LVS_SORTASCENDING" in the
> .rc file, and the list is sorted - as would be expected. When this style is
> removed, the above three items are inserted in the sequence shown by the
> code, that is, 0, 1, 2 but not 4, 3, 2.
This is essentially the same as with the columns, you can not insert a
item (a row in this case) past the end of the items. Tring to insert
a number 6 item into an empty list doesn't give you 6 items, it only
gives you 1 item. The OS inserts the item for you, but it's item
index has to be 1 (or 0, depending on how you are calling the
indexes.)
Hope that clears things up.
--
Mark Miesfeld
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users