No announcement yet.

Ownerdrawn buttons..

  • Filter
  • Time
  • Show
Clear All
new posts

  • Ownerdrawn buttons..

    Here's a little something to chew on for those of you who like me,
    also like to create your own buttons: If button is made to mimic
    Flat-style, that is, when mouse hoovers over it, edges becomes
    raised. If another control then has keyboard focus and a key is
    pressed, button may freeze in up-state. Test your own code and see..

    Reason for this is because to avoid unneccesary redrawing, most of
    us set a flag for up, flat and down states. Just found and fixed
    this stupid bug in the beta of Poffs2, but tested other's samples
    and found the same thing happened there.

    Only way I found to fix this, was by using a timer (bad solution)
    or simply skip the flag, so button always is redrawn in WM_MOUSEMOVE.
    I used the later and it still looks good - no flicker. Could not find
    a way to determine when another control has focus and a key is pressed
    while mouse is over button - from within the button, that is, which is
    a must. Removing the flag was the easy solution, so I took that route..

    BTW, newest Poffs2 beta at
    I'll upload the databases today. Slow connection, have to split them up
    into "smaller" files, I think. If this latest beta works fine, I'll try
    to wrap this whole thing up tonight.