Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
Application programming
Delphi
'Un'know bugs

TStringGrid + WinXP + Debug dcus + Popupmenu Pages that link to <a href="https://ozoneasylum.com/backlink?for=5720" title="Pages that link to TStringGrid + WinXP + Debug dcus + Popupmenu" rel="nofollow" >TStringGrid + WinXP + Debug dcus + Popupmenu\

Well, our application used a TStringGrid to display some products...
when the customer double clicked them, they were added to his shopping cart.
Now, she could also right click, and there would be a menu allowing 'add to cart' as well.
The Tstringgrid was set to allow only one row selected at a time, but select the whole row.

All worked fine, until one day we tried the programm under XP.

Problem: If you compiled without debug dcus (project/options/compiler/debug/) 'something' would be changing the selection from (example):
Top = 4, Bottom = 4 to top = 0, bottom = 4. This did not happen under windows 2000, NT 4, 98, 95, or ME. Only under XP. Turning on debug dcus (to debug the problem) made it go away.
Ie. there was a bug, that seemingly was fixed in the debug dcus. Now, you don't want to distribute your application with debug dcus turned on.
Therefore we had to code around it...
in the onPopup of our popupmenu,
if stringrid.selection.top = 0 (it always set it to zero), I fetched the current mousePos via getCursorPos(), turned that to a client coordinate with stringgrid.screentoClient() and changed the selection accordingly. I probably could have also set the selection's top to it's current bottom.
I also had to assign a whole TGridRect, instead of being able to set the single attributes... but that's a different story.

So long,
Tyberius Prime.

Ps: Please sent me a note (or post in here) if you encounter this problem as well... nothing could be found in google at that time.


(Added by: Tyberius Prime on Wed 11-Jun-2003)

« BackwardsOnwards »

Show Forum Drop Down Menu