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 a component derrived from TWinContro

 
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: Mon Aug 30, 2004 1:42 pm    Post subject: TabOrder and TabStop in a component derrived from TWinContro Reply with quote



Hi everyone,

Sometime ago i posted a question about how i would use TabOrder and TabStop
in my component, but i can't seem to find it anymore...

So here i post it again.

I have a Component with several other components in it:

class PACKAGE TMyComponent : public TWinControl
{
private:
TComboBox *FComboBox;
TStringGrid *FStringGrid;
TBitBtn *FBitBtn;
TImage *FImage;

................

I Only Want TabStop and TabOrder on the combobox.

I have tried using :
int FTabOrder;
bool FTabStop;

bool __fastcall GetTabStop(){return FTabStop;}
void __fastcall SetTabStop(bool TabStop){FTabStop = TabStop;}

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

But that does not have the real TabOrder/TabStop Effect.

If i do not have a TabOrder/TabStop property i get an error.

Any help would be great.


Back to top
Todd Brylski
Guest





PostPosted: Mon Aug 30, 2004 10:06 pm    Post subject: Re: TabOrder and TabStop in a component derrived from TWinCo Reply with quote



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

Quote:
Hi everyone,

Sometime ago i posted a question about how i would use TabOrder and TabStop
in my component, but i can't seem to find it anymore...

Here is what I responded with on July 30, 2004:

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
Paw Suddergaard
Guest





PostPosted: Wed Sep 01, 2004 8:09 am    Post subject: Re: TabOrder and TabStop in a component derrived from TWinCo Reply with quote



Hi, thanks for you quick reply.

I have tried your aproach, but it still is not the real tabstop and
taborder.

I can still set taborder to the same value of alle my components. If i use
tab key when running the a program with my component, the cursor disappears
somtimes. Maby thats because i tab to something "in" my component??? But i
cannot think of what it could be, because i have set tabstop = false to
everything.

Any ideas?

Thanks again.

"Todd Brylski" <tbrylski (AT) yyaahhoooo (DOT) com> wrote

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

Hi everyone,

Sometime ago i posted a question about how i would use TabOrder and
TabStop
in my component, but i can't seem to find it anymore...

Here is what I responded with on July 30, 2004:

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; // <---
}

//--------------------------------------------------------------------------

-
Quote:

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

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

Todd





Back to top
Todd Brylski
Guest





PostPosted: Wed Sep 01, 2004 10:39 pm    Post subject: Re: TabOrder and TabStop in a component derrived from TWinCo Reply with quote

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

Quote:
Hi, thanks for you quick reply.

I have tried your aproach, but it still is not the real tabstop and
taborder.

This line in the constructor:
Edit->TabStop = true;
Should be:
Edit->TabStop = false;

Quote:
I can still set taborder to the same value of alle my components.

I am not sure what you mean by this?

Quote:
If i use tab key when running the a program with my component,
the cursor disappears somtimes.

I did not see that happen.

Quote:
Maby thats because i tab to something "in" my component??? But i
cannot think of what it could be, because i have set tabstop = false to
everything.

Any ideas?

Are you sure you 'republished' the properties and not
created new ones?

your original code used:
__property bool TabStop ... // this is a new property

__property TabStop ... //this is republished

Todd



Back to top
Paw Suddergaard
Guest





PostPosted: Thu Sep 02, 2004 9:18 am    Post subject: Re: TabOrder and TabStop in a component derrived from TWinCo Reply with quote

Hi,

YES! It Works now!!! I had set TabStop to a new Property, instead of
republishing...

Thanks, ALOT!


Quote:
Are you sure you 'republished' the properties and not
created new ones?

your original code used:
__property bool TabStop ... // this is a new property

__property TabStop ... //this is republished

"Todd Brylski" <tbrylski (AT) yyaahhoooo (DOT) com> wrote

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

Hi, thanks for you quick reply.

I have tried your aproach, but it still is not the real tabstop and
taborder.

This line in the constructor:
Edit->TabStop = true;
Should be:
Edit->TabStop = false;

I can still set taborder to the same value of alle my components.

I am not sure what you mean by this?

If i use tab key when running the a program with my component,
the cursor disappears somtimes.

I did not see that happen.

Maby thats because i tab to something "in" my component??? But i
cannot think of what it could be, because i have set tabstop = false to
everything.

Any ideas?

Are you sure you 'republished' the properties and not
created new ones?

your original code used:
__property bool TabStop ... // this is a new property

__property TabStop ... //this is republished

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.