Feature to Resize only window border


#1

Hi Jules,
When we resize the Application window, all the contents also resize immidiately. Is there any way to show only the border as a line when we resize as how Windows Native window does , and do the actual resizing only after releasing the mouse…
I have a component which have more painting , so when i resize it looks very sluggish. Hope you understand. I don’t think i can inherit anything and implement, it has to be done by you only.

Thanks,
Noorul


#2
yourComponent::resized()
{
    beingResized = true;
    startTimer(300);
}

yourComponent::timerCallback()
{
    beingResized = false;
    repaint();
}

yourComponent::paint(...)
{
    if (beingResized) return;
    [...]
}

In all case, you better optimize your painting, as resize is only the small tip of the iceberg, you’ll have the same issue when your component is damaged by another window and you have to redraw the parts below damaged area.
You know you can use setBufferedToImage IIRC too, see if that helps


#3

Yes, I’d also say that if you need to ask for this, it’s probably your code that needs tightening up. If you’re rendering something that’s really cpu-intensive, then you should probably be using a background thread to render it, rather than blocking the main event thread and making your app unresponsive.


#4

Whatever painting i am doing is completely on the context which is coming to Component::paint();
For e.g if i have a High Resolution image which has to fit inside a component… I use drawImageWithin() to draw, because the component will be resized when the window is resized…

As drawImageWithin() is slow, it is making my application sluggish…

Another way i can do is , create another image of component size , create a context for it and draw that image in another thread , after drawing is done call repaint again… Which is a lot of changes to do in all the component and many threads for every component painting…

If you can do that border resizing … It will be very great…

And another thing is , the same feature if you can do for StretchableManager also means, it’s very great…

Thanks,
Noorul


#5

I’ve got apps that render big resized images and everything runs extremely smoothly. Are you running on an old 80486 or something!?


#6

I posted only because it is sluggish and it will be better if we have an option. And It will be helpful while we run in debug mode…

Thanks,
Noorul