Ignore:
Timestamp:
Jan 31, 2017 10:27:36 AM (5 years ago)
Author:
toby
Message:

simplify a bit further; tested w/EPD on Mac & WinXP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElemGUI.py

    r2679 r2680  
    8383            if name[0] == 'None':
    8484                butWid *= 2
    85             # patch for wx 2.9+ on Mac/Linux where EVT_COMBOBOX happens only on a
    86             # value change. Not ideal because wx.CB_READONLY is better.
     85            # patch for wx 2.9+ where EVT_COMBOBOX happens only on a value change.
    8786            i,j= wx.__version__.split('.')[0:2]
    8887            if int(i)+int(j)/10. > 2.8:
    89                 El = wx.ComboBox(choices=name, parent=self, pos=pos, size=wx.Size(butWid,27),
    90                     style=wx.CB_DROPDOWN, value=name[0]+' ') # add an invisible space
    91                 if sum(color)/3 < 150 and color[1] < 150: # background is mostly dark, use white letters
    92                     El.SetForegroundColour((255,255,255))
     88                startname = name[0]+' '  # add an invisible space
    9389            else:
    94                 El = wx.ComboBox(choices=name, parent=self, pos=pos, size=wx.Size(butWid,23),
    95                     style=wx.CB_READONLY, value=name[0])
     90                startname = name[0]
     91            # Not ideal because wx.CB_READONLY is better.
     92            El = wx.ComboBox(choices=name, parent=self, pos=pos, size=wx.Size(butWid,27),
     93                    style=wx.CB_DROPDOWN, value=startname)
     94            #El = wx.ComboBox(choices=name, parent=self, pos=pos, size=wx.Size(butWid,23),
     95            #        style=wx.CB_READONLY, value=name[0])
     96            if sum(color)/3 < 150 and color[1] < 150: # background is mostly dark, use white letters
     97                El.SetForegroundColour((255,255,255))
    9698            El.Bind(wx.EVT_COMBOBOX,self.OnElButton)
    9799       
Note: See TracChangeset for help on using the changeset viewer.