"Push like" radio buttons in Windows 7

Discussion in 'C Programming' started by Marcus, Feb 21, 2012.

  1. Marcus

    Marcus Guest

    Hi

    In my c++ project I have a group of radio buttons. All of them have
    got the "Push like" property set to true. Every button has also got an
    icon on it instead of text. These radio buttons works fine in XP but
    in Windows 7 the clicked button does not appear pushed. There is no
    way of seeing which button is selected. Now if I remove the icons from
    the radiobuttons then I can see which one is selected because it gets
    a different color than the un-selected.

    I could not find any solution to this on the Internet, but I doubt I
    am the only one having this problem.

    Please help, what is wrong here?
    Marcus, Feb 21, 2012
    #1
    1. Advertising

  2. Please check the Windows API for windows.
    Also X-windows programming in unix or linux programming.
    88888 Dihedral, Feb 21, 2012
    #2
    1. Advertising

  3. In article <>,
    Marcus <> wrote:
    >Hi
    >
    >In my c++ project I have a group of radio buttons. All of them have
    >got the "Push like" property set to true. Every button has also got an
    >icon on it instead of text. These radio buttons works fine in XP but
    >in Windows 7 the clicked button does not appear pushed. There is no
    >way of seeing which button is selected. Now if I remove the icons from
    >the radiobuttons then I can see which one is selected because it gets
    >a different color than the un-selected.
    >
    >I could not find any solution to this on the Internet, but I doubt I
    >am the only one having this problem.
    >
    >Please help, what is wrong here?
    >


    You've defiitely come to the right place. People here will be glad to help.

    --
    > No, I haven't, that's why I'm asking questions. If you won't help me,
    > why don't you just go find your lost manhood elsewhere.


    CLC in a nutshell.
    Kenny McCormack, Feb 21, 2012
    #3
  4. On Feb 21, 2:55 pm, Marcus <> wrote:
    > Every button has also got an
    > icon on it instead of text. These radio buttons works fine in XP but
    > in Windows 7 the clicked button does not appear pushed.
    >

    Unfortunately there's not much you can do in C/C++ if a library
    function in something like a windowing system doesn't work correctly.
    (That's also the case for most languages).

    The real answer is to get the source code of the radio button object
    and fix it. But that entails a whole new version of the SDK, maybe a
    new version of Windows. It's not worth it for something as small as
    that.
    The other answer is to apply a patch in code. This is also difficult,
    because of object encapsulation. You can probably hack the button
    class code, obtain the window handle, intercept the WM_PAINT message,
    and draw a black border to indicate "pushed". But it's a nasty
    solution, and might break in the next version of the SDK.

    Another alternative is to knock up your own radio buttons. This would
    take me about a day's work to do. The problem is they won't have all
    the functionality of the built-in radio buttons. But they should work
    well enough to provide radio buttons for your particular application.
    This solution breaks down if you're using fancy C++ object hierarchies
    that need the genuine MS Button class beneath them, but it will work
    well enough for most code.

    The best solution is to find a workaround. Maybe you can reset the
    radio button's icon to a pushed in one when it's in state "pushed".
    This is cluntzy, but it's the least bad answer.
    Malcolm McLean, Feb 21, 2012
    #4
  5. Marcus <> writes:
    > In my c++ project I have a group of radio buttons.

    [...]

    This is not the best place to ask.

    First of all, this newsgroup discusses C, not C++.

    Second, the C++ newsgroups focus on portable C++ programming.
    Things like radio buttons are closely tied to the OS and/or GUI
    framework you're using.

    If you're using the Win32 API, comp.os.ms-windows.programmer.win32
    is probably a good place to ask. If not, try a newsgroup or
    other forum that deals with whataver framework you're using.
    (stackoverflow.com might be a good choice.)

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Feb 21, 2012
    #5
  6. Marcus

    Marcus Guest

    On 21 Feb, 17:54, Malcolm McLean <>
    wrote:
    > On Feb 21, 2:55 pm, Marcus <> wrote:> Every button has also got an
    > > icon on it instead of text. These radio buttons works fine in XP but
    > > in Windows 7 the clicked button does not appear pushed.

    >
    > Unfortunately there's not much you can do in C/C++ if a library
    > function in something like a windowing system doesn't work correctly.
    > (That's also the case for most languages).
    >
    > The real answer is to get the source code of the radio button object
    > and fix it. But that entails a whole new version of the SDK, maybe a
    > new version of Windows. It's not worth it for something as small as
    > that.
    > The other answer is to apply a patch in code. This is also difficult,
    > because of object encapsulation. You can probably hack the button
    > class code, obtain the window handle, intercept the WM_PAINT message,
    > and draw a black border to indicate "pushed". But it's a nasty
    > solution, and might break in the next version of the SDK.
    >
    > Another alternative is to knock up your own radio buttons. This would
    > take me about a day's work to do. The problem is they won't have all
    > the functionality of the built-in radio buttons. But they should work
    > well enough to provide radio buttons for your particular application.
    > This solution breaks down if you're using fancy C++ object hierarchies
    > that need the genuine MS Button class beneath them, but it will work
    > well enough for most code.
    >
    > The best solution is to find a workaround. Maybe you can reset the
    > radio button's icon to a pushed in one when it's in state "pushed".
    > This is cluntzy, but it's the least bad answer.


    Thanks for answering, if no other solution comes into mind maybe I
    will resort to what you suggests (the change icon way).
    Marcus, Feb 22, 2012
    #6
  7. Marcus

    Marcus Guest

    On 21 Feb, 23:25, Keith Thompson <> wrote:
    > Marcus <> writes:
    > > In my c++ project I have a group of radio buttons.

    >
    > [...]
    >
    > This is not the best place to ask.
    >
    > First of all, this newsgroup discusses C, not C++.
    >
    > Second, the C++ newsgroups focus on portable C++ programming.
    > Things like radio buttons are closely tied to the OS and/or GUI
    > framework you're using.
    >
    > If you're using the Win32 API, comp.os.ms-windows.programmer.win32
    > is probably a good place to ask.  If not, try a newsgroup or
    > other forum that deals with whataver framework you're using.
    > (stackoverflow.com might be a good choice.)
    >
    > --
    > Keith Thompson (The_Other_Keith)  <http://www.ghoti.net/~kst>
    >     Will write code for food.
    > "We must do something.  This is something.  Therefore, we must do this."
    >     -- Antony Jay and Jonathan Lynn, "Yes Minister"


    Thanks for not just giving me a hard time for asking in the wrong
    group, but actually point me to a better suited one. I will try
    posting in that one instead.
    I guess what I am looking for is something like an XP style of the
    radiobutton. I remember using something like that some time ago when
    having problems with different behaviour of an open file dialog in XP/
    win7. That, I solved by simple using the old style of dialog even on
    Win7.
    Marcus, Feb 22, 2012
    #7
  8. 在 2012å¹´2月22日星期三UTC+8下åˆ3æ—¶08分48秒,Marcus写é“:
    > On 21 Feb, 23:25, Keith Thompson <> wrote:
    > > Marcus <> writes:
    > > > In my c++ project I have a group of radio buttons.

    > >
    > > [...]
    > >
    > > This is not the best place to ask.
    > >
    > > First of all, this newsgroup discusses C, not C++.
    > >
    > > Second, the C++ newsgroups focus on portable C++ programming.
    > > Things like radio buttons are closely tied to the OS and/or GUI
    > > framework you're using.
    > >
    > > If you're using the Win32 API, comp.os.ms-windows.programmer.win32
    > > is probably a good place to ask.  If not, try a newsgroup or
    > > other forum that deals with whataver framework you're using.
    > > (stackoverflow.com might be a good choice.)
    > >
    > > --
    > > Keith Thompson (The_Other_Keith)  <http://www.ghoti.net/~kst>
    > >     Will write code for food.
    > > "We must do something.  This is something.  Therefore, we must do this."
    > >     -- Antony Jay and Jonathan Lynn, "Yes Minister"

    >
    > Thanks for not just giving me a hard time for asking in the wrong
    > group, but actually point me to a better suited one. I will try
    > posting in that one instead.
    > I guess what I am looking for is something like an XP style of the
    > radiobutton. I remember using something like that some time ago when
    > having problems with different behaviour of an open file dialog in XP/
    > win7. That, I solved by simple using the old style of dialog even on
    > Win7.


    OK, check SMDL and the open source GMP for image processing.

    These two packages are most written in C and support an object
    interface layor for cross platform GUIs in different Oses.
    88888 Dihedral, Feb 22, 2012
    #8
  9. 88888 Dihedralæ–¼ 2012å¹´2月23日星期四UTC+8上åˆ3時05分53秒寫é“:
    > 在 2012å¹´2月22日星期三UTC+8下åˆ3æ—¶08分48秒,Marcus写é“:
    > > On 21 Feb, 23:25, Keith Thompson <> wrote:
    > > > Marcus <> writes:
    > > > > In my c++ project I have a group of radio buttons.
    > > >
    > > > [...]
    > > >
    > > > This is not the best place to ask.
    > > >
    > > > First of all, this newsgroup discusses C, not C++.
    > > >
    > > > Second, the C++ newsgroups focus on portable C++ programming.
    > > > Things like radio buttons are closely tied to the OS and/or GUI
    > > > framework you're using.
    > > >
    > > > If you're using the Win32 API, comp.os.ms-windows.programmer.win32
    > > > is probably a good place to ask.  If not, try a newsgroup or
    > > > other forum that deals with whataver framework you're using.
    > > > (stackoverflow.com might be a good choice.)
    > > >
    > > > --
    > > > Keith Thompson (The_Other_Keith)  <http://www.ghoti.net/~kst>
    > > >     Will write code for food.
    > > > "We must do something.  This is something.  Therefore, we must do this."
    > > >     -- Antony Jay and Jonathan Lynn, "Yes Minister"

    > >
    > > Thanks for not just giving me a hard time for asking in the wrong
    > > group, but actually point me to a better suited one. I will try
    > > posting in that one instead.
    > > I guess what I am looking for is something like an XP style of the
    > > radiobutton. I remember using something like that some time ago when
    > > having problems with different behaviour of an open file dialog in XP/
    > > win7. That, I solved by simple using the old style of dialog even on
    > > Win7.

    >
    > OK, check SMDL and the open source GMP for image processing.


    I typed it wrong again. Check GIMP and GTK.
    >
    > These two packages are most written in C and support an object
    > interface layor for cross platform GUIs in different Oses.
    88888 Dihedral, Feb 23, 2012
    #9
  10. Marcus

    Shao Miller Guest

    On 2/22/2012 02:08, Marcus wrote:
    > I guess what I am looking for is something like an XP style of the
    > radiobutton. I remember using something like that some time ago when
    > having problems with different behaviour of an open file dialog in XP/
    > win7. That, I solved by simple using the old style of dialog even on
    > Win7.
    >


    You could potentially find out how wxWidgets does their magic when
    deriving buttons from the OS or underlying GUI. The source code is
    available.
    Shao Miller, Feb 25, 2012
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott D Johnson
    Replies:
    1
    Views:
    1,050
    Scott D Johnson
    Sep 27, 2006
  2. Jan C. Faerber
    Replies:
    0
    Views:
    613
    Jan C. Faerber
    Jun 30, 2009
  3. Marcus
    Replies:
    4
    Views:
    391
    Marcus
    Feb 22, 2012
  4. Dr. Leff
    Replies:
    3
    Views:
    282
    David Mark
    Oct 15, 2007
  5. Dr. Leff
    Replies:
    3
    Views:
    212
    David Mark
    Oct 15, 2007
Loading...

Share This Page