Thread View: borland.public.cppbuilder.nativeapi
8 messages
8 total messages
Started by Carlos
Mon, 28 Jan 2008 13:30
Creation order of all controls
Author: Carlos
Date: Mon, 28 Jan 2008 13:30
Date: Mon, 28 Jan 2008 13:30
10 lines
1153 bytes
1153 bytes
Hello, I would like to change the creation order of all controls in my form. What is the best way ? I need obtain all controls order by taborder for sequence check. any ideas? Regards
Re: Creation order of all controls
Author: Clayton Arends
Date: Mon, 28 Jan 2008 16:29
Date: Mon, 28 Jan 2008 16:29
21 lines
1887 bytes
1887 bytes
"Carlos" <a@a.com> wrote in message news:479dd907@newsgroups.borland.com... > I would like to change the creation order of all controls in my form. What > is the best way ? You can hand edit the DFM file and put the controls in the order you'd like. You can cut-and-paste all controls to a temporary form and then cut-and-paste each control back one at a time in the proper order. > I need obtain all controls order by taborder for sequence check. Look at the method TWinControl::FindNextControl(). It allows you to look for controls using TabOrder. > any ideas? If you can explain what you are trying to accomplish then I might have more ideas. Clayton
Re: Creation order of all controls
Author: Remy Lebeau (TeamB)
Date: Mon, 28 Jan 2008 17:38
Date: Mon, 28 Jan 2008 17:38
19 lines
1712 bytes
1712 bytes
"Carlos" <a@a.com> wrote in message news:479dd907@newsgroups.borland.com... > I would like to change the creation order of all controls in > my form. What is the best way ? Creation order is dictated by the entries in the DFM. The controls are created in the order in which they are placed on the TForm/TDataModule at design-time. If you want to change the creation order, you have to rearrange the DFM contents manually. > I need obtain all controls order by taborder for sequence check. Tab order has nothing to do with creation order. Every control has its own TabOrder property instead. To obtain a list of controls based on tab order, look at the TWinControl::GetTabOrderList() method. Gambit
Re: Creation order of all controls
Author: Carlos
Date: Mon, 28 Jan 2008 18:57
Date: Mon, 28 Jan 2008 18:57
38 lines
2284 bytes
2284 bytes
Hello Clayton, I need iterate all controls in a TForm for check errors and show it if necesary. I my form exists PageControls, Panels, groupbox... it is a problem for make visible a control inside of a tab not visible I would like an order iteration (like taborder) for check controls. Thank you. "Clayton Arends" <nospam_claytonarends@hotmail.com> escribi� en el mensaje de noticias news:479e02e7$1@newsgroups.borland.com... > "Carlos" <a@a.com> wrote in message > news:479dd907@newsgroups.borland.com... > >> I would like to change the creation order of all controls in my form. >> What >> is the best way ? > > You can hand edit the DFM file and put the controls in the order you'd > like. > > You can cut-and-paste all controls to a temporary form and then > cut-and-paste each control back one at a time in the proper order. > >> I need obtain all controls order by taborder for sequence check. > > Look at the method TWinControl::FindNextControl(). It allows you to look > for controls using TabOrder. > >> any ideas? > > If you can explain what you are trying to accomplish then I might have > more ideas. > > Clayton >
Re: Creation order of all controls
Author: Carlos
Date: Mon, 28 Jan 2008 19:00
Date: Mon, 28 Jan 2008 19:00
32 lines
2122 bytes
2122 bytes
Hello Remy, The problem of taborder is that container controls like tabsheet, panel,... defines a internal taborder. I need iterate all controls inside form. Regards "Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje de noticias news:479e12f2$1@newsgroups.borland.com... > > "Carlos" <a@a.com> wrote in message > news:479dd907@newsgroups.borland.com... > >> I would like to change the creation order of all controls in >> my form. What is the best way ? > > Creation order is dictated by the entries in the DFM. The controls are > created in the order in which they are placed on the TForm/TDataModule at > design-time. If you want to change the creation order, you have to > rearrange the DFM contents manually. > >> I need obtain all controls order by taborder for sequence check. > > Tab order has nothing to do with creation order. Every control has its > own TabOrder property instead. To obtain a list of controls based on tab > order, look at the TWinControl::GetTabOrderList() method. > > > Gambit >
Re: Creation order of all controls
Author: Remy Lebeau (TeamB)
Date: Mon, 28 Jan 2008 20:26
Date: Mon, 28 Jan 2008 20:26
46 lines
2286 bytes
2286 bytes
"Carlos" <a@a.com> wrote in message news:479e2597@newsgroups.borland.com...
> I my form exists PageControls, Panels, groupbox... it is a
> problem for make visible a control inside of a tab not visible
You can write a simple recursive function to handle that, ie:
void __fastcall EnsureVisible(TControl *Control)
{
if( Control )
{
TTabSheet *pSheet = dynamic_cast<TTabSheet*>(Control);
if( pSheet )
{
EnsureVisible(pSheet->PageControl);
pSheet->PageControl->ActivePage = pSheet;
}
else
{
EnsureVisible(Control->Parent);
Control->Visible = true; // optional, depending on your UI
design
}
}
}
void __fastcall TForm1::ValidateSomething()
{
//...
if( ... some error occured ... )
{
EnsureVisible(SomeNestedControl);
SomeNestedControl->SetFocus();
return;
}
//...
}
> I would like an order iteration (like taborder) for check controls.
You don't need to do that, but if you must have an ordered list, then look
at TWinControl::GetTabOrderList(), like I suggested earlier.
Gambit
Re: Creation order of all controls
Author: Remy Lebeau (TeamB)
Date: Mon, 28 Jan 2008 20:27
Date: Mon, 28 Jan 2008 20:27
13 lines
1344 bytes
1344 bytes
"Carlos" <a@a.com> wrote in message news:479e2674$1@newsgroups.borland.com... > The problem of taborder is that container controls like > tabsheet, panel,... defines a internal taborder. > I need iterate all controls inside form. Then you need to use a recursive function to loop through every container's child controls/containers. Gambit
Re: Creation order of all controls
Author: Carlos
Date: Tue, 29 Jan 2008 14:53
Date: Tue, 29 Jan 2008 14:53
54 lines
2756 bytes
2756 bytes
Thank you,
I prefer cut and paste components for order list.
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje de
noticias news:479e3a58$1@newsgroups.borland.com...
>
> "Carlos" <a@a.com> wrote in message
> news:479e2597@newsgroups.borland.com...
>
>> I my form exists PageControls, Panels, groupbox... it is a
>> problem for make visible a control inside of a tab not visible
>
> You can write a simple recursive function to handle that, ie:
>
> void __fastcall EnsureVisible(TControl *Control)
> {
> if( Control )
> {
> TTabSheet *pSheet = dynamic_cast<TTabSheet*>(Control);
> if( pSheet )
> {
> EnsureVisible(pSheet->PageControl);
> pSheet->PageControl->ActivePage = pSheet;
> }
> else
> {
> EnsureVisible(Control->Parent);
> Control->Visible = true; // optional, depending on your UI
> design
> }
> }
> }
>
> void __fastcall TForm1::ValidateSomething()
> {
> //...
> if( ... some error occured ... )
> {
> EnsureVisible(SomeNestedControl);
> SomeNestedControl->SetFocus();
> return;
> }
> //...
> }
>
>> I would like an order iteration (like taborder) for check controls.
>
> You don't need to do that, but if you must have an ordered list, then look
> at TWinControl::GetTabOrderList(), like I suggested earlier.
>
>
> Gambit
>
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