Does wxWidgets provide a way to find out when user clicks a link in HTML view? Does it let you update the HTML content from code? Does it support JavaScript? :)
wxHTMLWindow does not support CSS or Javascript. Catching clicks is pretty easy:
SuperStrict Framework wx.wxApp Import wx.wxFrame Import wx.wxHTMLWindow Import wx.wxPanel Import wx.wxButton Import wx.wxMessageDialog Type htmlTestFrame Extends wxFrame Field html:wxHtmlWindow Field topSizer:wxBoxSizer Method OnInit() Local ID:Int = 100 html = New wxHtmlWindow.Create(Self, ID, 0, 0, 300, 100) html.LoadPage("test.html") TopSizer = New wxBoxSizer.Create(wxVERTICAL) TopSizer.Add(html, 0, wxALL | wxEXPAND, 0) TopSizer.SetSizeHints(Self) TopSizer.Fit(Self) Connect(ID, wxEVT_COMMAND_HTML_LINK_CLICKED, OnLinkClicked) EndMethod Function OnLinkClicked(event:wxEvent) wxMessageBox "Link clicked" EndFunction EndType Type htmlTestApp Extends wxApp Field frame:htmlTestFrame Method OnInit:Int() frame = htmlTestFrame(New htmlTestFrame.Create(Null, -1, 30, 30, 300, 100)) SetTopWindow(frame) frame.Show() Return True EndMethod EndType New htmlTestApp.Run()
It is possible to update content but I believe Brucey is still working on that part of the interface. I owe him more testing on this very widget since I plan to use it in a project.
HTML tags can be intercepted and other wx controls added to the HTML display window. There is an example of this in the latest SVN snapshot: http://wxmax.googlecode.com/svn/trunk/wx.mod/samples/html/widget/widget.bmx