Numerical Input and manipulation

I'm new to wxpython. I see some ways of taking numerical user input in the
masked edit controls portion of the wxPython demo but I don't see any
example of how to actually take and manipulate the user input for those data
fields. Are there some simpler examples somewhere that I'm missing? And
for that matter, are masked edit controls the best/only way to take user
input? The specific program I am working on is one to do English to Metric
to English conversions. Any help is greatly appreciated. Thank you!

Mactov wrote:

I need Candlestick and DataBaseConnector objects on
the model part, a Controller and some View things such as Panels and
frames. But I feel very embarassed with the "device context". My
CandleSet class has a DrawSeries method but it must draw in one of
those DCs (wxMemoryDC ?) and my panels should also use DC to draw basic
things such as axis and legend. How can I share an only one DC ?

your DrawSeries method should take a DC as an input parameter:

def DrawSeries(self,DC)
        #draw some stuff:
        .....
        DC.DrawREctangle(x,y,w,h)
        ....

THat way you can draw your axes, etc ont eh DC, then pass it in to draw
the Candles (whatever the heck they are!)

Do I have to use two DCs and
"blit" the Model DC to the View DC when all computing stuff is done ?

No, but you may want to draw to a background DC and blit it to the
screen when you're done (Double Buffering). Also, I wouldn't think the
Model in an MVC structure would have a DC.

Take a look at the Wiki at the topics here for more about drawing:

http://wiki.wxpython.org/index.cgi/RecipesImagesAndGraphics

Particularly (because I wrote it)
http://wiki.wxpython.org/index.cgi/DoubleBufferedDrawing

Also, take a look at the FloatCanvas in the latest version of the Demo.
You might be able to make use of it, or get ideas from it in any case.
If you're on Windows, the version included doesn't work so well, so you
might want to try this one:

ftp://ftp.orr.noaa.gov/From_ORR/HMRD/FromChris/FloatCanvas2.zip

You also might want to check out wxPyPlot:

http://www.cyberus.ca/~g_will/wxPython/wxpyplot.html

For more ideas.

-Chris

ยทยทยท

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (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