swift-win32 icon indicating copy to clipboard operation
swift-win32 copied to clipboard

Change `Button` to owner drawn class

Open compnerd opened this issue 3 years ago • 2 comments

Convert the Button implementation to use an owner drawn button. This should allow for changing the button to include an image and title simultaneously. Additionally, it would allow for embedding a Label and ImageView members which can then be made available to the user to control the button more thoroughly.

compnerd avatar May 22 '21 04:05 compnerd

Last few days I am playing with BS_OWNERDRAW on Button, and while my drawing code works (for background, border and text colors), I am having issues with passing Button ref to the WndProc which handles the drawing of the Button.

I can't promise anything at the moment.

h4cky avatar Jun 08 '21 11:06 h4cky

Ah, you mean the reference to the Button instance? You cannot do that directly; the way to accomplish that is by squirreling away the pointer into GWLP_USERDATA. There are a couple of examples of that in the tree already.

compnerd avatar Jun 09 '21 03:06 compnerd