mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-14 08:01:46 -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)
|
wxBEGIN_EVENT_TABLE(FrequencyDialog, wxDialog)
|
||||||
EVT_CHAR_HOOK(FrequencyDialog::OnChar)
|
EVT_CHAR_HOOK(FrequencyDialog::OnChar)
|
||||||
|
EVT_SHOW(FrequencyDialog::OnShow)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstance *demod, const wxPoint & position,
|
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;
|
wxString freqStr;
|
||||||
activeDemod = demod;
|
activeDemod = demod;
|
||||||
this->targetMode = targetMode;
|
this->targetMode = targetMode;
|
||||||
|
this->initialString = initString;
|
||||||
|
|
||||||
if (targetMode == FDIALOG_TARGET_DEFAULT) {
|
if (targetMode == FDIALOG_TARGET_DEFAULT) {
|
||||||
if (activeDemod) {
|
if (activeDemod) {
|
||||||
@ -54,7 +56,7 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
|
|||||||
|
|
||||||
if (initString != "" && initString.length() == 1) {
|
if (initString != "" && initString.length() == 1) {
|
||||||
dialogText->SetValue(initString);
|
dialogText->SetValue(initString);
|
||||||
dialogText->SetSelection(initString.length(), initString.length());
|
dialogText->SetSelection(2, 2);
|
||||||
dialogText->SetFocus();
|
dialogText->SetFocus();
|
||||||
} else {
|
} else {
|
||||||
if (initString != "") {
|
if (initString != "") {
|
||||||
@ -183,3 +185,10 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FrequencyDialog::OnShow(wxShowEvent &event) {
|
||||||
|
if (initialString.length() == 1) {
|
||||||
|
dialogText->SetSelection(2, 2);
|
||||||
|
dialogText->SetFocus();
|
||||||
|
}
|
||||||
|
}
|
@ -34,6 +34,8 @@ private:
|
|||||||
DemodulatorInstance *activeDemod;
|
DemodulatorInstance *activeDemod;
|
||||||
void OnEnter ( wxCommandEvent &event );
|
void OnEnter ( wxCommandEvent &event );
|
||||||
void OnChar ( wxKeyEvent &event );
|
void OnChar ( wxKeyEvent &event );
|
||||||
|
void OnShow(wxShowEvent &event);
|
||||||
FrequencyDialogTarget targetMode;
|
FrequencyDialogTarget targetMode;
|
||||||
|
std::string initialString;
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user