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 

TabOrder and TabStop in Multi component derived from TWinCon

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





PostPosted: Fri Jul 30, 2004 12:30 pm    Post subject: TabOrder and TabStop in Multi component derived from TWinCon Reply with quote



Hi!

I have a component with several other components in it. Button, Combobox
etc... the component is derived from TWinControl.

I only want TabStop and TabOrder on one of the components in the component
to get a "normal" component. So i have set all the others to Tabstop =
false; and the only component i want tabstop = true; i have set taborder =
0;

But i can't seem to get tabstop and taborder to work... I have these
properties:

private:
............
int FTabOrder;
bool FTabStop;

int __fastcall GetTabOrder(){return FTabOrder;}
void __fastcall SetTabOrder(int TabOrder){FTabOrder = TabOrder;}
bool __fastcall GetTabStop(){return FTabStop;}
void __fastcall SetTabStop(bool TabStop){FTabStop = TabStop;}

__published:
__property int TabOrder = {read = GetTabOrder, write =
SetTabOrder};
__property bool TabStop = {read = GetTabStop, write =
SetTabStop};


Any help would be great!

Thanks in advance,

Paw Suddergaard


Back to top
Todd Brylski
Guest





PostPosted: Sat Jul 31, 2004 3:48 am    Post subject: Re: TabOrder and TabStop in Multi component derived from TWi Reply with quote



"Paw Suddergaard" <paw (AT) easyflex (DOT) dk> wrote

Quote:
But i can't seem to get tabstop and taborder to work...

Try something like this:

class PACKAGE TWinControlX : public TWinControl
{
private:
TButton* Button;
TComboBox* Combo;
TEdit* Edit;
bool __fastcall GetTabStop();
void __fastcall SetTabStop( bool Value );
protected:
public:
__fastcall TWinControlX(TComponent* Owner);
__published:
__property TabOrder ;
__property TabStop = { read=GetTabStop, write=SetTabStop } ;
};

__fastcall TWinControlX::TWinControlX(TComponent* Owner)
: TWinControl(Owner)
{
Width = 200;
Height = 150;

Button = new TButton(this);
Button->Parent = this;
Button->SetBounds( 16, 16, Button->Width, Button->Height );
Button->TabStop = false;

Combo = new TComboBox(this);
Combo->Parent = this;
Combo->SetBounds( 16, 48, Combo->Width, Combo->Height );
Combo->TabStop = false;

Edit = new TEdit(this);
Edit->Parent = this;
Edit->SetBounds( 16, 80, Edit->Width, Edit->Height );

Edit->TabStop = true; // <---
}
//---------------------------------------------------------------------------

bool __fastcall TWinControlX::GetTabStop()
{
return Edit->TabStop;
}

void __fastcall TWinControlX::SetTabStop( bool Value )
{
Edit->TabStop = Value;
}

Todd



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) 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.