In a brand new project, add a ListBox to the window and name it LB:
-
Add an Open Event into Window1,
-
Copy / Paste the code below into the Window1.Open event:
[code] Dim LoopIdx As Integer
Dim LocRow As Integer
For LoopIdx = 0 To 3
LB.AddRow "Row " + Str(LoopIdx) + “, 0”
LocRow = LB.LastIndex
LB.Cell(LocRow,1) = "Row " + Str(LoopIdx) + “, 1”
LB.Cell(LocRow,2) = "Row " + Str(LoopIdx) + “, 2”
LB.Cell(LocRow,3) = "Row " + Str(LoopIdx) + “, 3”
Next
LB.Heading(-1) = “0” + Chr(9) + “1” + Chr(9) + “2” + Chr(9) + “3”[/code]
- Select the ListBox and add it a DoubleCLick Event, then Copy / Paste the code below into Window1.LB.DoubleCLick:
[code] Dim row,column as Integer
row=Me.RowFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
column=Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
Me.CellType(row,column)=ListBox.TypeEditable
Me.EditCell(row,column)[/code]
Run and click in the right part of the ListBox to see what I reported earlier.
Example code:
Example project (5KB)
NOTA: I was not able to replicate the Return (in the Open Button of the Open file dialog) “pass thru” to the ListBox Cell 0,0 in edit mode.
You may or may not hear beeps using that example.
So, I added the compiled (Cocoa) application with a Text file so you will hear those beeps and see what the project allows you to do.
Do not use the Utilities Menus, they belongs to something else.
Generated application of the original project (where I originally have found that new feature):
The working application, 1.25MB
At Import time, if you press the Return key (to activate the Open button), you can see what I called “the Return passing thru”: one Return key press for two functions: press theOpen button and enter in the Edit mode for the ListBox Cell(0,0)
In the archive, there is a text file. Use Import to load it and watch how the things work (or not). The red lines are in red because there is nothing in Column 0 (either I do not found this story printed in a magazine or the story were not printed in French): it is a help to find missings.
Every column is resizeable, you can select one or more Rows (to copy it/them), you can move (drag) one or many Rows up or down (even non consecutive Rows), etc.
The two buttons in the ToolBar does not works too.
I took that skeleton project and improve it in a different way than the one I started with.
The projects have been created and modified using Xojo 2013 Release 4.1.
Xojo 2013 Release 4.1 runs on a MacBook Pro using OS X 10.8.5.