|
Just plain text , the first one is " COM1:" , and here is the code processing the click. But that is after the selection so it should not matter.
<pre lang=" LPNMITEMACTIVATE pia = (LPNMITEMACTIVATE)pNMHDR;
CPoint point(pia->ptAction);
// Select the item the user clicked on.
UINT uFlags;
int nItem = m_list.HitTest(point, &uFlags);
CString strText = m_list.GetItemText( nItem, 0);
SetDlgItemText(IDC_EDIT3, strText);
*pResult = 0;"></pre>
|
|
|
|
|
|
Nice, but...a little issue with MS terminology, as always.
The item is not really "selected", that to me implies some outside act.
I have been using POSITION iterating thru document / view the term used there is "get".
But I am just too picky.
I have a feeling the problem is related to PropertyPage "dialog".
Been having problem selecting CEdit control using mouse ( it works fine using tab) and just "discovered " when I run the dialog test by itself it works just peachy , but won't work in ProperyPage.
Maybe this selection issue is related. I'll try to run the dialog outside PropertySheets to see if it works differently.
Don't spent too much time on it, it is just annoying , but I can live with it.
Vaclav
|
|
|
|
|
In your message handler, you could try:
int nItem = m_list.GetNextItem(-1, LVNI_SELECTED);
CString strText = m_list.GetItemText(nItem, 0);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
David,
the "problem" is indicated by mouse pointer changes from howering over "C" to "OM1:" and than there is no event. The actual processing is fine.
And it does it only on first "COM1:" and last "COM5:" lines.
The "COM2:" thru "COM4:" it works on the entire text.
Richard,
just confirmed that in plain dialog app I can select the CEdit box using mouse.
I guess in my spare time I'll kluge some workaround. Perhaps real subclassing will work.
Vaclav
|
|
|
|
|
Sorry. I misinterpreted this:
I can select the first and last COM port with mouse pointing to letter "C" only.
What styles does your list control have?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 22-Aug-13 11:28am.
|
|
|
|
|
David, it's the little details which will get you each and every time. Ha ha.
Have a great day.
Vaclav
|
|
|
|
|
I just added a list control to a dialog, changed its style to report, and added the following code:
m_list.SetExtendedStyle(LVS_EX_TRACKSELECT);
m_list.InsertColumn(0, _T("COM port"), LVCFMT_LEFT, 100);
m_list.InsertItem(0, _T("COM1:"));
m_list.InsertItem(1, _T("COM2:"));
m_list.InsertItem(2, _T("COM3:"));
m_list.InsertItem(3, _T("COM4:"));
m_list.InsertItem(4, _T("COM5:")); Now, no matter where the mouse hovers over any of the five items, that item will be selected after about 0.5 seconds.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
David,
same problem. Only works when then mouse is over "C" in first line.
I really believe it has something to do with CPropertPage.
But I like the tracking better than clicking.
Now if I could apply that to CEdit I'll be a happy camper.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: same problem. Even on a dialog box?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
David,
I am bad in multitasking, so I am trying to keep the CEdit problem separate.
I have not tried to implement your tracking method on the CEdit.
I got too many fires going same time. I'll keep you posted on this one.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: And it does it only on first "COM1:" and last "COM5:" lines. The "COM2:" thru "COM4:" it works on the entire text. That is just bizarre!
If it was not for that piece of information, I was going to suggest it might have something to do with the width of the column set really narrow and the rest of the text for some reason being written outside of the column - I believe I have seen something like that before, but what you describe here is just weird.
Sorten Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
I just put over 30 random characters in the item column and the problem is really on the first and last line. ONLY when the mouse is over the first character in the field it will get selected.
I give up.
Cheers
Vaclav
|
|
|
|
|
Here is a crazy update.
Now I cannot even select by "howering " over the first letter! But I can change / edit the item by moving the mouse to the left until I get "regular" focus. I deffinetly have an issue with my VC 6.0.
Case closed.
|
|
|
|
|
Question has been solved
Thanks everyone for those comments it helped me a lot, I am considering users here asthe most amazing users ever!
oky I have a list view (using MDI also) and I am drawing everything from scratch, everything works amazingly, but recently when i tried to print tons of data, i the list went crazy, and it seems the whole app went crazy not just the listview, I tried to disable all the features in my app and that bug still there
basically the program has a highlight row and that row in blue, that bug changes it to another color, and i cannot use the editing text method and when I minimize the list, it does not come back, as if the whole program got busted?
bty, its not form custom draw cuz i did check every single line...
http://oi43.tinypic.com/25zibrl.jpg[^]
what made it weird that even the menu went black? i am sure that if it a listview problem it wont change the menu color?? is the listview has a specific stack size or heap size in onwerdata? i dunno what i am saying but the list works fine in some cases except when i deal with more data,
any ideas why that happens?
edit1:
I tried update the whole list with the whole program and nothing happened (if it paints issues redrawing the whole app will help but did not work here?)
edit2:
some has almost same problem and he wrote (I am using a CListView in my application. When I run the application and it gets a lot of items in it's CListView (3 or 4 thousand at least) the application's windows go all stange. From then after all Menus in all applications (including taskbar and desktop menus) are displayed with black bars over most of their items, moving the mouse down over them removes most of the black bars.
Thanks for any help.)
but no one answered him?
modified 21-Aug-13 17:27pm.
|
|
|
|
|
Hi,
I'm not certain if this is the problem but you say that the problem started when you wanted to show a lots of data, you also mentioned that you draw the list yourself. (Custom draw)
It could be that you are running out of resources, GDI resources to be precises, this could explain why even other part of the application are getting problems drawing themselfes.
Its a wild guess, but its worth to check this. (this can be verified quickly with the task manager)
regards
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
i did not even think about that?!!! the thing is as soon as my program rich 10000 objects then that bug appears so, and if i am not wrong i remember that win7 it's 10000 as default so, by increasing that it will fix it 100%, which can be done from the registry
thanks I really appreciate that, and i do like this site better than stackoverflow, since they think that they are the best and as soon as you ask question they consider you as a jerk (down vote)
anyway thanks a lot....
|
|
|
|
|
The only thing I can think of to check right now is GDI leaks.
When the system runs out of resources, all kinds of system-wide funkiness may be enjoyed.
Have you checked for them? If not, you can view them in the task-manager.
View->Select Columns->GDI Objects
If this number is not steady - i.e it increases, you've got a leak.
More info: here[^] and here[^].
"Science adjusts its views based on what's observed. Faith is the denial of observation, so that belief can be preserved." - Tim Minchin
|
|
|
|
|
Thanks A lot I did that...
|
|
|
|
|
|
I will check that Out,
thanks for those links
|
|
|
|
|
I think you must see something like this, for Cpp,
Virtual Mode ListView[^]
because, if you have 10000000 items, you can´t load all of them,
hope this helps,
Carlos
|
|
|
|
|
I am having a problem grasping the constructor initialization in MFC property sheet.
Original page definition with initialization
CMyPropertyPage11::CMyPropertyPage11() : CPropertyPage(CMyPropertyPage11::IDD)
Original declaration
class CMyPropertyPage11 : public CPropertyPage
New common BasePropertyPAge class for all CmyPropertyPagexx , inherited from CPropertyPage.
I need to have all CmyPropertyPagexx classes access to same class instance initialized in BasePropertyPage.
class CMyPropertyPage11 : public CBasePropertyPage
The inheritance hierarchy is now
CMyPropertyPagexx
CBasePropertyPage
CPropertyPage
Since CBasePropertyPage also inherits from CPropertyPage I need to apply virtual inheritance and should be able to figure that out myself.
<b><b></b>Mye main question - how do I initialize the CmyPropertyPage11?</b>
CMyPropertyPage11::CMyPropertyPage11() : ??
Thanks for you help.
Cheers
Vaclav
-- modified 22-Aug-13 13:11pm.
|
|
|
|
|
There are at least 3 ways you can handle this. Which way you choose depends on what you need.
If you only need one resource, you assign it to CBasePropertyPage. In this case you take CBasePropertyPage::IDD and pass it to CPropertyPage. For CMyPropertyPage11 you don't need an initializer in that case. You can use the controlls on the page directly.
If every derived property page class needs its own resource you need to decide whether you really want/need to derive CBasePropertyPage from CPropertyPage.
If you don't need access to the GUI from that class it will probably be easier to just define it as stand alone and derive your property pages from CPropertyPage and CBasePropertyPage. This way you can keep your original initialization.
If for some reason you need to have property page funtionality directly in CBasePropertyPage, you need to change CBasePropertyPage's constuctor to take an UINT. Then you initialize like that:
CMyPropertyPage11::CMyPropertyPage11() : CBasePropertyPage(CMyPropertyPage11::IDD)
{
}
CBasePropertyPage::CBasePropertyPage(UINT idd) : CPropertyPage(idd)
{
}
To access the controls on the page from CBasePropertyPage you need pure virtual functions that you override in the derived class(es).
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Thanks,
I am still little confused, but I'll sleep on it.
I am sure my terminology was not too clear.
So in reality each ProperyPage ( dialog) adds a filter to a graph - DirectShow API's , hence the graph is common to all.
Thanks again for your help, appreciate it.
Vaclav
|
|
|
|