Can someone please help fixing a listbox bug?

BlitzMax Forums/MaxGUI Module/Can someone please help fixing a listbox bug?

Grisu(Posted 2007) [#1]
Hello!

There's a listbox bug that causes the listbox items to completely disappear or to shift downwards when you resize / maximize / minimize a window. The bug isn't fixed in the axe module. It is said to exist since b+.

The only workaround found so far is to delete and recreate the listbox each time the window size is touched. Easy if you have one short listbox in your app. But not if you use tons of them with dozens of entries.

Bug reports and example codes:
http://www.blitzbasic.com/Community/posts.php?topic=64433
http://www.blitzbasic.com/Community/posts.php?topic=69056

Any other ideas, how to solve this issue?

Grisu

P.S.:
I'm really sorry to make this call, but the bug "destroys" my app I have been working on for 1,5 years. :/


DavidDC(Posted 2007) [#2]
I tried both sets of code and I can't seem to recreate in Leopard (Intel).

Those large icons you provided don't space correctly though. They end up on top of each other. When replaced with smaller icons all is fine.

- David


Grisu(Posted 2007) [#3]
Thanks for your help. This bug only occours under Win32!

Can you post a screenshot?


SebHoll(Posted 2007) [#4]
There's a listbox bug that causes the listbox items to completely disappear or to shift downwards when you resize / maximize / minimize a window. The bug isn't fixed in the axe module. It is said to exist since b+.

Hi Grisu,

I've been helping with the Axe.Win32MaxGUI development recently, so I thought I'd take a look at your problem. It appears that this is actually a *Windows* bug that occurs when LVM_SETCOLUMNWIDTH is called when responding to a WM_SIZE, or WM_WINDOWPOSCHANGING message. Anyway, it's a quick fix, so once I've finished off the other stuff in my release, I'll send it off to BRL for public consumption. Please stand by!


DavidDC(Posted 2007) [#5]


I don't think this overlapping is a MaxGui bug. I'm pretty sure Leopard is more strict than its predecessors re maximum gui object sizes.

Out of interest, why do you load the icons this way?

LoadIconStrip(MaskPixmap(LoadPixmap("icons.jpg"),-1,-1,-1))

couldn't you just

LoadIconStrip("icons.jpg") ? Probably a silly question - I've never worked with pixmap masks.

[edit: thanks Seb - I really appreciate all this great win32 gui work you are doing!]

- David


Grisu(Posted 2007) [#6]
@Seb: Thanks a lot for looking into this. Quick fix? Sounds to easy to be true... :) Will you patch the normal guimodule as well or only the axe one?

@David:
LoadIconStrip(MaskPixmap(LoadPixmap("icons.jpg"),-1,-1,-1))

By using "Loadpixmap" you gain some extra milliseconds when loading images as this is an internal function bmx uses. If you know what images your app will eat, you can also use "LoadpixmapPNG" or "LoadpixmapJPEG".

The "maskimage" part is needed to to mask it -1,-1,-1. By default bmx uses 0,0,0 (i.e. black). My icons have black borders, I don't need to mask them at all, so this workaround.



The iconsize does not matter, the bug will occour anyway,
I'm using big icons (96x96) and small ones on my list (16x16). See image above.


Grisu(Posted 2007) [#7]
@Seb: Is it possible to "force" a listbox NOT to use an horizontal slidebar at all (even if the items inside are larger than the listbox width)?


SebHoll(Posted 2007) [#8]
Will you patch the normal guimodule as well or only the axe one?

Well, I'm only working on the new module, though the fix is easy to add to the old one. I suppose it's up to Skid whether he adds it or not...

@Seb: Is it possible to "force" a listbox NOT to use an horizontal slidebar at all (even if the items inside are larger than the listbox width)?

Sorry, but the Windows API doesn't support the selective removal of just one of the scroll-bars - you can only remove both.


Grisu(Posted 2007) [#9]
Thanks for the explanation. Didn't know that.

Can one just copy the fix over to the old module by hand?
Or are there tons of changes needed?

The axe module in the last beta release is still far away from being done (especially parent / child window support is missing)...


SebHoll(Posted 2007) [#10]
The axe module in the last beta release is still far away from being done (especially parent / child window support is missing)...

I know that there are still a few things left to do, but it should be nearing completion. What version are you using? Skid uploaded v1.36 of Win32MaxGUIEx a day or so ago that was quite a major release... If that was the version you are referring to and it hasn't fixed your child window problems, please can you post some code that demonstrates the exact problems you are having, and I'll have a look...

Thanks


Grisu(Posted 2007) [#11]
I'm using MaxGuiWin32: "Version: 1.36" and axe module: "Version: 0.34" and was refering to the axe module.

Will try to dig up short example codes. Somewhat over the weekend, as I'm busy atm.

Issues that I recognised for me:
- Multiple canvas in child and parent windows affecting each other when drawing to them.
- Child windows showing up "behind" the parent window instead of in front of it (only when the parent window is maximized?!).
- SetGadgetLayout on textareas not acting accordingly when maximizing a window.
- icon files (import objectfile.o) not used as windows icon anymore.

Thanks for all the hard work you put into this.


DavidDC(Posted 2007) [#12]
Re:

>LoadIconStrip(MaskPixmap(LoadPixmap("icons.jpg"),-1,-1,-1))

Thanks for explaining!

- David


SebHoll(Posted 2007) [#13]
axe module: "Version: 0.34" and was refering to the axe module

Yeah, the latest Axe.Win32MaxGUI version is now 0.36, which is available via SVN (although its name has changed to MaxGUI.mod/Win32MaxGUIEx.mod). Let me know, which of the problems still exist with this version...

Btw, the problem with importing ".o" object files is something to do with program linking (as oppose to the module), so as a temporary fix, you could comment out the Import "resource.o" or Import "xpmanifest.o" from the top of win32maxguiex.bmx if you want to use your own (however, this will disable XP themes if a manifest file isn't included in your own object file).


Grisu(Posted 2007) [#14]
I'd really love to help / test, but I failed getting svn up and running.

May be because I'm only an ordinary, dumb bmx user...

Why not just upload it to the axe mod server, so that one can download / compile and run it easily?


SebHoll(Posted 2007) [#15]
I'd really love to help / test, but I failed getting svn up and running.

I was a bit daunted at the idea of using SVN at first, but if you download TortoiseSVN for Windows, after the initial set-up you can download (I think it's called 'checkout' in SVN langauge) any code updates simply by right-clicking on your installation folder in Windows Explorer, and selecting SVN Update from the context menu. It's working brilliantly on my main Vista PC! ;-)


Grisu(Posted 2007) [#16]
Thanks again Seb.

Installed and still failed to sync the directories.



Could you e-mail me a plain zip file with the updated module?


SebHoll(Posted 2007) [#17]
Could you e-mail me a plain zip file with the updated module?

You aren't giving up that easily are you? ;-)

In TortoiseSVN, you shouldn't specify the folder you want to download to in the URL (it already knows this - you only need to specify the path if you were calling a command-line based SVN program that isn't integrated into the shell).

So basically, do what you did but don't add the folder onto the end, i.e. when entering the repository URL, just use:

http://www.blitzbasic.com:81/svn/maxgui/dev/maxgui.mod/

You can either delete your current maxgui.mod folder and start again, or right-click, and under the TortoiseSVN sub-menu, select Relocate, making sure to use the exact URL I have given above...


Grisu(Posted 2007) [#18]
Still doesn't work. TortoiseSVN says the name is vaild, but no data was found?



Can browse the http://www.blitzbasic.com:81/svn dir by hand, but can't find the module?