Skip to content

Commit

Permalink
Merge pull request #59 from Fred-Redstone-2/interface-modif
Browse files Browse the repository at this point in the history
Ajustement interface modification
  • Loading branch information
Fred-Redstone-2 authored May 11, 2024
2 parents ca33eb8 + d989ad9 commit c67eaf0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
31 changes: 22 additions & 9 deletions src/ca/qc/bdeb/sim204/smartsounds/ModificationPartition.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def confirmer():
def launch(root, x, y, taille_texte, comp, base_comp):
global portee, mesure, note, no_note, type_note
top = Toplevel(root)
top.geometry("%dx%d" % (x, y))
top.geometry("%dx%d" % (800 * x, 270 * y))
top.title("Modification de partition")

btn = Button(
Expand Down Expand Up @@ -397,20 +397,33 @@ def launch(root, x, y, taille_texte, comp, base_comp):
base_text_y = 10
base_x_btn = 420
base_y_btn = 30
espacement = 50 * y

portee.place(x=text_x, y=base_text_y)
mesure.place(x=text_x, y=base_text_y + espacement)
note.place(x=text_x, y=base_text_y + 2 * espacement)
no_note.place(x=text_x, y=base_text_y + 3 * espacement)
type_note.place(x=text_x, y=base_text_y + 4 * espacement)
btn.place(x=base_x_btn, y=base_y_btn)
btn2.place(x=base_x_btn + 80, y=base_y_btn)
btn3.place(x=base_x_btn, y=base_y_btn + 40)
btn4.place(x=base_x_btn + 80, y=base_y_btn + 40)
btn5.place(x=base_x_btn, y=base_y_btn + 80)
btn6.place(x=base_x_btn + 80, y=base_y_btn + 80)
btn7.place(x=base_x_btn + 1, y=base_y_btn + 120)
btn8.place(x=base_x_btn + 1, y=base_y_btn + 160)
btn9.place(x=base_x_btn + 1, y=base_y_btn + 200)
portee.place(x=text_x, y=base_text_y)
mesure.place(x=text_x, y=base_text_y + 50)
note.place(x=text_x, y=base_text_y + 100)
no_note.place(x=text_x, y=base_text_y + 150)
type_note.place(x=text_x, y=base_text_y + 200)
top.update()

base_x_btn = type_note.winfo_x() + type_note.winfo_width() + 10 * x
espacement_x = 5 * x
espacement_y = 40 * y
btn.place(x=base_x_btn, y=base_y_btn)
btn2.place(x=base_x_btn + btn.winfo_width() + espacement_x, y=base_y_btn)
btn3.place(x=base_x_btn, y=base_y_btn + espacement_y)
btn4.place(x=base_x_btn + btn.winfo_width() + espacement_x, y=base_y_btn + espacement_y)
btn5.place(x=base_x_btn, y=base_y_btn + 2 * espacement_y)
btn6.place(x=base_x_btn + btn.winfo_width() + espacement_x, y=base_y_btn + 2 * espacement_y)
btn7.place(x=base_x_btn + 1, y=base_y_btn + 3 * espacement_y)
btn8.place(x=base_x_btn + 1, y=base_y_btn + 4 * espacement_y)
btn9.place(x=base_x_btn + 1, y=base_y_btn + 5 * espacement_y)


def get_composition_changee():
Expand Down
4 changes: 2 additions & 2 deletions src/ca/qc/bdeb/sim204/smartsounds/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def tonalite_change(event):
textvariable=g,
font=("Eras Demi ITC", taille_texte)
)
duree['values'] = ('4 mesures', '8 mesures', '16 mesures', '32 mesures', '60 mesures')
duree['values'] = ('4 mesures', '8 mesures', '16 mesures', '32 mesures')
duree['state'] = 'readonly'
duree.place(x=tonalite.winfo_x(), y=textDuree.winfo_y())
duree.current(0)
Expand Down Expand Up @@ -398,7 +398,7 @@ def verifier_composition():

def modifier_partition():
if partitionGeneree:
ModificationPartition.launch(root, 800 * multiplicateurX, 270 * multiplicateurY, taille_texte, composition,
ModificationPartition.launch(root, multiplicateurX, multiplicateurY, taille_texte, composition,
deepcopy(composition))
root.after(5000, verifier_composition)

Expand Down

0 comments on commit c67eaf0

Please sign in to comment.