Browse Source

[big update] 4 Unterteilungsfenster mit einigen weiteren Buttons

Unterteilung in die 4 Fenster; "linkes Ohr, rechtes Ohr, beide Ohren, generelles".

Hinzufügen einiger Widgets die mir sinnvoll erscheinen.
Hinter den widgets stecken bisher fast keine Funktionen! Es sind nur leere Buttons bisher

Außerdem hinzufügen zweier Bildedateien die als Icon dienen könnten
master
seyffejn 4 years ago
parent
commit
38b91490a3

+ 1
- 1
TinnitusAnalyse/.idea/TinnitusAnalyse.iml View File

@@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.5" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">

+ 2
- 0
TinnitusAnalyse/.idea/dictionaries/Julian.xml View File

@@ -8,10 +8,12 @@
<w>lautstärke</w>
<w>linkem</w>
<w>linkes</w>
<w>nachname</w>
<w>ohren</w>
<w>rauschen</w>
<w>rechtem</w>
<w>rechtes</w>
<w>vorname</w>
</words>
</dictionary>
</component>

+ 1
- 1
TinnitusAnalyse/.idea/misc.xml View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.5 (TinnitusAnalyse)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.5" project-jdk-type="Python SDK" />
</project>

+ 59
- 38
TinnitusAnalyse/.idea/workspace.xml View File

@@ -1,7 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="5b3f2136-e422-4072-84be-e86e40fa2d55" name="Default Changelist" comment="" />
<list default="true" id="5b3f2136-e422-4072-84be-e86e40fa2d55" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/TinnitusAnalyse.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/TinnitusAnalyse.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dictionaries/Julian.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dictionaries/Julian.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/TinnitusAnalyse_GUI.py" beforeDir="false" afterPath="$PROJECT_DIR$/TinnitusAnalyse_GUI.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -9,21 +15,12 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/tkinter/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="42840">
<caret line="2522" column="16" selection-start-line="2522" selection-start-column="16" selection-end-line="2522" selection-end-column="16" />
</state>
</provider>
</entry>
</file>
<leaf>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/TinnitusAnalyse_GUI.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="21" selection-start-line="21" selection-end-line="21" />
<state relative-caret-position="270">
<caret line="89" column="74" selection-start-line="89" selection-start-column="74" selection-end-line="89" selection-end-column="74" />
<folding>
<element signature="e#0#54#0" expanded="true" />
</folding>
@@ -32,8 +29,12 @@
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/.idea/TinnitusAnalyse.iml">
<provider selected="true" editor-type-id="text-editor" />
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/tkinter/ttk.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="281">
<caret line="552" selection-start-line="552" selection-end-line="552" />
</state>
</provider>
</entry>
</file>
</leaf>
@@ -46,6 +47,11 @@
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>ttk</find>
<find>mainFrame</find>
<find>linkerFrame</find>
</findStrings>
<dirStrings>
<dir>C:\Users\Julian\PycharmProjects\TinnitusAnalyse</dir>
</dirStrings>
@@ -60,7 +66,7 @@
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="321" />
<option name="y" value="274" />
<option name="width" value="1602" />
@@ -71,24 +77,12 @@
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="TinnitusAnalyse" type="b2602c69:ProjectViewProjectNode" />
<item name="TinnitusAnalyse" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
<panes />
</component>
<component name="PropertiesComponent">
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="restartRequiresConfirmation" value="false" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RecentsManager">
@@ -150,14 +144,15 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="321" y="274" width="1602" height="1093" extended-state="0" />
<frame x="-8" y="-8" width="2576" height="1416" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.29987213" />
<window_info content_ui="combo" id="Project" order="0" weight="0.18479118" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.30625" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.30553392" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -170,22 +165,48 @@
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
<layout-to-restore>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.18479118" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.30553392" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Terminal" order="8" />
<window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout-to-restore>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/.idea/TinnitusAnalyse.iml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/tkinter/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="42840">
<state relative-caret-position="809">
<caret line="2522" column="16" selection-start-line="2522" selection-start-column="16" selection-end-line="2522" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.idea/TinnitusAnalyse.iml">
<provider selected="true" editor-type-id="text-editor" />
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/tkinter/ttk.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="281">
<caret line="552" selection-start-line="552" selection-end-line="552" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/TinnitusAnalyse_GUI.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="21" selection-start-line="21" selection-end-line="21" />
<state relative-caret-position="270">
<caret line="89" column="74" selection-start-line="89" selection-start-column="74" selection-end-line="89" selection-end-column="74" />
<folding>
<element signature="e#0#54#0" expanded="true" />
</folding>

BIN
TinnitusAnalyse/27130.png View File


BIN
TinnitusAnalyse/Headphones Icon.ico View File


+ 107
- 96
TinnitusAnalyse/TinnitusAnalyse_GUI.py View File

@@ -1,12 +1,7 @@
from tkinter import * # all the classic tkinter stuff
from tkinter import ttk # some newer additional widgets

"""
Background Funktionen
"""


from tkinter.ttk import Frame, Label, Button, LabelFrame, Combobox, Style, Checkbutton, Entry, Panedwindow

# FUNKTIONEN DIE DURCH GUI KLICKS AUSGEFÜHRT WERDEN---------------------------------------------------------------------

def button_rauschen_minus_press():
print("Rauschen_Press_Plus pressed")
@@ -20,9 +15,11 @@ def button_rauschen_plus_press():
def button_linkes_ohr_press():
print("button linkes ohr pressed")


def button_beide_ohren_press():
print("button beide ohren pressed")


def button_rechtes_ohr_press():
print("button rechtes ohr pressed")

@@ -32,94 +29,108 @@ def scale_lautstärke_change(self):
lautstärke = float(scaleLautstärke.get())
print(lautstärke)

root = Tk() # build the main window
root.title("Tinnitus Analyse")

# MainFrame
mainFrame = ttk.Frame(root, padding="3 3 30 30") # parent is root, padding is extra space at the edges
mainFrame.grid(column=0, row=0, sticky=(N, W, E, S)) # the frame sticks to every side of the window when resized

# Frequenz
labelFrequenz = Label(mainFrame, text="Frequenz [kHz]")
labelFrequenz.grid(row=0, column=0, sticky="w") # sticky = w(est) makes the text left aligned

frequenz = StringVar() # Frequenz Variable [kHz]
entryFrequenz = ttk.Entry(mainFrame, width=7, textvariable=frequenz) # create a field where u can enter text
entryFrequenz.grid(column=1, row=0, sticky=(W, E)) # position the field
# todo: Failproof the entry field to just numbers between a range!
# todo: add function to entry change!
def button_ohren_synchro():
auswahl = comboOhrenSynchro.get() # holt die momentane Auswahl aus combobox
print("Einstellungen von:" + auswahl + " auf alle anderen Ohren setzen")

# Rauschen
labelRauschen = Label(mainFrame, text="Rauschen [+/- kHz]", anchor="w")
labelRauschen.grid(column=0, row=1, sticky="w")

buttonRauschenPlus = Button(mainFrame, text="+", command=button_rauschen_plus_press)
buttonRauschenPlus.grid(column=1, row=1)

buttonRauschenMinus = Button(mainFrame, text="-", command=button_rauschen_minus_press)
buttonRauschenMinus.grid(column=2, row=1)

rauschen = StringVar() # Rauschen Variable [+/- kHz]
entryRauschen = ttk.Entry(mainFrame, width=7, textvariable=rauschen) # create a field where u can enter text
entryRauschen.grid(column=3, row=1) # position the field
# todo: add function to entry change

# Linkes / Rechts Ohr
labelOhren = Label(mainFrame, text="Audioausgabe auf:")
labelOhren.grid(column=0, row=2, sticky="w")

buttonLinkesOhr = Button(mainFrame, text="linkem Ohr", command=button_linkes_ohr_press)
buttonLinkesOhr.grid(column=1, row=2)

buttonBeideOhren = Button(mainFrame, text="beiden Ohren", command=button_beide_ohren_press)
buttonBeideOhren.grid(column=2, row=2)

buttonRechtesOhr = Button(mainFrame, text="rechtem Ohr", command=button_rechtes_ohr_press)
buttonRechtesOhr.grid(column=3, row=2)

# Lautstärke
labelLautstärke = Label(mainFrame, text="Lautstärke [%]:")
labelLautstärke.grid(column=0, row=3)

scaleLautstärke = Scale(mainFrame, from_=0, to=100, orient=HORIZONTAL, length=200, command=scale_lautstärke_change)
scaleLautstärke.grid(column=1, row=3, columnspan=2)




# --------------EXAMPLE GUI----------------------
# mainframe = ttk.Frame(root, padding="3 3 3 3") # parent is root, padding is extra space at the edges
# mainframe.grid(column=0, row=0, sticky=(N, W, E, S)) # the frame sticks to every side of the window when resized
# root.columnconfigure(0, weight=1) # if the main window is resized, the frame should expand to take up the extra space
# root.rowconfigure(0, weight=1) # if the main window is resized, the frame should expand to take up the extra space
#
# frequency = StringVar() # a StringVar is meant to be used to edit Tkinter widget's texts
# meters = StringVar()
#
# """
# Frequency Entry
# """
# frequency_entry = ttk.Entry(mainframe, width=7, textvariable=frequency) # create a field where u can enter text
# frequency_entry.grid(column=2, row=1, sticky=(W, E)) # position the field
# ttk.Label(mainframe, text="Frequenz (kHz)").grid(column=1, row=1, sticky=W) # label the field
#
# """
# Rauschen
# """
# frequency_entry = ttk.Entry(mainframe, width=7, textvariable=frequency) # create a field where u can enter text
# frequency_entry.grid(column=2, row=1, sticky=(W, E)) # position the field
# ttk.Label(mainframe, text="frequency (kHz)").grid(column=1, row=1, sticky=W) # label the field
#
# ttk.Label(mainframe, textvariable=meters).grid(column=2, row=2, sticky=(W, E))
# ttk.Button(mainframe, text="Calculate", command=calculate).grid(column=3, row=3, sticky=W)
#
# #ttk.Label(mainframe, text="frequency (kHz)").grid(column=3, row=1, sticky=W)
# ttk.Label(mainframe, text="is equivalent to").grid(column=1, row=2, sticky=E)
# ttk.Label(mainframe, text="meters").grid(column=3, row=2, sticky=W)
#
# for child in mainframe.winfo_children(): child.grid_configure(padx=5, pady=5)
#
# frequency_entry.focus()
# root.bind('<Return>', calculate)

root.mainloop()
# AUFBAU DES ROOT WINDOWS ----------------------------------------------------------------------------------------------
root = Tk() # build the main window
root.title("Tinnitus Analyse")
#root.iconbitmap('headphones.ico') #todo: fix icon
root.minsize(width=800, height=600)
root.resizable(True, True)
#root.columnconfigure(0, weight=1)
root.rowconfigure(0, weight=1) # extra platz nach unten wird automatisch von Frames eingenommen


# DIE DREI OBEREN FRAMES AUFBAUEN---------------------------------------------------------------------------------------
linkerFrame = LabelFrame(root, text="linkes Ohr", width=100, height = 100, padding="3 3 30 30") # parent is root, padding is extra space at the edges
linkerFrame.grid(column=0, row=0, sticky=(N + W + E + S)) # the frame sticks to every side of the window when resized

mittlererFrame = LabelFrame(root, text="beide Ohren", width=100, height=100, padding="3 3 30 30")
mittlererFrame.grid(column=1, row=0, sticky=(N + W + E + S))

rechterFrame = LabelFrame(root, text="rechtes Ohr", width=100, height=100, padding="3 3 30 30")
rechterFrame.grid(column=2, row=0, sticky=(N + W + E + S))


# DIE DREI OBEREN FRAMES FÜLLEN-----------------------------------------------------------------------------------------
labelFrames = [linkerFrame, mittlererFrame, rechterFrame]
for aktLabelFrame in labelFrames:
# -------- FREQUENZ ------------------------
labelFrequenz = Label(aktLabelFrame, text="Frequenz [kHz]")
labelFrequenz.grid(row=0, column=0, sticky=W) # sticky = w(est) makes the text left aligned
frequenz = DoubleVar() # Frequenz Variable [kHz]
entryFrequenz = Entry(aktLabelFrame, textvariable=frequenz) # create a field where u can enter text
entryFrequenz.grid(column=1, row=0, sticky=W) # position the field
# todo: Failproof the entry field to just numbers between a range!
# todo: add function to entry change!
# ----------- RAUSCHEN --------------------
# todo: iwas überlegen ich brauch 3 verschiedene stringVars eigentlich für jedes Ohr!!!
# todo: add function to entry change
labelRauschen = Label(aktLabelFrame, text="Rauschen[+/- kHz]", anchor="w")
labelRauschen.grid(column=0, row=1, sticky=W)
buttonRauschenPlus = Button(aktLabelFrame, text="+", command=button_rauschen_plus_press)
buttonRauschenPlus.grid(column=2, row=1)
buttonRauschenMinus = Button(aktLabelFrame, text="-", command=button_rauschen_minus_press)
buttonRauschenMinus.grid(column=3, row=1)
rauschen = StringVar() # Rauschen Variable [+/- kHz]
entryRauschen = Entry(aktLabelFrame, textvariable=rauschen) # create a field where u can enter text
entryRauschen.grid(column=1, row=1, sticky=W) # position the field
# ------------------ LAUTSTÄRKE ------------------
labelLautstärke = Label(aktLabelFrame, text="Lautstärke [%]:")
labelLautstärke.grid(column=0, row=3, sticky="w")
scaleLautstärke = Scale(aktLabelFrame, from_=0, to=100, orient=HORIZONTAL, length=200, command=scale_lautstärke_change)
scaleLautstärke.grid(column=1, row=3, columnspan=2)
# ------------ KOMMENTAR ----------------
labelKommentar = Label(aktLabelFrame, text="weitere Kommentare:")
labelKommentar.grid(column=0, row=4)
kommentar = StringVar() # Rauschen Variable [+/- kHz]
entryKommentar = Entry(aktLabelFrame, textvariable=kommentar, width=33) # create a field where u can enter text
entryKommentar.grid(column=1, row=4, rowspan=4, columnspan=2, sticky=W)


# DEN UNTEREN FRAME BAUEN-----------------------------------------------------------------------------------------------
untererFrame = LabelFrame(root, text="Generelles", width=300, height=100, padding="3 3 30 30")
untererFrame.grid(column=0, row=1, columnspan=3, sticky=(N + W + E + S))

# DEN UNTEREN FRAME FÜLLEN----------------------------------------------------------------------------------------------
# ------------NAMENSEINGABE-------------
labelNachname = Label(untererFrame, text="Nachname:")
labelNachname.grid(column=0, row=0)
nachname = StringVar()
entryNachname = Entry(untererFrame, textvariable=nachname)
entryNachname.grid(column=1, row=0)
labelVorname = Label(untererFrame, text="Vorname:")
labelVorname.grid(column=2, row=0)
vorname = StringVar()
entryVorname = Entry(untererFrame, textvariable=vorname)
entryVorname.grid(column=3, row=0)
# ------------------OHRENAUSWAHL-----------
labelOhren = Label(untererFrame, text="Audioausgabe auf:")
labelOhren.grid(column=0, row=1, sticky="w")
buttonLinkesOhr = Button(untererFrame, text="linkem Ohr", command=button_linkes_ohr_press)
buttonLinkesOhr.grid(column=1, row=1)
buttonBeideOhren = Button(untererFrame, text="beiden Ohren", command=button_beide_ohren_press)
buttonBeideOhren.grid(column=2, row=1)
buttonRechtesOhr = Button(untererFrame, text="rechtem Ohr", command=button_rechtes_ohr_press)
buttonRechtesOhr.grid(column=3, row=1)
# --------- OHREN SYNCHRONISIEREN -----------------------
labelOhrenSynchro = Label(untererFrame, text="Einstellungen von ")
labelOhrenSynchro.grid(column=0, row=2)
comboOhrenSynchro = Combobox(untererFrame, values=["Linkes Ohr", "Rechtes Ohr", "Beide Ohren"])
comboOhrenSynchro.grid(column=1, row=2)
labelOhrenSynchro2 = Label(untererFrame, text=" für alle anderen Ohren übernehmen")
labelOhrenSynchro2.grid(column=2, row=2)
buttonOhrenSynchro = Button(untererFrame, text="Bestätigen", command=button_ohren_synchro)
buttonOhrenSynchro.grid(column=3, row=2)

# ----------- SPEICHERN --------------------
buttonSpeichern = Button(untererFrame, text="SPEICHERN")
buttonSpeichern.grid(column=6, row=3)




root.mainloop()

Loading…
Cancel
Save