Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / getting html code from wxHTMLWindow component

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. getting html code from wxHTMLWindow component
#3426
Posted by: 2004-02-27 18:44:23
Hi,

I use a wxHTMLWindow component to display some informations well formatted.
I want user could be able to save in a html file but I didn't find any method in the wxHTMLWindow class that returns HTML code.

How can I get HTML code from this component ?

Thanks.

PS : Excuse me for my poor english ... :)

Message2. Re: getting html code from wxHTMLWindow component
#3427
Posted by: upCASE 2004-02-27 19:51:35
Hi!
I hope that I understood you correctly :)
You're trying to get the HTML code source of a page displayed in a wxHtmlWindow, right?

True, there seems to be no method to do this directly, but I found a workaround using the wxHtmlWinParser class:

wxHtmlWindow* html = new wxHtmlWindow(this);
html->LoadPage("index.html");
wxHtmlWinParser *parser = w->GetParser();
wxString* source = parser->GetSource();
wxMessageBox(*source);

I checked it and it works for me :)

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: getting html code from wxHTMLWindow component
#3435
Posted by: 2004-03-01 19:41:19
It works perfectly.

Thanks !

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-4-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0