From dc071ac380b805c49312d789fcb887a5fd710e16 Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 17 Jun 2024 17:55:15 +0200 Subject: [PATCH] font size --- iramuteq.py | 18 +++++++++++++++--- layout.py | 9 +++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/iramuteq.py b/iramuteq.py index 042ee0e..79b15e5 100755 --- a/iramuteq.py +++ b/iramuteq.py @@ -240,8 +240,7 @@ class IraFrame(wx.Frame): log.info('version : %s' % ConfigGlob.get('DEFAULT', 'version')) print(size) wx.Frame.__init__(self, parent, id, title, pos, size, style) - #Font - self.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) + # configuration self.AppliPath = AppliPath self.images_path = os.path.join(AppliPath,'images') @@ -260,6 +259,15 @@ class IraFrame(wx.Frame): self._mgr = aui.AuiManager() self._mgr.SetManagedWindow(self) self.x = 0 + #Font + try : + self.pref.read(self.ConfigPath['preferences']) + self.fontsize = self.pref.getint('iramuteq','fontsize') + except : + print('no pref : setting fontsize to 12') + self.fontsize = 12 + self.SetFont(wx.Font(self.fontsize, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) + #-------------------------------------------------------------------------------- # creation menu #-------------------------------------------------------------------------------- @@ -511,7 +519,8 @@ class IraFrame(wx.Frame): Name("lefttree"). Caption(_("Historic")). Left(). - MinSize(wx.Size(300,400)). + MinSize(wx.Size(200,400)). + BestSize(wx.Size(300,-1)). Layer(1). Position(1). CloseButton(False). @@ -528,6 +537,7 @@ class IraFrame(wx.Frame): # | aui.AUI_NB_TAB_EXTERNAL_MOVE | aui.AUI_NB_TAB_MOVE | aui.AUI_NB_TAB_FLOAT| wx.NO_BORDER self.nb.SetAGWWindowStyleFlag(notebook_flags) self.nb.SetArtProvider(aui.ChromeTabArt()) + self.nb.SetFont(wx.Font(self.fontsize, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) #self.nb.SetArtProvider(aui.VC8TabArt()) #self.nb.parent = self #self._notebook_style = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER @@ -539,6 +549,7 @@ class IraFrame(wx.Frame): aui.AuiPaneInfo(). Name("Tab_content"). CenterPane()) + #self._mgr.AddPane(self.Sheet, wx.aui.AuiPaneInfo().Name("Data").CenterPane()) #self._mgr.AddPane(self.Sheet, aui.AuiPaneInfo().Name("Data").CenterPane()) self.nb.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnCloseTab) @@ -684,6 +695,7 @@ class IraFrame(wx.Frame): self.Text = '' self.lexique = None self.corpus = None + def finish_init(self) : try : diff --git a/layout.py b/layout.py index c671a54..67411fc 100644 --- a/layout.py +++ b/layout.py @@ -46,7 +46,7 @@ from webexport import WebExport from corpus import Corpus from sheet import MySheet from graph_to_json import GraphToJson -from listlex2 import LexPanel +#from listlex2 import LexPanel import langue @@ -460,9 +460,12 @@ class OpenCHDS(): # self.TabChdSim = wx.aui.AuiNotebook(self.parent.nb, -1, wx.DefaultPosition) notebook_flags = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | aui.AUI_NB_TAB_MOVE | aui.AUI_NB_TAB_FLOAT| wx.NO_BORDER panel.TabChdSim = aui.AuiNotebook(panel, -1, wx.DefaultPosition) - #panel.TabChdSim = LB.LabelBook(panel, -1, agwStyle = INB_TOP|INB_SHOW_ONLY_TEXT|INB_FIT_LABELTEXT) + + #panel.TabChdSim = LB.LabelBook(panel, -1, agwStyle = INB_TOP|INB_SHOW_ONLY_TEXT|INB_FIT_LABELTEXT) panel.TabChdSim.SetAGWWindowStyleFlag(notebook_flags) panel.TabChdSim.SetArtProvider(aui.ChromeTabArt()) + font = wx.Font(self.parent.fontsize, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) + panel.TabChdSim.SetFont(font) sizer1.Add(panel.TabChdSim,10, wx.EXPAND, 5) panel.SetSizer(sizer1) sizer1.Fit(panel) @@ -508,6 +511,7 @@ class OpenCHDS(): self.tab_prof_seg = ProfListctrlPanel(self.parent, self, prof_seg[str(i + 1)], False, i + 1) self.prof_seg_nb.AddPage(self.tab_prof_seg, _("Cluster") + ' %i' % (i + 1)) panel.ProfNB.SetSelection(0) + panel.ProfNB.SetFont(font) if clnb > 2 : self.TabAFC = aui.AuiNotebook(panel.TabChdSim, -1, wx.DefaultPosition) log.info('read AFC') @@ -1413,6 +1417,7 @@ class CateLayout(DefaultMatLayout) : def dolayout(self) : self.tableau.read_tableau(self.pathout['analyse.db']) TabCate = ElCategorizator(self.ira.nb, self.pathout, self.tableau) + TabCate.parametres = self.parametres self.ira.nb.AddPage(TabCate, ' - '.join([_('ElCaTeGoRiZaToR'), self.parametres['name']])) class SimiMatLayout(DefaultMatLayout) : -- 2.7.4