FrequencyDialog.h 1.29 KB
Newer Older
1 2 3
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#pragma once

#include "wx/dialog.h"
#include "wx/textctrl.h"
#include "wx/string.h"
#include "wx/button.h"
#include "DemodulatorInstance.h"

#define wxID_FREQ_INPUT 3001

class FrequencyDialog: public wxDialog
{
public:
    typedef enum FrequencyDialogTarget {
        FDIALOG_TARGET_DEFAULT,
        FDIALOG_TARGET_CENTERFREQ,
        FDIALOG_TARGET_FREQ,
        FDIALOG_TARGET_BANDWIDTH,
        FDIALOG_TARGET_WATERFALL_LPS,
        FDIALOG_TARGET_SPECTRUM_AVG,
        FDIALOG_TARGET_GAIN
    } FrequencyDialogTarget;
    FrequencyDialog ( wxWindow * parent, wxWindowID id, const wxString & title,
27
                  DemodulatorInstancePtr demod = nullptr,
28 29 30 31 32 33 34 35 36
                  const wxPoint & pos = wxDefaultPosition,
                  const wxSize & size = wxDefaultSize,
                  long style = wxDEFAULT_DIALOG_STYLE,
                  FrequencyDialogTarget targetMode = FDIALOG_TARGET_DEFAULT,
                  wxString initString = "");

    wxTextCtrl * dialogText;

private:
37
    DemodulatorInstancePtr activeDemod;
38 39 40 41 42 43 44
    void OnEnter ( wxCommandEvent &event );
    void OnChar ( wxKeyEvent &event );
	void OnShow(wxShowEvent &event);
    FrequencyDialogTarget targetMode;
	std::string initialString;
    DECLARE_EVENT_TABLE()
};