Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Debugger Stop button redux

(1/1)

Pecan:

--- Quote from: mandrav on February 17, 2006, 03:32:47 pm ---
--- Quote from: Takeshi Miya on February 17, 2006, 03:23:00 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.

--- End quote ---

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

--- End quote ---

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: ---    ::SendMessage(GetHwnd(), TB_ENABLEBUTTON,
                  (WPARAM)tool->GetId(), (LPARAM)MAKELONG(enable, 0));

--- End code ---

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

kkez:
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?


--- Quote from: mandrav on February 17, 2006, 03:32:47 pm ---What's even more strange, is that the compiler's Stop button uses the exact same image file but it works just fine...
--- End quote ---
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...

thomas:
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...

Pecan:

--- Quote from: thomas 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...

--- End quote ---

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]

Pecan:
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]

Navigation

[0] Message Index

Go to full version