mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-29 07:10:41 -05:00
Fix initial numeric input char for Windows
This commit is contained in:
parent
f377d46467
commit
33c27c5684
@ -6,6 +6,7 @@
|
||||
|
||||
wxBEGIN_EVENT_TABLE(FrequencyDialog, wxDialog)
|
||||
EVT_CHAR_HOOK(FrequencyDialog::OnChar)
|
||||
EVT_SHOW(FrequencyDialog::OnShow)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstance *demod, const wxPoint & position,
|
||||
@ -14,6 +15,7 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
|
||||
wxString freqStr;
|
||||
activeDemod = demod;
|
||||
this->targetMode = targetMode;
|
||||
this->initialString = initString;
|
||||
|
||||
if (targetMode == FDIALOG_TARGET_DEFAULT) {
|
||||
if (activeDemod) {
|
||||
@ -54,7 +56,7 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
|
||||
|
||||
if (initString != "" && initString.length() == 1) {
|
||||
dialogText->SetValue(initString);
|
||||
dialogText->SetSelection(initString.length(), initString.length());
|
||||
dialogText->SetSelection(2, 2);
|
||||
dialogText->SetFocus();
|
||||
} else {
|
||||
if (initString != "") {
|
||||
@ -183,3 +185,10 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void FrequencyDialog::OnShow(wxShowEvent &event) {
|
||||
if (initialString.length() == 1) {
|
||||
dialogText->SetSelection(2, 2);
|
||||
dialogText->SetFocus();
|
||||
}
|
||||
}
|
@ -34,6 +34,8 @@ private:
|
||||
DemodulatorInstance *activeDemod;
|
||||
void OnEnter ( wxCommandEvent &event );
|
||||
void OnChar ( wxKeyEvent &event );
|
||||
void OnShow(wxShowEvent &event);
|
||||
FrequencyDialogTarget targetMode;
|
||||
std::string initialString;
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user