comments
This commit is contained in:
parent
9910b0232f
commit
4fe5aeaf7f
1 changed files with 11 additions and 5 deletions
16
src/gui.py
16
src/gui.py
|
@ -14,9 +14,9 @@ class GUI:
|
||||||
self.parent.resizable(False, False)
|
self.parent.resizable(False, False)
|
||||||
self.f = Frame(self.parent)
|
self.f = Frame(self.parent)
|
||||||
|
|
||||||
self.columnspan = 3
|
self.columnspan = 3 # taille utilisé en largeur pour les éléments
|
||||||
self.style = Style.FILE
|
self.style = Style.FILE # style utilisé
|
||||||
self.current_location = ""
|
self.current_location = "" # ce qu'on regarde
|
||||||
|
|
||||||
def start(self) -> None:
|
def start(self) -> None:
|
||||||
"""Affiche la fenêtre"""
|
"""Affiche la fenêtre"""
|
||||||
|
@ -77,6 +77,7 @@ class GUI:
|
||||||
)
|
)
|
||||||
|
|
||||||
def _update_style(self, new_style: str, start: int) -> None:
|
def _update_style(self, new_style: str, start: int) -> None:
|
||||||
|
"""Met à jour la barre de menu de selection des styles + la fenêtre au besoin"""
|
||||||
if new_style != self.style:
|
if new_style != self.style:
|
||||||
self.style_menu.delete(0, len(Style.PRESETS_LIST))
|
self.style_menu.delete(0, len(Style.PRESETS_LIST))
|
||||||
|
|
||||||
|
@ -107,24 +108,28 @@ class GUI:
|
||||||
command=lambda: self._open_directory(start),
|
command=lambda: self._open_directory(start),
|
||||||
).grid(column=self.columnspan - 1, row=1)
|
).grid(column=self.columnspan - 1, row=1)
|
||||||
|
|
||||||
|
# Barre de menu
|
||||||
menu_bar = Menu(self.parent)
|
menu_bar = Menu(self.parent)
|
||||||
self.parent.config(menu=menu_bar)
|
self.parent.config(menu=menu_bar)
|
||||||
|
|
||||||
|
# Menu "Style"
|
||||||
file_menu = Menu(menu_bar)
|
file_menu = Menu(menu_bar)
|
||||||
self.style_menu = Menu(file_menu)
|
self.style_menu = Menu(file_menu)
|
||||||
self._update_style(self.style, start)
|
|
||||||
file_menu.add_cascade(label="Selection style", menu=self.style_menu)
|
|
||||||
self._add_styles_menu_bar(start)
|
self._add_styles_menu_bar(start)
|
||||||
|
file_menu.add_cascade(label="Selection style", menu=self.style_menu)
|
||||||
|
|
||||||
|
# Menu "Fermer"
|
||||||
file_menu.add_separator()
|
file_menu.add_separator()
|
||||||
file_menu.add_command(
|
file_menu.add_command(
|
||||||
label="Fermer",
|
label="Fermer",
|
||||||
command=self.parent.destroy,
|
command=self.parent.destroy,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Tout ça dans l'onglet "Fichier"
|
||||||
menu_bar.add_cascade(label="Fichier", menu=file_menu)
|
menu_bar.add_cascade(label="Fichier", menu=file_menu)
|
||||||
|
|
||||||
def _show_info(self, name_err: str, msg: str) -> None:
|
def _show_info(self, name_err: str, msg: str) -> None:
|
||||||
|
"""Fenêtre info qui affiche le message d'avertissement"""
|
||||||
title = f"{name_err} - {self.name}"
|
title = f"{name_err} - {self.name}"
|
||||||
info = Toplevel()
|
info = Toplevel()
|
||||||
info.resizable(False, False)
|
info.resizable(False, False)
|
||||||
|
@ -151,6 +156,7 @@ class GUI:
|
||||||
self.f.grid(columnspan=self.columnspan)
|
self.f.grid(columnspan=self.columnspan)
|
||||||
|
|
||||||
def _pager(self, num_page: int, errors: list[ClangError], start_row: int) -> None:
|
def _pager(self, num_page: int, errors: list[ClangError], start_row: int) -> None:
|
||||||
|
"""Affiche les avertissement sous forme de pages"""
|
||||||
self._reset_frame()
|
self._reset_frame()
|
||||||
|
|
||||||
idx = start_row
|
idx = start_row
|
||||||
|
|
Reference in a new issue