compatibility wxpython4.2
authorpierre <ratinaud@univ-tlse2.fr>
Thu, 26 Oct 2023 16:05:21 +0000 (18:05 +0200)
committerpierre <ratinaud@univ-tlse2.fr>
Thu, 26 Oct 2023 16:05:21 +0000 (18:05 +0200)
dialog.py

index d0a59c9..67c8a2b 100755 (executable)
--- a/dialog.py
+++ b/dialog.py
@@ -743,22 +743,22 @@ class PrefGraph(wx.Dialog):
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(self.label_4, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         sizer_nb = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_nb.Add(self.check1, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_nb.Add(self.spin_nb, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_nb.Add(self.check1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_nb.Add(self.spin_nb, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
         fsizer.Add(sizer_nb, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(self.label_chic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         sizer_nbchic = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_nbchic.Add(self.check_chic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_nbchic.Add(self.spin_nbchic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_nbchic.Add(self.check_chic, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_nbchic.Add(self.spin_nbchic, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
         fsizer.Add(sizer_nbchic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(self.label_5, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         sizer_chi = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_chi.Add(self.spin_chi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_chi.Add(self.spin_chi, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
         fsizer.Add(sizer_chi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
@@ -769,7 +769,7 @@ class PrefGraph(wx.Dialog):
         sizer_2.Add(fsizer, 0, wx.EXPAND, 0)
         bsizer_1 = wx.FlexGridSizer(0,3,0,0)
         bsizer_1.Add(self.label_7, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        bsizer_1.Add(self.check4, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
+        bsizer_1.Add(self.check4, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
         grid_min.Add(self.label_min, 0,wx.ALL |  wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
         grid_min.Add(self.spin_min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
         grid_max.Add(self.label_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -781,7 +781,7 @@ class PrefGraph(wx.Dialog):
         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         bsizer_1.Add(self.label_tchi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        bsizer_1.Add(self.check_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
+        bsizer_1.Add(self.check_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
         grid_min_tchi.Add(self.label_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
         grid_min_tchi.Add(self.spin_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
         grid_max_tchi.Add(self.label_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -792,12 +792,12 @@ class PrefGraph(wx.Dialog):
         sizer_2.Add(bsizer_1, 0, wx.EXPAND, 5)
         sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         sizer_f = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_f.Add(self.label_8, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_f.Add(self.spin_f1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_f.Add(self.label_9, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_f.Add(self.spin_f2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_f.Add(self.label_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
-        sizer_f.Add(self.spin_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_f.Add(self.label_8, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_f.Add(self.spin_f1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_f.Add(self.label_9, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_f.Add(self.spin_f2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_f.Add(self.label_f3, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_f.Add(self.spin_f3, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
         sizer_2.Add(sizer_f, 0, wx.EXPAND, 5)
         sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 5)
         fsizer2 = wx.FlexGridSizer(0,2,0,0)
@@ -1218,7 +1218,7 @@ class PrefUCECarac(wx.Dialog):
         btn_ok.SetDefault()
         btnsizer.AddButton(btn_ok)
         btnsizer.Realize()
-        first.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
+        first.Add(btnsizer, 0, wx.ALIGN_RIGHT, 5)
         self.SetSizer(first)
         first.Fit(self)
 
@@ -2001,16 +2001,16 @@ class PrefWordCloud ( wx.Dialog ):
         bSizer5.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
         self.spin_mincex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 5 )
         self.spin_mincex.SetValue( 5 )
-        bSizer5.Add( self.spin_mincex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
-        bSizer4.Add( bSizer5, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
+        bSizer5.Add( self.spin_mincex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        bSizer4.Add( bSizer5, 1, wx.EXPAND, 5 )
         bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
         self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, "Max", wx.DefaultPosition, wx.DefaultSize, 0 )
         self.m_staticText8.Wrap( -1 )
-        bSizer6.Add( self.m_staticText8, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        bSizer6.Add( self.m_staticText8, 0,wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
         self.spin_maxcex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 50 )
         self.spin_maxcex.SetValue( 50 )
         bSizer6.Add( self.spin_maxcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
-        bSizer4.Add( bSizer6, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
+        bSizer4.Add( bSizer6, 1, wx.EXPAND, 5 )
         fgSizer1.Add( bSizer4, 1, wx.EXPAND, 5 )
         self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
         fgSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
@@ -2026,7 +2026,7 @@ class PrefWordCloud ( wx.Dialog ):
         bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
         self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, _("Background color"), wx.DefaultPosition, wx.DefaultSize, 0 )
         self.m_staticText9.Wrap( -1 )
-        bSizer7.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
+        bSizer7.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
         self.color_bg = wx.ColourPickerCtrl( self, wx.ID_ANY, (255,255,255), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
         bSizer7.Add( self.color_bg, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
         fgSizer1.Add( bSizer7, 1, wx.EXPAND, 5 )
@@ -2477,11 +2477,11 @@ class message(wx.Frame):
         sizer_2.Add(self.HtmlPage, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         #m_sdbSizer1 = wx.StdDialogButtonSizer()
         m_sdbSizer1 = wx.BoxSizer(wx.HORIZONTAL)
-        m_sdbSizer1.Add(  self.button_1 , 0, wx.ALIGN_RIGHT | wx.EXPAND)
+        m_sdbSizer1.Add(  self.button_1 , 0, wx.EXPAND)
         if self.save :
-            m_sdbSizer1.Add(  self.button_2 , 0, wx.ALIGN_RIGHT | wx.EXPAND)
+            m_sdbSizer1.Add(  self.button_2 , 0, wx.EXPAND)
         if self.uceids is not None :
-            m_sdbSizer1.Add(  self.butsub , 0, wx.ALIGN_RIGHT | wx.EXPAND)
+            m_sdbSizer1.Add(  self.butsub , 0, wx.EXPAND)
         #m_sdbSizer1.Realize()
         #self.panel.SetSizer( m_sdbSizer1 )
         sizer_2.Add( m_sdbSizer1, 0, wx.ALIGN_RIGHT, 5)
@@ -2492,7 +2492,7 @@ class message(wx.Frame):
     def OnSavePage(self, evt) :
         dlg = wx.FileDialog(
             self, message=_("Save as ..."), defaultDir=os.getcwd(),
-            defaultFile="concordancier.html", wildcard="html|*.html", style=wx.SAVE | wx.OVERWRITE_PROMPT
+            defaultFile="concordancier.html", wildcard="html|*.html", style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
             )
         #dlg.SetFilterIndex(2)
         dlg.CenterOnParent()
@@ -2977,7 +2977,7 @@ class ImageViewer ( wx.Frame ):
     def OnSaveImage(self, event) :
         dlg = wx.FileDialog(
             self, message=_("Save as..."), defaultDir=self.parametres.get('pathout',os.getcwd()),
-            defaultFile= self.imagename, wildcard=self.parametres['wildcard'], style=wx.SAVE | wx.OVERWRITE_PROMPT
+            defaultFile= self.imagename, wildcard=self.parametres['wildcard'], style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
             )
         dlg.SetFilterIndex(0)
         dlg.CenterOnParent()