🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #537

Re: Creation order of all controls

#537
From: Remy Lebeau (TeamB)
Date: Mon, 28 Jan 2008 20:26
46 lines
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 
Technical Details
Message-ID: <479e3a58$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <479dd907@newsgroups.borland.com> <479e02e7$1@newsgroups.borland.com> <479e2597@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c9cdd7c64c7a4e9
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <479dd907@newsgroups.borland.com> <479e02e7$1@newsgroups.borland.com> <479e2597@newsgroups.borland.com>
Subject: Re: Creation order of all controls
Date: Mon, 28 Jan 2008 12:26:49 -0800
Lines: 48
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 207.178.157.90
Message-ID: <479e3a58$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1201551960 207.178.157.90 (28 Jan 2008 12:26:00 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail