 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Lance Robaldo Guest
|
Posted: Wed Feb 15, 2006 10:03 pm Post subject: TDBNavigator in Studio 2006 |
|
|
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
|
Posted: Fri Feb 17, 2006 3:03 am Post subject: Re: TDBNavigator in Studio 2006 |
|
|
"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 |
|
 |
|
|
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
|
|