Style is now cleared when the API key/User ID controls are changed (clipboard style would overwrite the default style on osx)

This commit is contained in:
Niklas Bölter
2010-11-14 14:03:07 +01:00
parent 6d5171688c
commit 18d142e2a1

View File

@@ -513,6 +513,7 @@ class APIView (wx.Panel):
fgSizerInput.Add(self.m_staticIDText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
self.inputID = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
self.inputID.Bind(wx.EVT_TEXT, self.removeStyle)
fgSizerInput.Add(self.inputID, 1, wx.ALL | wx.EXPAND, 5)
self.m_staticKeyText = wx.StaticText(self, wx.ID_ANY, u"API key:", wx.DefaultPosition, wx.DefaultSize, 0)
@@ -520,6 +521,7 @@ class APIView (wx.Panel):
fgSizerInput.Add(self.m_staticKeyText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
self.inputKey = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
self.inputKey.Bind(wx.EVT_TEXT, self.removeStyle)
fgSizerInput.Add(self.inputKey, 0, wx.ALL | wx.EXPAND, 5)
pmainSizer.Add(fgSizerInput, 0, wx.EXPAND, 5)
@@ -555,6 +557,14 @@ class APIView (wx.Panel):
self.Layout()
self.charChanged(None)
def removeStyle(self, event):
object = event.GetEventObject()
value = object.GetLineText(0)
object.Clear()
object.ChangeValue(value)
object.SetModified(True)
event.Skip()
def charChanged(self, event):
cChar = service.Character.getInstance()
ID, key = cChar.getApiDetails(self.Parent.Parent.getActiveCharacter())