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, heres what Ive 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 Columns 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.