access control for IDE components

Is there a way to make vcl design-time components private? For example, if my form contains a TTable called Table1, and my code looks like this:

TfrMyForm* MyForm1 = new TfrMyForm(this);
MyForm1->Table1->DatabaseName = "C:/temp";
MyForm1->Table1->TableType = ttParadox;
MyForm1->Table1->TableName = "Table1.db";
MyForm1->ShowModal();
if (MyForm1->Table1->Active)
MyForm1->Table1->Close();
delete MyForm1;

....why am I able to manipulate Table1's database name and table name and tabletype properties? I instead want it to be necessary to have a member function handle it, like so:

TfrMyForm* MyForm1 = new TfrMyForm(this);
MyForm1->ConfigureTables();
MyForm1->ShowModal();
MyForm1->CloseTables();
delete MyForm1;

This way, we can restrict manipulation of the form's components to only the member functions, and any change to these components later on necessitates only a change in the member functions and not (potentially) code all throughout the entire project. Isn't that how standard C++ object code is supposed to work?
0
Evan
7/13/2009 2:46:44 PM
embarcadero.cppbuilder.ide 2180 articles. 1 followers. Follow

3 Replies
740 Views

Similar Articles

[PageSpeed] 58
Get it on Google Play
Get it on Apple App Store

<Evan Streb> wrote in message news:136856@forums.codegear.com...

> Is there a way to make vcl design-time components private?

No.  They must be declared as __published in order to work at design-time, 
and __published has the same visibility as public.

> For example, if my form contains a TTable called Table1, and my code looks 
> like this:
<snip>
> ...why am I able to manipulate Table1's database name and table
> name and tabletype properties?

Because Table1 is publically visible to outside code.

> I instead want it to be necessary to have a member function handle it, 
> like so:

In order to do that in your current code, you would have to declare Table1 
as private or protected - but then you would lose design-time support for 
Table1.

What you could do instead is move Table1 to a separate TDataModule, and then 
have TfrMyForm instantiate and use that TDataModule internally as needed. 
That way, you still have design-time support for Table1, as well as keeping 
it isolated from any public access.

-- 
Remy Lebeau (TeamB)
0
Remy
7/13/2009 5:11:55 PM
So I guess my question then is why do __published components have the same visibility as public ones? Why was it deemed necessary to give design-time components public access? Because if they were private by default it would've been much more time-consuming to write simple code?

Evan

> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> <Evan Streb> wrote in message news:136856@forums.codegear.com...
> 
> > Is there a way to make vcl design-time components private?
> 
> No.  They must be declared as __published in order to work at design-time, 
> and __published has the same visibility as public.
> 
> > For example, if my form contains a TTable called Table1, and my code looks 
> > like this:
> <snip>
> > ...why am I able to manipulate Table1's database name and table
> > name and tabletype properties?
> 
> Because Table1 is publically visible to outside code.
> 
> > I instead want it to be necessary to have a member function handle it, 
> > like so:
> 
> In order to do that in your current code, you would have to declare Table1 
> as private or protected - but then you would lose design-time support for 
> Table1.
> 
> What you could do instead is move Table1 to a separate TDataModule, and then 
> have TfrMyForm instantiate and use that TDataModule internally as needed. 
> That way, you still have design-time support for Table1, as well as keeping 
> it isolated from any public access.
> 
> -- 
> Remy Lebeau (TeamB)
0
Evan
7/13/2009 6:55:10 PM
<Evan Streb> wrote in message news:137008@forums.codegear.com...

> So I guess my question then is why do __published components have
> the same visibility as public ones?

Because '__published' is essentially the same as 'public', just with 
compiler-generated RTTI attached to it.

> Why was it deemed necessary to give design-time components public access?

You would have to ask the original Borland developers.  __published has 
always been public.

-- 
Remy Lebeau (TeamB)
0
Remy
7/13/2009 8:28:54 PM
Reply:

Similar Artilces:

IDE
Does anybody use an IDE or code (web coding: HTML/XML/CSS/JS/PHP/JSP) editor that they would recommend. I've been evaluating several and here are my results so far: NVU: I don't like WYSIWYG editors but I'll keep it around for the occasional complicated table I need to do quick. Scite: I haven't looked at it in depth but it didn't seem to have the project management I wanted. Screem: It was too buggy, the project management was too difficult, and it had no regex support that I could find. Bluefish: I'm using it now and it looks good but I've n...

IDE
Hi, we'd been using JBuilderX for 4+ years now and looking to re-tool but unfortunately, the latest version does not support EAServer. I'm curious what others are using for development. Are there any other IDEs that support deployment to EAserver as the older JBuilder used to do? Eclipse? Marley wrote: > Hi, we'd been using JBuilderX for 4+ years now and looking > to re-tool but unfortunately, the latest version does not > support EAServer. I'm curious what others are using for > development. Are there any other IDEs that support > deployment to EAs...

IDE
How can I modify the IDE of PowerBilder? Thanks -- ________________________________ Alessandro Isola Ateikon s.r.l. Uff. Conegliano 0438/415709 www.ateikon.com What exactly are you trying to achieve? The IDE is highly customizable by itself, and if you really want to go deeper than that, there is a set of instructions to make even deeper modificaitons, although these are not for the faint of heart. regards, Bill Alessandro Isola wrote: > > How can I modify the IDE of PowerBilder? > > Thanks > > -- > ________________________________ &...

ide
hi all ! i'm using perl with tk extension in developping desktop apps . working on macosx platform, I use either the Xcode editor or emacs. i'm lacking debugger support and tk gui ide . anybody any idea if there's a ide out there with support for debugging and/or tk ? thanks erik --Apple-Mail-4-517507745 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Try ptkdb. You can get it from CPAN as Devel::ptkdb (I think; not where I can check at the moment). Then run your app as 'perl -dptkdb myapp'. On Jul...

ides
begin 666 ides.zip M4$L#!!0````(`+**!B_QYF)N+ ,``$L&```,`!4`;&]V9V%T96PN:61E550) M``,0*S$_$"LQ/U5X! `D!"0$755;LF,K"/T_59D#0T!$T>'X@/D/H1<[Z7MR M^R_E%EDO2,0>M$T/G74VU;XK-3Z7_-BB<>>AJCBKL1>M63;I+4KJY[Q^^$XE M-U,:L9ULC$UMS8XS7(Q83&6R4HLF5*]W"A&AP95?/[%ZI[7+HF(QZ$0MZ/+W MC%=,.EX,356IRYDD"[^N1KQ^7/:FM;Q23'&*TG&;F>F*&K%716>T>F"W#C3B MI0`FHW,/`\X0(U%T*3."JM=)K>*BWX*W-,]""M! @B%XAL.?S@*M-CK7F\6C M"$D#FL8*":2CSEI>.84N2)-8DKHR45SJ1=TY5 HN+HA%;%; /CKTPX,N:]%6 MN8 ]&am...

movement of controls on ide
i have a problem , sometimes i cannot drag the controls here and there(they get stuck in one place)  on the webform while designing the form in vs.net 2003. i have installed the vs again . but the problem persists   Control can only be dragged if it has absolute positioning. Check that control has style="absolute: ... ". It also helps if you choose Grid Layout for the page.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no rights. ...

Accessing SQL in IDE
Greetings, I really like the SQL IDE in VS.NET. However, the one flaw I find is that everytime I open a table or run a stored procedure I get prompted for user name and password. Is there a setting to disable the 'Always prompt for login name and password ' type security?? Thanks, DS...

VS ide / delphi ide key map
I'm quit lost in VS ide, F9 run, F8 / F7 Ctrl+Alt+P for tool pallet and the fast find when you type component name F11 to switch to code view / object inspector, the ability to navigate in the object inspector with tab and writing property name. Will someone make a Delphi to VS guide? -- Henning Swiboda wrote: > I'm quit lost in VS ide, F9 run, F8 / F7 > Ctrl+Alt+P for tool pallet and the fast find when you type component > name > F11 to switch to code view / object inspector, the ability to navigate > in the object inspector with tab and writing propert...

Controls and support by IDE
Hi, there are many controls, which have a special properties, where intellisense of IDE gives a developer help. It means, when a developer writes that property in .aspx file, the value can be set by a dialog box or by choosing from a range of values (like from dropdownlist). The first group contains properties for setting url: ImageUrl, PostBackUrl, NavigateUrl. Other are Style, CssClass, ... How can I make properties like that? I expect to add some attributes to them. I just don`t know which one. ThanksIf this is a answer to your problem, mark it as answer in right upper corner. It hel...

about IDE
 Hi,i am a C# coder, and now i want to start to learn asp.net . i started by Visual Web Developer ,but that is too much slow for my PC (1.73 GHz processor, 512Mb Ram). So, which IDE i can use  for best feature ?Please share to me with any opinion for getting start or anything else.... Thankx in advanceregardsarefin  Why not extend your RAM to 1G or higher for you to perform development faster? Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET Visual Web Developer is th...

Which IDE
This is not which IDE is the best post, it is a which IDE is best for ME post. Currently I am using Web Matrix but there are a few things that I don’t like. 1. Like every one else, no Intellisense (code completion) 2. I want tabs that show all my open documents which I can quickly flick through like Visual Studio. What I don’t like about Visual Studio .Net Professional: 1. The price. 2. I don’t like using code behind that much but I guess I’m just not used to it and can get over the fact. So this is not so major. The way I work now is assemblies and code in the aspx pages in ...

IDE Only
I did a complete search and could not find an answer, so I'm posting to see if anyone knows. I need a way to determine if the IDR is running in Delphi 2007. I have some code I do not need executed while I'm programming/debugging the application. I have code that worked for Delphi 7, but does not work properly with Delphi 2007. It's a simple code that looks at window titles, see below *NOTE: Bug in forum won't let your show correct array code, converts to URL* function DelphiRunning : boolean; var H1, H2, H3, H4 : Hwnd; const A1 : array(0..12] of char = ...

Version nbr on TRAN-IDE, MSG-IDE
I've installed the EBF19641 on my client. I'd hoped to see the version nbr reflected on the "properties" window. But I don't see a new version nbr on TRAN-IDE (still see imc53). And I don't find a properties screen/window at all for MSG-IDE. Is the display missing? The version number is not updated on the Tran-IDE start up screen. When you install a patch, make sure you copy the Cover.ROLL.xxxxx file into the NNSY_ROOT directory. If you encounter a problem with Tran-IDE, then mention your current patch level specified by the number appended to t...

Web resources about - access control for IDE components - embarcadero.cppbuilder.ide

Component - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

AirAsia disaster: Indonesia cites faulty component, crew response in crash
Pilots appear to have reset the computer system's circuit breaker, leading to a series of failures that caused them to lose control of the plane ...

Samsung announces big profits for Q3 2015, driven by components business
... So beneficial was the weakened won that it translated to quarterly gains of approximately 800 billion won ($705 million), primarily from component ...

Teardown of iPad Pro reveals revamped component layout
... Apple device teardown on the iPad Pro on Wednesday, revealing a reworked internal design dominated by massive batteries and bespoke audio components. ...

Corvette Stingray gets optional Z06 components
Filed under: Chevrolet , Coupe , Performance Chevrolet announces a series of upgrades available for the Corvette Stingray derived from the equipment ...

Samsung reportedly lost key iPhone 7 component business
... for Samsung , which is ironic considering the two companies are fierce rivals in the mobile business. The Korean giant produces various components ...

Crew, faulty component caused AirAsia crash
Indonesian investigators said crew action and a faulty component caused the AirAsia jet crash in the Java Sea last year, killing 162 passengers. ...

IDG Contributor Network: Four critical patches for November Patch Tuesday update core Windows and Office ...
Microsoft's November Patch Tuesday brings us four critical updates and eight important patches that attempt to resolve 54 reported vulnerabilities ...

Immigration Law Enforcement: A Vital Component Of National Security And Counterterrorism
While the administration claims that these refugees are being vetted, there is no way to actually screen these people

Taiwan panel makers calling on China government for component tariff reductions
Panel makers in Taiwan are calling on the China government to allow for zero tariffs on panel components due to Taiwan's weakening panel supply ...

Resources last updated: 12/12/2015 7:55:01 PM