Thank you very much.It does work well.Thanks again. Ben Hutchings 写道:
> Wayne Tang <[EMAIL PROTECTED]> wrote: > > Where can I find more detailed information about gecko,including every > > class ,function defined in gecko,even relationship between classes? > > LXR at <http://lxr.mozilla.org> allows you to search and cross- > reference headers (and the rest of the source). > > <snip> > > I am planning to develop an application based on gecko,which need to > > know that the size of every frame in HTML file,the position and the > > size of every element in every frame. > > I try some code like this,but it dos not work: > > > > > > presShell->GetPrimaryFrameFor(content, &frame); > > if (frame) > > { > > nsRect rect=frame->GetRect(); > > printf("x=%f\ty=%f width=%f height=%f > > \n",rect.x,rect.y,rect.width,rect.height); > > } > > > > > > the rsult is x=0 y=0 width=0 height=0 > > What's wrong with these codes?Why all 0? > > I don't know about this as I haven't touched frames. > > > If I want to get the position and size of every element in frame,what > > more need I do? > > You can iterate over elements with standard W3C DOM interfaces, so I > shan't describe that bit. Then you need to get the nsIDOMNSDocument > interface (Mozilla extension) for the document and call > nsIDOMNSDocument::GetBoxObjectFor(nsIDOMElement *, nsIBoxObject **) > to get a "box object" for the element. Then call methods on that > to get the position and size. The size can be 0 if the element is > not displayed for some reason. > > > I am newbie to gecko even mozilla.Hope somebody point a direction to > > me.Thanks in advance. > > -- > Ben Hutchings -- [EMAIL PROTECTED] shortened to [EMAIL PROTECTED] > If you've signed my GPG key, please send a signature on and to the new uid. > Lowery's Law: > If it jams, force it. If it breaks, it needed replacing anyway. _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
