Mail Archives: djgpp/1997/08/02/01:22:21
Daniel Mattsson <daniel DOT mattsson AT gavle DOT mail DOT telia DOT com> wrote in article
<3 DOT 0 DOT 32 DOT 19970729144506 DOT 00693058 AT m1 DOT 261 DOT telia DOT com>...
> When i run this the button behaves kinda like a checkbox, when the mouse
is
> clicked over it it changes to the pushed_button bitmap. How do i make
work
> like a normal button, so that the pushed_button bmp is displayed when the
> button is clicked and then when the button is released it will be
> overwritten with the normal_button bmp?
>
> /Daniel Mattsson
Here's the problem: according to your code, you want the pushed button
bitmap to appear when the object's D_SELECTED flag is set. To get the
result you want, you would have to clear the D_SELECTED flag after the
mouse button is released, meaning you would have to write your own handler
for MSG_CLICK.
However, there is a more fundamental problem here: if you _do_ de-select
the button after clicking it, what effect is it going to have? What is
this button meant to do?
Perhaps a better solution is to set the D_EXIT flag on the object, causing
the dialog to exit when the button is pushed. Then, process the button and
re-enter the dialog. When the dialog reappears, the button will be
deselected again, and you will get the effect you are looking for.
--Chris
---------------------------------------------------------------------------
Chris La Mantia / lamantia AT gte DOT net
Current Project: Infinite Worlds, an RPG with a dynamic world
http://home1.gte.net/lamantia/infinite
NO UNSOLICITED COMMERCIAL E-MAIL ACCEPTED
- Raw text -