StringGrid (fixed)

BlitzMax Forums/BlitzMax Programming/StringGrid (fixed)

Chris C(Posted 2006) [#1]
Had a brain wave and fixed a project I did a while back

It provides a rather nice String Grid component, theres a fair bit of flexibility about how it looks.



Get it from my website.


Booticus(Posted 2006) [#2]
Bummer. It won't work for me. I compile it and it compiles with no errors, but I get nothing except a quick flash of where the MaxGUI window should be. Any clues? For the sake of brevity I emailed you the logs from BmaxIDE. :)


Chris C(Posted 2006) [#3]
Still unable to replicate the problem here...

Have you had chance to try the steps I suggested ?

I'd like to get to the bottom of this, does anyone else see this behaviour?


Scott Shaver(Posted 2006) [#4]
I can't get it to build, on XP




Chris C(Posted 2006) [#5]
looks like a problem with mingw most odd!

try cleaning out all the .bmx and recompiling?

oh btw what version of gcc are you using?


Scott Shaver(Posted 2006) [#6]
yep I had version 3.4.2 of mingw now using 3.1 and it compiles but same problem as Booticus.


Chris C(Posted 2006) [#7]
thanks for helping me track down the other issue, the new version should work for everyone now! so redownload it if you got an earlier version

Why it should have previously worked on my machine, but not others is beyond me!

@booticus do let me know, but I'm fairly sure it should work okay now (famous last words)


TeaVirus(Posted 2006) [#8]
Chris,
I just re-download and I'm having the same problem that Booticus and Scott are. The window pops up an then immediately closes.


Scott Shaver(Posted 2006) [#9]
It's working for me now.


Chris C(Posted 2006) [#10]
ARRRRRGGGGHHHHHH

so why on earth does it work for Scott and me?

you haven't got a stale .bmx folder (theres 2 of them) kicking around have you??

picked up old version from your browser/isp's cache???
(well you never know!)


popcade(Posted 2006) [#11]
@Chris

Just tried many examples on your site, those are really amazing,especially the MikMod one.

Can I use that mik dll with other languages like PureBasic? Actually, looking forward PB v4 currently.


Chris C(Posted 2006) [#12]
Yes but did the darn string grid work!!!!!

re mikmod I'd wait till Clive release the next version of MaxMod I helped him with an improvement that may eventually lead to it working on Linux too (some byte order issues still with Mac), and it sounds amazing!


popcade(Posted 2006) [#13]
Yes, StringGrid works perfectly on my Win2000(with BMax 1.16)

Would you have time take a look at MiniFMod?
http://www.fmod.org/files/minifmod160_gcc.zip
Seems to allow statically linked into the app.


kmac(Posted 2006) [#14]
As above, builds with gcc 3.2.3 but not 3.4.2.

The display is very brief.


Perturbatio(Posted 2006) [#15]
It works for me until I move the mouse over the grid. you can press a button to add things to the grid no problem, it just dies when the mouse passes over it.


Chris C(Posted 2006) [#16]
ah £$%&&£ IT! I'm flogging a dead horse here aint I?....


Perturbatio(Posted 2006) [#17]
ah £$%&&£ IT! I'm flogging a dead horse here aint I?....

Not necessarily. But it isn't looking pretty just now :)


Perturbatio(Posted 2006) [#18]
I get an "Unhandled Memory Exception Error" in debug mode with WaitEvent highlighted.
*EDIT*
I can edit the stringgrid with the keyboard, but mouseevents kill it.


Brucey(Posted 2006) [#19]
It's very pretty.

How about a Linux / Mac port ? :-)


Chris C(Posted 2006) [#20]
okay new version of the dead horse uploaded seem to work fine on perturbatio's machine *hopefully* it works for everyone else

@Brucey - you are more than welcome to port the C sources to mac ;)


TeaVirus(Posted 2006) [#21]
It works!! Thanks Chris!

Just out of curiosity, what needed fixing?


Booticus(Posted 2006) [#22]
Nice! It works now Chris! Sorry I didnt get back to you earlier. I was busy reinstalling Bmax and re compiling my modules. Glad we got it going!


Chris C(Posted 2006) [#23]
yea gods - a winner, is there a dr in the house

I'm going to run a few extended tests to check for memory leaks ( avoiding the existing maxgui leaks if I can! )

I'll let you know how I get on here...


Booticus(Posted 2006) [#24]
BTW, where can I get your fancy colored pastel looking cels in the grid?


Chris C(Posted 2006) [#25]
just use

		StringGrid1.SetOptions(..
                      SGO_VISIBLE     |..'     // grid visible
                      SGO_CELLSEL     |..'     // hilite single cell
                      SGO_ROWSEL      |..'     // hilite whole row
                      SGO_EDITABLE    |..'     // allow editing cells
                      SGO_FIXEDCOL    |..'     // show fixed column
                      SGO_FIXEDROW    |..'     // show fixed row
                      SGO_EXTENDLINES |..'     // Extends lines when
                      SGO_SHOWFOCUS   |..'     // greys out grid when focus lost
..'                   SGO_TITLE       |..'     // show a title cell at top
         		          SGO_XPSTYLE     |..'     // alternate style gradient fills  // fixed cells And selected cell
	        	          SGO_USERSIZE    |..'     // user can size columns (autosize must be off)
		                  SGO_ROWBARS     |..'     // color ever other row
..'	                  SGO_SCROLLDOT   |..'     // grid scrolled indicators
..'                   SGO_NONE        |..'     // no options set
..'                   SGO_COLSEL      |..'     // Select whole column
..'                   SGO_AUTOSIZE    |..'     // autosize columns
..'                   SGO_NUMBERROWS  |..'     // auto numbers rows
                      0)'                    // allows commenting out lines


after you have created it

There seems to be a very slight memory leak after creating and destroying a few thousand string grids
This wont be a problem for most people, but I'm looking into it


I've uploaded a new version, the memory leak is very small and only happens when making and destroying large numbers of string grids

theres a source sample sg-stress.bmx, which shows this behaviour, check the working set memory in a decent task manager, after a longish while you should see it creep up by a few KB, AFAIK you never seem to get this memory back, but I could be wrong...

I'd appreciate any contributions to the code, also if you use the string grid in a project please email me and let me know what your using it for you.


Chris C(Posted 2006) [#26]
just uploaded a new version, events are working now, new usage example (thank you to Scot Marlow)