🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages Started by CapStick Fri, 25 Apr 2003 00:46
Button
#16815
Author: CapStick
Date: Fri, 25 Apr 2003 00:46
17 lines
1283 bytes
Using Win32 API free Borland Compiler

Is it possible to create a button
in a rectangle (not in a dialog)

and associating an ID to A region I guess

without creating a new window just for the button

Many thanks in advance



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
Re: Button
#16817
Author: Ed Mulroy [TeamB]
Date: Fri, 25 Apr 2003 01:35
26 lines
2005 bytes
A button IS a type of window, a class of window that is pre-defined and
whose code is part of Windows' code.  A button does not need to be in a
dialog.  It is ok to put a button in a normal (non-dialog) window.  The
button is a child of the window in which it resides and is assigned an ID
just like is done any other child window.

If you wanted to you could write code to paint the image of a button and of
its label in both the normal and depressed state, detect key clicks, hotkey
presses, detect the Enter key when you simulated that it had the focus and
send messages to the parent.  That would duplicate the action of a button
and keep you from having to create a window but it is a lot of work and for
little gain.

.  Ed

> CapStick wrote in message
> news:3ea884eb$1@newsgroups.borland.com...
>
> Using Win32 API free Borland Compiler
>
> Is it possible to create a button
> in a rectangle (not in a dialog)
>
> and associating an ID to A region I guess
>
> without creating a new window just for the button
Re: Button
#16818
Author: CapStick
Date: Fri, 25 Apr 2003 01:52
49 lines
2601 bytes
"Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org> wrote in message
news:3ea89148@newsgroups.borland.com...
> A button IS a type of window, a class of window that is pre-defined and
> whose code is part of Windows' code.  A button does not need to be in a
> dialog.  It is ok to put a button in a normal (non-dialog) window.  The
> button is a child of the window in which it resides and is assigned an ID
> just like is done any other child window.
>
> If you wanted to you could write code to paint the image of a button and
of
> its label in both the normal and depressed state, detect key clicks,
hotkey
> presses, detect the Enter key when you simulated that it had the focus and
> send messages to the parent.  That would duplicate the action of a button
> and keep you from having to create a window but it is a lot of work and
for
> little gain.
>
> .  Ed
>
> > CapStick wrote in message
> > news:3ea884eb$1@newsgroups.borland.com...
> >
> > Using Win32 API free Borland Compiler
> >
> > Is it possible to create a button
> > in a rectangle (not in a dialog)
> >
> > and associating an ID to A region I guess
> >
> > without creating a new window just for the button
>
>

My Humblest Apologies.
I should have stated that
i wished to place this button on the Title Bar
i have managed thus far to place a rectangle on the bar
 Many hanks





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
Re: Button
#16819
Author: Remy Lebeau (TeamB)
Date: Fri, 25 Apr 2003 02:05
13 lines
1452 bytes
"CapStick" <lol@ljones81.fsnet.co.uk> wrote in message
news:3ea89466@newsgroups.borland.com...

> i wished to place this button on the Title Bar

The titlebar cannot have child windows on it.  Everything must be managed
via manual drawing only.  Please refer to the "Form Title area" discussion
in the .vcl.components.using group earlier this week.  It explains some of
what is needed.


Gambit
Re: Button
#16826
Author: Ed Mulroy [TeamB]
Date: Fri, 25 Apr 2003 12:46
33 lines
2582 bytes
That is a quite different problem than what I understood you to want from
your first message.

The title bar cannot have a window and a button is a window.  It is part of
the "non-client" area of the window, the area that is managed by Windows
itself.

There is a set of messages that Windows sends to the window procedure which
relate to the title bar and other non-client areas.  Most of them begin with
WM_NC (think of the NC as Non-Client), such as WM_NCPAINT and WM_NCHITTEST.

You can elect to handle those things and paint the title bar, frame, etc
yourself.
As an alternative you could create the window to not have a title bar.
Windows will handle the drawing of the borders.  Paint a title bar yourself
in response to a WM_NCPAINT message.  Put a button in there.  When someone
clicks in the non-button area of where your version of the title bar is
painted, respond to the WM_NCHITTEST message by returning HTCAPTION so that
Windows acts in the normal click-on-title-bar fashion.  You can get the
dimensions for the title bar from a call to GetSystemMetrics.

Note that this scheme means that for any of these which you want you will
have to implement the maximize, minimize or close boxes and system menu
yourself.

.  Ed

> CapStick wrote in message
> news:3ea89466@newsgroups.borland.com...
>
> I should have stated that
> i wished to place this button on the Title Bar
> i have managed thus far to place a rectangle on the bar
Re: Button
#16731
Author: CapStick
Date: Fri, 25 Apr 2003 19:43
53 lines
2915 bytes
"Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org> wrote in message
news:3ea93061@newsgroups.borland.com...
> That is a quite different problem than what I understood you to want from
> your first message.
>
> The title bar cannot have a window and a button is a window.  It is part
of
> the "non-client" area of the window, the area that is managed by Windows
> itself.
>
> There is a set of messages that Windows sends to the window procedure
which
> relate to the title bar and other non-client areas.  Most of them begin
with
> WM_NC (think of the NC as Non-Client), such as WM_NCPAINT and
WM_NCHITTEST.
>
> You can elect to handle those things and paint the title bar, frame, etc
> yourself.
> As an alternative you could create the window to not have a title bar.
> Windows will handle the drawing of the borders.  Paint a title bar
yourself
> in response to a WM_NCPAINT message.  Put a button in there.  When someone
> clicks in the non-button area of where your version of the title bar is
> painted, respond to the WM_NCHITTEST message by returning HTCAPTION so
that
> Windows acts in the normal click-on-title-bar fashion.  You can get the
> dimensions for the title bar from a call to GetSystemMetrics.
>
> Note that this scheme means that for any of these which you want you will
> have to implement the maximize, minimize or close boxes and system menu
> yourself.
>
> .  Ed
>
> > CapStick wrote in message
> > news:3ea89466@newsgroups.borland.com...
> >
> > I should have stated that
> > i wished to place this button on the Title Bar
> > i have managed thus far to place a rectangle on the bar
>
>

Thank you for all your answers
Much Appreciated


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads