🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by Rusty Thu, 27 Mar 2003 16:05
Inheriting from TCustomComboBox
#17274
Author: Rusty
Date: Thu, 27 Mar 2003 16:05
14 lines
1563 bytes
Greetings:

I am trying to make a custom combo box that is like the TColorBox component
but has additional support for colors with alpha.  The problem I'm having is
that I can't seem to override the DrawItem method.  In my derived class, the
function declaration is the same as the one in its parent's class,
TCustomComboBox.  The declaration looks like this:

virtual void __fastcall DrawItem(int Index, const Types::TRect &Rect,
Windows::TOwnerDrawState State);

In my class, I have it declared exactly as shown above, but it never gets
called from my control.  Instead, it calls the parent class's DrawItem
method.  Any ideas what I am doing wrong?
Re: Inheriting from TCustomComboBox
#17275
Author: Rusty
Date: Thu, 27 Mar 2003 16:48
18 lines
1438 bytes
Nevermind.  I wasn't setting the Style property correctly.  If you're
curious, I was doing the following:

inherited::Style << csOwnerDrawFixed;
FStyle << cbStandardColors
           << cbExtendedColors
           << cbSystemColors;

Instead, I should have been doing this:

inherited::Style = csOwnerDrawFixed;
FStyle = FStyle.Clear( );
FStyle << cbStandardColors
          << cbExtendedColors
          << cbSystemColors;

All the Best,
Rusty
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