[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TableView.EditWith not working


While we're there.

I find the TableView control to be quite unwieldy from the user viewpoint as well.

Activate requires an Enter key (unless you have set up a TableView_Click() to force the Activate and that doesn't seem to work consistently-ish). So to allow M. User to use the mouse ..... bah! I'll start again.

Consider a TableView with 4 columns: a Date, a Credit amount, a Debit amount and a Balance column. I think you and I have probably seen that type of thing somewhere before. 😉 The desired actions (from the user view) are to click on the TableView in the blank area (which seems impossible to ensure is visible) this would immediately add a new row with the Date column set to the current date. Then in a normal transaction (user hasn't moved their hand off the mouse yet) focus is set to the Credit column of the new row.

If the ledger entry is a credit then the user starts pressing number keys. If not (without letting the mouse go, they click on the Debit column) and start entering numbers.

Now it gets interesting. They enter a Credit using the keypad and hit enter. The system "should" calculate and display the new Balance and then... (the fingers are still on the keyboard here). Focus should go to the Balance column to suggest their situation. It's the right hand column. Now philosophically, the most logical key to them to indicate that the transaction is complete, is to hit Return, which would take them to the "Have a nice day" control. Again logically, to them, if there are more entries to be made they want to press Tab resulting in a new row with the date column complete and focus yet again on the Debit column.

Further, let's try to enter a backdated (or forward) entry. From the Debit column on the new row, they want a backtab or a click on the Date column to move focus to the Date column and edit it with a (oh God forbid) a calendar popup. (where a doubleclick selection will accept that and move again to the Debit column. )

I have been immoderately informed that this is a typical desire, several thousands of times. Yet I have never been able to meet their desire. They inform me that this is how things worked since Xerxes was still learning his sums. Or, not to put too much of a fine point on it, as one Senior Accountant put it to me once, "It has thus been since Xerxes the Elder commenced auditing the contents of his nasal passages using his index finger!"

 I am not sure whether Xerxes had access to rodents for his adroit auditing activities but that statement at the time left a lasting (and visual) impression on my mind.

So, why, why, why is it so hard to set up a TableView just like that, like a ledger?

I guess Tiny Tim will go without a turkey again this year. 🙁

b

p.s. BruceS I think your comment on the wiki EditWith() is entirely apt.


On 2/6/25 9:06 pm, Bruce Steers wrote:
But it seems the wiki warning for Edit() is also true for EditWith()

Ie. if you do not use the Click event then arrow keys operate the TableView not the MaskBox

So i'd recommend using the Click event instead.
Maybe control Editing or not with the Ctrl key?
Public Sub TableView1_Click()

  If TableView1.Column <> 1 Or If Not Mouse.Control Then Return

  TableView1.EditWith(MaskBox1)

End

Respects
BruceS


On Mon, 2 Jun 2025 at 12:23, Bruce Steers <bsteers4@xxxxxxxxx <mailto:bsteers4@xxxxxxxxx>> wrote:

    Okay seems it also works in the DblClick event that is essentially
    Activate i guess.


    On Mon, 2 Jun 2025 at 12:20, Bruce Steers <bsteers4@xxxxxxxxx
    <mailto:bsteers4@xxxxxxxxx>> wrote:

        I think it's the same rules as TableView.Edit() command
        https://gambaswiki.org/wiki/comp/gb.form/tableview/edit
        <https://gambaswiki.org/wiki/comp/gb.form/tableview/edit>

         you can only use it in the Click event not the Activate event.
        I tested it and can confirm it works as expected if you use
        the Click event.

        I guess the wiki should also say that in EditWith help>

        Respects
        BruceS


        On Mon, 2 Jun 2025 at 00:16, Lee <t.lee.davidson@xxxxxxxxx
        <mailto:t.lee.davidson@xxxxxxxxx>> wrote:

            On 6/1/25 6:47 PM, Lee wrote:
            > I don't know what I'm doing wrong, but I cannot get
            .EditWith to work with a MaskBox. I have not tried any
            other editor control.
            >
            > Simple project attached.

            Sorry, this is with gb.gui.qt which loads gb.qt6 on my
            system. I tried with gb.qt5 and the editor still gets
            immediately hidden.


-- Lee

            --- Gambas User List Netiquette
            [https://gambaswiki.org/wiki/doc/netiquette
            <https://gambaswiki.org/wiki/doc/netiquette>] ----
            --- Gambas User List Archive
            [https://lists.gambas-basic.org/archive/user
            <https://lists.gambas-basic.org/archive/user>] ----



Follow-Ups:
Re: TableView.EditWith not workingBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: TableView.EditWith not workingLee <t.lee.davidson@xxxxxxxxx>
References:
TableView.EditWith not workingLee <t.lee.davidson@xxxxxxxxx>
Re: TableView.EditWith not workingLee <t.lee.davidson@xxxxxxxxx>
Re: TableView.EditWith not workingBruce Steers <bsteers4@xxxxxxxxx>
Re: TableView.EditWith not workingBruce Steers <bsteers4@xxxxxxxxx>
Re: TableView.EditWith not workingBruce Steers <bsteers4@xxxxxxxxx>