# Path: boris/dialog.py
# def MessageDialog(title, text, buttons):
# def error_message_box(task, error_type, error_file_name,
#                       error_lineno):  # do NOT use this function directly, use error_message function
# def error_message(task: str, exc_info: tuple) -> None:
#     def __init__(self, parent=None):
#     def __init__(self):
#     def browse(self):
#     def ok(self):
#     def __init__(self, label_caption, elements_list):
#     def __init__(self, text, codes_list):
#     def getCode(self):
#     def pbOK_clicked(self):
#     def __init__(self, text, observations_list):
#     def get_selected_observations(self):
#     def __init__(self, time_format):
#     def __init__(self):
#     def rb_changed(self):
#     def pbOK_clicked(self):
#     def pbCancel_clicked(self):
#     def __init__(self):
#     def click(self, msg):
#     def __init__(self):
#     def click(self, msg):
#     def __init__(self):
#     def __init__(self):
#     def save_results(self):
#     def __init__(self):
#     def save_results(self):
#     def __init__(self):
#     def __init__(self):
#     def tw_cellDoubleClicked(self, r, c):
# def choose_obs_subj_behav_category(pj: dict,
#                                    selected_observations: list,
#                                    maxTime=0,
#                                    flagShowIncludeModifiers: bool = True,
#                                    flagShowExcludeBehaviorsWoEvents: bool = True,
#                                    by_category: bool = False,
#                                    show_time: bool = False,
#                                    timeFormat: str = HHMMSS):
# class Info_widget(QWidget):
# class Video_overlay_dialog(QDialog):
# class Input_dialog(QDialog):
# class DuplicateBehaviorCode(QDialog):
# class ChooseObservationsToImport(QDialog):
# class Ask_time(QDialog):
# class EditSelectedEvents(QDialog):
# class FindInEvents(QWidget):
# class FindReplaceEvents(QWidget):
# class explore_project_dialog(QDialog):
# class Results_dialog(QDialog):
# class ResultsWidget(QWidget):
# class View_data_head(QDialog):
# class View_explore_project_results(QWidget):


from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from decimal import getcontext
from boris.config import *
from boris import dialog
import decimal
import json
import binascii
import os
import io
    import sys

    def chooseColor(self):
        """
        area color button clicked
        """
        cd = QColorDialog()

        col = cd.getColor()
        if col.isValid():
            self.btColor.setStyleSheet("QWidget {background-color:%s}" % col.name())
            self.areaColor = col
            self.areaColor.setAlpha(int(self.slAlpha.value() / 100 * 255))

        if self.selectedPolygon:
            self.selectedPolygon.setBrush(self.areaColor)

            for idx, area in enumerate(self.polygonsList2):
                ac, pg = area
                if pg == self.selectedPolygon:
                    pg.setBrush(self.areaColor)
                    self.polygonsList2[idx] = [ac, pg]
                    break

        if self.closedPolygon:
            self.closedPolygon.setBrush(self.areaColor)

    def closeEvent(self, event):

        if self.flagMapChanged:


# Path: boris/dialog.py
# def MessageDialog(title, text, buttons):
# def error_message_box(task, error_type, error_file_name,
#                       error_lineno):  # do NOT use this function directly, use error_message function
# def error_message(task: str, exc_info: tuple) -> None:
#     def __init__(self, parent=None):
#     def __init__(self):
#     def browse(self):
#     def ok(self):
#     def __init__(self, label_caption, elements_list):
#     def __init__(self, text, codes_list):
#     def getCode(self):
#     def pbOK_clicked(self):
#     def __init__(self, text, observations_list):
#     def get_selected_observations(self):
#     def __init__(self, time_format):
#     def __init__(self):
#     def rb_changed(self):
#     def pbOK_clicked(self):
#     def pbCancel_clicked(self):
#     def __init__(self):
#     def click(self, msg):
#     def __init__(self):
#     def click(self, msg):
#     def __init__(self):
#     def __init__(self):
#     def save_results(self):
#     def __init__(self):
#     def save_results(self):
#     def __init__(self):
#     def __init__(self):
#     def tw_cellDoubleClicked(self, r, c):
# def choose_obs_subj_behav_category(pj: dict,
#                                    selected_observations: list,
#                                    maxTime=0,
#                                    flagShowIncludeModifiers: bool = True,
#                                    flagShowExcludeBehaviorsWoEvents: bool = True,
#                                    by_category: bool = False,
#                                    show_time: bool = False,
#                                    timeFormat: str = HHMMSS):
# class Info_widget(QWidget):
# class Video_overlay_dialog(QDialog):
# class Input_dialog(QDialog):
# class DuplicateBehaviorCode(QDialog):
# class ChooseObservationsToImport(QDialog):
# class Ask_time(QDialog):
# class EditSelectedEvents(QDialog):
# class FindInEvents(QWidget):
# class FindReplaceEvents(QWidget):
# class explore_project_dialog(QDialog):
# class Results_dialog(QDialog):
# class ResultsWidget(QWidget):
# class View_data_head(QDialog):
# class View_explore_project_results(QWidget):


# Path: boris/behav_coding_map_creator.py
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from decimal import getcontext
from boris.config import *
from boris import dialog
import decimal
import json
import binascii
import os
import io
    import sys


    def chooseColor(self):
        """
        area color button clicked
        """
        cd = QColorDialog()

        col = cd.getColor()
        if col.isValid():
            self.btColor.setStyleSheet("QWidget {background-color:%s}" % col.name())
            self.areaColor = col
            self.areaColor.setAlpha(int(self.slAlpha.value() / 100 * 255))

        if self.selectedPolygon:
            self.selectedPolygon.setBrush(self.areaColor)

            for idx, area in enumerate(self.polygonsList2):
                ac, pg = area
                if pg == self.selectedPolygon:
                    pg.setBrush(self.areaColor)
                    self.polygonsList2[idx] = [ac, pg]
                    break

        if self.closedPolygon:
            self.closedPolygon.setBrush(self.areaColor)

    def closeEvent(self, event):

        if self.flagMapChanged:


            response = dialog.MessageDialog("BORIS - Modifiers map creator",