Re: [ANN] The Gecko-Delphi Framework v1 beta released. (The breath of fresh air for Kylix)

From: KAMA Software (support_at_kamasoftware.com)
Date: 05/14/04


Date: Fri, 14 May 2004 19:19:03 +0400


Hello.

1. If you want to change the caption of the Form1 you can use this line of
code:
  <tag oncommand="window.title=\"New Caption\""/>

  2. If you need to get access to Delphi object from JavaScript you need
chooise the
  other way.
  To do it you must create a IMyForm1.idl interface. Build it by xpidl2pas
compiler.
  Implement skeleton for interface IMyForm1 as wrapper for native Delphi
Form1.

  TMyForm1 = class(TnsSupports, IMyForm1)
    function Get_Caption : nsString;
    procedure Set_Caption(const Value : nsString);
    constructor Create(AOwner : TForm1);
  end;

  Implement the factory to create instance of object. Don't forget registr
one in GRE.

  TMyFormFactory = class(TnsSupports, nsIFactory)
    function CreateInstance(aOuter : nsISupportsH; const iid : TGUID; var
_result : Pointer): HRESULT;
end;

  function TMyFormFactory.CreateInstance(aOuter : nsISupportsH; const iid :
TGUID; var _result : Pointer): HRESULT;
  begin
    _result := TnsSupports.Get_NSInterface(TMyForm1.Create(Form1),
IMyForm1);
  end;

  For now you can get access to Form1 from JavaScript.

  function deplhiAccess()
  {
    Form1 = Components.classes[COMPONENT_MYFORM1_KEY].createInstance();
    Form1 = Form1.QueryInterface(Components.Interfaces.IMyForm1);
    Form1.Caption = "New Caption";
  }

  <tag oncommand="deplhiAccess()"/>

  Don't try to build it directly. This is only idea and must be going to
debug!

"Alexander Adam" <nospam@please.com> wrote in message
news:40a41152$1@newsgroups.borland.com...
> hi,
>
> "KAMA Software" <support@kamasoftware.com> schrieb im Newsbeitrag
> news:40a10b0e@newsgroups.borland.com...
> > Hello.
> > Sorry for the delayed response. You can download a patch with
Gecko-Delphi
> > Framework dcu for Delphi 6 SP2 from our server.
> > Follow this link:
> > http://www.kamasoftware.com/beta/download/GDF_v1.0_D6_patch.zip
>
> thanks, works fine. any change to execute javascript in the xul form and
> access some delphi objects?
> something like <... oncommand="form1.caption = 'hi there'"/>
>
> thx
>
>



Relevant Pages

  • Re: How to submit a form in a popup window?
    ... How do I submit that form1 from the javascript from my current window? ... something via Javascript to mainwin, ...
    (comp.lang.javascript)
  • Re: Using Javascript to branch from one asp page to another and return
    ... Somewhere at this point (perhaps in the submit button code of form1 ... or somewhere in form1processer) the javascript confirm comes up asking ... > form1processor generates html that asks your questions and either ... >> return to the calling asp page to continue the original processing. ...
    (microsoft.public.inetserver.asp.general)
  • Re: set form item value with javascript
    ... Below is a snippet of my form. ... There are other form items on it, ... How do I submit this with javascript? ... /* Needed if A element removed from form1 */ ...
    (comp.lang.javascript)
  • Re: How to submit a form in a popup window?
    ... There is a form (form1) in the url in that popup window, I need to submit that form. ... How do I submit that form1 from the javascript from my current window? ... could anyone recommend a newsgroup on javascript for newbies where I can ask my queries. ...
    (comp.lang.javascript)