SSB_ALLOWMULTIBLOCKS not working for me to select multiple blocks with mouse

Posted by: gordon.proctor on 25 October 2024, 10:20 am EST

  • Posted 25 October 2024, 10:20 am EST

    I’m using c++ and have an application built over 15 years ago with this spread 8 grid.We have a new requirement to enable multiblock selects. The default of the grid is to not allow this.

    I do the following:

    SSSetBool(m_hWnd, SSB_RETAINSELBLOCK, TRUE);

    SSSetBool(m_hWnd, SSB_ALLOWMULTIBLOCKS , TRUE );

    When I select a single block, both SSGetMultiSelBlocks and SSGetSelectBlock will return the block.

    When I hold down the Ctrl button and mouse select a second block, as soon as I press the left mouse button to select the second block, the first block is no longer highlighted.

    I can not select a second block.

    I thought that maybe we are intercepting the Ctrl key in a PreTranslateMessage and not passing it to the grid. This is not the case as we pass it to the grid. I proved this by trying Ctrl-space, which selects the current column.

    Any help in getting this working would be appreciated.

  • Posted 31 October 2024, 4:32 am EST

    I’ve discovered my problem. We were calling SSSetActiveCell on the Leave cell message, after a left mouse click, which resets the blocks selected.

  • Posted 31 October 2024, 5:15 am EST

    Although I can now see multiple blocks selected in the grid, I only get one block returned in SSGetMultiSelBlocks. Using Spread 8.0.22

  • Posted 31 October 2024, 6:59 am EST

    Correction, I get all blocks except the last block highlighted.

  • Posted 31 October 2024, 9:36 pm EST

    Add debugging statements to track the selection state. For example, log the current selection before and after a mouse click to see if the selection is indeed being cleared. This can help pinpoint where the logic is going awry.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels