Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Retaining cell focus after leaving control

Hi team

Version 3.0.2

This is a minor one, I was wanting to retain the cell selection after losing focus to the grid control, however it always seems to disappear. I am trying the following code in the CREATE event:
* always show the selected cell selection_style = get_Property(ctrl_grid_images$, 'OLE.SelectionStyle') selection_style<8> = true$ Set_Property(ctrl_grid_images$, 'OLE.SelectionStyle', selection_style) Please let me know if you need anymore info.

Cheers,
James

User: James Birnie

Comments

  • Hi James,

    My guess is that this is really a slightly different problem. The SelectionStyle property will certainly keep your formatting for the cell when the EditTable loses focus. I just tested to confirm. What I think is probably happening is that our cell is no longer selected once you lose focus. This is probably due to the ResetSelPos property, which is turned on by default.
  • edited January 2016
    Hi Don

    Thanks again for the quick feedback. That ResetSelPos property was helpful. It didn't change my issue, but maybe I'm mis-interpreting what the 'OLE.SelectionStyle' actually means. For me, when I lose focus from the grid e.g. back to the folder selection EDITLINE or an SRP button, the black border in the selected call below (for the blue cross) disappears. When it gets focus again e.g. via tab then it reappears. Is this expected when setting selection_style<8> = true$ as per the above code?

    No rush with this, hope you have a good weekend.



    User: James Birnie
  • James,

    First off, good looking window!

    Second, I now understand what you are referring to. The cell border itself is not preserved when the SRP EditTable loses focus but the Foreground and Background colors are. I believe this is intentional but I will have to double check with my programmer to confirm. I can see how the documentation might be a little misleading. The docs refers to "the selection colors", which I believe specifically refers to attributes 1, 2, and 3. I think the idea is that a border implies focus and selection, thus moving away from the control should also remove the border. What if you added a cell background color (<1, 2>)? This could be something very subtle, and theme friendly, like 'S L=95'.
  • Hi Don

    That worked great - thanks for the tip!

    User: James Birnie
Sign In or Register to comment.