Implement dose tracking functionality and enhance CSV migration
- Added a new migration script to introduce dose tracking columns in the CSV. - Updated DataManager to handle new dose tracking columns and methods for adding doses. - Enhanced MedTrackerApp to support dose entry and display for each medicine. - Modified UIManager to create a scrollable input frame with dose tracking elements. - Implemented tests for delete functionality, dose tracking, edit functionality, and scrollable input. - Updated existing tests to ensure compatibility with the new CSV format and dose tracking features.
This commit is contained in:
63
scripts/test_scrollable_input.py
Normal file
63
scripts/test_scrollable_input.py
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test script to verify the scrollable input frame functionality.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
|
||||
# Add src to path
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
|
||||
|
||||
|
||||
def test_scrollable_input():
|
||||
"""Test the scrollable input frame."""
|
||||
from init import logger
|
||||
from ui_manager import UIManager
|
||||
|
||||
# Create a test window
|
||||
root = tk.Tk()
|
||||
root.title("Scrollable Input Frame Test")
|
||||
root.geometry("400x600") # Smaller window to test scrolling
|
||||
|
||||
# Create UI manager
|
||||
ui_manager = UIManager(root, logger)
|
||||
|
||||
# Create main frame
|
||||
main_frame = ttk.Frame(root, padding="10")
|
||||
main_frame.grid(row=0, column=0, sticky="nsew")
|
||||
root.grid_rowconfigure(0, weight=1)
|
||||
root.grid_columnconfigure(0, weight=1)
|
||||
main_frame.grid_rowconfigure(1, weight=1)
|
||||
main_frame.grid_columnconfigure(0, weight=1)
|
||||
|
||||
# Create the scrollable input frame
|
||||
_input_ui = ui_manager.create_input_frame(main_frame)
|
||||
|
||||
# Add instructions
|
||||
instructions = ttk.Label(
|
||||
root,
|
||||
text="Test the scrolling functionality:\n"
|
||||
"1. Try mouse wheel scrolling over the input area\n"
|
||||
"2. Use the scrollbar on the right\n"
|
||||
"3. Test dose tracking buttons\n"
|
||||
"4. Resize the window to test responsiveness",
|
||||
justify="left",
|
||||
)
|
||||
instructions.grid(row=1, column=0, padx=10, pady=10, sticky="ew")
|
||||
|
||||
# Print success message
|
||||
print("✓ Scrollable input frame created successfully!")
|
||||
print("✓ Medicine dose tracking UI elements loaded")
|
||||
print("✓ Scrollbar functionality active")
|
||||
print("✓ Mouse wheel scrolling enabled")
|
||||
print("\nTest window opened. Close the window when done testing.")
|
||||
|
||||
# Start the test GUI
|
||||
root.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_scrollable_input()
|
||||
Reference in New Issue
Block a user