BBC BASIC for Windows
Programming >> Operating System >> Keeping LV item focus http://bb4w.conforums.com/index.cgi?board=os&action=display&num=1373179893 Keeping LV item focus
Post by Matt 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
Re: Keeping LV item focus
Post by admin on Jul 7th, 2013, 09:17am
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 Re: Keeping LV item focus
Post by admin on Jul 7th, 2013, 8:48pm
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. Re: Keeping LV item focus
Post by Matt on Jul 8th, 2013, 05:01am
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
Re: Keeping LV item focus
Post by admin on Jul 8th, 2013, 08:22am
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.
Re: Keeping LV item focus
Post by Matt on Jul 8th, 2013, 1:31pm