Make HtmlView Gadget forget history

Started by Midimaster, February 15, 2021, 15:49:23

Previous topic - Next topic

Midimaster

Hi, I'm using the HtmlView-Gadget to show the user several informations: The game's User-Manual is completely html-based, but also the Game-Result-Page at the end is displayed with the same HtlmView-Gadget.

In the User-Manual I offer a BACK and a FORWARD button zu enable the user to navigate through the manual.

Now I observed that if the user clicks often on BACK in the User-Manual, he is able to suddenly "navigate" back to the Game-Result-Page which showed the game results 10min ago. 

now my question: Is it possible to reset the Html-Gadget, so that it "forget" previous URLs?
...back from Egypt

Dabz

Can you not track the forwarding and the backwarding somehow, so, when the user clicks back constantly, they get to the "Home" page, and, well, intercept another back click with a HTMLGo("Home"), thus, not looping back to the results page.

Or, split the User-Manual and Game-Results pages into separate views, use panels to toggle between the two.

Free the HTMLView if you can when the player leaves the game result page, then create a new one?

Just some idea's, as I dont think their is a way to clear the history from the HTMLView, though, I'm probably wrong! :D

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Midimaster

thank you for your idea, but it will not work....

it looks like the HTtmlView does not report correct the current displayd url.

In the manual the user can click on text based links to jump to chapters. like:

manual.html#chapter1

On the BACK-Button I let me report with HtmlViewCurrentURL(HtmlView), what the current displayed page is. But jumping completely back to the start URL is not possible, because already one step before beeing HOME the HtmlViewCurrentURL(HtmlView) answers already with the start URL, but the HtmlView still show a Chapter (deep inside the manual).

would I now use a ....
Code (BlitzMax) Select
IF HtmlViewCurrentURL(HtmlView)<>FirstURL
... the last BACK step will not be done.

But... If I don't use the If-Statement, I'm able to step back. But after clicking at penultimate step now the former document appears. Again HtmlViewCurrentURL(HtmlView) show the current documents URL. After another BACK-step suddenly the HOME of the current document appears.

Strange!!!!

Code:
Code (BlitzMax) Select
Case Button[BUT_BACK]
Print "BACK STEP"
Print "First URL=" + firsturl
Local current$=HtmlViewCurrentURL(HtmlView)
Print "current before=" + current
If current<>FirstURL
HtmlViewBack HtmlView
EndIf



...back from Egypt

Dabz

#3
Well, I'm not sure then, though, I know Brucey's WXWidgets mod thingy me jobby does indeed have a HTML view control and it contains a clear history member, might mean migrating your code to that, but, it is a billion times better then MaxGUI anyway.

Thats all I have really.

Dabz

EDIT: https://docs.wxwidgets.org/3.0/classwx_html_window.html#a0cf30ee8ee03ff0fa6ee42fb349bb851
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit