Buttons with Icons - In Dialog editor
-
Hi people ! Just stopped to ponder if Microsoft actually missed this critical point in their designs: is it really impossible to specify the icon or bitmap of a button in a dialog template beforehand ? Must I use run-time creation of a button and splat the icon over it in there ? And is there a method to size the button to it's contents ? At least I can't find an option in the preferences of a button control to specify it's icon.. Very odd.. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.
-
Hi people ! Just stopped to ponder if Microsoft actually missed this critical point in their designs: is it really impossible to specify the icon or bitmap of a button in a dialog template beforehand ? Must I use run-time creation of a button and splat the icon over it in there ? And is there a method to size the button to it's contents ? At least I can't find an option in the preferences of a button control to specify it's icon.. Very odd.. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.
- "Just stopped to ponder..." No I do not think micosoft missed a critical point. Remeber that icons and bitmaps basicaly did not exist when the first version of Windows was created. Both Microsoft and Apple (and who ever) had to creat the specifications before they (existed) could be used. Now they could have changed the format for the dialog template class to include icon/bitmap for the buttons (for all I know they did). 2) "And is there a method to size the button to it's contents " I have notice that some controls do adjust them selfs to it's contents (this may be an MFC thing). I recommend that you look at "The Win32 Foundation Classes" by Sam Blackburn here at code project. I know there are other articles out there on this subject (maybe at programmerhaven.com). INTP
-
Hi people ! Just stopped to ponder if Microsoft actually missed this critical point in their designs: is it really impossible to specify the icon or bitmap of a button in a dialog template beforehand ? Must I use run-time creation of a button and splat the icon over it in there ? And is there a method to size the button to it's contents ? At least I can't find an option in the preferences of a button control to specify it's icon.. Very odd.. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.
Hi I subclassed Cimage and put a handler in it for mouse clicks. Best Wishes, ez_way
-
- "Just stopped to ponder..." No I do not think micosoft missed a critical point. Remeber that icons and bitmaps basicaly did not exist when the first version of Windows was created. Both Microsoft and Apple (and who ever) had to creat the specifications before they (existed) could be used. Now they could have changed the format for the dialog template class to include icon/bitmap for the buttons (for all I know they did). 2) "And is there a method to size the button to it's contents " I have notice that some controls do adjust them selfs to it's contents (this may be an MFC thing). I recommend that you look at "The Win32 Foundation Classes" by Sam Blackburn here at code project. I know there are other articles out there on this subject (maybe at programmerhaven.com). INTP
Thank you for your answer. However, I think you've misunderstood me here. As far as I know, Windows 95 did support bitmapped/iconed buttons already, at least the requirement for the
SetIcon
method of CButton requires Windows 95 or later. I somehow find it an impossible idea that someone would still develop software for Windows 3.11 or earlier. When you edit a button's properties, there is a possibility to specify the flag BS_ICON or BS_BITMAP for it. But there lacks a field to specify the resource used for this button. I ended up into a solution to create one icon control, and specify the sizes of the buttons according to that. Then I used theSetIcon
method to load & specify the icon resource for the button during the creation of the dialog. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible. -
Thank you for your answer. However, I think you've misunderstood me here. As far as I know, Windows 95 did support bitmapped/iconed buttons already, at least the requirement for the
SetIcon
method of CButton requires Windows 95 or later. I somehow find it an impossible idea that someone would still develop software for Windows 3.11 or earlier. When you edit a button's properties, there is a possibility to specify the flag BS_ICON or BS_BITMAP for it. But there lacks a field to specify the resource used for this button. I ended up into a solution to create one icon control, and specify the sizes of the buttons according to that. Then I used theSetIcon
method to load & specify the icon resource for the button during the creation of the dialog. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible."impossible idea that someone would still develop software for Windows 3.11 or earlier" Not develop, but maintain/add functionality. It was not until this last year that they finaly allowed me convert it to Win32 (95 or later). I've been writting software since before windows existed. As for button properties, may be it was just there way of resource code changes. After all adding a couple of new bit flags is simple and should not break any of the existing programs. Microsofts development teams do seem to have good reasons for most of the things they do, it is just hard to figure out (at times) what those reasons where. A lot of what they did was neccesary to avoid breaking old code and make it easier to convert old 16 bit Windows code to 32 bit Windows code. You'll notice that there are many references like "This is included to support... When developing for Win32 you should funcX". INTP