Permanent popup menu (aka list control) c++, MFC
-
Can you explain a bit more what you need? What I understood is that you want to use a popup menu instead than a list control because you want something like a list control with reduced functionalities and custom behaviours; isn't it? Can't you write a class that inherit from
CListCtrl
and modifies the standard behaviours?Yes. Just like what u mentioned. What I need to do is to create a popup menu literally looks like list control. The reason why I do so is because I found out that the list control icon attribute as following... m_list.SetExtendedStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT); ...where when I click on one of the item, I manage to select the whole row but not able to highlight the icon itself. If u have notice, when you put in the above code, there will be an empty white space reserved for the icon to be loaded. My original task is to eliminate that white space (in other words is to make it transparent). For example, I'm trying to make the list control to be exactly same as the right click button in Adobe PDF reader where i can select whole row with icon (transparent background) and a tick (check mark). By the way, the icons I obtained is from EnumWindowProc where I get from Window Application (same as ALT + TAB button)
Sincerely, arthur89kim
-
I'm not sure that I fully understand your question, but a popup menu is, by its nature, a transient item. It pops up, the user makes a selection, it disappears. If you want some sort of permanent list on display I think you may need to use a different control. Perhaps you could give some more detail on the problem you are trying to solve.
It's time for a new signature.
What I need to do is to create a popup menu literally looks like list control. The reason why I do so is because I found out that the list control icon attribute as following... m_list.SetExtendedStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT); ...where when I click on one of the item, I manage to select the whole row but not able to highlight the icon itself. If u have notice, when you put in the above code, there will be an empty white space reserved for the icon to be loaded. My original task is to eliminate that white space (in other words is to make it transparent). For example, I'm trying to make the list control to be exactly same as the right click button in Adobe PDF reader where i can select whole row with icon (transparent background) and a tick (check mark). By the way, the icons I obtained is from EnumWindowProc where I get from Window Application (same as ALT + TAB button).
Sincerely, arthur89kim
-
Yes. Just like what u mentioned. What I need to do is to create a popup menu literally looks like list control. The reason why I do so is because I found out that the list control icon attribute as following... m_list.SetExtendedStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT); ...where when I click on one of the item, I manage to select the whole row but not able to highlight the icon itself. If u have notice, when you put in the above code, there will be an empty white space reserved for the icon to be loaded. My original task is to eliminate that white space (in other words is to make it transparent). For example, I'm trying to make the list control to be exactly same as the right click button in Adobe PDF reader where i can select whole row with icon (transparent background) and a tick (check mark). By the way, the icons I obtained is from EnumWindowProc where I get from Window Application (same as ALT + TAB button)
Sincerely, arthur89kim
Then what you want is a list control with a customized appearance. For this, the best is to use a owner-draw list control with the owner-draw property set (i.e. created using the
LVS_OWNERDRAWFIXED
style); then process theWM_DRAWITEM
to give your control the apeearance you want. Look at these links for some samples: -
Then what you want is a list control with a customized appearance. For this, the best is to use a owner-draw list control with the owner-draw property set (i.e. created using the
LVS_OWNERDRAWFIXED
style); then process theWM_DRAWITEM
to give your control the apeearance you want. Look at these links for some samples:Thanks for the reply. I'll look into it. I was hoping to find alternative way to solve it without using owner-draw or other drawing method. :-O If that's the case, I shall study on it. Thanks again.
Sincerely, arthur89kim
-
What I need to do is to create a popup menu literally looks like list control. The reason why I do so is because I found out that the list control icon attribute as following... m_list.SetExtendedStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT); ...where when I click on one of the item, I manage to select the whole row but not able to highlight the icon itself. If u have notice, when you put in the above code, there will be an empty white space reserved for the icon to be loaded. My original task is to eliminate that white space (in other words is to make it transparent). For example, I'm trying to make the list control to be exactly same as the right click button in Adobe PDF reader where i can select whole row with icon (transparent background) and a tick (check mark). By the way, the icons I obtained is from EnumWindowProc where I get from Window Application (same as ALT + TAB button).
Sincerely, arthur89kim
I am still very confused about your requirements. If you have a popup menu then the selection rectangle will cover the entire width of the item you select; just right click on this page and move your mouse up and down the list.
It's time for a new signature.
-
I am still very confused about your requirements. If you have a popup menu then the selection rectangle will cover the entire width of the item you select; just right click on this page and move your mouse up and down the list.
It's time for a new signature.
Sorry for the confusion, I was given task to make a list control with icons (EnumWindowProc from windows' applications) and a tick (check mark) to indicate my item is selected when I double click on it. However, the drawback of using list control occurs when I highlight the item before double clicking it. This is where my task given, I am suppose to make a full row highlight without white space (especially when there is an icon in the list). The white space is reserved for the icons inserted into it. Hence, I was trying to use CMenu to obtain desirable results (exp: right click on PDF file to see the popup menu). ;P Nevertheless, by using popup menu, I am not able to show the popup menu permanently as we can do with list control. I hope my statements do clear up the confusion made. Thanks for your patient to help me out. :-O
Sincerely, arthur89kim
-
Sorry for the confusion, I was given task to make a list control with icons (EnumWindowProc from windows' applications) and a tick (check mark) to indicate my item is selected when I double click on it. However, the drawback of using list control occurs when I highlight the item before double clicking it. This is where my task given, I am suppose to make a full row highlight without white space (especially when there is an icon in the list). The white space is reserved for the icons inserted into it. Hence, I was trying to use CMenu to obtain desirable results (exp: right click on PDF file to see the popup menu). ;P Nevertheless, by using popup menu, I am not able to show the popup menu permanently as we can do with list control. I hope my statements do clear up the confusion made. Thanks for your patient to help me out. :-O
Sincerely, arthur89kim
If you use a normal list control with the LVS_EX_FULLROWSELECT style then you will get the result you are asking for. Take a look at any Windows program (Windows Explorer for example) that has a list view and you will see what I mean.
It's time for a new signature.
-
If you use a normal list control with the LVS_EX_FULLROWSELECT style then you will get the result you are asking for. Take a look at any Windows program (Windows Explorer for example) that has a list view and you will see what I mean.
It's time for a new signature.
Thanks for your reply. I have try it out but no different. There is still white space withing that icon area.
Sincerely, arthur89kim
-
Thanks for your reply. I have try it out but no different. There is still white space withing that icon area.
Sincerely, arthur89kim
-
arthur89kim wrote:
I have try it out but no different. There is still white space withing that icon area.
I am still not sure what it is you are trying to achieve and why white space is so important.
It's time for a new signature.
That is the task I'm given. To eliminate the white space in order to make it a full row highlight without white space. It would seems more professional that way. By the way, thanks for your reply. I will try out the WM_DRAWITEM as mentioned by Sauro Viti.
Sincerely, arthur89kim