Zooming on a wx.Panel

Dear wxPython users,

wx.Panel doesn’t support zooming by default.

Do you think it could be possible to add a zooming feature ? i.e. if we zoom on a wx.Panel, all children widgets of this Panel should be zoomed too (ex : if there are StaticBitmap children of the Panel, they should be rescaled too!) and repositionned.

How much effort would this need? Do you have an idea on the steps needed to do that ?

Maybe I would need more generally a Canvas tool ? I tried some things in the wx Demo, but I didn’t find something easy to use for my needs. (FloatCanvas seems a bit complicated and slow for my needs : it doesn’t provide an easy way to place buttons on the canvas)

(My final goal is to do this : https://stackoverflow.com/questions/21351282/wxpython-for-image-and-buttons-resizable)

Thank you

Basj

Basj wrote:

wx.Panel doesn't support zooming by default.

Do you think it could be possible to add a zooming feature ? i.e. if
we zoom on a wx.Panel, all children widgets of this Panel should be
*zoomed too* (ex : if there are StaticBitmap children of the Panel,
they should be rescaled too!) and repositionned.

How much effort would this need? Do you have an idea on the steps
needed to do that ?

That's a very hard problem, because you can't use the same approach in
every app. You don't always want everything to scale identically. (The
operating systems all have magnifier tools for that.) Sometimes, you
want one field to grow, or you want to rearrange things. That's why
there is no automatic action.

(My final goal is to do this :
python - wxPython for image and buttons (resizable) - Stack Overflow)

You never going to be able to build that with standard widgets. You're
going to need to use a bitmap (like a FloatCanvas) or an OpenGL canvas
and implement your own hit detection.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Do you think it could be possible to add a zooming feature ? i.e. if we
zoom on a wx.Panel, all children widgets of this Panel should be *zoomed
too* (ex : if there are StaticBitmap children of the Panel, they should be
rescaled too!) and repositionned.

How much effort would this need? Do you have an idea on the steps needed
to do that ?

A lot....See Tim's answer.

Maybe I would need more generally a Canvas tool ? I tried some things in

the wx Demo, but I didn't find something easy to use for my needs.
(FloatCanvas seems a bit complicated and slow for my needs : it doesn't
provide an easy way to place buttons on the canvas)

Complicated, maybe, but it does a lot -- and much of the complication an be
ignored for simple use-cases.

I've had in mind forever to add support for Widgets -- and I don't think it
would be too hard. Patches accepted. And if you went that route, you could
take advantage of much of the existing FloatCanvas infrastructure...

(My final goal is to do this :

python - wxPython for image and buttons (resizable) - Stack Overflow
)

OH, you don't want real buttons -- you want custom drawn re-scalable
clickable thingies -- that is EXACTLY what floatcanvas makes easy for you!

Sorry, the demo is not as complete as it might be...but do look again!

Also look at the many small demos in the source:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/FloatCanvas/Demos/

-Chris

···

On Mon, Jan 27, 2014 at 10:56 AM, Basj <nouvellecollection@gmail.com> wrote:

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov