owner-draw list control

hi there

i have a couple of questions regarding owner-draw list controls
(CListCtrl-derived)

first of all, this is what i want to do - i want to display graphic
images to a user using a list control in LARGE ICON mode, showing
images which have been loaded off disk (stored as JPG)

i have the library to read the image files (CxImage - very good!) - but
now i want to leverage the functionality of a list control to show the
user these images

i also want the user to be able to change the viewing size of the
images

i'm thinking i have two options:

option 1:

owner-draw list control, and i draw the image directly to the list DC
using the CxImage library


option 2:

dynamically create icons from the image data (which i can get as DIB
data blobs), and then add them to an image list which i attach to the
list control, and then i don;t have to do any kind of drawing myself


questions:

1. can i do an owner-draw list control when it is in LARGE ICON mode? i
read somewhere that you can only owner-draw in report mode, but maybe
this is incorrect....

2. with owner-draw list controls, can i dynamically set the item height
at runtime after the control is first created? or does this message
only get set once?

3. if i go with Option 2 - wil the list control respond appropriately
if i change the imagelist for LARGE ICON mode to a list with
bigger/smaller icons?


thanks for any help you can give me
my deadline is LOOMING!!! (know that feeling??)
bhu

0
bhuvidya (34)
8/8/2006 11:59:49 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
747 Views

Similar Articles

[PageSpeed] 13

From
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html
/customdraw.asp , it appears that owner drawing works only in report mode.
So you appear to be out of luck.

However, a better option is to handle NM_CUSTOMDRAW. Above link talks about
it and the following link shows how to do it:
http://www.codeproject.com/listctrl/lvcustomdraw.asp

Custom drawing gives you the ability to individually control each cell. All
this is done dynamically and hopefully will do what you want.
--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message
news:1155081589.921652.178990@i3g2000cwc.googlegroups.com...
>
> hi there
>
> i have a couple of questions regarding owner-draw list controls
> (CListCtrl-derived)
>
> first of all, this is what i want to do - i want to display graphic
> images to a user using a list control in LARGE ICON mode, showing
> images which have been loaded off disk (stored as JPG)
>
> i have the library to read the image files (CxImage - very good!) - but
> now i want to leverage the functionality of a list control to show the
> user these images
>
> i also want the user to be able to change the viewing size of the
> images
>
> i'm thinking i have two options:
>
> option 1:
>
> owner-draw list control, and i draw the image directly to the list DC
> using the CxImage library
>
>
> option 2:
>
> dynamically create icons from the image data (which i can get as DIB
> data blobs), and then add them to an image list which i attach to the
> list control, and then i don;t have to do any kind of drawing myself
>
>
> questions:
>
> 1. can i do an owner-draw list control when it is in LARGE ICON mode? i
> read somewhere that you can only owner-draw in report mode, but maybe
> this is incorrect....
>
> 2. with owner-draw list controls, can i dynamically set the item height
> at runtime after the control is first created? or does this message
> only get set once?
>
> 3. if i go with Option 2 - wil the list control respond appropriately
> if i change the imagelist for LARGE ICON mode to a list with
> bigger/smaller icons?
>
>
> thanks for any help you can give me
> my deadline is LOOMING!!! (know that feeling??)
> bhu
>


0
ajaykalra (6842)
8/9/2006 12:09:23 AM
This code might be interesting to you:

http://www.codeproject.com/listctrl/thumbnailview.asp

Tom

"bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message 
news:1155081589.921652.178990@i3g2000cwc.googlegroups.com...
>
> hi there
>
> i have a couple of questions regarding owner-draw list controls
> (CListCtrl-derived)
>
> first of all, this is what i want to do - i want to display graphic
> images to a user using a list control in LARGE ICON mode, showing
> images which have been loaded off disk (stored as JPG)
>
> i have the library to read the image files (CxImage - very good!) - but
> now i want to leverage the functionality of a list control to show the
> user these images
>
> i also want the user to be able to change the viewing size of the
> images
>
> i'm thinking i have two options:
>
> option 1:
>
> owner-draw list control, and i draw the image directly to the list DC
> using the CxImage library
>
>
> option 2:
>
> dynamically create icons from the image data (which i can get as DIB
> data blobs), and then add them to an image list which i attach to the
> list control, and then i don;t have to do any kind of drawing myself
>
>
> questions:
>
> 1. can i do an owner-draw list control when it is in LARGE ICON mode? i
> read somewhere that you can only owner-draw in report mode, but maybe
> this is incorrect....
>
> 2. with owner-draw list controls, can i dynamically set the item height
> at runtime after the control is first created? or does this message
> only get set once?
>
> 3. if i go with Option 2 - wil the list control respond appropriately
> if i change the imagelist for LARGE ICON mode to a list with
> bigger/smaller icons?
>
>
> thanks for any help you can give me
> my deadline is LOOMING!!! (know that feeling??)
> bhu
> 


0
tserface (3861)
8/9/2006 3:14:57 PM
thanks to both Tom and Ajay - both suggestions have given me what i
need! i could go one of two ways:

1. use CustomDraw to draw bitmap directly
2. convert images to icons and let CListCtrl do the rest

thanks guys - this is the info i needed!

i love usenet :-)

bhu



Tom Serface wrote:

> This code might be interesting to you:
>
> http://www.codeproject.com/listctrl/thumbnailview.asp
>
> Tom
>
> "bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message
> news:1155081589.921652.178990@i3g2000cwc.googlegroups.com...
> >
> > hi there
> >
> > i have a couple of questions regarding owner-draw list controls
> > (CListCtrl-derived)
> >
> > first of all, this is what i want to do - i want to display graphic
> > images to a user using a list control in LARGE ICON mode, showing
> > images which have been loaded off disk (stored as JPG)
> >
> > i have the library to read the image files (CxImage - very good!) - but
> > now i want to leverage the functionality of a list control to show the
> > user these images
> >
> > i also want the user to be able to change the viewing size of the
> > images
> >
> > i'm thinking i have two options:
> >
> > option 1:
> >
> > owner-draw list control, and i draw the image directly to the list DC
> > using the CxImage library
> >
> >
> > option 2:
> >
> > dynamically create icons from the image data (which i can get as DIB
> > data blobs), and then add them to an image list which i attach to the
> > list control, and then i don;t have to do any kind of drawing myself
> >
> >
> > questions:
> >
> > 1. can i do an owner-draw list control when it is in LARGE ICON mode? i
> > read somewhere that you can only owner-draw in report mode, but maybe
> > this is incorrect....
> >
> > 2. with owner-draw list controls, can i dynamically set the item height
> > at runtime after the control is first created? or does this message
> > only get set once?
> >
> > 3. if i go with Option 2 - wil the list control respond appropriately
> > if i change the imagelist for LARGE ICON mode to a list with
> > bigger/smaller icons?
> >
> >
> > thanks for any help you can give me
> > my deadline is LOOMING!!! (know that feeling??)
> > bhu
> >

0
bhuvidya (34)
8/9/2006 10:09:52 PM
Glad you got it figured out.  Yeah, this kind of support forum is a real 
wonderful deal for everyone.

Tom

"bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message 
news:1155161392.880073.260530@h48g2000cwc.googlegroups.com...
>
> thanks to both Tom and Ajay - both suggestions have given me what i
> need! i could go one of two ways:
>
> 1. use CustomDraw to draw bitmap directly
> 2. convert images to icons and let CListCtrl do the rest
>
> thanks guys - this is the info i needed!
>
> i love usenet :-)
>
> bhu


0
tserface (3861)
8/9/2006 10:24:27 PM
Reply:

Similar Artilces:

Copying cell contents to a list
First of all - apologies if this is in the wrong group. I wasn't sure if it should be newusers (which I am) or programming (which I might need). I have inherited a lottery syndicate at work after the previous organiser retired. He kept an Excel 97 spreadsheet with 8 columns - A (Date), B to G (Winning numbers) and H (Bonus number). This list has now grown to about 800 rows as each draw's numbers are added to the bottom of the list (I will be removing about 600). I have adapted the spreadsheet to automatically check our numbers against the winning numbers (using HLOOKUP) after I have ...

Where is the data menu for sorting lists?
Am trying to sort an address list into alphabetical order. Help says click on list and and select from data menu. When i click no data menu appears. can anyone help please? Thank you. Do you want to tell us what Office program you're referring to, and what version of that program? Daddy "Shakoh" <Shakoh@discussions.microsoft.com> wrote in message news:7E04A2BD-DA32-462B-A912-5469035351C9@microsoft.com... > Am trying to sort an address list into alphabetical order. Help says click > on > list and > and select from data menu. When i click no...

List Control #3
how to move one value from one LIST control to Another List control. -- farah ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------ If you mean dragging and dropping follow this link. There is sample showing how to implement dragging/dropping items between list controls. http://www.codeguru.com/forum/showthread.php?t=331244 "farah" wrote: > > how to move one value from one LIST control to Another List control. > > > > -- &g...

CROSS-POST (also on General)
Hi, when I right-click in the folder list to create a new sub- folder I get an error: >>>> ERROR MSG >>>> Outlook can't read the registry information - Close and restart Outlook - Reinstall Outlook - Reinstall Microsoft Exchange or other e-mail system <<<< END <<<<< we have tried everything, including re-install of Office 2000. We have run this on Windows 2000 Professional.... please help if you have an answer thanks Philip When this error occurred on a Win XP machine (running Outlook 2002), I did a System Restore to fix it. If ...

Display/Hide a Form Control/Field Based On Another Field Value?
Hi all, I have to Combo boxes on a form. The first one I would always like users to see. The second, however, I would like hidden if the first box has certain values selected. So, if ComboBox1 has values of 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a value of 3, I would like ComboBox2 hidden. Is there a relatively simple way of doing this, if at all? Thanks for your help as always! --Eric You have to take care of 2 things: (1) When you move from record to record and the combo box contents changes (2) When the user changes the contents of the combo box For (1), inse...

Can you program Excel to draw an asymptote?
I want to know if there is a way to get excel to put an asymptote on a chart if you already have a parabolic data set on the chart. My goal is to find to value of the asymptote for further analysis. I know I can fudge a straight line graph onto the chart but it is not meaningful without the true value. HELP!!! "csusbgirl07" <csusbgirl07@discussions.microsoft.com> schrieb im Newsbeitrag news:6E51019A-7160-4A93-862F-A785BD2DBD3E@microsoft.com... > I want to know if there is a way to get excel to put an asymptote on a chart > if you already have a parabolic data set ...

Validation Dropdown list starts at b ottom of list
I have created several Data Validation dropdown lists in xl2003. The lists contain about 20-25 items. If the cell is blank as it should be when starting, the list defaults to the bottom items. Most of the time the item needing to be selected is near the top. Is there a way to make the list show the listed items from top to bottom by default? Thanks, Tonso You have to make sure that your list of items contains no blanks. If you are using a formula to define the list, make sure it doesn't overflow. -- HTH Bob "Tonso" <wthomasss@hotmail.com> wrote in...

How to display Cdialog-derived control in MFC extension DLL
Hi All, This post follows another post which I have posted before in another group without arriving at a suitable solution. The problem which I'm about to write about and for which I seek your help really has to do with something that I have experienced with respect to xll. Yet here I won't dexcribe the problem in terms of the original xll project that I built. Rather, I chose to create a mini-version of the that problem in terms of MFC extension dll --- that makes things simpler and devoid of all the "extra noise" accompanied when creating an xll project. Moreover, the o...

Adding Toronto Exchange to watch list
I've just re-installed Money 03 and now I need to add the Toronto Stock Exchange (TSX) to my "Investment Watch List". It's not listed in the list of exchanges. Can someone help? Thanks Is there anyone out there that can answer this for me??? Anyone??? On Fri, 12 Sep 2003 16:12:05 -0400, Steve P <Steve25261@comcast.net> wrote: >I've just re-installed Money 03 and now I need to add the Toronto >Stock Exchange (TSX) to my "Investment Watch List". It's not listed >in the list of exchanges. > >Can someone help? > >Thanks In ...

Dirlist control
Really dows not exists in VC++ 6.0 a Dirlist control ? A Control that shows the tree of the directory of a given drive. I think that this is a common request. Can someone say me where to find this ? Thanks Alb460 Take a look at SHBrowseForFolder(). -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "alb460" <alb460@nospam.virgilio.it> wrote in message news:054301c349db$a196b5a0$a401280a@phx.gbl... > Really dows not exists in VC++ 6.0 a Dirlist control ? > A Control that shows the tree of the directory of a given > drive. > I think that this is a common reque...

Remove menu from MDI control
I'm using VC++ 6.0 on WinXP. With an MDI control, how do I remove the menu (file, print, help, etc)? I don't want it to show in the application at all. -karen In resource editor, you can remove it from all the menus that have it. For MDI, it will appear in more than one menu. The number depends upon the number of doctemplates in your application. If you want to remove the entire menubar, see the following article in MSDN: http://support.microsoft.com/default.aspx?scid=kb;en-us;131368 -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "karen" <nothing@nospam.com>...

alphabetical list
ok...I have complied a list of my DVD collection and what I am trying to do is alphabatize the list. What problem I have when doing it is when I click sort button it always groups words like "A" and "The". I want it to ignore those words and focus on the word after "A" or "The" Create a helper column and add this formula to it =SUBSTITUTE(SUBSTITUTE(A20,"The ",""),"A ","") Then sort both columns by the helper column -- HTH Bob Phillips "Ronnie" <Ronnie@discussions.microsoft.com> wrote i...

need to know how to incorporate drop-down fields and lists
working w/ms word 2003, Designing my own webpage... want to incorporate both drop-down fields and drop-down lists, won"t let me put in the text i need??? Talk to me like i"m ten yrs. old.... new to this stuff. Thanks!!! ...

Passing control name to sub
I'm having trouble passing a MSFlexGrid control to a sub. The control name is "flxGalleries". The error is "Type Mismatch. Error '13'". I have the following code: Private Sub Form_Open (Cancel as Integer) ... do stuff ... GridSetup flxGalleries 'Call the Sub and pass the Control ... do more stuff ... End Sub Public Sub GridSetup (ByRef flxGrid As MSFlexGrid) With flxGrid ... do stuff ... End With End Sub What have I done wrong? Cheers Try: Call GridSetup(flxGalleries) 'Call the Sub and ...

Updating 2004 FI list
Does anyone know how to update Money 2004's Financial Institution list? When I check to see if my FI is online and supported, it is. When I check the Money 2004 list, it is not there. Any solutions? Thank you, any help would be great. -- Thanks, Andrew ...

How to change owner (From:) of a public folder, newsgroup post
How do I change the Owner or From: for a newsgroup post. This is a post in an Exchange 2003 public folder of type newsgroup. The posts in question are from a generic user account and I need to change it to the specific user. I tried by opening the post, choosing Edit menu -> Revise Contents, and changing the From: to the new person. But it would not save, and if I reposted it would keep the original user (poster) in the From: field (and of course it also changed the post to the current date/time). I have tried this method, to no avail, using the original user, and two different a...

Programmatically listing Relationships of ADP file
I'm fairly new to access and would like to get a listing of the relationships in the ADP file. How would I go about doing that programmatically? I haven't the first idea of where to start. I did find something that said to loop through the relationships collection, but I can't seem to find it. FWIW, I'm fairly fluent in Excel VBA. Thanks, Barb Reinhardt On Tue, 23 Mar 2010 12:30:01 -0700, Barb Reinhardt <BarbReinhardt@discussions.microsoft.com> wrote: A good start would be to open a VBA window, click the Help button, and look for Relationships...

Deleted Distribution List
Hi , LONG time Outlook user here..and I'm stumped ! I accidentally deleted a Distribution list from my Outlook 2007 contacts this afternoon. Immediately , I tried EDIT >UNDO , but it was greyed out. I searched Deleted Items in Mail ( thinking all deleted Outlook items ended up there ) and I couldn't find it. I searched Personal Folders as well ..but still no joy. I ended up recreating it , but the question remains , ..." Where did it go ?? " ( in case I do it again..) Many Thanks Next time it happens simply restore it from your backup. What, yo...

Comparing Lists in Excel
Maybe this is a really dumb question, but I can't find any useful information anywwhere else. I have two separate excel worksheets each containing one list of information. The first contains a list of all items of type x that exist in the world. The second contains a list of all the items of type x that I own (therefore the second list is a subset of the first list). What I want to be able to do is to generate a list of all items of type x that I DO NOT own. Does anyone know how to do this? Any suggestions you could offer would be greatly appreciated. Thanks. See http://...

Frustration in 'not able' to draw or paint?
Greetings :) I'm an Art Teacher in Singapore. I've been teaching Art for 7 years. Before this job, I was a Graphic Designer. However, since I was trained as a teacher, I was more exposed to Fine Arts. In fact, I've always liked to draw and paint since young. As a teacher, I've always come across students who complained, 'I can't draw!' Well, I would say, most of the times, this complaint is unvalid. I've seen how, with patience and perserverence, my students have achieved better results and are amazed at their own achievements. It is frustrating to me too, ...

How do I turn the pivot chart into a list with all cells filled?
I have the pivot chart and would like to copy and paste it so that all fields are filled Select the pivot table. Choose Edit>Copy Select the cell where you'd like to paste the copy Choose Edit>Paste Special Select Values, click OK There are instructions here for filling the blanks: http://www.contextures.com/xlDataEntry02.html gianna wrote: > I have the pivot chart and would like to copy and paste it so that all fields > are filled -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

SPAM LISTING
Is there somewhere, on the internet, a list of SPAM sender that I can use to put filtering on my Exchange 2003 server? I have started to enter theme manualy but it's a long process!!!! Thanks! Jean-Seb I am using NoSPAMProxy. It has a cool monitor where I can blacklist something with one click. "John Smith" <john.smith@aol.com> schrieb im Newsbeitrag news:j5Whc.33230$CO3.1123537@news20.bellglobal.com... > Is there somewhere, on the internet, a list of SPAM sender that I can use to > put filtering on my Exchange 2003 server? I have started to enter theme > m...

Smart List Builder install documentation include on all workstati
In the documentation for Smart List Builder install it should include that it needs to be installed on all workstations that use the shared reports dictionary. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGro...

what causes the recently used file list option to be unavailable .
Tools / Options / Recently used file list is greyed out - How do I correct this ? John You don't say which version so try searching the knowledge base http://support.microsoft.com/default.aspx With a search string of MRU Disabled in Excel -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "JohnPrice" <JohnPrice@discussions.microsoft.com> wrote in message news:ECA43906-EC33-4B92-8580-39923E449B9C@microsoft.com... > Tools / Options / Recently used file list is greyed out - How do I correct > this ? Hi! So...

PO not listed for Invoicing
We have a Drop-ship PO with status Released and Revision 0. We can view it under All Purchase Order Transaction window. But when we try to invoice it from eith View->Purchasing Lists window or POP window, it's not listed under the Vendor name. Any help is appreciated. Any chance already assigned to an Invoice Batch? -- Mick "ThongD" wrote: > We have a Drop-ship PO with status Released and Revision 0. We can view it > under All Purchase Order Transaction window. But when we try to invoice it > from eith View->Purchasing Lists window or POP window, it&...