Page 1 of 1

Weird behaviour of wxHtmlWindow

Posted: Mon Oct 11, 2004 2:24 pm
by KarolRybak
I'm new to wxWidgets but not new to programming. I'm creating a simple application and i wanted to implement nice toolbar with images using wxHtmlWindow. I have created six images, put them into a table and attached links to them. I have my HtmlWindow in a sizer so that it can resize horizontally, everything is nice, but sometimes horizontal scrollbar appears ( i use wxHW_SCROLLBAR_NEVER style). Actually it is easiest to observe it when i first maximize app window and then restore it. contents of htmlWindow resizes properly, but scrollbar appears and when i scroll right there's nothing but a blank space. What is weird when i use wxHW_SCROLLBAR_AUTO this does not happen, but instead i get vertical scrollbar, like if the document was higher than it actually is. If anyone could help me with some solution or workaround i would be grateful.

Re: Weird behaviour of wxHtmlWindow

Posted: Mon Oct 11, 2004 2:43 pm
by caseyodonnell
That's an interesting approach to using images on your toolbar. I assume you partially want the images to 'grow' as you resize the window? Why that particular choice? What I suspect is happening is that whatever code is re-sizing the image is guessing wrong and making it one pixel too big in one direction or another. Dang integer math! Perhaps you could try wxStaticBitmap? Though I'm reading the docs now, and they recommend using something else for image display.

I've also just used a wxImage and blitted its bitmap to a window on Draw.

Anyone else? What are you using for image displays?

wxImageDisplay would be a nice control...
KarolRybak wrote:I'm new to wxWidgets but not new to programming. I'm creating a simple application and i wanted to implement nice toolbar with images using wxHtmlWindow. I have created six images, put them into a table and attached links to them. I have my HtmlWindow in a sizer so that it can resize horizontally, everything is nice, but sometimes horizontal scrollbar appears ( i use wxHW_SCROLLBAR_NEVER style). Actually it is easiest to observe it when i first maximize app window and then restore it. contents of htmlWindow resizes properly, but scrollbar appears and when i scroll right there's nothing but a blank space. What is weird when i use wxHW_SCROLLBAR_AUTO this does not happen, but instead i get vertical scrollbar, like if the document was higher than it actually is. If anyone could help me with some solution or workaround i would be grateful.

Posted: Mon Oct 11, 2004 5:30 pm
by KarolRybak
In fact i'm not resizing images, they are distributed horizontaly as the window grows. I chose this way of displaying because i wanted to add simple frame around pictures, using two nested tables. Finally i ended up with a line below pictures. The problem is not with resizing - it works good, but with this stupid scrollbar which shouldn't be there. I made some screenshots to make it more clear, don't worry about labels (they're in polish)

Image
Image
Image