ScrollGroup Bug?
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    Hello

    I've got a little bit trouble with the MUI ScrollGroup on MorphOS.

    Example Program:
    http://home.alb42.de/files/Leu0.02.lha

    resize the Program that you have to use the scrollbars. But one cant use them, when one clicks to them, the click goes to the under laying Grid, which of course handles and "eats" the event. But the Grid cannot know if it is in the visible area or not. I'm not sure how I could do here something different, so how the error could be on my side.
    This happen only on MorphOS, on AROS, Amiga MUI 3.8, it works as expected, you can move the scrollbar and the Grid underneath does not get a click.

    The Grid is an self drawn Area.mui inside a Virtualgroup.mui inside the Scrollgroup.mui.


    I noticed that before already with my LCL implementation where I noticed that on a multiple tabs group an element (like a button) gets a click even it's tab is not visible at the moment.
  • »05.06.19 - 18:00
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 1838 from 2003/3/5
    From: Poland
    This comes down to how you handle IDCMP_MOUSEBUTTONS in MUIM_HandleEvent. Looks like you handle and eat them even when the click is outside of the displayed area of your object.

    You can see it works just fine in the System Preferences if you open them on a low resolution screen. It likely works for you on MUI 3 since its routing of events is a bit different.
  • »05.06.19 - 21:07
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Papiosaur
    Posts: 1229 from 2003/4/10
    From: France
    Hi ALB42,

    thanks a lot for this new spreadsheet for MorphOS!

    I have just tested Leu 0.02 Amiga68k and MorphOS version under MorphOS 3.11 and i have the same problem:

    As you say, i can't select scrollbar after reduce the window size.

    With the mouse wheel i can down the vertical scrollbar and when it is down i can select horizontal bar with the mouse cursor...

    Maybe it may help you...
  • »05.06.19 - 21:12
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 1838 from 2003/3/5
    From: Poland
    Code:

    #define _between(a,x,b) ((x)>=(a) && (x)<=(b))
    #define _isinobject(x,y) (_between(_mleft(obj),(x),_mright(obj)) && _between(_mtop(obj),(y),_mbottom(obj)))


    and then

    Code:
    if (_isinobject(msg->imsg->MouseX,msg->imsg->MouseY)) 


    to determine whether the click is meant for your object or not
  • »05.06.19 - 21:13
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    thanks for your answer,

    the problem I do that already, isinobject is true, I check that and exit my handler without "eating" it.

    The object does not know that it's in a scrollgroup and therefore hidden by it.

    If you place that carefully you can actually see how it selects the cells underneath.
  • »05.06.19 - 21:44
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 1838 from 2003/3/5
    From: Poland
    How do you set up the event handler? It'd help a lot if you could share your MUIM_Setup and MUIM_HandleEvent code...
  • »06.06.19 - 07:52
    Profile Visit Website
  • Cocoon
    Cocoon
    Georg
    Posts: 56 from 2004/4/7
    Maybe you have unconventional way of creating/adding MUI objects which breaks some flag/optimization (~I_AM_INSIDE_VIRTUAL_GROUP) used to filter out mouse clicks to objects which are in hidden area of virtual group.
  • »06.06.19 - 07:55
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    sure:

    I hope Github is ok, Caution Pascal :-P

    MUIM_Setup

    MUIM_HANDLEEVENT

    @Georg:
    Interesting idea, but what that means? Its rather difficult process how the objects are created (because its recursive and deeply hidden in the pascal class system) so it exactly does it like you would write it in plain.
    so its creating Area, Virtual Group, Scrollbox, Window, application.

    But, as I said before I had a similar problem, when I did it forward in the LCL
    so create order Application, Window, Scrollbox ... and always put with AddMember/Remmember into the parent object. (where it does not work this way because Init only, the child element gets destroyed again with the new parent attached)

    [ Edited by ALB42 06.06.2019 - 11:58 ]
  • »06.06.19 - 10:52
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 1838 from 2003/3/5
    From: Poland
    Try the GUIMODE flag in EHNode.ehn_Flags.
    Also, calling DoSuper in HandleEvent looks incorrect. You generally don't call this at all because if the parent class needs to handle events, it installs its own handler.
    Always eat click events if they're inside your own object, even if you don't do anything with them.
  • »06.06.19 - 11:11
    Profile Visit Website
  • Cocoon
    Cocoon
    Georg
    Posts: 56 from 2004/4/7
    Quote:

    jacadcaps wrote:
    Always eat click events if they're inside your own object, even if you don't do anything with them.


    _isinobject() "lies" if click happens in hidden part of half visible object inside virtual group. So for things to work the click must be filtered out elsewhere by MUI itself.

    Maybe it's like this: Old MUI used to always check if filtering is required. Then someone invented MUI_EHF_GUIMODE and then changed click-kill-filtering to be done only for event handlers with MUI_EHF_GUIMODE flag. And all internal MUI classes were changed to use that flag anyway. So nothing changed for those. And for normal event handlers without MUI_EHF_GUIMODE the checks/filtering was not done anymore. And this breaks stuff which does not use or know about MUI_EHF_GUIMODE.
  • »06.06.19 - 12:24
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    Thanks, it fixed it. now its working nicely.. but this is really I would never thought of, because if I would add such function I would make the flag work exactly the other way round, that it stays backward compatible.
    But ok, thats none of my business, thanks very much.

    Leu0.03
  • »06.06.19 - 17:41
    Profile Visit Website
  • MorphOS Developer
    Nadir
    Posts: 143 from 2003/3/17
    Hi,

    It seems the new version fails to load the demo files, with an error requester saying that the spreadsheet file isn't valid. It did work on a previous version.

    By the way, it would be nice if one didn't have to manually activate the string gadget to enter something in a cell.

    Thanks anyway for the very promising tool.
  • »06.06.19 - 21:08
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    Thanks for the notice, sorry I uploaded the wrong version ;)

    now should work again.
    hmm, if you double click to a cell the focus should jump into the edit field (and an enter should advance downwards)
  • »06.06.19 - 21:39
    Profile Visit Website
  • MorphOS Developer
    Nadir
    Posts: 143 from 2003/3/17
    OK, that works better.

    It indeed works with double click on a cell but in a typical spreadsheet application you can just go to a cell with the cursor keys and then just start typing there.
  • »06.06.19 - 22:03
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    polluks
    Posts: 442 from 2007/10/23
    From: Gelsenkirchen,...
    powerpc-morphos/Leu is 68k...
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.12
  • »06.06.19 - 22:12
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    polluks: fixed
    now should be the right exe
  • »07.06.19 - 15:11
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    Quote:

    Nadir wrote:
    It indeed works with double click on a cell but in a typical spreadsheet application you can just go to a cell with the cursor keys and then just start typing there.


    Could you be so kind to try the latest Version with that feature?
    Leu0.05

    Thanks
  • »09.06.19 - 21:12
    Profile Visit Website
  • MorphOS Developer
    Nadir
    Posts: 143 from 2003/3/17
    Quote:

    ALB42 wrote:

    Could you be so kind to try the latest Version with that feature?
    Leu0.05

    Thanks


    Yes, that's perfect. I see you also added support form cursor keys to confirm input and move to the adjacent cell. Very nice improvement, so thanks a lot for that.

    Another thing, is the size of the spreadsheet maxed out at either A1:S39 or alternatively the size of a loaded sheet? Any chance you could make this expand dynamically as you scroll right/down (or otherwise use a much larger hardcoded limit)?
  • »10.06.19 - 01:53
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 114 from 2015/3/31
    Quote:

    Nadir wrote:
    Another thing, is the size of the spreadsheet maxed out at either A1:S39 or alternatively the size of a loaded sheet? Any chance you could make this expand dynamically as you scroll right/down (or otherwise use a much larger hardcoded limit)?


    The problem is exactly as I described in this thread. It's just very crude, a MUI Area in a Scrollbox, that means this Area have to be as large as the largest cols/rows * width/Height of every cell
    And because I draw first to a temp rastport (with own Bitmap) it needs a lot of Memory to make a lot of rows/cols. I ran already into a not enough memory situation.
    The scrolling in the scrollbox also becomes slower with big images (like 2000x2000 px).
    My idea was to ultimately replace that later with a own group and self manage the scrollbars, which also would make it possible to scroll together with the focus cell and make a cell wise scrolling like excel and libre office do.
    The whole stuff is object oriented so it basically just mean replace a lower class layer.
    I will do that eventually but not sure when ;)
    Currently fiddling with TurboCalc functions (TCD loader) to convert to my own functions ;)
  • »10.06.19 - 11:09
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    polluks
    Posts: 442 from 2007/10/23
    From: Gelsenkirchen,...
    By the way you should not use PNG icons for OS3.
    It's a bit complicated, see http://aminet.net/package/util/libs/IconLib_46.4
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.12
  • »16.06.19 - 01:34
    Profile