Recent

Author Topic: use units  (Read 5242 times)

kao

  • Newbie
  • Posts: 3
use units
« on: July 25, 2006, 06:11:51 am »
Hello, in delphi there was an option named, "use unit" in wich automatically you could add a unit to another so you can make references to their components. I can add the unit in the code editor but the component just don´t appear in the object inspector.
   An example is, i want to set the datasource of a dbgrid in my form using a datasource in a datamodule. What can i do??

Sorry about my poor english

Thank you

kao

  • Newbie
  • Posts: 3
RE: use units
« Reply #1 on: July 26, 2006, 05:54:20 am »
Did I miss something?, I really hope somebody can help me!!

thanx

CCRDude

  • Hero Member
  • *****
  • Posts: 600
RE: use units
« Reply #2 on: July 26, 2006, 07:37:58 am »
Code: [Select]
Unit ThisIsMyFirstUnit;

interface

uses ThisIsMyOtherUnit;

implementation

uses ThisIsYetAnotherUnit;

end.


Units never appear i the Object Inspector. Why should they? It's for objects, not units. And the Code Explorer always shows the unit of the active tab.

I also don't quite understand the example... wait...

You're speaking about a form unit of a different form, and want to set unit1.dbgrid.datasource := unit2.datasource or something like that? I've no idea if Lazarus supports this, have you tried to type it in manually?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2584
RE: use units
« Reply #3 on: July 26, 2006, 11:40:13 am »
The object inspector can't show components on other forms/datamodules yet.

If you want this, you need to do it manually in the Form.Create
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018