ANN: wxPython 2.8.9.2 release

The wxWidgets team is in the early stages of preparing for a 2.8.10
release, but I already had a set of 2.8.9.2 release candidate files
that I made a few days ago. Since it's still possible that there
could be delays in the 2.8.10 release I thought that it would be nice
to go ahead and release the 2.8.9.2 binaries. So...

Announcing

···

----------

The 2.8.9.2 release of wxPython is now available for download at
http://wxpython.org/download.php. This release adds the wx.lib.agw
package, adds an event watcher to the widget inspection tool, and
fixes a bunch of bugs. A summary of changes is listed below and also
at http://wxpython.org/recentchanges.php.

Source code is available as a tarball and a source RPM, as well as
binaries for Python 2.4, 2.5 and 2.6[1], for Windows and Mac, as well
some packages for various Linux distributions.

[1] If installing the Python 2.6 version of wxPython on 64-bit XP or
Vista then please read the README presented by the installer for
instructions on how to enable the themed controls. (If anybody has a
better solution for this please let Robin know.)

What is wxPython?
-----------------

wxPython is a GUI toolkit for the Python programming language. It
allows Python programmers to create programs with a robust, highly
functional graphical user interface, simply and easily. It is
implemented as a Python extension module that wraps the GUI components
of the popular wxWidgets cross platform library, which is written in
C++.

wxPython is a cross-platform toolkit. This means that the same program
will usually run on multiple platforms without modifications.
Currently supported platforms are 32-bit and 64-bit Microsoft Windows,
most Linux or other Unix-like systems using GTK2, and Mac OS X 10.4+.
In most cases the native widgets are used on each platform to provide
a 100% native look and feel for the application.

Changes in 2.8.9.2
------------------

Added the wx.lib.agw package, which contiains most of the widgets from
http://xoomer.alice.it/infinity77/main/freeware.html written by Andrea
Gavana. Andrea's widgets that were already in wx.lib were also moved
to the wx.lib.agw package, with a small stub module left in wx.lib.
As part of this addition the demo framework was given the ability to
load demo modules from a sub-folder of the demo directory, to make it
easier to maintain collections of demo samples as a group.

Added the wx.PyPickerBase class which can be used to derive new picker
classes in Python. Used it to implement a color picker for Mac that
uses a wx.BitmapButton instead of a normal wx.Button. This makes the
color picker look and behave lots better on Mac than before.

You can now pass the handler function to the Unbind method. If it is
given then Unbind will only disconenct the event handler that uses the
same handler function, so if there are multiple bindings for the same
event type you'll now be able to selectively unbind specific
instances.

Added a new tool to the Widget Inspection Tool that allows you to watch
the events passing through a widget. It can also be used
independently, see wx.lib.eventwatcher.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

The wxWidgets team is in the early stages of preparing for a 2.8.10
release, but I already had a set of 2.8.9.2 release candidate files
that I made a few days ago. Since it's still possible that there
could be delays in the 2.8.10 release I thought that it would be nice
to go ahead and release the 2.8.9.2 binaries. So...

Announcing
----------

The 2.8.9.2 release of wxPython is now available for download at
Redirecting.... This release adds the wx.lib.agw
package, adds an event watcher to the widget inspection tool, and
fixes a bunch of bugs. A summary of changes is listed below and also
at http://wxpython.org/recentchanges.php.

Source code is available as a tarball and a source RPM, as well as
binaries for Python 2.4, 2.5 and 2.6[1], for Windows and Mac, as well
some packages for various Linux distributions.

[1] If installing the Python 2.6 version of wxPython on 64-bit XP or
Vista then please read the README presented by the installer for
instructions on how to enable the themed controls. (If anybody has a
better solution for this please let Robin know.)

What is wxPython?
-----------------

wxPython is a GUI toolkit for the Python programming language. It
allows Python programmers to create programs with a robust, highly
functional graphical user interface, simply and easily. It is
implemented as a Python extension module that wraps the GUI components
of the popular wxWidgets cross platform library, which is written in
C++.

wxPython is a cross-platform toolkit. This means that the same program
will usually run on multiple platforms without modifications.
Currently supported platforms are 32-bit and 64-bit Microsoft Windows,
most Linux or other Unix-like systems using GTK2, and Mac OS X 10.4+.
In most cases the native widgets are used on each platform to provide
a 100% native look and feel for the application.

Changes in 2.8.9.2
------------------

Added the wx.lib.agw package, which contiains most of the widgets from
http://xoomer.alice.it/infinity77/main/freeware.html written by Andrea
Gavana. Andrea's widgets that were already in wx.lib were also moved
to the wx.lib.agw package, with a small stub module left in wx.lib.
As part of this addition the demo framework was given the ability to
load demo modules from a sub-folder of the demo directory, to make it
easier to maintain collections of demo samples as a group.

Some of Andrea's demos are partially broken. The KnobCtrl and GradientButton are supposed to allow the changing of the colors of various parts of the widget. I couldn't get any of the KnobCtrl's colors to change at all. The GradientButton's Top Start color changes, but the others don't seem to (or the change is too subtle for me to tell the difference).

Added a new tool to the Widget Inspection Tool that allows you to watch
the events passing through a widget. It can also be used
independently, see wx.lib.eventwatcher.

This is really cool. It should make testing for events much easier. Thanks!

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

Just the thought of this makes me drool. I can't wait to try it.

···

On Thu, Feb 19, 2009 at 11:44 PM, Robin Dunn <robin@alldunn.com> wrote:

Added a new tool to the Widget Inspection Tool that allows you to watch
the events passing through a widget. It can also be used
independently, see wx.lib.eventwatcher.

--
Josh English
Joshua.R.English@gmail.com

I just downloaded it. Looks really nice. So far I noticed one tiny
glitch. In Recent Additions/updates -> TreeMixin->CustomTreeCtrl
unchecked check boxes have black backgrounds. Once they are checked,
their backgrounds become white (using Vista). I am assuming this is
not the intended look.

Fahri

···

On Fri, Feb 20, 2009 at 2:44 AM, Robin Dunn <robin@alldunn.com> wrote:

The wxWidgets team is in the early stages of preparing for a 2.8.10
release, but I already had a set of 2.8.9.2 release candidate files
that I made a few days ago. Since it's still possible that there
could be delays in the 2.8.10 release I thought that it would be nice
to go ahead and release the 2.8.9.2 binaries. So...

Announcing
----------

The 2.8.9.2 release of wxPython is now available for download at
Redirecting.... This release adds the wx.lib.agw
package, adds an event watcher to the widget inspection tool, and
fixes a bunch of bugs. A summary of changes is listed below and also
at http://wxpython.org/recentchanges.php.

Source code is available as a tarball and a source RPM, as well as
binaries for Python 2.4, 2.5 and 2.6[1], for Windows and Mac, as well
some packages for various Linux distributions.

[1] If installing the Python 2.6 version of wxPython on 64-bit XP or
Vista then please read the README presented by the installer for
instructions on how to enable the themed controls. (If anybody has a
better solution for this please let Robin know.)

What is wxPython?
-----------------

wxPython is a GUI toolkit for the Python programming language. It
allows Python programmers to create programs with a robust, highly
functional graphical user interface, simply and easily. It is
implemented as a Python extension module that wraps the GUI components
of the popular wxWidgets cross platform library, which is written in
C++.

wxPython is a cross-platform toolkit. This means that the same program
will usually run on multiple platforms without modifications.
Currently supported platforms are 32-bit and 64-bit Microsoft Windows,
most Linux or other Unix-like systems using GTK2, and Mac OS X 10.4+.
In most cases the native widgets are used on each platform to provide
a 100% native look and feel for the application.

Changes in 2.8.9.2
------------------

Added the wx.lib.agw package, which contiains most of the widgets from
http://xoomer.alice.it/infinity77/main/freeware.html written by Andrea
Gavana. Andrea's widgets that were already in wx.lib were also moved
to the wx.lib.agw package, with a small stub module left in wx.lib.
As part of this addition the demo framework was given the ability to
load demo modules from a sub-folder of the demo directory, to make it
easier to maintain collections of demo samples as a group.

Added the wx.PyPickerBase class which can be used to derive new picker
classes in Python. Used it to implement a color picker for Mac that
uses a wx.BitmapButton instead of a normal wx.Button. This makes the
color picker look and behave lots better on Mac than before.

You can now pass the handler function to the Unbind method. If it is
given then Unbind will only disconenct the event handler that uses the
same handler function, so if there are multiple bindings for the same
event type you'll now be able to selectively unbind specific
instances.

Added a new tool to the Widget Inspection Tool that allows you to watch
the events passing through a widget. It can also be used
independently, see wx.lib.eventwatcher.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Mike,

Some of Andrea's demos are partially broken. The KnobCtrl and GradientButton
are supposed to allow the changing of the colors of various parts of the
widget. I couldn't get any of the KnobCtrl's colors to change at all. The
GradientButton's Top Start color changes, but the others don't seem to (or
the change is too subtle for me to tell the difference).

They both work perfectly well for me. Keep in mind that in the
KnobCtrl demo, only the first KnobCtrl is customizable with colours
and ticks (look at the static box text). The same applies to the
GradientButton demo, only the bottom button will change its colours.
On which platform did you test it?

<OT>: I am waiting for congratulations ( :smiley: ), this morning at 05.36
my daughter was born: she is the most beautiful creature on earth.

I'll be back to the wxPython mailing list soon.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Fri, Feb 20, 2009 at 4:30 PM, Mike Driscoll wrote:

WOW! Congratulations! Even better than wx.lib.agw!! :smiley: Best to you all!

Che

···

On Fri, Feb 20, 2009 at 6:01 PM, Andrea Gavana andrea.gavana@gmail.com wrote:

Hi Mike,

On Fri, Feb 20, 2009 at 4:30 PM, Mike Driscoll wrote:

Some of Andrea’s demos are partially broken. The KnobCtrl and GradientButton

are supposed to allow the changing of the colors of various parts of the

widget. I couldn’t get any of the KnobCtrl’s colors to change at all. The

GradientButton’s Top Start color changes, but the others don’t seem to (or

the change is too subtle for me to tell the difference).

They both work perfectly well for me. Keep in mind that in the

KnobCtrl demo, only the first KnobCtrl is customizable with colours

and ticks (look at the static box text). The same applies to the

GradientButton demo, only the bottom button will change its colours.

On which platform did you test it?

: I am waiting for congratulations ( :smiley: ), this morning at 05.36

my daughter was born: she is the most beautiful creature on earth.

Congratulations. Enjoy it as much as you can.

···

On Fri, Feb 20, 2009 at 6:01 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

Hi Mike,

On Fri, Feb 20, 2009 at 4:30 PM, Mike Driscoll wrote:

Some of Andrea's demos are partially broken. The KnobCtrl and GradientButton
are supposed to allow the changing of the colors of various parts of the
widget. I couldn't get any of the KnobCtrl's colors to change at all. The
GradientButton's Top Start color changes, but the others don't seem to (or
the change is too subtle for me to tell the difference).

They both work perfectly well for me. Keep in mind that in the
KnobCtrl demo, only the first KnobCtrl is customizable with colours
and ticks (look at the static box text). The same applies to the
GradientButton demo, only the bottom button will change its colours.
On which platform did you test it?

<OT>: I am waiting for congratulations ( :smiley: ), this morning at 05.36
my daughter was born: she is the most beautiful creature on earth.

I'll be back to the wxPython mailing list soon.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Congratulations, enjoy every minute with her as they grow up so fast.
We are waiting for our 4 grandchild this next week.
Phil

···

At 05:01 PM 2/20/2009, Andrea Gavana wrote:

Hi Mike,

On Fri, Feb 20, 2009 at 4:30 PM, Mike Driscoll wrote:
> Some of Andrea's demos are partially broken. The KnobCtrl and GradientButton
> are supposed to allow the changing of the colors of various parts of the
> widget. I couldn't get any of the KnobCtrl's colors to change at all. The
> GradientButton's Top Start color changes, but the others don't seem to (or
> the change is too subtle for me to tell the difference).

They both work perfectly well for me. Keep in mind that in the
KnobCtrl demo, only the first KnobCtrl is customizable with colours
and ticks (look at the static box text). The same applies to the
GradientButton demo, only the bottom button will change its colours.
On which platform did you test it?

<OT>: I am waiting for congratulations ( :smiley: ), this morning at 05.36
my daughter was born: she is the most beautiful creature on earth.

I'll be back to the wxPython mailing list soon.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

most of my text boxes need reducing in width - how can I make the text box size something I decide? and the same goes for the label? how can I make it wrap?
My script is attached

get-rundata.py (9.29 KB)

most of my text boxes need reducing in width - how can I make the text box size something I decide?

When using sizers, you can give the sizer sizing the textCtrl (what you are calling a textbox, if I understand it) a proportionality value, like with any control. If you make it 0 and tell it not to expand, its size will be given by whatever you set its size at when you constructed it.

and the same goes for the label? how can I make it wrap?

I think you mean the value of the textCtrl, that is, its text? Have you tried setting the style flag wx.TE_MULTILINE ?

Lastly, when attaching a runnable sample, try to leave out if you can things like MySQL, xlrd, xlwt, etc., that don’t come standard with wxPython, since it makes it more likely people can quickly test your code.

HTH,
Che

···

On Fri, Feb 20, 2009 at 6:37 PM, Joe and Janine Loyzaga jloyzaga@bigpond.net.au wrote:

My script is attached

import wx

#import easygui

import xlwt

#import pyExcelerator

import xlrd

import MySQLdb

#import psycopg2

import os

from datetime import datetime

from datetime import date

db = MySQLdb.connect(user=“root”, passwd=“”, db=“automate-cisss”)

cursor = db.cursor()

cursor.execute(“”“SELECT DISTINCT r.Runtype FROM runtype r;”“”)

runtypes = [item[0] for item in cursor.fetchall()]

cursor.execute(“”“SELECT DISTINCT e.Environment Name FROM environments e;”“”)

envs = [item[0] for item in cursor.fetchall()]

cursor.execute(“”“SELECT DISTINCT a.AUT FROM application under test a;”“”)

AUT = [item[0] for item in cursor.fetchall()]

cursor.execute(“”“SELECT DISTINCT p.Phase FROM phase p;”“”)

phases = [item[0] for item in cursor.fetchall()]

#wb = xlrd.open_workbook(‘C:\Data\CISSS\Resources\UserIDPassword.xls’)

#sh = wb.sheet_by_name(u’Sheet1’)

#authors = [sh.cell(rowx=0,colx=1).value, sh.cell(rowx=1,colx=1).value ]

#book = pyExcelerator.parse_xls(“C:\Data\CISSS\Resources\UserIDPassword.xls”)

#data = book[0][1]

#envs = [sh.cell(rowx=0,colx=1).value, sh.cell(rowx=1,colx=1).value ]

class MyForm(wx.Frame):

    def __init__(self):

            self.runs = []

            self.input_cell = 0

            self.style0 = xlwt.easyxf('font: name Times New Roman, color-index red, bold on',

                                      num_format_str='#,##0.00')

            self.style1 = xlwt.easyxf(num_format_str='DD-MMM-YY')

            #todaypieces = date.today()

            #todaypieces="%02d-%02d-%s" % (todaypieces.day, todaypieces.month, todaypieces.year)



            #today = todaypieces.split("/")

            #today = "%s-%s-%s" % (pieces[2], pieces[1], pieces[0])

            #today= date.today.strftime('%d-%m-%Y')

            #today = date.today()

            #today = date.today.strftime('%d-%m-%Y')

            today = date.today()

            today = today.strftime("%d-%m-%Y")

            self.file_path =  "c:\Rundata-%s.xls"%(str(today))

            # get the appropriate point to add new data

            self.init_workbook()

            self.frame = wx.Frame.__init__(self, None, wx.ID_ANY, title='My Form')



            font1 = wx.Font(14, wx.DECORATIVE, wx.NORMAL, wx.BOLD, False, u'Arial')



            # Add a panel so it looks correct on all platforms

            self.panel = wx.Panel(self, wx.ID_ANY)



            bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_OTHER, (16, 16))

            titleIco = wx.StaticBitmap(self.panel, wx.ID_ANY, bmp)

            title = wx.StaticText(self.panel, wx.ID_ANY, 'Enter Automation Run Details')

            title.SetFont(font1)



            topSizer                = wx.BoxSizer(wx.VERTICAL)

            titleSizer        = wx.BoxSizer(wx.HORIZONTAL)

            self.gridSizer     = wx.GridSizer(rows=7, cols=2, hgap=5, vgap=5)

            titleSizer.Add(titleIco, 0, wx.ALL, 5)

            titleSizer.Add(title, 0, wx.ALL, 5)

            topSizer.Add(titleSizer, 0, wx.CENTER)

            topSizer.Add(wx.StaticLine(self.panel), 0, wx.ALL|wx.EXPAND, 5)



            bmp = wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_OTHER, (16, 16))



            # select Application under test

            self.cbAUT = self.combo("Select AUT", AUT, ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)

            # select Run Type

            self.cbruntype = self.combo("Select Run Type", runtypes, ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)



            # select Run Environment

            self.cbenvs = self.combo("Select Run Environment", envs, ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)



            # select Release Phase

            self.cbphases = self.combo("Select Release Phase", phases, ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)



            # select End Point

            self.inputTxtTwo = self.textbox('Ending point.  Press OK to accept or type new end point.','99', bmp)



            # select Scheduled Start Time

            self.inputTxtThree = self.textbox('Starting at what hour? - e.g. for tomorrow at 6 then just enter 6, 24 hour clock. For immediate start just accept (please note 99 should display). Press OK to accept .','99', bmp)


            # select QTP on or off

            self.checkboxqtp_value = "QTP ON?"

            self.checkBoxqtp = self.checkbox("Select QTP On or Off", self.checkboxqtp_value, ((wx.EVT_CHECKBOX, self.OnSelect),), bmp)

            # select Selenium

            self.checkboxselenium_value = "Selenium ON?"

            self.checkBoxselenium = self.checkbox("Select Selenium On or Off", self.checkboxselenium_value, ((wx.EVT_CHECKBOX, self.OnSelect),), bmp)

            # select Selenium Grid

            self.checkboxseleniumgrid_value = "Selenium Grid ON?"

            self.checkBoxseleniumgrid = self.checkbox("Select Selenium Grid On or Off", self.checkboxseleniumgrid_value, ((wx.EVT_CHECKBOX, self.OnSelect),), bmp)

            # select Starting Point

            self.inputTxtOne = self.textbox('Starting point.  Press OK to accept or type new start point. Include Header Row','2', bmp)



            topSizer.Add(self.gridSizer, 0, wx.ALL|wx.EXPAND, 5)

            topSizer.Add(wx.StaticLine(self.panel), 0, wx.ALL|wx.EXPAND, 5)

            btnSizer                = wx.BoxSizer(wx.HORIZONTAL)

            okBtn = wx.Button(self.panel, wx.ID_ANY, 'OK')

            cancelBtn = wx.Button(self.panel, wx.ID_ANY, 'Cancel')

            self.Bind(wx.EVT_BUTTON, self.onOK, okBtn)

            self.Bind(wx.EVT_BUTTON, self.onCancel, cancelBtn)

            btnSizer.Add(okBtn, 0, wx.ALL, 5)

            btnSizer.Add(cancelBtn, 0, wx.ALL, 5)

            topSizer.Add(btnSizer, 0, wx.ALL|wx.CENTER, 5)



            # SetSizeHints(minW, minH, maxW, maxH)

            self.SetSizeHints(250,300,600,500)



            self.panel.SetSizer(topSizer)

            topSizer.Fit(self)



    def combo(self, label_str, choices_list, bind_list, bmp = None):

            if bmp:

                    bitmap = wx.StaticBitmap(self.panel, wx.ID_ANY, bmp)

            label = wx.StaticText(self.panel, wx.ID_ANY, label_str)

            combo = wx.ComboBox(self.panel, -1, pos=(50, 70), size = (150, -1), choices= choices_list, style = wx.CB_READONLY)

            for event, func in bind_list:

                    combo.Bind(event, func)

            input_sizer   = wx.BoxSizer(wx.HORIZONTAL)

            input_sizer.Add((20,20), proportion=1)  # this is a spacer

            if bmp:

                    input_sizer.Add(bitmap, 0, wx.ALL, 5)

            input_sizer.Add(label, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

            self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)

            self.gridSizer.Add(combo,0,wx.EXPAND)

            return combo

    def checkbox(self, label_str, choices_list, bind_list, bmp = None):

            if bmp:

                    bitmap = wx.StaticBitmap(self.panel, wx.ID_ANY, bmp)

            label = wx.StaticText(self.panel, wx.ID_ANY, label_str)

            checkbox = wx.CheckBox(self.panel, -1, pos=(50, 70), size = (150, -1), style = wx.CB_READONLY)

            for event, func in bind_list:

                    checkbox.Bind(event, func)

            input_sizer   = wx.BoxSizer(wx.HORIZONTAL)

            input_sizer.Add((20,20), proportion=1)  # this is a spacer

            if bmp:

                    input_sizer.Add(bitmap, 0, wx.ALL, 5)

            input_sizer.Add(label, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

            self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)

            self.gridSizer.Add(checkbox,0,wx.EXPAND)

            return checkbox



    def textbox(self, label_str, default_value = '', bmp = None):

            if bmp:

                    bitmap = wx.StaticBitmap(self.panel, wx.ID_ANY, bmp)

            label = wx.StaticText(self.panel, wx.ID_ANY, label_str)

            tbox = wx.TextCtrl(self.panel, wx.ID_ANY,default_value)

            input_sizer   = wx.BoxSizer(wx.HORIZONTAL)

            input_sizer.Add((20,20), proportion=1)  # this is a spacer

            if bmp:

                    input_sizer.Add(bitmap, 0, wx.ALL, 5)

            input_sizer.Add(label, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

            self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)

            self.gridSizer.Add(tbox, 0, wx.EXPAND)

            return tbox



    def init_workbook(self):

            self.workbook = xlwt.Workbook()

            self.worksheet = self.workbook.add_sheet('Automation Run')

            if os.path.exists(self.file_path):

                    print "file exists"

                    book = xlrd.open_workbook(self.file_path)

                    sheet = book.sheet_by_index(0)

                    cells = sheet.row(0) # first row is zero

                    # The following step allows for the chance that there may be gaps

                    # in the data -- e.g. the user has deleted some items

                    data = [cell.value for cell in cells if cell.ctype != xlrd.XL_CELL_EMPTY]

                    for item in data:

                            self.worksheet.write(0, self.input_cell, item, self.style0)

                            self.input_cell += 1



    def onOK(self, event):

            # we append to runs the current values of the dialog

            results = []

            #global inputTxtOne

            for dialog in self.cbAUT, self.cbruntype, self.cbenvs, self.cbphases, self.inputTxtOne, self.inputTxtTwo, self.inputTxtThree:

                    results.append(dialog.GetValue())



            self.runs.append('|'.join(results))

            print self.runs[-1]



            #self.worksheet.write(0, self.input_cell, str(self.runs[-1]), self.style0)

            #self.input_cell += 1

            #qtp = self.chkQTP.GetValue()

            qtp = self.checkBoxqtp.GetValue()

            selenium = self.checkBoxselenium.GetValue()

            print selenium

            Grid = self.checkBoxseleniumgrid.GetValue()

            value = ''

            if qtp:

                    value = 'QTP'

            if Grid:

                    value = 'Grid'

            if selenium:

                    value = 'selenium'

            if qtp and selenium:

                    value = "QTP|Selenium"

            if qtp and Grid:

                    value = 'QTP|Grid'

            results.append(value)

            self.runs.append('|'.join(results))

            print self.runs[-1]

            self.worksheet.write(0, self.input_cell, str(self.runs[-1]), self.style0)

            self.input_cell += 1

            self.workbook.save(self.file_path)



    def onCancel(self, event):

            self.workbook.save(self.file_path)

            self.closeProgram()



    def closeProgram(self):

            # self.runs should now have the full list of different options for runs

            self.Close()



    def OnSelect(self, event):

            item = event.GetSelection()

            print item

            #v1 = cb.GetValue()



            #print item

            #print v1

            #win = event.GetEventObject() #  call this if you want to know which box was clicked

            #for ix, item in enumerate(self.cbAUT):

            #       if win == item:

            #               break

            #item = event.GetSelection()

            #print "You selected item %s in combobox number %s" % (item,ix)



            #mld = "You selected '"

            #for cb in self.cbs:

            #       v1 = cb.GetValue()

            #       if v1:

            #               mld = v1.join((mld,"', "))

            #       print mld[:-2]

                    #   #easygui.msgbox(mld[:-2])

Run the program

if name == ‘main’:

    app = wx.PySimpleApp()

    form = MyForm()

    frame = form.Show()

    app.MainLoop()

wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

So here would be changed ? to what would the proportionality value be in the code? and where would wx.TE_MULTILINE go?

if bmp:
                       bitmap = wx.StaticBitmap(self.panel, wx.ID_ANY, bmp)
               label = wx.StaticText(self.panel, wx.ID_ANY, label_str)
               tbox = wx.TextCtrl(self.panel, wx.ID_ANY,default_value)
               input_sizer = wx.BoxSizer(wx.HORIZONTAL)
               input_sizer.Add((20,20), proportion=1) # this is a spacer
               if bmp:
                       input_sizer.Add(bitmap, 0, wx.ALL, 5)
               input_sizer.Add(label, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
               self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)
               self.gridSizer.Add(tbox, 0, wx.EXPAND)
               return tbox
C M wrote:

···

On Fri, Feb 20, 2009 at 6:37 PM, Joe and Janine Loyzaga > <jloyzaga@bigpond.net.au <mailto:jloyzaga@bigpond.net.au>> wrote:

    most of my text boxes need reducing in width - how can I make the
    text box size something I decide?

When using sizers, you can give the sizer sizing the textCtrl (what you are calling a textbox, if I understand it) a proportionality value, like with any control. If you make it 0 and tell it not to expand, its size will be given by whatever you set its size at when you constructed it.
  
    and the same goes for the label? how can I make it wrap?

I think you mean the value of the textCtrl, that is, its text? Have you tried setting the style flag wx.TE_MULTILINE ?

Lastly, when attaching a runnable sample, try to leave out if you can things like MySQL, xlrd, xlwt, etc., that don't come standard with wxPython, since it makes it more likely people can quickly test your code.

HTH,
Che

    My script is attached

    import wx
    #import easygui
    import xlwt
    #import pyExcelerator
    import xlrd
    import MySQLdb
    #import psycopg2
    import os
    from datetime import datetime
    from datetime import date

    db = MySQLdb.connect(user="root", passwd="", db="automate-cisss")
    cursor = db.cursor()
    cursor.execute("""SELECT DISTINCT r.`Runtype` FROM runtype r;""")
    runtypes = [item[0] for item in cursor.fetchall()]

    cursor.execute("""SELECT DISTINCT e.`Environment Name` FROM
    environments e;""")
    envs = [item[0] for item in cursor.fetchall()]
    cursor.execute("""SELECT DISTINCT a.`AUT` FROM `application under
    test` a;""")
    AUT = [item[0] for item in cursor.fetchall()]

    cursor.execute("""SELECT DISTINCT p.`Phase` FROM `phase` p;""")
    phases = [item[0] for item in cursor.fetchall()]

    #wb = xlrd.open_workbook('C:\Data\CISSS\Resources\UserIDPassword.xls')
    #sh = wb.sheet_by_name(u'Sheet1')
    #authors = [sh.cell(rowx=0,colx=1).value,
    sh.cell(rowx=1,colx=1).value ]
    #book =
    pyExcelerator.parse_xls("C:\Data\CISSS\Resources\UserIDPassword.xls")
    #data = book[0][1]
    #envs = [sh.cell(rowx=0,colx=1).value, sh.cell(rowx=1,colx=1).value ]
    class MyForm(wx.Frame):
           def __init__(self):
                   self.runs =
                   self.input_cell = 0
                   self.style0 = xlwt.easyxf('font: name Times New
    Roman, color-index red, bold on',
                                             num_format_str='#,##0.00')
                   self.style1 = xlwt.easyxf(num_format_str='DD-MMM-YY')
                   #todaypieces = date.today()
                   #todaypieces="%02d-%02d-%s" % (todaypieces.day,
    todaypieces.month, todaypieces.year)

                   #today = todaypieces.split("/")
                   #today = "%s-%s-%s" % (pieces[2], pieces[1], pieces[0])
                   #today= date.today.strftime('%d-%m-%Y')
                   #today = date.today()
                   #today = date.today.strftime('%d-%m-%Y')
                   today = date.today()
                   today = today.strftime("%d-%m-%Y")
                   self.file_path = "c:\Rundata-%s.xls"%(str(today))
                   # get the appropriate point to add new data
                   self.init_workbook()
                   self.frame = wx.Frame.__init__(self, None,
    wx.ID_ANY, title='My Form')

                   font1 = wx.Font(14, wx.DECORATIVE, wx.NORMAL,
    wx.BOLD, False, u'Arial')

                   # Add a panel so it looks correct on all platforms
                   self.panel = wx.Panel(self, wx.ID_ANY)

                   bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION,
    wx.ART_OTHER, (16, 16))
                   titleIco = wx.StaticBitmap(self.panel, wx.ID_ANY, bmp)
                   title = wx.StaticText(self.panel, wx.ID_ANY, 'Enter
    Automation Run Details')
                   title.SetFont(font1)

                   topSizer = wx.BoxSizer(wx.VERTICAL)
                   titleSizer = wx.BoxSizer(wx.HORIZONTAL)
                   self.gridSizer = wx.GridSizer(rows=7, cols=2,
    hgap=5, vgap=5)
                   titleSizer.Add(titleIco, 0, wx.ALL, 5)
                   titleSizer.Add(title, 0, wx.ALL, 5)
                   topSizer.Add(titleSizer, 0, wx.CENTER)
                   topSizer.Add(wx.StaticLine(self.panel), 0,
    wx.ALL|wx.EXPAND, 5)

                   bmp = wx.ArtProvider.GetBitmap(wx.ART_HELP,
    wx.ART_OTHER, (16, 16))

                   # select Application under test
                   self.cbAUT = self.combo("Select AUT", AUT,
    ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)
                   # select Run Type
                   self.cbruntype = self.combo("Select Run Type",
    runtypes, ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)

                   # select Run Environment
                   self.cbenvs = self.combo("Select Run Environment",
    envs, ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)

                   # select Release Phase
                   self.cbphases = self.combo("Select Release Phase",
    phases, ((wx.EVT_COMBOBOX, self.OnSelect),), bmp)

                   # select End Point
                   self.inputTxtTwo = self.textbox('Ending point.
     Press OK to accept or type new end point.','99', bmp)

                   # select Scheduled Start Time
                   self.inputTxtThree = self.textbox('Starting at what
    hour? - e.g. for tomorrow at 6 then just enter 6, 24 hour clock.
    For immediate start just accept (please note 99 should display).
    Press OK to accept .','99', bmp)
                   # select QTP on or off
                   self.checkboxqtp_value = "QTP ON?"
                   self.checkBoxqtp = self.checkbox("Select QTP On or
    Off", self.checkboxqtp_value, ((wx.EVT_CHECKBOX, self.OnSelect),),
    bmp)
                   # select Selenium
                   self.checkboxselenium_value = "Selenium ON?"
                   self.checkBoxselenium = self.checkbox("Select
    Selenium On or Off", self.checkboxselenium_value,
    ((wx.EVT_CHECKBOX, self.OnSelect),), bmp)
                   # select Selenium Grid
                   self.checkboxseleniumgrid_value = "Selenium Grid ON?"
                   self.checkBoxseleniumgrid = self.checkbox("Select
    Selenium Grid On or Off", self.checkboxseleniumgrid_value,
    ((wx.EVT_CHECKBOX, self.OnSelect),), bmp)
                   # select Starting Point
                   self.inputTxtOne = self.textbox('Starting point.
     Press OK to accept or type new start point. Include Header
    Row','2', bmp)

                   topSizer.Add(self.gridSizer, 0, wx.ALL|wx.EXPAND, 5)
                   topSizer.Add(wx.StaticLine(self.panel), 0,
    wx.ALL|wx.EXPAND, 5)
                   btnSizer = wx.BoxSizer(wx.HORIZONTAL)
                   okBtn = wx.Button(self.panel, wx.ID_ANY, 'OK')
                   cancelBtn = wx.Button(self.panel, wx.ID_ANY, 'Cancel')
                   self.Bind(wx.EVT_BUTTON, self.onOK, okBtn)
                   self.Bind(wx.EVT_BUTTON, self.onCancel, cancelBtn)
                   btnSizer.Add(okBtn, 0, wx.ALL, 5)
                   btnSizer.Add(cancelBtn, 0, wx.ALL, 5)
                   topSizer.Add(btnSizer, 0, wx.ALL|wx.CENTER, 5)

                   # SetSizeHints(minW, minH, maxW, maxH)
                   self.SetSizeHints(250,300,600,500)

                   self.panel.SetSizer(topSizer)
                   topSizer.Fit(self)

           def combo(self, label_str, choices_list, bind_list, bmp =
    None):
                   if bmp:
                           bitmap = wx.StaticBitmap(self.panel,
    wx.ID_ANY, bmp)
                   label = wx.StaticText(self.panel, wx.ID_ANY, label_str)
                   combo = wx.ComboBox(self.panel, -1, pos=(50, 70),
    size = (150, -1), choices= choices_list, style = wx.CB_READONLY)
                   for event, func in bind_list:
                           combo.Bind(event, func)
                   input_sizer = wx.BoxSizer(wx.HORIZONTAL)
                   input_sizer.Add((20,20), proportion=1) # this is a
    spacer
                   if bmp:
                           input_sizer.Add(bitmap, 0, wx.ALL, 5)
                   input_sizer.Add(label, 0,
    wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
                   self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)
                   self.gridSizer.Add(combo,0,wx.EXPAND)
                   return combo
           def checkbox(self, label_str, choices_list, bind_list, bmp
    = None):
                   if bmp:
                           bitmap = wx.StaticBitmap(self.panel,
    wx.ID_ANY, bmp)
                   label = wx.StaticText(self.panel, wx.ID_ANY, label_str)
                   checkbox = wx.CheckBox(self.panel, -1, pos=(50,
    70), size = (150, -1), style = wx.CB_READONLY)
                   for event, func in bind_list:
                           checkbox.Bind(event, func)
                   input_sizer = wx.BoxSizer(wx.HORIZONTAL)
                   input_sizer.Add((20,20), proportion=1) # this is a
    spacer
                   if bmp:
                           input_sizer.Add(bitmap, 0, wx.ALL, 5)
                   input_sizer.Add(label, 0,
    wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
                   self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)
                   self.gridSizer.Add(checkbox,0,wx.EXPAND)
                   return checkbox

           def textbox(self, label_str, default_value = '', bmp = None):
                   if bmp:
                           bitmap = wx.StaticBitmap(self.panel,
    wx.ID_ANY, bmp)
                   label = wx.StaticText(self.panel, wx.ID_ANY, label_str)
                   tbox = wx.TextCtrl(self.panel, wx.ID_ANY,default_value)
                   input_sizer = wx.BoxSizer(wx.HORIZONTAL)
                   input_sizer.Add((20,20), proportion=1) # this is a
    spacer
                   if bmp:
                           input_sizer.Add(bitmap, 0, wx.ALL, 5)
                   input_sizer.Add(label, 0,
    wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
                   self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)
                   self.gridSizer.Add(tbox, 0, wx.EXPAND)
                   return tbox

           def init_workbook(self):
                   self.workbook = xlwt.Workbook()
                   self.worksheet =
    self.workbook.add_sheet('Automation Run')
                   if os.path.exists(self.file_path):
                           print "file exists"
                           book = xlrd.open_workbook(self.file_path)
                           sheet = book.sheet_by_index(0)
                           cells = sheet.row(0) # first row is zero
                           # The following step allows for the chance
    that there may be gaps
                           # in the data -- e.g. the user has deleted
    some items
                           data = [cell.value for cell in cells if
    cell.ctype != xlrd.XL_CELL_EMPTY]
                           for item in data:
                                   self.worksheet.write(0,
    self.input_cell, item, self.style0)
                                   self.input_cell += 1

           def onOK(self, event):
                   # we append to runs the current values of the dialog
                   results =
                   #global inputTxtOne
                   for dialog in self.cbAUT, self.cbruntype,
    self.cbenvs, self.cbphases, self.inputTxtOne, self.inputTxtTwo,
    self.inputTxtThree:
                           results.append(dialog.GetValue())

                   self.runs.append('|'.join(results))
                   print self.runs[-1]

                   #self.worksheet.write(0, self.input_cell,
    str(self.runs[-1]), self.style0)
                   #self.input_cell += 1
                   #qtp = self.chkQTP.GetValue()
                   qtp = self.checkBoxqtp.GetValue()
                   selenium = self.checkBoxselenium.GetValue()
                   print selenium
                   Grid = self.checkBoxseleniumgrid.GetValue()
                   value = ''
                   if qtp:
                           value = 'QTP'
                   if Grid:
                           value = 'Grid'
                   if selenium:
                           value = 'selenium'
                   if qtp and selenium:
                           value = "QTP|Selenium"
                   if qtp and Grid:
                           value = 'QTP|Grid'
                   results.append(value)
                   self.runs.append('|'.join(results))
                   print self.runs[-1]
                   self.worksheet.write(0, self.input_cell,
    str(self.runs[-1]), self.style0)
                   self.input_cell += 1
                   self.workbook.save(self.file_path)

           def onCancel(self, event):
                   self.workbook.save(self.file_path)
                   self.closeProgram()

           def closeProgram(self):
                   # self.runs should now have the full list of
    different options for runs
                   self.Close()

           def OnSelect(self, event):
                   item = event.GetSelection()
                   print item
                   #v1 = cb.GetValue()

                   #print item
                   #print v1
                   #win = event.GetEventObject() # call this if you
    want to know which box was clicked
                   #for ix, item in enumerate(self.cbAUT):
                   # if win == item:
                   # break
                   #item = event.GetSelection()
                   #print "You selected item %s in combobox number %s"
    % (item,ix)

                   #mld = "You selected '"
                   #for cb in self.cbs:
                   # v1 = cb.GetValue()
                   # if v1:
                   # mld = v1.join((mld,"', "))
                   # print mld[:-2]
                           # #easygui.msgbox(mld[:-2])

    # Run the program
    if __name__ == '__main__':
           app = wx.PySimpleApp()
           form = MyForm()
           frame = form.Show()
           app.MainLoop()

    _______________________________________________
    wxpython-users mailing list
    wxpython-users@lists.wxwidgets.org
    <mailto:wxpython-users@lists.wxwidgets.org>
    http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

------------------------------------------------------------------------

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

where is a really good wxpython reference where I can see what values are available for controls and perhaps an example of how to set them?
Joe

Andrea Gavana wrote:

<OT>: I am waiting for congratulations ( :smiley: ), this morning at 05.36
my daughter was born: she is the most beautiful creature on earth.

Yay! How long until she is creating generic widgets for wxPython? :wink:

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Mike Driscoll wrote:

Some of Andrea's demos are partially broken. The KnobCtrl and GradientButton are supposed to allow the changing of the colors of various parts of the widget. I couldn't get any of the KnobCtrl's colors to change at all. The GradientButton's Top Start color changes, but the others don't seem to (or the change is too subtle for me to tell the difference).

Try this in the GradientButton, maybe it will help it make more sense for you:

1. Set the Top Start to a light or medium color
2. Set the Top End to a darker shade of the same color
3. Set the Bottom Start to the same color as #2
4. Set the Bottom End to a dark color

If you only do one or two of those then it can end up in a weird state, or one that is difficult to see what has changed.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Fahreddın Basegmez wrote:

I just downloaded it. Looks really nice. So far I noticed one tiny
glitch. In Recent Additions/updates -> TreeMixin->CustomTreeCtrl
unchecked check boxes have black backgrounds. Once they are checked,
their backgrounds become white (using Vista). I am assuming this is
not the intended look.

No, and I am unable to duplicate the problem on my XP or Vista systems. Do you have anything special about yours?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Joe and Janine Loyzaga wrote:

where is a really good wxpython reference where I can see what values are available for controls and perhaps an example of how to set them?

Here are a few:
  wxWidgets: Documentation
  wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
  http://wiki.wxpython.org/
  How to Learn wxPython - wxPyWiki
  C++GuideForwxPythoneers - wxPyWiki
  wxPython tutorial - Python GUI programming in wxPython

And don't forget to refer to the wxPython demo. Almost everything is shown there with a typical usage, and you can also edit the code for the samples on the fly and see the results immediately. Experimentation is a great teacher.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Joe and Janine Loyzaga wrote:

So here would be changed ? to what would the proportionality value be in the code? and where would wx.TE_MULTILINE go?

if bmp:
                      bitmap = wx.StaticBitmap(self.panel, wx.ID_ANY, bmp)
              label = wx.StaticText(self.panel, wx.ID_ANY, label_str)
              tbox = wx.TextCtrl(self.panel, wx.ID_ANY,default_value)
              input_sizer = wx.BoxSizer(wx.HORIZONTAL)
              input_sizer.Add((20,20), proportion=1) # this is a spacer
              if bmp:
                      input_sizer.Add(bitmap, 0, wx.ALL, 5)
              input_sizer.Add(label, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
              self.gridSizer.Add(input_sizer, 0, wx.ALIGN_RIGHT)
              self.gridSizer.Add(tbox, 0, wx.EXPAND)
              return tbox

http://wiki.wxpython.org/MakingSampleApps

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Joe and Janine Loyzaga wrote:

where is a really good wxpython reference where I can see what values are available for controls and perhaps an example of how to set them?

Here are a few:
    wxWidgets: Documentation
    wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
    http://wiki.wxpython.org/
    How to Learn wxPython - wxPyWiki
    C++GuideForwxPythoneers - wxPyWiki
    wxPython tutorial - Python GUI programming in wxPython

And don't forget to refer to the wxPython demo. Almost everything is shown there with a typical usage, and you can also edit the code for the samples on the fly and see the results immediately. Experimentation is a great teacher.

wheres the demo?

Not really. Have an Nvidia GeForce 8500 GT video card. Nothing
custom. This is the machine I am developing my wxPython application
with and haven't noticed any other problems. When I get a chance, I
will install the new version on my XP machine and see how that goes.
Probably next week.

···

On Fri, Feb 20, 2009 at 9:43 PM, Robin Dunn <robin@alldunn.com> wrote:

Fahreddın Basegmez wrote:

I just downloaded it. Looks really nice. So far I noticed one tiny
glitch. In Recent Additions/updates -> TreeMixin->CustomTreeCtrl
unchecked check boxes have black backgrounds. Once they are checked,
their backgrounds become white (using Vista). I am assuming this is
not the intended look.

No, and I am unable to duplicate the problem on my XP or Vista systems. Do
you have anything special about yours?

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

This was a bit garbled on my screen, as I’m only reading “wheres the demo?”. I assume what was cut off the message was, “Thank you, Robin, for providing those very helpful links. Could you just tell me where I could find the demo?” Might want to try adjusting the settings on your email client.

···

On Fri, Feb 20, 2009 at 9:56 PM, Joe and Janine Loyzaga jloyzaga@bigpond.net.au wrote:

Robin Dunn wrote:

Joe and Janine Loyzaga wrote:

where is a really good wxpython reference where I can see what values are available for controls and perhaps an example of how to set them?

Here are a few:

[http://docs.wxwidgets.org/stable/](http://docs.wxwidgets.org/stable/)

[http://wxpython.org/docs/api/](http://wxpython.org/docs/api/)

[http://wiki.wxpython.org/](http://wiki.wxpython.org/)

[http://wiki.wxpython.org/How%20to%20Learn%20wxPython](http://wiki.wxpython.org/How%20to%20Learn%20wxPython)

[http://wiki.wxpython.org/C%2B%2BGuideForwxPythoneers](http://wiki.wxpython.org/C%2B%2BGuideForwxPythoneers)

[http://zetcode.com/wxpython/](http://zetcode.com/wxpython/)

And don’t forget to refer to the wxPython demo. Almost everything is shown there with a typical usage, and you can also edit the code for the samples on the fly and see the results immediately. Experimentation is a great teacher.

wheres the demo?