Article View: comp.os.os2.programmer
Article #3245Re: Putting Icons onto pushbuttons ?
From: BAKER,Gavin
Date: Mon, 04 Jan 1993 04:20
Date: Mon, 04 Jan 1993 04:20
46 lines
2573 bytes
2573 bytes
In <1992Dec29.171040.955@panix.com> os2man@panix.com writes: > In <1992Dec29.125326.5216@ugle.unit.no> benji@Lise.Unit.NO (Jrn Norheim) writes: > > >I am trying to make a PM application that use pushbuttons quite heavily. I > >would like to put Icons or Bitmaps onto these buttons, but I have not figured > >out quite how to do this. I would prefer to attach the Icons or Bitmaps > >to the button without having to make a userbutton and catching the BN_PAINT > >message. > > >If anyone could help me with this problem, I would appreciate it very much. > > The only way to do this is to make it/them userbutton(s) as you described. > Of course, I could be wrong (and would appreciate a correction, if so). > > Cheers, > Q > -- > "If you choose not to decide, you | "My other body is in the shop" - seen > still have made a choice" - Rush | on a T-shirt > ------------------------------------------------------------------------ I have been through the PM Ref online docs, as I needed to do the same thing, and unsuccessfully tried to use the BS_ICON flag. Using a BS_ICON style button, I had to use the pCtlData in WinCreateWindow filling the BTNCDATA with the appropriate data. This seemed to fail no matter what I did. So, I wrote my own button. It handles text and bitmaps, and can also be two-state (for a toggle), which was something else I needed. It wasn't that hard, really. If you're interested, I can mail you sample code. Also, have a look at the MMPM toolkit. (I found this out _after_ I'd written my own BUTTON control). IBM have implemented a Bitmap button which handles text, icons, bitmaps, and animations, as well as two-states. Exactly what I needed, but until MM is included with the base product, I can't use it. Still, once 2.1 comes out it should be included, which will make things a lot easier. Hope this helps! Gavin ------ demogrb@lust.latrobe.edu.au .sig under construction
Technical Details
Message-ID:
<1993Jan4.042045.8301@lugb.latrobe.edu.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!ucsvc.ucs.unimelb.edu.au!lugb!newsReferences:
<1992Dec29.125326.5216@ugle.unit.no> <1992Dec29.171040.955@panix.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!ucsvc.ucs.unimelb.edu.au!lugb!news Newsgroups: comp.os.os2.programmer Subject: Re: Putting Icons onto pushbuttons ? Message-ID: <1993Jan4.042045.8301@lugb.latrobe.edu.au> From: DEMOGRB@LUST.LATROBE.EDU.AU (BAKER,Gavin) Date: Mon, 4 Jan 1993 04:20:45 GMT Sender: news@lugb.latrobe.edu.au (USENET News System) References: <1992Dec29.125326.5216@ugle.unit.no> <1992Dec29.171040.955@panix.com> Organization: La Trobe University In-Reply-To: os2man@panix.com's message of 29 Dec 92 17:10:40 GMT X-News-Reader: VMS NEWS 1.24 Lines: 47