Changing the "Outline" of the Selected Browse Cell

I’m trying to make an updatable browse (1st image) look and behave some what like an Excel workbook (2nd image). Specifically, I want the selected cell to look more like it does in Excel. This means changing the dotted line to solid and maybe making it more solid. I imagine if it’s available, it would be in some property setting. Any ideas on how to do that, anyone?
2024-09-12_10-36-38
2024-09-12_10-43-10

PROP:BarFrame might help a bit, but I don’t think it affects the thickness.

PROPSTYLE:BarFrame

An array property that sets or returns the selected bar frame color for the style number specifed as the array element.

?List{PROPSTYLE:BarFrame, 1} = COLOR:Blue

If PROPSTYLE:BarFrame is set for a style where the default frame color is not set, the runtime library uses one on the base selection bar’s background color.

If the barframe color matches the selection bar color, the focus rectangle is not drawn if the list box has focus

Not what you asked for, but you can change the LIST behavior from row selection to cell/column selection…

1 Like

That almost worked, Jeff. Made it all the way around the cell until it hit the bottom. :upside_down_face:
2024-09-12_11-39-27

The underline overrides the barframe. If I turn the underline off, then I get a fully encompassed cell.

What if you hop on one foot? :slight_smile:

Personally, I fall down and scream… but that’s just me! :rofl:

1 Like

Well…I decided to try to “draw” the bottom line. First, I tried a BOX control, but the z-order kept it hidden. Then I tried a REGION, which worked well, except it caught all the click events. Same problem as the BOX for a LINE. So I finally did a REGION with a height of 1 positioned at the bottom of the cell, which works. I figure if I want bolder lines, I could do 4 REGIONs bordering the cell.

2024-09-13_11-07-52

If this is a browse procedure, I wonder if exploiting the built-in EIP functionality would allow you to accomplish your goal in a way that’s more maintainable. Like maybe setting the created ENTRY control as readonly, and figuring out an auto-edit mode when the window opens. But prevent it from writing.

Could be done with a normal listbox too, but more work.

Well, it is an EIP browse, and I am leveraging the EIP control to set the position of the region. I temporarily set the edit control for the cell to be that of the region and then I capture the position, height, and width. Then I turn off the edit control and calculate the bottom line from the positional parameters of the region and alter it accordingly. The code below gets executed on a NewSelection event and a couple of others.

  IF ?List{PROP:Column} > 0 THEN
    IF boxfeq = 0 THEN
      boxfeq = CREATE(0, CREATE:REGION)
      boxfeq{PROP:Color} = COLOR:Green
      boxfeq{PROP:fill} = COLOR:Green
      boxfeq{PROP:LineWidth} = 9  ! doesnt do anything for a region
    END
    UNHIDE(boxfeq)                 
    P# = target{PROP:Pixels}
    target{PROP:Pixels} = true
    ?LIST{PROP:Edit, ?List{PROP:Column}} = boxfeq
    ?LIST{PROP:Edit, ?List{PROP:Column}} = 0
    SETPOSITION(boxfeq, boxfeq{PROP:Xpos} + ?List{PROP:Xpos}, boxfeq{PROP:ypos} + ?List{PROP:ypos} + boxfeq{PROP:height}, boxfeq{PROP:Width}, 2)
    target{PROP:Pixels} = P#
    UNHIDE(boxfeq)                 
    ?List{PROPLIST:BarFrame} = COLOR:Green
  END

No judging. It hasn’t been cleaned up yet.

1 Like

That code should work ok with a non-EIP browse. Here’s a little demo of it. There are two anomalies. If the window loses focus and then gains focus or is resized, the region disappears. That’s easily fixed by trapping on those events. The other anomaly, which you can see in the demo, is when you click on a cell and then drag it to another cell. The NewSelection event doesn’t happen until MouseUp, so the region isn’t moved until then. That’s minor.
2024-09-13_14-03-33

1 Like