Statusbars

It took me a little while to figure this out, I just thought I'd post the following info...

The Default Win32 palette defined in IDEMain doesn't include a TStatusBar.

It's simple enough to add in a project (I also added the JVCL TJvStatusBar in my projects):


 IDEScripter1.DefineClassByRTTI(TJvStatusBar,       '', [mvpublic, mvpublished], true, TRedefineOption.roInclude);
  IDEScripter1.DefineClassByRTTI(TStatusBar,       '', [mvpublic, mvpublished], true, TRedefineOption.roInclude);

  IDEEngine1.RegisterComponent('Win32',    TStatusBar,    'ComCtrls,ExtCtrls,StdCtrls');
  IDEEngine1.RegisterComponent('JVCL',     TJvStatusBar,  'ComCtrls,StdCtrls,ExtCtrls');



The only trick is that in the script you can't access the Panels with StatusBar1.Panels[0], you need to do instead use:


  StatusBar1.Panels.Items[0].Text := ' Recs: ' + IntToStr(recCount);



Wagner: is there any trick to getting the default property established in scripter that would allow for StatusBar1.Panels[0] := 'something'; format?

Cheers,
EdB

Hi Ed, simply use TRedefineOption.roOverwrite instead of roInclude. That will solve your problem.

Still getting "Cannot assign a nil tp TStatusPanel" when I use roOverwrite and then try

StatusBar1.Panels[0]:='something';

But

  StatusBar1.Panels.Items[0].text := 'something'; 

 works with either roInclude or roOverwrite - I can live with that.

Thanks.

EdB



Shouldn't you use



StatusBar1.Panels[0].Text:='something';


instead of


StatusBar1.Panels[0]:='something';


?

Of course it is.

I'd spent the weekend working with Digital Metaphors Report Builder - where I'm constantly doing things like:

  if (ppDBPipeline1['status']='New') then...

Which somehow cemented the notion that the default property for TStatusBar was items.text.

<sigh>

Now, where did I leave that "thump,thump, thump"...

Cheers,
EdB