🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13533

Re: Get style of a button

#13533
From: Remy Lebeau (TeamB)
Date: Wed, 08 Oct 2003 17:32
31 lines
2352 bytes
"husonov" <husonov@borland.com> wrote in message
news:3f83ae37@newsgroups.borland.com...

> How can I know mathematically/logically that someone had specified
> BS_DEFPUSHBUTTON, BS_CHECKBOX, BS_RADIOBUTTON,
> etc. in the dwStyle parameter?

The same as with any style - use the bitwise AND operator.  The styles are
always combined with bitwise OR to begin with, so bitwise AND is the way to
reverse it:

    if( dwStyle & BS_DEFPUSHBUTTON )
    if( dwStyle & BS_CHECKBOX )
    ...

It does not matter that the styles are not powers of 2.  That just means
that certain styles occupy multiple bits instead of single bits, that's all.
When a given multi-bit style is specified, the window checks for that
condition (if it supports multi-bit styles) and sees that all of the
necessary bits are present so that particular style is applied, otherwise
the individual styles accompanying the single bits that are actually present
are used instead.  For the most part, styles are single-bit, yes.  But that
limits a window to only 32 possible styles then.  If a given control needs
more than 32 styles, then it has to start supporting multi-bit styles and
testing for overlapped bits when appropriate.  Otherwise, some functionality
has to be moved out of styles and into functions instead to manipulate the
window differently.


Gambit
Technical Details
Message-ID: <3f8449db@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f83ae37@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f25c939140529f26
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-08 10:44:06 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f83ae37@newsgroups.borland.com>
Subject: Re: Get style of a button
Date: Wed, 8 Oct 2003 10:32:52 -0700
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.137.75
Message-ID: <3f8449db@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1065634267 67.22.137.75 (8 Oct 2003 10:31:07 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail