BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TDBNavigator in Studio 2006

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Lance Robaldo
Guest





PostPosted: Wed Feb 15, 2006 10:03 pm    Post subject: TDBNavigator in Studio 2006 Reply with quote



We just upgraded from BCB6 to BCB Studio 2006.

I have a project with a TDBNavigator in it. I'm trying to programatically
set the buttons that I want to be visible.

The code is as follows:

NavBar->VisibleButtons =TButtonSet() << nbFirst << nbPrior << nbNext <<
nbLast << nbInsert << nbDelete << nbEdit << nbPost << nbCancel ;

However I'm getting the following compiler error:

[C++ Error] EedpMainForm.cpp(1502): E2094 'operator<<' not implemented in
type 'TButtonSet' for arguments of type 'TNavigateBtn'


This has always worked fine in BCB5.
I pulled up Borland's help, and their example is virtually identical.

Any ideas?

Thanks,
Lance.
Back to top
JD
Guest





PostPosted: Fri Feb 17, 2006 3:03 am    Post subject: Re: TDBNavigator in Studio 2006 Reply with quote



"Lance Robaldo" <RRobaldo (AT) wltsoftware (DOT) com> wrote:
Quote:

[...] This has always worked fine in BCB5. I pulled up
Borland's help, and their example is virtually identical.

It works with BCB6 as well. I suspect that another fix for v10
broke it so it should be reported to QC so that it can be fixed
in the next sp.

I don't have v10 but I'm confident that the following is a
viable workaround. TNavButton is derived from TSpeedButton
so to set the properties for a TNavButton, use the same methods
that you would use for a TSpeedButton. To get a pointer to the
individual TNavButton, use the TDBNavigator's Components
property:

//-------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
SetDBNavBtn( nbFirst, false );
}
//-------------------------------------------------------------
void __fastcall TForm1::SetDBNavBtn( TNavigateBtn Button, bool State )
{
(static_cast<TNavButton*>(DBNavigator1->Components[Button]))->Visible = State;
}
//-------------------------------------------------------------

If you want to set multiple buttons without the control
repainting itself:

::SendMessage(DBNavigator1->Handle, WM_SETREDRAW, FALSE, 0);
SetDBNavBtn( nbFirst, false );
SetDBNavBtn( nbLast, true );
::SendMessage(DBNavigator1->Handle, WM_SETREDRAW, TRUE, 0);
DBNavigator1->Refresh();

~ JD
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.