[Lazarus] Hint about CreateWnd

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Mar 1 19:54:33 CET 2008


On Sat, 1 Mar 2008 19:16:40 +0100
zeljko <zeljko at holobit.net> wrote:

> On Saturday 01 March 2008 18:23, Mattias Gaertner wrote:
> > On Sat, 1 Mar 2008 16:37:35 +0100
> >
> > zeljko <zeljko at holobit.net> wrote:
> > > On Saturday 01 March 2008 16:07, Mattias Gaertner wrote:
> > > > On Sat, 1 Mar 2008 15:44:55 +0100
> > > >
> > > > zeljko <zeljko at holobit.net> wrote:
> > > > > On Saturday 01 March 2008 14:52, Mattias Gaertner wrote:
> > > > > > Replace
> > > > > >   DoSomeOperationWith(Handle)
> > > > > > with
> > > > > >   DoSomeOperationThatNeedsAHandle;
> > > > > >
> > > > > > For example any Canvas operation needs a handle.
> > > > >
> > > > > tnx, I've found Loaded() satisfies my needs - for runtime, but
> > > > > Loaded() isnt' called during design time ? so ... what to call
> > > > > here ?
> > > >
> > > > I hope, you mean 'override' not to 'call'.
> > >
> > > yes , I mean 'overrde' I don't call Loaded() ;)
> > >
> > > > Loaded is called during designtime too. Otherwise you found a
> > > > bug.
> > >
> > > Not when you drop control on to form for the first time.
> > > Later, when you start that project, then it properly calls
> > > Loaded(). So it could be a bug.
> >
> > I see.
> > No that's, not a bug. Loaded is called after the lfm data has been
> > transmitted. No lfm data - no Loaded.
> > If you tell, what you are trying to do, I can tell you what method
> > to override.
> 
> I'm creating new component on component palette :) (qt only
> component), everything works fine, bug when I drop it for the first
> time on the form it doesn't load it's properties (it is
> QTableWidget), so it have to load rowcount, colcount etc .... it
> looks empty - no rows, no cols, white colored etc ...(OI is filled OK
> with props). After saving project, and restating laz ide (yes, now
> Loaded() is called) , I can see all clearly.
> No problems during runtime, designtime only.

When your QTTableWidget is created it should pull all values from the
'LCL' control. OR: you can override CreateWnd of your LCL control and
push all values.


Mattias





More information about the Lazarus mailing list