# Path: rtlsdr_scanner/events.py
# def post_event(destination, status):
#     if isinstance(destination, Queue.Queue):
#         destination.put(status)
#     elif isinstance(destination, wx.EvtHandler):
#         wx.PostEvent(destination, status)
# 
# class EventThread(wx.PyEvent):
#     def __init__(self, status, arg1=None, arg2=None):
#         wx.PyEvent.__init__(self)
#         self.SetEventType(EVENT_THREAD)
#         self.data = Status(status, arg1, arg2)
# 
# class Event(object):
#     STARTING, STEPS, INFO, DATA, STOPPED, ERROR, FINISHED, PROCESSED, \
#         CAL, LEVEL, UPDATED, DRAW, \
#         DELAY_COUNT, DELAY_START, \
#         LOC, LOC_RAW, LOC_WARN, LOC_ERR, LOC_SAT = range(19)


import sys
import wx
        import visvis as vv
from rtlsdr_scanner.events import post_event, EventThread, Event
        from visvis.core.line import Line


class DialogPreview(wx.Dialog):
    def __init__(self, parent, settings):
        self.settings = settings

        wx.Dialog.__init__(self, parent=parent, title="Preview",
                           style=wx.RESIZE_BORDER | wx.CAPTION |
                           wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.SYSTEM_MENU)
        self.Lower()

        Figure = app.GetFigureClass()
        fig = Figure(self)
        fig.bgcolor = (1, 1, 1)

        sizer = wx.BoxSizer()
        sizer.Add(fig._widget, 1, wx.EXPAND | wx.ALL, border=5)

        self.SetSizer(sizer)
        self.SetAutoLayout(True)
        self.Layout()

        self.__setup_plot()

        self.Bind(wx.EVT_CLOSE, self.__on_close)

    def __on_close(self, event):
        event.Veto()

    def __restore_style(self, style):

# Path: rtlsdr_scanner/events.py
# def post_event(destination, status):
#     if isinstance(destination, Queue.Queue):
#         destination.put(status)
#     elif isinstance(destination, wx.EvtHandler):
#         wx.PostEvent(destination, status)
# 
# class EventThread(wx.PyEvent):
#     def __init__(self, status, arg1=None, arg2=None):
#         wx.PyEvent.__init__(self)
#         self.SetEventType(EVENT_THREAD)
#         self.data = Status(status, arg1, arg2)
# 
# class Event(object):
#     STARTING, STEPS, INFO, DATA, STOPPED, ERROR, FINISHED, PROCESSED, \
#         CAL, LEVEL, UPDATED, DRAW, \
#         DELAY_COUNT, DELAY_START, \
#         LOC, LOC_RAW, LOC_WARN, LOC_ERR, LOC_SAT = range(19)


# Path: rtlsdr_scanner/plot_preview.py
import sys
import wx
        import visvis as vv
from rtlsdr_scanner.events import post_event, EventThread, Event
        from visvis.core.line import Line



class DialogPreview(wx.Dialog):
    def __init__(self, parent, settings):
        self.settings = settings

        wx.Dialog.__init__(self, parent=parent, title="Preview",
                           style=wx.RESIZE_BORDER | wx.CAPTION |
                           wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.SYSTEM_MENU)
        self.Lower()

        Figure = app.GetFigureClass()
        fig = Figure(self)
        fig.bgcolor = (1, 1, 1)

        sizer = wx.BoxSizer()
        sizer.Add(fig._widget, 1, wx.EXPAND | wx.ALL, border=5)

        self.SetSizer(sizer)
        self.SetAutoLayout(True)
        self.Layout()

        self.__setup_plot()

        self.Bind(wx.EVT_CLOSE, self.__on_close)

    def __on_close(self, event):
        event.Veto()

    def __restore_style(self, style):

        self.SetWindowStyle(style)