BBC BASIC for Windows
« Keeping LV item focus »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:55pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Keeping LV item focus  (Read 2090 times)
Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Keeping LV item focus
« Thread started on: Jul 7th, 2013, 06:51am »

Hi,

Not sure how to do this, or if it can be done. When I select an item in a LV and request it be deleted, for instance, I have a confirmation dialog box appear. When this does, however, the focus is removed from the LV and the highlight bar(s) disappear. Is there a way of keeping the bars visible when the confirmation box appears? (Not sure if I've explained this very well.)

Matt
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Keeping LV item focus
« Reply #1 on: Jul 7th, 2013, 09:17am »

on Jul 7th, 2013, 06:51am, Matt wrote:
Is there a way of keeping the bars visible when the confirmation box appears? (Not sure if I've explained this very well.)

Is perhaps LVS_SHOWSELALWAYS the style you are wanting?

http://msdn.microsoft.com/en-us/library/windows/desktop/bb774739.aspx

"The selection, if any, is always shown, even if the control does not have the focus".

Richard.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Keeping LV item focus
« Reply #2 on: Jul 7th, 2013, 5:50pm »

on Jul 7th, 2013, 09:17am, Richard Russell wrote:
Is perhaps LVS_SHOWSELALWAYS the style you are wanting?

It is, but I'm confusing myself. I've been using extended listview style. I can't figure out how to use this. It may be basic stuff, but can you point me there, please.

Matt
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Keeping LV item focus
« Reply #3 on: Jul 7th, 2013, 8:48pm »

on Jul 7th, 2013, 5:50pm, Matt wrote:
I've been using extended listview style. I can't figure out how to use this. It may be basic stuff, but can you point me there, please.

It's not an extended listview style - those all start with LVS_EX_ - it's a regular style bit like LVS_REPORT, which I assume you're already using. Like all style bits you just OR them together (that's why they're bits!): LVS_REPORT OR LVS_SHOWSELALWAYS

Incidentally I notice that in LVLIB.BBC the style and extended style aren't passed as parameters to FN_lv_setup(), making it impossible to use them at all. That's a major shortcoming of the library, don't you think?

Richard.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Keeping LV item focus
« Reply #4 on: Jul 8th, 2013, 05:01am »

on Jul 7th, 2013, 8:48pm, Richard Russell wrote:
It's not an extended listview style - those all start with LVS_EX_ - it's a regular style bit like LVS_REPORT, which I assume you're already using.

As it happens, I wasn't using it specifically, because I'd forgotten it was being used in the library - and, obviously, how it was used. I assume that the basic styles cannot be changed once the LV is set up, only the extended styles, or am I wrong in that?

Quote:
Incidentally I notice that in LVLIB.BBC the style and extended style aren't passed as parameters to FN_lv_setup(), making it impossible to use them at all. That's a major shortcoming of the library, don't you think?

Absolutely. I initially threw this library together for my own benifit, but decided to add other variations and put it on the website. However, I hadn't reviewed the setup PROC as carefully as I'd thought. Again, a learning curve. Thanks. I will adjust it and reupload. Any more comments will be gratefully received.

Matt
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Keeping LV item focus
« Reply #5 on: Jul 8th, 2013, 08:22am »

on Jul 8th, 2013, 05:01am, Matt wrote:
I assume that the basic styles cannot be changed once the LV is set up, only the extended styles, or am I wrong in that?

Both the style and the extended style should normally be specified in the CreateWindowEx call: that's the only place you can definitely set them. In some cases you can subsequently change some of the style bits using SetWindowLong but only if it is specifically documented that you can - and often that must be associated with a forced redraw, or an update of some other kind, to ensure the control is in an internally consistent state. Also, there may on occasion be a specific method provided to change a style (such as the EM_SETREADONLY message discussed previously).

But as a general rule you should assume that both the style and the extended style are set when the control is created and are never changed again.

Richard.
« Last Edit: Jul 8th, 2013, 11:56am by admin » User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Keeping LV item focus
« Reply #6 on: Jul 8th, 2013, 1:31pm »

on Jul 8th, 2013, 08:22am, Richard Russell wrote:
But as a general rule you should assume that both the style and the extended style are set when the control is created and are never changed again.

Thanks Richard. I do have a switch in the program that changes whether the gridline is active or not, and that seems to work fine.

Matt
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls