Mega Search
23.2 Million


Sign Up

Make a donation  
Auto add required units for components on form  
News Group: embarcadero.public.delphi.ide

Hi,

"Auto add required units for components on form". This is something that 
Delphi 7 has always done. Now in XE4 this does not seem to be the case. 
Is there some hotkey/function available to add required units?

Thanks
Rael

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 10-Jan-2015, at 9:54 PM EST
From: Rael Bauer
 
Re: Auto add required units for components on form [Edit]  
News Group: embarcadero.public.delphi.ide
ken wrote:

> See my post *"Uses clause does not auto-update when adding components
> to a form"* a couple of pages down in this forum (17 Dec 2014). I
> reported exactly the same issue. The reply was exactly the same -
> *"its never done that"*, but I and a couple of other people I noted in
> that post firmly believe that it did. So you're not going mad.

The IDE has always updated the 'uses' clause at save/compile time.  It merely 
adds the units for the components themselves and their ancestors, but not 
for any external units that define types used in component properties and 
event handlers.  Component packages have to implement custom TSelectionEditor 
wizards that implement the TSelectionEditor.RequiresUnits() method to add 
additional units to the 'uses' clause as needed.  SelectionEditors are also 
invoked at save/compile time.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 12-Jan-2015, at 9:51 AM EST
From: Remy Lebeau (TeamB)
 
Re: Auto add required units for components on form [Edit]  
News Group: embarcadero.public.delphi.ide
> {quote:title=Rael Bauer wrote:}{quote}
> Hi,
> 
> "Auto add required units for components on form". This is something that 
> Delphi 7 has always done. Now in XE4 this does not seem to be the case. 
> Is there some hotkey/function available to add required units?
> 
> Thanks
> Rael

See my post *"Uses clause does not auto-update when adding components to a form"* a couple of pages down in this forum (17 Dec 2014). 
I reported exactly the same issue. The reply was exactly the same - *"its never done that"*, but I and a couple of other people I noted in that post firmly believe that it did. So you're not going mad.

CTRL + Space  will add the required units to the Uses clause.

regards - ken s

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 12-Jan-2015, at 5:08 AM EST
From: ken skuse
 
Re: Auto add required units for components on form  
News Group: embarcadero.public.delphi.ide
Rael Bauer wrote:
> Hi,
> 
> "Auto add required units for components on form". This is something that 
> Delphi 7 has always done. Now in XE4 this does not seem to be the case. 
> Is there some hotkey/function available to add required units?
> 
> Thanks
> Rael

XE4 works just as D7 did.  They are added on compile or save if not there.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 10-Jan-2015, at 10:57 PM EST
From: Jeff Overcash (TeamB)