Missing gridline in LIG

Just starting out? Need help? Post your questions and find answers here.
User avatar
Lord
Addict
Addict
Posts: 907
Joined: Tue May 26, 2009 2:11 pm

Missing gridline in LIG

Post by Lord »

Hi!

I noticed, after I switched from Win7 to Win11, that the gridline
between header and first line is missing. At least here.

Code: Select all

If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  ListIconGadget(1,10,10,480,230,"Titel",400,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
  For a=1 To 5
    AddGadgetItem(1,-1,"Item "+Str(a),0,0)
  Next
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Is it only here or has anyone else this also noticed?
Image
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Missing gridline in LIG

Post by boddhi »

I don't have W11 but with W10, it's the same...
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: Missing gridline in LIG

Post by Mijikai »

Same for me on my Win 11
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: Missing gridline in LIG

Post by BarryG »

Doesn't show it on Win 10 either. Has it ever?
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4991
Joined: Sun Apr 12, 2009 6:27 am

Re: Missing gridline in LIG

Post by RASHAD »

Hi Lord
Workaround

Code: Select all

If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  ListIconGadget(1,10,10,480,230,"Titel",400,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
  AddGadgetColumn(1, 1, "test",100)
  header = SendMessage_(GadgetID(1), #LVM_GETHEADER,0,0 )
  SetWindowTheme_(Header, "","BUTTON") 
  For a=1 To 5
    AddGadgetItem(1,-1,"Item "+Str(a),0,0)
  Next
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Egypt my love
User avatar
Lord
Addict
Addict
Posts: 907
Joined: Tue May 26, 2009 2:11 pm

Re: Missing gridline in LIG

Post by Lord »

Hi @all!
Thanks for confirmation.
BarryG wrote: Fri Sep 20, 2024 10:42 am ... Has it ever?
Not her on Win7.

@Rashad:
Thank you for the workaround.
But I think this is a little misleading, as it let you think you can
trigger some action if you klick on column header.

I this a bug?
Image
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4991
Joined: Sun Apr 12, 2009 6:27 am

Re: Missing gridline in LIG

Post by RASHAD »

Hi Lord
The Header still as is
The theme is just a skin nothing more
You can also disable the Modern XP theme if you like

No Bug as I know and remember

Just checked the snippet with Windows 7
You are right but because Windows 7 was using a proper theme(LinearGradient)
Egypt my love
User avatar
jacdelad
Addict
Addict
Posts: 2031
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Missing gridline in LIG

Post by jacdelad »

Hasnt this been always that way? Afaik it's a bug already confirmed a long time ago.
Anyway, there's another fix for Windows:

Code: Select all

SendMessage_(GadgetID(#MyLIG),#LVM_SETEXTENDEDLISTVIEWSTYLE,#LVS_EX_GRIDLINES,#LVS_EX_GRIDLINES)
Edit:
Found it: https://www.purebasic.fr/german/viewtop ... 7&start=10, so it has been in since 4.51 at least.
And here: viewtopic.php?t=54152
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
Lord
Addict
Addict
Posts: 907
Joined: Tue May 26, 2009 2:11 pm

Re: Missing gridline in LIG

Post by Lord »

Hi!

It seems, that on Win11 nobody uses gridlines anymore.
So a missing first gridline is not detectable.
But if you have an empty LIG with some empty rows and gridlines on,
it looks like the header has double the height as a regular row.
And that looks ugly.

@jacdelad:
SendMessage_(GadgetID(#MyListIcon), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)
This doesn't solve this problem either. Same missing gridline.

I now think that it is a windows issue, not a PureBasic issue.

Thanks for help.
Image
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Re: Missing gridline in LIG

Post by ebs »

Code: Select all

SendMessage_(GadgetID(#MyLIG),#LVM_SETEXTENDEDLISTVIEWSTYLE,#LVS_EX_GRIDLINES,#LVS_EX_GRIDLINES)
When I use this (Win 11 Pro), it seems to make the vertical grid lines a little bit darker and more noticeable, but the horizontal line under the header row is still missing.

Does anyone else see this?
User avatar
jacdelad
Addict
Addict
Posts: 2031
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Missing gridline in LIG

Post by jacdelad »

Lord wrote: Fri Sep 20, 2024 2:58 pm @jacdelad:
SendMessage_(GadgetID(#MyListIcon), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)
This doesn't solve this problem either. Same missing gridline.
You're right, I didn't notice that. It only gets fixed for older Windows versions.

How about:

Code: Select all

SetWindowTheme_(Header, "","") 
for RASHADS code? I for one would prefer this, the BUTTON makes header look strange with the round corners and such.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Re: Missing gridline in LIG

Post by ebs »

How about:
SetWindowTheme_(Header, "","")
Plain text
for RASHADS code? I for one would prefer this, the BUTTON makes header look strange with the round corners and such.
Unfortunately, this doesn't do anything either. :(
User avatar
ChrisR
Addict
Addict
Posts: 1484
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Missing gridline in LIG

Post by ChrisR »

Lord wrote: Fri Sep 20, 2024 12:41 pm @Rashad: ... But I think this is a little misleading, as it let you think you can
trigger some action if you klick on column header.
Maybe

Code: Select all

If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  ListIconGadget(1,10,10,480,230,"Titel",400,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
  AddGadgetColumn(1, 1, "test",100)
  header = SendMessage_(GadgetID(1), #LVM_GETHEADER,0,0 )
  ;SetWindowTheme_(Header, "","BUTTON")
  SetWindowTheme_(Header, "","")
  SetWindowLongPtr_(header, #GWL_STYLE, GetWindowLongPtr_(header, #GWL_STYLE) &~ #HDS_BUTTONS)
  For a=1 To 5
    AddGadgetItem(1,-1,"Item "+Str(a),0,0)
  Next
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4991
Joined: Sun Apr 12, 2009 6:27 am

Re: Missing gridline in LIG

Post by RASHAD »

Hi ChrisR
No need to SetWindowLongPtr_(header, #GWL_STYLE, GetWindowLongPtr_(header, #GWL_STYLE) &~ #HDS_BUTTONS)
I keep saying that the themes is just a skin
If you don't like "BUTTON" skin
You can try
SetWindowTheme_(Header, "","TAB")
But I still advice with "BUTTON" because it's so close to the required action
Egypt my love
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Re: Missing gridline in LIG

Post by ebs »

ChrisR,

Your code produces the best looking result on Win 11 IMHO.
The header row is clearly defined with a different color than the rest of the control and there are no "buttons" to click! :D

It also works fine with my standard trick of setting the header font to bold.

Thank you!
Post Reply