Author Topic: Debugger Stop button redux  (Read 3575 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2150
Debugger Stop button redux
« on: March 29, 2006, 10:14:06 pm »
No, it happens for example in the Stop button of the Debugger's toolbar. It is always red, where it should be grayed out when there is no debugging session. Sometimes happens for others buttons, like Search.
It only happens on Windows though.

What's even more strange, is that the compiler's Stop button uses the exact same image file but it works just fine...

I've spent a day tracing through wxWidgets, trying to discern the behavior difference between
the compiler stop toolbar button and the debugger button.

Guess what; there is none. Every line of code executed for one is the same for the other.
The difference has to be in  XP when the statement
Code: [Select]
    ::SendMessage(GetHwnd(), TB_ENABLEBUTTON,
                  (WPARAM)tool->GetId(), (LPARAM)MAKELONG(enable, 0));

is issued in tbar95.cpp:void wxToolBar::DoEnableTool(wxToolBarToolBase *tool, bool enable).

So the problem must be in the way XP sees the toolbar bitmap.

So.. I spent another day mangling the toolbar.

If the bitmap is  first in the sequence of bitmaps it works correctly.



If the .png is edited in any way, it works in it's own place. I think, because my editing removes the transparency.
I don't know how to put transparency back after editing the .png



So.. there seems to be a solution here.

Anyone have any suggestions as to where I should look next?

thanks
pecan
« Last Edit: March 30, 2006, 01:28:58 am by Pecan »

Offline kkez

  • Almost regular
  • **
  • Posts: 153
    • WinapiZone
Re: Debugger Stop button redux
« Reply #1 on: March 30, 2006, 04:36:16 pm »
TB_ENABLEBUTTON doesn't gray the image (if any) - it just disable the button.

Maybe it's the image itself that cannot be grayed by code... how the image is grayed?

What's even more strange, is that the compiler's Stop button uses the exact same image file but it works just fine...
For me, the menu items that uses that image aren't grayed. The toolbar debugger abort button is not grayed, but the compiler abort button is. Again, maybe it's just the image, you tried to change it Pecan, and it works...
« Last Edit: March 30, 2006, 04:43:00 pm by kkez »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Debugger Stop button redux
« Reply #2 on: March 30, 2006, 07:17:33 pm »
Unluckily, it is not quite so easy. First, the "stop" button is not the only one, the "next instruction" button is not greyed, either (it is hard to see, since it is only black on transparent). All other icons have transparency, too, although most use 8 Bit indexed /matte, and the "stop" button uses 32 bit rgba. For all others, transparency works just normal.

I tried converting both buttons in question to 8 Bit with and without matte using ImageMagick, and it did not make the slightest difference. I compared the XRC files, the only difference between compiler and debugger is that the compiler's "stop" button starts disabled by XRC. I tried that too, does not change anything.
I looked at the source (maybe the wrong tool was being disabled?) and found nothing. Everything is just fine. Both buttons are exactly identical, and they are handled in the exact same way. Yet they look different...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2150
Re: Debugger Stop button redux
« Reply #3 on: March 30, 2006, 10:19:20 pm »
Unluckily, it is not quite so easy. First, the "stop" button is not the only one, the "next instruction" button is not greyed, either...

Ok, I spent another day with the debugger .png's
Find attached "dbgrun.png" that solves the problem with
it, and all the following png's.

I had to make the "paper" transparent, set a stray red pixel,
and color the black to red. XP is picking up on these colors
to do xor's or some wierdness.

The stray pixel has to remain, or this solution won't work.




thanks
pecan

EDIT: Attached is the 22x22 dbgrun.png image


[attachment deleted by admin]
« Last Edit: March 31, 2006, 02:29:18 am by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2150
Re: Debugger Stop button redux
« Reply #4 on: March 31, 2006, 02:22:18 am »
Please find attached the 16x16 .png image of dbgrun.png that solves the
"debugger buttons not being greyed out" when disabled problem.





thanks
pecan


[attachment deleted by admin]
« Last Edit: March 31, 2006, 02:34:23 am by Pecan »