May 06, 2024, 06:17:25 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Listview question

Started by billhsln, May 20, 2010, 02:06:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billhsln

Is there a way to determine a listview's row size?  Since, I can not add a graphic into a listview (at least, I don't understand how to).  I would like to put the graphic on the side of the listview.  The graphic is 80x80, so it is fairly small, but I would like the listview row to be the same size.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

A quick look didn't show me anything.

Maybe you can use SETFONT to set the fontsize so the image matches.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Bill,

Here's one I prepared earlier - well, 5 years ago, to be exact! It was written in IB Pro, but
I have calafudged it for EBasic. I wrote it to keep a visual check on our servers at work. Every
whatever minutes you set it to, it has a look to report space usage

Not all functions work now, as I don't work at the same place any longer

What it does do is show you how to have an icon in a listview, and I reckon that
is what you want. Open and compile as a Project, with all the files in the same
folder

Hope this helps,

Brian

billhsln

Thanks, Brian.  I have tried to use the program as an example.  It seems that I am doing something wrong.  Not sure exactly what.  So, I decided to upload what I have.  Maybe you or some one else here can see what I am missing or screwing up.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

It's hard to tell if I can make it work without the support files.

But as written it will never work.

You made it a dialog based application by using the createdialog command.
then you created the listview
then you started doing things to the listview
at the time you used these commands:
CONTROLCMD w1,1,@LVINSERTCOLUMN,0,"Pokemon"
CONTROLCMD w1,1,@LVSETCOLWIDTH,0,760
SENDMESSAGE w1,0x1001,0,0xD2FAFA,1 :'Set background colour
SENDMESSAGE w1,0x1024,0,0x800080,1 :'Set text colour
SENDMESSAGE w1,0x1026,0,0xD2FAFA,1 :'Set text background colour

the listview does not exists yet.

if you had used OPENWINDOW w1 then you could use those commands where you did.

you have to remember that controls in a dialog don't actually exists until you execute a SHOWDIALOG or DOMODAL.

If you insist on using a dialog then you'll have to put all that stuff inside the handler case @IDINITDIALOG

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

fasecero

Quote
If you insist on using a dialog then you'll have to put all that stuff inside the handler case @IDINITDIALOG

Correct, or you can place SHOWDIALOG w1 at the beginning of the code.


billhsln

I was doing it in a Window (w1) but it was not displaying the Icons.  So I thought that it might require the screen being a DIALOG, so I switched it.  Will put it back to being a window and see what happens.

Thanks,
Bill
When all else fails, get a bigger hammer.

billhsln

Changed back to a Window, but the Icons still do not display.  I am attaching a short setup.  This has the first 10 icons and the csv file I use as input.  This should be enough data to test what I have done.

Any help will be appreciated.  I must be doing some thing wrong compared to the example, I just don't see it.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

Right off the bat your icon names in the pics directory are 3 digits followed by ".ico"
This line:pokepic[i] = LOADIMAGE(getstartpath + "pics\\" + flds[0] + ".ico",@IMGICON)
is trying to load files with the following names:
Quote001-Bulbasaur.ico
002-Ivysaur.ico
etc.

with the icon names you posted  I changed this line:pokepic[i] = LOADIMAGE(getstartpath + "pics\\" + flds[0] + ".ico",@IMGICON)to this:pokepic[i] = LOADIMAGE(getstartpath + "pics\\" + left$(flds[0],3) + ".ico",@IMGICON)and the images appeared just like they are suppose to.

Also, in what you posted, lose the SHOWDIALOG w1 line.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

Thanks, Larry.  I have been looking at this for a while and totally missed the fact that I was not pulling the correct file names.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

No problem.  Was an easy find once you posted the data to run it.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

It seems I was trying to hard to figure out what was wrong and totally missed something simple.  I was just too close to the problem.

Thanks again, Larry.  At least now I can keep going.  Will upload this one when I get it done.  It is a simpler version of my Pokemon Catalog program.

Take care,
Bill
When all else fails, get a bigger hammer.

Brian

Having eight grandchildren, I should really be in the know . . . but I never
knew what Pokemon really meant

Then I learned it was just a made-up word for Pocket Monster - what a letdown!

Brian

LarryMc

Quote from: billhsln on May 23, 2010, 12:16:30 PM
It seems I was trying to hard to figure out what was wrong and totally missed something simple.  I was just too close to the problem.
You can tell from some of my past post that I have exactly the same problem real often. ;)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library