Weird behaviour of wxHtmlWindow

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
KarolRybak
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Oct 11, 2004 1:59 pm

Weird behaviour of wxHtmlWindow

Post by KarolRybak » Mon Oct 11, 2004 2:24 pm

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.

caseyodonnell
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Sep 10, 2004 1:03 pm
Location: Troy, NY
Contact:

Re: Weird behaviour of wxHtmlWindow

Post by caseyodonnell » Mon Oct 11, 2004 2:43 pm

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.

KarolRybak
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Oct 11, 2004 1:59 pm

Post by KarolRybak » Mon Oct 11, 2004 5:30 pm

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

Post Reply