Edit a document in Listbox ?

I spent sometimes yesterday to merge and edit two text documents (from two different sources) in a Listbox.

I just read the Xojo Editor Conversation and I am curious about your experience.

If you do not want to read the explanation below, just think “How do I edit a Listbox contents “by Row”, "by Column” using Edit MenuItems (Copy, Cut, Clear, Paste) and Select.
This can also involve Date columns display change, move text from Columns x to column y, and so on.
At last, do some changes (Replace, Moves, Column Insert / Add) in selected Rows and so on.

The document is about a sunday strips comic character. The involved data are (stored in Columns):

a. Matrix # (index value since the first published day) b. Strip or Story title (Row with a Green background) c. Dates (Start and End) d. # of Sundays (the story runs in x Sundays) e. Script writer f. Artist g. Printed in<book_name> h. Comments i. Summary

So, here’s what I’ve done:

I have a feature to add Rows based on a bunch of properties, notably an index value related to a start date and a Mon-Sat or Sunday only (in other words: skip Sunday or Sunday only). so this feature create a list with filled and empty Columns (provisions for other data).

I created the “empty” list and saved it,
then I loaded it in a main document.

I took a list from a web site (Data in a html TABLE) and paste it in the previously created document.

I realized that I had some misplaced Columns and so I extracted these Rows, moved the Columns to be in tune with the first part of the document using Column Copy (or Cut) and Paste. I had a problem with a Column (Row) alignment: the first Cell was empty and I had to copy / Paste this Column into macOS TextEdit, delete the first line and Copy / Paste the Data back in the Listbox.

The same data part (list from Internet) had Dates in the dd month_name yyyy format (in two Columns: start-end) and I changed that to SQLDates. Fine. Fortunately, this document was well formed (use only one delimiter and really follows the same constuction format; this is not always the case).

Then, I pasted the “correctly formatted” data back into the original window. A click in the Date (Start) column and I was nearly happy.

Simple set of Replace features allows me to add firstname to family names of scripters and drawers persons.

Doh ! I had duplicated (170 fully defined Rows vs matrix # [think index] and their Dates… 170 ? I can do that by hand.
Doh #2: I forgot to add a tag (for a Row special background Color) for these 170 entries… I can do that by hand too.
Doh #3: I do not know how to put the same name in nearly 4,200 Rows (one Column). I know how to do that in a spreadsheet, but I failed to add this feature for a Listbox (mainly because of the user interface). I leaved this for the ides of Mars.

And I just noticed that I “Loose” two informations: the Stories # and the Comments column. Not a problem: Insert a Column for “Comments” and …
Insert a Column (before the Strip / Story Name column),
Copy / New document with the selected Rows,
Insert Index: a feature that adds a new Column(0) and an index number in that column.
Then, Cut the Column(0) contents and Past in the dedicated Column (Column 2 in that case),
Delete Column(0) now useless.
Copy all,
Paste the data into the original window (after clearing the previous data).

Now, I have a document with unique data that I can fill with informations I have to get from the original comic strips (Strip Title, Comments, Summary, etc.).

If you understand the above, do you think at some more automation / add new features to enhance the user experience (skip some manual steps) ?
Else, I can add some screen shots.

As an example of a feature to add, I think at the Copy to spreadsheet feature: you select a Cell, and move the selection to many Rows below and say “Copy to bottom”: the software copy the contents of the first Cell into all other selected Cells.
[sorry: I do not do that in a spreadsheet for decades… so my explanation can be a bit dark].
The only problem is… how to mimic the UI in a Listbox (without a 2 man-years coding) ?

PS: for the newbies, I have to say that the Listbox Control does not have many of the features I used (read above).
I add code for the Column’s Copy / Cut / Paste / Clear and put the UI in a Contextual Menu (far better to use than a set of Menu Items).
New document with the selection: a feature that create a new window and copy / paste all selected rows from one window into the newly created indow.
And so on. especially Search-Replace Text and Date format display change (actually only a small set of dates source format to IDO 8601; I am trying to improve this in the future).
I nearly forgot the Insert (and Delete) Column feature… Append a Column is easy (add 1 to the number of Columns; no User Interface involved here).
The hardest part (beside the User Interface) was to think at the feature - think it is possible to add the feature.

I confess I do not understand any of the long story above.

You say
‘If you do not want to read the explanation below, just think “How do I edit a Listbox contents “by Row”, "by Column” using Edit MenuItems (Copy, Cut, Clear, Paste) and Select.’

Using loops and testing for whether a row is selected.
If you offer search and replace, you can choose which cells it applies to.
But the OS will not treat the whole listbox as a text area and do it for you.
You need to look at each cell in turn and decide what to do.

I was suspecting that.

Think you want to search and replace only on selected Rows and Columns (or more “simple” from the user perspective) on a range of Cells from the same Column.

How will you do that ?

Clue: how can I let the user to choose a Range of Cells ?
Yes, for the code part, I can do it / think how I can do it , but for the user interface part, I have no idea.

I do not know how to select a Cell (a click in it) some Cells, adjacents or not. And this is the intuitive part: select things and apply a change (or Copy, Paste, whatever)…

Another clue is: I cannot explain clearly what the question is, so how can I code it :wink:
(the line above is more or less a joke, a reality).

Single answer:

I have a MenuItem that allows the user to create a new document with the selected Rows (and I loved it). The feature is done like that:
create a new window (with a Listbox)
scan the whole document,
if Row is marked as Selected, Copy it and append it into the new window.

I also added: Export the selected Rows as new text (or csv) file.

Doh! The answer was sent ! I had to force quit Firefox, High Sierra Update was knocking (asking for a reboot), so I was in belief the anwser was lost…