Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Buttons with Icons - In Dialog editor

Buttons with Icons - In Dialog editor

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Antti Keskinen
    wrote on last edited by
    #1

    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.

    J B 2 Replies Last reply
    0
    • A Antti Keskinen

      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.

      J Offline
      J Offline
      John R Shaw
      wrote on last edited by
      #2
      1. "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
      A 1 Reply Last reply
      0
      • A Antti Keskinen

        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.

        B Offline
        B Offline
        BaldwinMartin
        wrote on last edited by
        #3

        Hi I subclassed Cimage and put a handler in it for mouse clicks. Best Wishes, ez_way

        1 Reply Last reply
        0
        • J John R Shaw
          1. "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
          A Offline
          A Offline
          Antti Keskinen
          wrote on last edited by
          #4

          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 the SetIcon 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.

          J 1 Reply Last reply
          0
          • A Antti Keskinen

            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 the SetIcon 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.

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            "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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups