MCPcopy Create free account
hub / github.com/audacity/audacity / AddTextBox

Method AddTextBox

libraries/lib-shuttlegui/ShuttleGui.cpp:691–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689}
690
691wxTextCtrl * ShuttleGuiBase::AddTextBox(
692 const TranslatableString &Caption, const wxString &Value, const int nChars)
693{
694 const auto translated = Caption.Translation();
695 HandleOptionality( Caption );
696 AddPrompt( Caption );
697 UseUpId();
698 if( mShuttleMode != eIsCreating )
699 return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
700 wxTextCtrl * pTextCtrl;
701 wxSize Size(wxDefaultSize);
702 if( nChars > 0 )
703 {
704 int width;
705 mpDlg->GetTextExtent( wxT("9"), &width, nullptr );
706 Size.SetWidth( nChars * width );
707 }
708 miProp=0;
709
710#ifdef EXPERIMENTAL_RIGHT_ALIGNED_TEXTBOXES
711 long flags = wxTE_RIGHT;
712#else
713 long flags = wxTE_LEFT;
714#endif
715
716 mpWind = pTextCtrl = safenew wxTextCtrlWrapper(GetParent(), miId, Value,
717 wxDefaultPosition, Size, GetStyle( flags ));
718#if wxUSE_ACCESSIBILITY
719 // so that name can be set on a standard control
720 mpWind->SetAccessible(safenew WindowAccessible(mpWind));
721#endif
722 mpWind->SetName(wxStripMenuCodes(translated));
723 UpdateSizers();
724 return pTextCtrl;
725}
726
727wxTextCtrl * ShuttleGuiBase::AddNumericTextBox(
728 const TranslatableString& Caption, const wxString& Value, const int nChars,

Callers 15

ErrorReportDialogMethod · 0.80
PopulateUIMethod · 0.80
PopulateOrExchangeFunction · 0.80
PopulateOrExchangeMethod · 0.80
LinkWithTokenDialogMethod · 0.80
PopulateOrExchangeMethod · 0.80
PopulateOrExchangeMethod · 0.80
PopulateMethod · 0.80
PopulateMethod · 0.80
Benchmark.cppFile · 0.80
PopulateOrExchangeMethod · 0.80

Calls 5

GetParentFunction · 0.85
GetStyleFunction · 0.85
TranslationMethod · 0.80
wxTextCtrlWrapperClass · 0.70
SetNameMethod · 0.45

Tested by

no test coverage detected