Skip to content

Commit 36aaabf

Browse files
authored
Merge pull request #27 from NSoiffer/fixSanjogBugReports
Various bug fixes
2 parents b6c943f + 54a5fc2 commit 36aaabf

File tree

3 files changed

+44
-44
lines changed

3 files changed

+44
-44
lines changed

NVDA-addon/addon/globalPlugins/MathCAT/MathCATPreferences.py

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -272,48 +272,47 @@ def MathCATPreferencesDialogOnCharHook(self,event):
272272
return
273273
if keyCode == wx.WXK_RETURN:
274274
UserInterface.OnClickOK(self,event)
275-
if keyCode == wx.WXK_TAB and (event.GetModifiers() == wx.MOD_CONTROL):
276-
#cycle the category forward
277-
new_category = self.m_listBoxPreferencesTopic.GetSelection() + 1
278-
if new_category == 3:
279-
new_category = 0
280-
self.m_listBoxPreferencesTopic.SetSelection(new_category)
281-
#update the ui to show the new page
282-
UserInterface.OnListBoxCategories(self,event)
283-
#set the focus into the category list box
284-
self.m_listBoxPreferencesTopic.SetFocus()
285-
#jump out so the tab key is not processed
286-
return
287-
if keyCode == wx.WXK_TAB and (event.GetModifiers() == wx.MOD_CONTROL|wx.MOD_SHIFT):
288-
#cycle the category back
289-
new_category = self.m_listBoxPreferencesTopic.GetSelection() - 1
290-
if new_category == -1:
291-
new_category = 2
292-
self.m_listBoxPreferencesTopic.SetSelection(new_category)
293-
#update the ui to show the new page
294-
UserInterface.OnListBoxCategories(self,event)
295-
#update the ui to show the new page
296-
self.m_listBoxPreferencesTopic.SetFocus()
297-
#jump out so the tab key is not processed
298-
return
299-
if (event.GetModifiers() == wx.MOD_NONE) and (MathCATgui.MathCATPreferencesDialog.FindFocus() == self.m_listBoxPreferencesTopic):
300-
#user tabbed from into the paged content, set the focus on the first control
301-
if self.m_listBoxPreferencesTopic.GetSelection() == 0:
302-
self.m_choiceImpairment.SetFocus()
303-
elif self.m_listBoxPreferencesTopic.GetSelection() == 1:
304-
self.m_choiceNavigationMode.SetFocus()
305-
elif self.m_listBoxPreferencesTopic.GetSelection() == 2:
306-
self.m_choiceBrailleMathCode.SetFocus()
307-
return
308-
if (event.GetModifiers() == wx.MOD_SHIFT) and (MathCATgui.MathCATPreferencesDialog.FindFocus() == self.m_buttonOK):
309-
#user shift+tabbed from into the paged content, set the focus on the last control
310-
if self.m_listBoxPreferencesTopic.GetSelection() == 0:
311-
self.m_choiceSpeechForChemical.SetFocus()
312-
elif self.m_listBoxPreferencesTopic.GetSelection() == 1:
313-
self.m_choiceSpeechAmountNavigation.SetFocus()
314-
elif self.m_listBoxPreferencesTopic.GetSelection() == 2:
315-
self.m_choiceBrailleHighlights.SetFocus()
316-
return
275+
if keyCode == wx.WXK_TAB:
276+
if event.GetModifiers() == wx.MOD_CONTROL:
277+
#cycle the category forward
278+
new_category = self.m_listBoxPreferencesTopic.GetSelection() + 1
279+
if new_category == 3:
280+
new_category = 0
281+
self.m_listBoxPreferencesTopic.SetSelection(new_category)
282+
#update the ui to show the new page
283+
UserInterface.OnListBoxCategories(self,event)
284+
#set the focus into the category list box
285+
self.m_listBoxPreferencesTopic.SetFocus()
286+
#jump out so the tab key is not processed
287+
return
288+
if event.GetModifiers() == wx.MOD_CONTROL|wx.MOD_SHIFT:
289+
#cycle the category back
290+
new_category = self.m_listBoxPreferencesTopic.GetSelection() - 1
291+
if new_category == -1:
292+
new_category = 2
293+
self.m_listBoxPreferencesTopic.SetSelection(new_category)
294+
#update the ui to show the new page
295+
UserInterface.OnListBoxCategories(self,event)
296+
#update the ui to show the new page
297+
self.m_listBoxPreferencesTopic.SetFocus()
298+
#jump out so the tab key is not processed
299+
return
300+
if (event.GetModifiers() == wx.MOD_NONE) and (MathCATgui.MathCATPreferencesDialog.FindFocus() == self.m_listBoxPreferencesTopic):
301+
if self.m_listBoxPreferencesTopic.GetSelection() == 0:
302+
self.m_choiceImpairment.SetFocus()
303+
elif self.m_listBoxPreferencesTopic.GetSelection() == 1:
304+
self.m_choiceNavigationMode.SetFocus()
305+
elif self.m_listBoxPreferencesTopic.GetSelection() == 2:
306+
self.m_choiceBrailleMathCode.SetFocus()
307+
return
308+
if (event.GetModifiers() == wx.MOD_SHIFT) and (MathCATgui.MathCATPreferencesDialog.FindFocus() == self.m_buttonOK):
309+
if self.m_listBoxPreferencesTopic.GetSelection() == 0:
310+
self.m_choiceSpeechForChemical.SetFocus()
311+
elif self.m_listBoxPreferencesTopic.GetSelection() == 1:
312+
self.m_choiceSpeechAmountNavigation.SetFocus()
313+
elif self.m_listBoxPreferencesTopic.GetSelection() == 2:
314+
self.m_choiceBrailleHighlights.SetFocus()
315+
return
317316
#continue handling keyboard event
318317
event.Skip()
319318

NVDA-addon/addon/globalPlugins/MathCAT/MathCATgui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class MathCATPreferencesDialog ( wx.Dialog ):
2121

2222
def __init__( self, parent ):
23-
wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"MathCAT Preferences"), pos = wx.DefaultPosition, size = wx.Size( 636,389 ), style = wx.DEFAULT_DIALOG_STYLE )
23+
wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"MathCAT Preferences"), pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.DEFAULT_DIALOG_STYLE )
2424

2525
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
2626

@@ -311,6 +311,7 @@ def __init__( self, parent ):
311311

312312
self.SetSizer( gbSizer1 )
313313
self.Layout()
314+
gbSizer1.Fit( self )
314315

315316
self.Centre( wx.BOTH )
316317

wxFormBuilder/MathCATgui.fbp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<property name="minimum_size"></property>
4848
<property name="name">MathCATPreferencesDialog</property>
4949
<property name="pos"></property>
50-
<property name="size">636,389</property>
50+
<property name="size">-1,-1</property>
5151
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
5252
<property name="subclass">; ; forward_declare</property>
5353
<property name="title">MathCAT Preferences</property>

0 commit comments

Comments
 (0)