Configtool: make tooltips for radio buttons work on Linux.
The problem was, applying tooltips to the radio buttons directly showed no effect on Linux. While this is likely a bug in wxPython, we can't change this behaviour. The solution is to also apply these help texts to the surrounding StaticBox. This works, even for the radio buttons. This solves issue #149.
This commit is contained in:
parent
276b82d013
commit
e5e8983427
|
|
@ -5,7 +5,7 @@
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def KINEMATICS
|
||||
/** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY
|
||||
This defines the type of kinematics your printer uses. That's essential!
|
||||
|
||||
Valid values (see dda_kinematics.h):
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def KINEMATICS
|
||||
/** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY
|
||||
This defines the type of kinematics your printer uses. That's essential!
|
||||
|
||||
Valid values (see dda_kinematics.h):
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class AccelerationPage(wx.Panel, Page):
|
|||
sbox.AddSpacer((5, 5))
|
||||
style = wx.RB_GROUP
|
||||
for k in self.accTypeKeys:
|
||||
rb = self.addRadioButton(k, style, self.onAccTypeSelect)
|
||||
rb = self.addRadioButton(k, style, self.onAccTypeSelect, b)
|
||||
style = 0
|
||||
|
||||
sbox.Add(rb, 1, wx.LEFT + wx.RIGHT, 16)
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class MechanicalPage(wx.Panel, Page):
|
|||
sbox.AddSpacer((5, 5))
|
||||
style = wx.RB_GROUP
|
||||
for k in self.kinematicsKeys:
|
||||
rb = self.addRadioButton(k, style, self.onKinematicsSelect)
|
||||
rb = self.addRadioButton(k, style, self.onKinematicsSelect, b)
|
||||
style = 0
|
||||
|
||||
sbox.Add(rb, 1, wx.LEFT + wx.RIGHT, 16)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class Page:
|
|||
self.textControls = {}
|
||||
self.checkBoxes = {}
|
||||
self.radioButtons = {}
|
||||
self.radioButtonBoxes = {}
|
||||
self.choices = {}
|
||||
self.font = font
|
||||
|
||||
|
|
@ -54,11 +55,13 @@ class Page:
|
|||
|
||||
return cb
|
||||
|
||||
def addRadioButton(self, name, style, validator):
|
||||
def addRadioButton(self, name, style, validator, sbox = None):
|
||||
rb = wx.RadioButton(self, wx.ID_ANY, self.labels[name], style = style)
|
||||
rb.SetFont(self.font)
|
||||
self.Bind(wx.EVT_RADIOBUTTON, validator, rb)
|
||||
self.radioButtons[name] = rb
|
||||
if sbox is not None:
|
||||
self.radioButtonBoxes[name] = sbox
|
||||
|
||||
return rb
|
||||
|
||||
|
|
@ -195,6 +198,8 @@ class Page:
|
|||
for k in self.radioButtons.keys():
|
||||
if k in ht.keys():
|
||||
self.radioButtons[k].SetToolTipString(ht[k])
|
||||
if k in self.radioButtonBoxes.keys():
|
||||
self.radioButtonBoxes[k].SetToolTipString(ht[k])
|
||||
|
||||
for k in self.choices.keys():
|
||||
if k in ht.keys():
|
||||
|
|
|
|||
Loading…
Reference in New Issue