Audacity 3.2.0
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
NumericTextCtrl Class Referencefinal

#include <NumericTextCtrl.h>

Inheritance diagram for NumericTextCtrl:
[legend]
Collaboration diagram for NumericTextCtrl:
[legend]

Classes

struct  FieldPosition
 
struct  Options
 

Public Member Functions

 NumericTextCtrl (const FormatterContext &context, wxWindow *parent, wxWindowID winid, NumericConverterType type, const NumericFormatID &formatName={}, double value=0.0, const Options &options={}, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 
virtual ~NumericTextCtrl ()
 
void SetName (const TranslatableString &name)
 
wxSize ComputeSizing (bool update=true, wxCoord digitW=0, wxCoord digitH=0)
 
bool Layout () override
 
void Fit () override
 
void SetValue (double newValue)
 
bool SetTypeAndFormatName (const NumericConverterType &type, const NumericFormatID &formatName)
 
bool SetFormatName (const NumericFormatID &formatName)
 
bool SetCustomFormat (const TranslatableString &customFormat)
 
void SetFieldFocus (int)
 
wxSize GetDimensions ()
 
wxSize GetDigitSize ()
 
void SetDigitSize (int width, int height)
 
void SetReadOnly (bool readOnly=true)
 
void EnableMenu (bool enable=true)
 
void SetInvalidValue (double invalidValue)
 
int GetFocusedDigit ()
 
- Public Member Functions inherited from NumericConverter
 NumericConverter (const FormatterContext &context, NumericConverterType type, const NumericFormatID &formatName={}, double value=0.0f)
 
virtual ~NumericConverter ()
 
virtual void ValueToControls ()
 
virtual void ValueToControls (double rawValue, bool nearest=true)
 
virtual void ControlsToValue ()
 
bool SetTypeAndFormatName (const NumericConverterType &type, const NumericFormatID &formatName)
 
bool SetFormatName (const NumericFormatID &formatName)
 
NumericFormatID GetFormatName () const
 
bool SetCustomFormat (const TranslatableString &customFormat)
 
void SetValue (double newValue)
 
void SetMinValue (double minValue)
 
void ResetMinValue ()
 
void SetMaxValue (double maxValue)
 
void ResetMaxValue ()
 
double GetValue ()
 
wxString GetString ()
 
void UpdateFormatToFit (double value)
 
void Adjust (int steps, int dir, int focusedDigit)
 
void Increment (int focusedDigit=-1)
 
void Decrement (int focusedDigit=-1)
 
- Public Member Functions inherited from Observer::Publisher< FormatChangedToFitValueMessage >
 Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={})
 Constructor supporting type-erased custom allocation/deletion. More...
 
 Publisher (Publisher &&)=default
 
Publisheroperator= (Publisher &&)=default
 
Subscription Subscribe (Callback callback)
 Connect a callback to the Publisher; later-connected are called earlier. More...
 
Subscription Subscribe (Object &obj, Return(Object::*callback)(Args...))
 Overload of Subscribe takes an object and pointer-to-member-function. More...
 

Private Member Functions

void OnFormatUpdated (bool resetFocus) override
 
void HandleFormatterChanged (bool resetFocus)
 
void OnCaptureKey (wxCommandEvent &event)
 
void OnKeyDown (wxKeyEvent &event)
 
void OnKeyUp (wxKeyEvent &event)
 
void OnMouse (wxMouseEvent &event)
 
void OnErase (wxEraseEvent &event)
 
void OnPaint (wxPaintEvent &event)
 
void OnFocus (wxFocusEvent &event)
 
void OnContext (wxContextMenuEvent &event)
 
void ValueToControls () override
 
void ControlsToValue () override
 
void UpdateAutoFocus ()
 
void Updated (bool keyup=false)
 
wxRect GetBox (size_t ii) const
 

Private Attributes

std::vector< wxRect > mBoxes
 
std::vector< FieldPositionmFieldPositions
 
bool mMenuEnabled
 
bool mReadOnly
 
std::unique_ptr< wxBitmap > mBackgroundBitmap
 
std::unique_ptr< wxFont > mDigitFont
 
std::unique_ptr< wxFont > mLabelFont
 
int mDigitBoxW
 
int mDigitBoxH
 
int mDigitW
 
int mDigitH
 
int mBorderLeft
 
int mBorderTop
 
int mBorderRight
 
int mBorderBottom
 
int mWidth
 
int mHeight
 
int mButtonWidth
 
int mFocusedDigit { 0 }
 
bool mAutoPos
 
double mScrollRemainder
 
NumericConverterType mType
 
bool mAllowInvalidValue
 

Friends

class NumericTextCtrlAx
 

Additional Inherited Members

- Public Types inherited from Observer::Publisher< FormatChangedToFitValueMessage >
using message_type = FormatChangedToFitValueMessage
 
using CallbackReturn = std::conditional_t< true, void, bool >
 
using Callback = std::function< CallbackReturn(const FormatChangedToFitValueMessage &) >
 Type of functions that can be connected to the Publisher. More...
 
- Static Public Attributes inherited from Observer::Publisher< FormatChangedToFitValueMessage >
static constexpr bool notifies_all
 
- Protected Member Functions inherited from NumericConverter
bool UpdateFormatter ()
 
virtual void OnFormatUpdated (bool resetFocus)
 
- Protected Member Functions inherited from Observer::Publisher< FormatChangedToFitValueMessage >
CallbackReturn Publish (const FormatChangedToFitValueMessage &message)
 Send a message to connected callbacks. More...
 
- Protected Attributes inherited from NumericConverter
FormatterContext mContext
 
NumericConverterType mType
 
double mMinValue { 0.0 }
 
double mMaxValue { std::numeric_limits<double>::max() }
 
double mInvalidValue { -1 }
 
double mValue { mInvalidValue }
 
std::unique_ptr< NumericConverterFormattermFormatter
 
NumericFormatID mFormatID
 
TranslatableString mCustomFormat
 
wxString mValueString
 
std::vector< wxString > mFieldValueStrings
 
Observer::Subscription mFormatUpdatedSubscription
 

Detailed Description

Definition at line 34 of file NumericTextCtrl.h.

Constructor & Destructor Documentation

◆ NumericTextCtrl()

NumericTextCtrl::NumericTextCtrl ( const FormatterContext context,
wxWindow *  parent,
wxWindowID  winid,
NumericConverterType  type,
const NumericFormatID formatName = {},
double  value = 0.0,
const Options options = {},
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize 
)

Definition at line 145 of file NumericTextCtrl.cpp.

153 :
154 wxControl(parent, id, pos, size, wxWANTS_CHARS),
155 NumericConverter(context, type, formatName, timeValue),
157 mDigitFont{},
158 mLabelFont{},
159 mAutoPos(options.autoPos)
160 , mType(type)
161{
162 mAllowInvalidValue = false;
163
164 mDigitBoxW = 11;
165 mDigitBoxH = 19;
166
167 mBorderLeft = 1;
168 mBorderTop = 1;
169 mBorderRight = 1;
170 mBorderBottom = 1;
171
172 mReadOnly = options.readOnly;
173 mMenuEnabled = options.menuEnabled;
174 mButtonWidth = mMenuEnabled ? 16 : 0;
175
176 SetLayoutDirection(wxLayout_LeftToRight);
177 Layout();
178 Fit();
180
181 //PRL -- would this fix the following?
182 //ValueToControls();
183
184 //mchinen - aug 15 09 - this seems to put the mValue back to zero, and do nothing else.
185 //ControlsToValue();
186
187 mScrollRemainder = 0.0;
188
189#if wxUSE_ACCESSIBILITY
190 SetLabel(wxT(""));
191 SetName( {} );
192 SetAccessible(safenew NumericTextCtrlAx(this));
193#endif
194
195 if (options.hasInvalidValue)
196 SetInvalidValue( options.invalidValue );
197
198 if (!options.formatSymbol.empty())
199 SetFormatName( options.formatSymbol );
200
201 if (!options.customFormat.empty())
202 SetCustomFormat( options.customFormat );
203
204 if (options.hasValue)
205 SetValue( options.value );
206}
wxT("CloseDown"))
#define safenew
Definition: MemoryX.h:10
NumericConverter(const FormatterContext &context, NumericConverterType type, const NumericFormatID &formatName={}, double value=0.0f)
void Fit() override
std::unique_ptr< wxFont > mDigitFont
void SetInvalidValue(double invalidValue)
bool Layout() override
bool SetCustomFormat(const TranslatableString &customFormat)
bool SetFormatName(const NumericFormatID &formatName)
friend class NumericTextCtrlAx
void ValueToControls() override
std::unique_ptr< wxBitmap > mBackgroundBitmap
void SetName(const TranslatableString &name)
NumericConverterType mType
void SetValue(double newValue)
std::unique_ptr< wxFont > mLabelFont

◆ ~NumericTextCtrl()

NumericTextCtrl::~NumericTextCtrl ( )
virtual

Definition at line 208 of file NumericTextCtrl.cpp.

209{
210}

Member Function Documentation

◆ ComputeSizing()

wxSize NumericTextCtrl::ComputeSizing ( bool  update = true,
wxCoord  digitW = 0,
wxCoord  digitH = 0 
)

Definition at line 314 of file NumericTextCtrl.cpp.

315{
316 if (!mFormatter)
317 return {};
318
319 // Get current box size
320 if (boxW == 0) {
321 boxW = mDigitBoxW;
322 }
323
324 if (boxH == 0) {
325 boxH = mDigitBoxH;
326 }
327 boxH -= (mBorderTop + mBorderBottom);
328
329 // We can use the screen device context since we're not drawing to it
330 wxScreenDC dc;
331
332 // First calculate a rough point size
333 wxFont pf(wxSize(boxW, boxH), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
334 int fontSize = pf.GetPointSize();
335 wxCoord strW;
336 wxCoord strH;
337
338 // Now decrease it until we fit within our digit box
339 dc.SetFont(pf);
340 dc.GetTextExtent(wxT("0"), &strW, &strH);
341 while (strW > boxW || strH > boxH) {
342 dc.SetFont(wxFont(--fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
343 dc.GetTextExtent(wxT("0"), &strW, &strH);
344 }
345 fontSize--;
346
347 // Create the digit font with the new point size
348 if (update) {
349 mDigitFont = std::make_unique<wxFont>(fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
350 dc.SetFont(*mDigitFont);
351
352 // Remember the actual digit width and height using the new font
353 dc.GetTextExtent(wxT("0"), &mDigitW, &mDigitH);
354 }
355
356 // The label font should be a little smaller
357 std::unique_ptr<wxFont> labelFont = std::make_unique<wxFont>(fontSize - 1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
358
359 // Use the label font for all remaining measurements since only non-digit text is left
360 dc.SetFont(*labelFont);
361
362 // Remember the pointer if updating
363 if (update) {
364 mLabelFont = std::move(labelFont);
365 }
366
367 auto& prefix = mFormatter->GetPrefix();
368 auto& fields = mFormatter->GetFields();
369
370 // Get the width of the prefix, if any
371 dc.GetTextExtent(prefix, &strW, &strH);
372
373 // Bump x-position to the end of the prefix
374 int x = mBorderLeft + strW;
375
376 if (update) {
377 // Set the character position past the prefix
378 int pos = prefix.length();
379
380 mBoxes.clear();
381 // No need to clear - all the data will be reinitialized anyway
382 mFieldPositions.resize(fields.size());
383
384 // Figure out the x-position of each field and label in the box
385 for (int i = 0, fcnt = fields.size(); i < fcnt; ++i) {
386 // Get the size of the label
387 dc.GetTextExtent(fields[i].label, &strW, &strH);
388
389 // Remember this field's x-position
390 mFieldPositions[i].fieldX = x;
391
392 // Remember metrics for each digit
393 for (int j = 0, dcnt = fields[i].digits; j < dcnt; ++j) {
394 mBoxes.push_back(wxRect { x, mBorderTop, boxW, boxH });
395 x += boxW;
396 pos++;
397 }
398
399 // Remember the label's x-position
400 mFieldPositions[i].labelX = x;
401
402 // Bump to end of label
403 x += strW;
404
405 // Remember the label's width
406 mFieldPositions[i].fieldW = x;
407
408 // Bump character position to end of label
409 pos += fields[i].label.length();
410 }
411 }
412 else {
413 // Determine the maximum x-position (length) of the remaining fields
414 for (int i = 0, fcnt = fields.size(); i < fcnt; ++i) {
415 // Get the size of the label
416 dc.GetTextExtent(fields[i].label, &strW, &strH);
417
418 // Just bump to next field
419 x += (boxW * fields[i].digits) + strW;
420 }
421 }
422
423 // Calculate the maximum dimensions
424 wxSize dim(x + mBorderRight, boxH + mBorderTop + mBorderBottom);
425
426 // Save maximumFinally, calculate the minimum dimensions
427 if (update) {
428 mWidth = dim.x;
429 mHeight = dim.y;
430 }
431
432 return wxSize(dim.x + mButtonWidth, dim.y);
433}
TranslatableString label
Definition: TagsEditor.cpp:165
std::unique_ptr< NumericConverterFormatter > mFormatter
std::vector< wxRect > mBoxes
std::vector< FieldPosition > mFieldPositions

References label, mBorderBottom, mBorderLeft, mBorderRight, mBorderTop, mBoxes, mButtonWidth, mDigitBoxH, mDigitBoxW, mDigitFont, mDigitH, mDigitW, mFieldPositions, NumericConverter::mFormatter, mHeight, mLabelFont, mWidth, and wxT().

Referenced by TimeToolBar::ComputeSizing(), and Layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ControlsToValue()

void NumericTextCtrl::ControlsToValue ( )
overrideprivatevirtual

Reimplemented from NumericConverter.

Definition at line 976 of file NumericTextCtrl.cpp.

977{
979}
virtual void ControlsToValue()

References NumericConverter::ControlsToValue().

Referenced by HandleFormatterChanged(), OnKeyDown(), and SetValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnableMenu()

void NumericTextCtrl::EnableMenu ( bool  enable = true)

Definition at line 287 of file NumericTextCtrl.cpp.

288{
289#if wxUSE_TOOLTIPS
290 wxString tip(_("(Use context menu to change format.)"));
291 if (enable)
292 SetToolTip(tip);
293 else {
294 wxToolTip *tt = GetToolTip();
295 if (tt && tt->GetTip() == tip)
296 SetToolTip(NULL);
297 }
298#endif
299 mMenuEnabled = enable;
300 mButtonWidth = enable ? 9 : 0;
301 Layout();
302 Fit();
303}
#define _(s)
Definition: Internat.h:73

References _, Fit(), Layout(), mButtonWidth, and mMenuEnabled.

Here is the call graph for this function:

◆ Fit()

void NumericTextCtrl::Fit ( )
override

Definition at line 498 of file NumericTextCtrl.cpp.

499{
500 wxSize sz = GetSize();
501 wxSize csz = GetClientSize();
502
503 sz.x = mButtonWidth + mWidth + (sz.x - csz.x);
504 sz.y = mHeight + (sz.y - csz.y);
505
506 SetInitialSize(sz);
507}

References mButtonWidth, mHeight, and mWidth.

Referenced by EnableMenu(), HandleFormatterChanged(), and SetDigitSize().

Here is the caller graph for this function:

◆ GetBox()

wxRect NumericTextCtrl::GetBox ( size_t  ii) const
private

Definition at line 981 of file NumericTextCtrl.cpp.

982{
983 if (ii < mBoxes.size())
984 return mBoxes[ii];
985 return {};
986}

References mBoxes.

Referenced by Layout(), OnMouse(), and OnPaint().

Here is the caller graph for this function:

◆ GetDigitSize()

wxSize NumericTextCtrl::GetDigitSize ( )
inline

Definition at line 100 of file NumericTextCtrl.h.

100{ return wxSize(mDigitBoxW, mDigitBoxH); }

Referenced by TimeToolBar::OnSize(), and TimeToolBar::Populate().

Here is the caller graph for this function:

◆ GetDimensions()

wxSize NumericTextCtrl::GetDimensions ( )
inline

Definition at line 99 of file NumericTextCtrl.h.

99{ return wxSize(mWidth + mButtonWidth, mHeight); }

Referenced by TimeToolBar::OnSize().

Here is the caller graph for this function:

◆ GetFocusedDigit()

int NumericTextCtrl::GetFocusedDigit ( )
inline

Definition at line 111 of file NumericTextCtrl.h.

111{ return mFocusedDigit; }

◆ HandleFormatterChanged()

void NumericTextCtrl::HandleFormatterChanged ( bool  resetFocus)
private

Definition at line 696 of file NumericTextCtrl.cpp.

697{
698 const auto boxesCount = mBoxes.size();
699 mBoxes.clear();
700
701 Layout();
702 Fit();
705
706 const auto newBoxesCount = mBoxes.size();
707
708 if (resetFocus || boxesCount > newBoxesCount)
709 {
710 // Handle the case when format was changed as a result of
711 // user action or if the format shrunk for some reason
713 }
714 else
715 {
716 // Try to keep the focus on the same digit
717 mFocusedDigit += newBoxesCount - boxesCount;
718 // Perform sanity check for the focused digit index
719 if (mFocusedDigit >= newBoxesCount)
721 }
722}
void ControlsToValue() override

References ControlsToValue(), Fit(), Layout(), mBoxes, mFocusedDigit, UpdateAutoFocus(), and ValueToControls().

Referenced by OnFormatUpdated(), SetCustomFormat(), SetFormatName(), and SetTypeAndFormatName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Layout()

bool NumericTextCtrl::Layout ( )
override

Definition at line 435 of file NumericTextCtrl.cpp.

436{
437 if (!mFormatter)
438 return {};
439
441
442 auto& prefix = mFormatter->GetPrefix();
443 auto& fields = mFormatter->GetFields();
444 auto& digits = mFormatter->GetDigitInfos();
445
446 wxMemoryDC memDC;
447 wxCoord strW, strH;
448 memDC.SetFont(*mLabelFont);
449 memDC.GetTextExtent(prefix, &strW, &strH);
450
451 int i;
452
453 // Draw the background bitmap - it contains black boxes where
454 // all of the digits go and all of the other text
455 wxPen Pen;
456 wxBrush Brush;
457
458 mBackgroundBitmap = std::make_unique<wxBitmap>(mWidth + mButtonWidth, mHeight,24);
459 memDC.SelectObject(*mBackgroundBitmap);
460
461 theTheme.SetBrushColour( Brush, clrTimeHours );
462 memDC.SetBrush(Brush);
463 memDC.SetPen(*wxTRANSPARENT_PEN);
464 memDC.DrawRectangle(0, 0, mWidth + mButtonWidth, mHeight);
465
466 int numberBottom = mBorderTop + (mDigitBoxH - mDigitH)/2 + mDigitH;
467
468 memDC.GetTextExtent(wxT("0"), &strW, &strH);
469 int labelTop = numberBottom - strH;
470
471 memDC.SetTextForeground(theTheme.Colour( clrTimeFont ));
472 memDC.SetTextBackground(theTheme.Colour( clrTimeBack ));
473 memDC.DrawText(prefix, mBorderLeft, labelTop);
474
475 theTheme.SetBrushColour( Brush, clrTimeBack );
476 memDC.SetBrush(Brush);
477
478 for(i = 0; i < digits.size(); i++)
479 memDC.DrawRectangle(GetBox(i));
480 memDC.SetBrush( wxNullBrush );
481
482 for(i = 0; i < fields.size(); i++)
483 memDC.DrawText(fields[i].label, mFieldPositions[i].labelX, labelTop);
484
485 if (mMenuEnabled) {
486 theTheme.SetPenColour( Pen, clrTimeFont );
487 theTheme.SetBrushColour( Brush, clrTimeFont );
488 memDC.SetPen(Pen);
489 memDC.SetBrush(Brush);
490 AColor::Arrow(memDC,
491 mWidth + 5,
492 (mHeight / 2) - 2,
493 mButtonWidth - 7);
494 }
495 return true;
496}
THEME_API Theme theTheme
Definition: Theme.cpp:82
static void Arrow(wxDC &dc, wxCoord x, wxCoord y, int width, bool down=true)
Definition: AColor.cpp:167
wxRect GetBox(size_t ii) const
wxSize ComputeSizing(bool update=true, wxCoord digitW=0, wxCoord digitH=0)
wxColour & Colour(int iIndex)
void SetBrushColour(wxBrush &Brush, int iIndex)
void SetPenColour(wxPen &Pen, int iIndex)

References AColor::Arrow(), ThemeBase::Colour(), ComputeSizing(), GetBox(), mBackgroundBitmap, mBorderLeft, mBorderTop, mButtonWidth, mDigitBoxH, mDigitH, mFieldPositions, NumericConverter::mFormatter, mHeight, mLabelFont, mMenuEnabled, mWidth, ThemeBase::SetBrushColour(), ThemeBase::SetPenColour(), theTheme, and wxT().

Referenced by EnableMenu(), HandleFormatterChanged(), SpectralSelectionBar::Populate(), and SetDigitSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnCaptureKey()

void NumericTextCtrl::OnCaptureKey ( wxCommandEvent &  event)
private

Definition at line 724 of file NumericTextCtrl.cpp.

725{
726 wxKeyEvent *kevent = (wxKeyEvent *)event.GetEventObject();
727 int keyCode = kevent->GetKeyCode();
728
729 // Convert numeric keypad entries.
730 if ((keyCode >= WXK_NUMPAD0) && (keyCode <= WXK_NUMPAD9))
731 keyCode -= WXK_NUMPAD0 - '0';
732
733 switch (keyCode)
734 {
735 case WXK_BACK:
736 case WXK_LEFT:
737 case WXK_RIGHT:
738 case WXK_HOME:
739 case WXK_END:
740 case WXK_UP:
741 case WXK_DOWN:
742 case WXK_TAB:
743 case WXK_RETURN:
744 case WXK_NUMPAD_ENTER:
745 case WXK_DELETE:
746 return;
747
748 default:
749 if (keyCode >= '0' && keyCode <= '9' && !kevent->HasAnyModifiers())
750 return;
751 }
752
753 event.Skip();
754
755 return;
756}

◆ OnContext()

void NumericTextCtrl::OnContext ( wxContextMenuEvent &  event)
private

Definition at line 566 of file NumericTextCtrl.cpp.

567{
568
569 if (!mMenuEnabled) {
570 event.Skip();
571 return;
572 }
573
574 wxMenu menu;
575
576 SetFocus();
577
578 std::vector<NumericFormatID> symbols;
579
581 mContext,
582 mType,
583 [&menu, &symbols, this, i = ID_MENU](auto& item) mutable
584 {
585 const auto ID = item.symbol.Internal();
586 symbols.push_back(ID);
587 menu.AppendRadioItem(i, item.symbol.Translation());
588
589 if (mFormatID == ID)
590 menu.Check(i, true);
591
592 ++i;
593 });
594
595 menu.Bind(wxEVT_MENU, [](auto&){});
596 BasicMenu::Handle{ &menu }.Popup(
598 { 0, 0 }
599 );
600
601 // This used to be in an EVT_MENU() event handler, but GTK
602 // is sensitive to what is done within the handler if the
603 // user happens to check the first menuitem and then is
604 // moving down the menu when the ...CTRL_UPDATED event
605 // handler kicks in.
606 auto menuIndex = ID_MENU;
607
608 int eventType = 0;
609
611 eventType = EVT_TIMETEXTCTRL_UPDATED;
613 eventType = EVT_FREQUENCYTEXTCTRL_UPDATED;
615 eventType = EVT_BANDWIDTHTEXTCTRL_UPDATED;
616 else
617 {
618 assert(false); // unsupported control type, skip it
619 return;
620 }
621
622 for (const auto& symbol : symbols)
623 {
624 if (!menu.IsChecked(menuIndex++) || mFormatID == symbol)
625 continue;
626
627 SetFormatName(symbol);
628
629 wxCommandEvent e(eventType, GetId());
630 e.SetString(symbol.GET());
631 GetParent()->GetEventHandler()->AddPendingEvent(e);
632
633 break;
634 }
635}
const NumericConverterType & NumericConverterType_BANDWIDTH()
const NumericConverterType & NumericConverterType_FREQUENCY()
const NumericConverterType & NumericConverterType_TIME()
#define ID_MENU
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
Definition: BasicMenu.cpp:209
FormatterContext mContext
NumericFormatID mFormatID
void SetFocus(const WindowPlacement &focus)
Set the window that accepts keyboard input.
Definition: BasicUI.h:392
static void Visit(const FormatterContext &context, const NumericConverterType &type, Visitor visitor)
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.

References ID_MENU, NumericConverter::mContext, NumericConverter::mFormatID, mMenuEnabled, mType, NumericConverterType_BANDWIDTH(), NumericConverterType_FREQUENCY(), NumericConverterType_TIME(), BasicMenu::Handle::Popup(), BasicUI::SetFocus(), SetFormatName(), and NumericConverterRegistry::Visit().

Referenced by OnMouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnErase()

void NumericTextCtrl::OnErase ( wxEraseEvent &  event)
private

Definition at line 509 of file NumericTextCtrl.cpp.

510{
511 // Ignore it to prevent flashing
512}

◆ OnFocus()

void NumericTextCtrl::OnFocus ( wxFocusEvent &  event)
private

Definition at line 679 of file NumericTextCtrl.cpp.

680{
681 KeyboardCapture::OnFocus( *this, event );
682
683 if (event.GetEventType() != wxEVT_KILL_FOCUS &&
684 mFocusedDigit <= 0 )
686
687 event.Skip( false ); // PRL: not sure why, but preserving old behavior
688}
void OnFocus(wxWindow &window, wxFocusEvent &event)
a function useful to implement a focus event handler The window releases the keyboard if the event is...

References mFocusedDigit, KeyboardCapture::OnFocus(), and UpdateAutoFocus().

Here is the call graph for this function:

◆ OnFormatUpdated()

void NumericTextCtrl::OnFormatUpdated ( bool  resetFocus)
overrideprivatevirtual

Reimplemented from NumericConverter.

Definition at line 690 of file NumericTextCtrl.cpp.

691{
693 HandleFormatterChanged(resetFocus);
694}
virtual void OnFormatUpdated(bool resetFocus)
void HandleFormatterChanged(bool resetFocus)

References HandleFormatterChanged(), and NumericConverter::OnFormatUpdated().

Here is the call graph for this function:

◆ OnKeyDown()

void NumericTextCtrl::OnKeyDown ( wxKeyEvent &  event)
private

Definition at line 776 of file NumericTextCtrl.cpp.

777{
778 if (!mFormatter || mBoxes.size() == 0)
779 {
780 mFocusedDigit = 0;
781 return;
782 }
783
784 event.Skip(false);
785
786 int keyCode = event.GetKeyCode();
787 int digit = mFocusedDigit;
788
789 if (mFocusedDigit < 0)
790 mFocusedDigit = 0;
791 if (mFocusedDigit >= (int)mBoxes.size())
792 mFocusedDigit = mBoxes.size() - 1;
793
794 // Convert numeric keypad entries.
795 if ((keyCode >= WXK_NUMPAD0) && (keyCode <= WXK_NUMPAD9))
796 keyCode -= WXK_NUMPAD0 - '0';
797
798 auto& digits = mFormatter->GetDigitInfos();
799
800 if (!mReadOnly && (keyCode >= '0' && keyCode <= '9' && !event.HasAnyModifiers())) {
801 int digitPosition = digits[mFocusedDigit].pos;
802 if (mValueString[digitPosition] == wxChar('-')) {
803 mValue = std::max(mMinValue, std::min(mMaxValue, 0.0));
805 // Beware relocation of the string
806 digitPosition = digits[mFocusedDigit].pos;
807 }
808 mValueString[digitPosition] = wxChar(keyCode);
810 Refresh();// Force an update of the control. [Bug 1497]
812 mFocusedDigit = (mFocusedDigit + 1) % (digits.size());
813 Updated();
814 }
815
816 else if (!mReadOnly && keyCode == WXK_DELETE) {
819 }
820
821 else if (!mReadOnly && keyCode == WXK_BACK) {
822 // Moves left, replaces that char with '0', stays there...
824 mFocusedDigit += digits.size();
825 mFocusedDigit %= digits.size();
826 wxString::reference theDigit = mValueString[digits[mFocusedDigit].pos];
827 if (theDigit != wxChar('-'))
828 theDigit = '0';
830 Refresh();// Force an update of the control. [Bug 1497]
832 Updated();
833 }
834
835 else if (keyCode == WXK_LEFT) {
837 mFocusedDigit += digits.size();
838 mFocusedDigit %= digits.size();
839 Refresh();
840 }
841
842 else if (keyCode == WXK_RIGHT) {
844 mFocusedDigit %= digits.size();
845 Refresh();
846 }
847
848 else if (keyCode == WXK_HOME) {
849 mFocusedDigit = 0;
850 Refresh();
851 }
852
853 else if (keyCode == WXK_END) {
854 mFocusedDigit = digits.size() - 1;
855 Refresh();
856 }
857
858 else if (!mReadOnly && keyCode == WXK_UP) {
859 Adjust(1, 1, mFocusedDigit);
860 Updated();
861 }
862
863 else if (!mReadOnly && keyCode == WXK_DOWN) {
864 Adjust(1, -1, mFocusedDigit);
865 Updated();
866 }
867
868 else if (keyCode == WXK_TAB) {
869#if defined(__WXMSW__)
870 // Using Navigate() on Windows, rather than the following code causes
871 // bug 1542
872 wxWindow* parent = GetParent();
873 wxNavigationKeyEvent nevent;
874 nevent.SetWindowChange(event.ControlDown());
875 nevent.SetDirection(!event.ShiftDown());
876 nevent.SetEventObject(parent);
877 nevent.SetCurrentFocus(parent);
878 GetParent()->GetEventHandler()->ProcessEvent(nevent);
879#else
880 Navigate(event.ShiftDown()
881 ? wxNavigationKeyEvent::IsBackward
882 : wxNavigationKeyEvent::IsForward);
883#endif
884 }
885
886 else if (keyCode == WXK_RETURN || keyCode == WXK_NUMPAD_ENTER) {
887 wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
888 wxWindow *def = tlw->GetDefaultItem();
889 if (def && def->IsEnabled()) {
890 wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
891 def->GetId());
892 cevent.SetEventObject( def );
893 GetParent()->GetEventHandler()->ProcessEvent(cevent);
894 }
895 }
896
897 else {
898 event.Skip();
899 return;
900 }
901
902 if (digit != mFocusedDigit) {
904 }
905}
wxEVT_COMMAND_BUTTON_CLICKED
int min(int a, int b)
void Adjust(int steps, int dir, int focusedDigit)
void Updated(bool keyup=false)

References NumericConverter::Adjust(), ControlsToValue(), mAllowInvalidValue, mBoxes, mFocusedDigit, NumericConverter::mFormatter, min(), NumericConverter::mInvalidValue, NumericConverter::mMaxValue, NumericConverter::mMinValue, mReadOnly, NumericConverter::mValue, NumericConverter::mValueString, SetFieldFocus(), SetValue(), Updated(), ValueToControls(), and wxEVT_COMMAND_BUTTON_CLICKED.

Here is the call graph for this function:

◆ OnKeyUp()

void NumericTextCtrl::OnKeyUp ( wxKeyEvent &  event)
private

Definition at line 758 of file NumericTextCtrl.cpp.

759{
760 int keyCode = event.GetKeyCode();
761
762 event.Skip(true);
763
764 if ((keyCode >= WXK_NUMPAD0) && (keyCode <= WXK_NUMPAD9))
765 keyCode -= WXK_NUMPAD0 - '0';
766
767 if ((keyCode >= '0' && keyCode <= '9' && !event.HasAnyModifiers()) ||
768 (keyCode == WXK_DELETE) ||
769 (keyCode == WXK_BACK) ||
770 (keyCode == WXK_UP) ||
771 (keyCode == WXK_DOWN)) {
772 Updated(true);
773 }
774}

References Updated().

Here is the call graph for this function:

◆ OnMouse()

void NumericTextCtrl::OnMouse ( wxMouseEvent &  event)
private

Definition at line 637 of file NumericTextCtrl.cpp.

638{
639 if (event.LeftDown() && event.GetX() >= mWidth) {
640 wxContextMenuEvent e;
641 OnContext(e);
642 }
643 else if (event.LeftDown()) {
644 SetFocus();
645
646 int bestDist = 9999;
647 unsigned int i;
648
649 mFocusedDigit = 0;
650 for(i = 0; i < mBoxes.size(); i++) {
651 int dist = abs(event.m_x - (GetBox(i).x +
652 GetBox(i).width/2));
653 if (dist < bestDist) {
654 mFocusedDigit = i;
655 bestDist = dist;
656 }
657 }
658
659 Refresh(false);
660 }
661 else if (event.RightDown() && mMenuEnabled) {
662 wxContextMenuEvent e;
663 OnContext(e);
664 }
665 else if(!mReadOnly && event.m_wheelRotation != 0 ) {
666 double steps = event.m_wheelRotation /
667 (event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0) +
669 mScrollRemainder = steps - floor(steps);
670 steps = floor(steps);
671
672 Adjust((int)fabs(steps), steps < 0.0 ? -1 : 1, mFocusedDigit);
673 Updated();
674
675 Refresh();
676 }
677}
void OnContext(wxContextMenuEvent &event)

References NumericConverter::Adjust(), GetBox(), mBoxes, mFocusedDigit, mMenuEnabled, mReadOnly, mScrollRemainder, mWidth, OnContext(), BasicUI::SetFocus(), and Updated().

Here is the call graph for this function:

◆ OnPaint()

void NumericTextCtrl::OnPaint ( wxPaintEvent &  event)
private

Definition at line 514 of file NumericTextCtrl.cpp.

515{
516 if (!mFormatter)
517 return;
518
519 wxBufferedPaintDC dc(this);
520 bool focused = (FindFocus() == this);
521
522 dc.DrawBitmap(*mBackgroundBitmap, 0, 0);
523
524 wxPen Pen;
525 wxBrush Brush;
526 if (focused) {
527 theTheme.SetPenColour( Pen, clrTimeFontFocus );
528 dc.SetPen(Pen);
529 dc.SetBrush(*wxTRANSPARENT_BRUSH);
530 dc.DrawRectangle(0, 0, mWidth, mHeight);
531 dc.SetPen( wxNullPen );
532 }
533
534 dc.SetFont(*mDigitFont);
535 dc.SetTextForeground(theTheme.Colour( clrTimeFont ));
536 dc.SetTextBackground(theTheme.Colour( clrTimeBack ));
537
538 dc.SetPen(*wxTRANSPARENT_PEN);
539 theTheme.SetBrushColour( Brush , clrTimeBackFocus );
540 dc.SetBrush( Brush );
541
542 auto& digits = mFormatter->GetDigitInfos();
543 auto digitsCount = int(digits.size());
544 int i;
545 for(i = 0; i < digits.size(); i++) {
546 wxRect box = GetBox(i);
547 if (focused && mFocusedDigit == i) {
548 dc.DrawRectangle(box);
549 dc.SetTextForeground(theTheme.Colour( clrTimeFontFocus ));
550 dc.SetTextBackground(theTheme.Colour( clrTimeBackFocus ));
551 }
552 int pos = digits[i].pos;
553 wxString digit = mValueString.Mid(pos, 1);
554 int x = box.x + (mDigitBoxW - mDigitW)/2;
555 int y = box.y + (mDigitBoxH - mDigitH)/2;
556 dc.DrawText(digit, x, y);
557 if (focused && mFocusedDigit == i) {
558 dc.SetTextForeground(theTheme.Colour( clrTimeFont ));
559 dc.SetTextBackground(theTheme.Colour( clrTimeBack ));
560 }
561 }
562 dc.SetPen( wxNullPen );
563 dc.SetBrush( wxNullBrush );
564}
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:383

References ThemeBase::Colour(), BasicUI::FindFocus(), GetBox(), mBackgroundBitmap, mDigitBoxH, mDigitBoxW, mDigitFont, mDigitH, mDigitW, mFocusedDigit, NumericConverter::mFormatter, mHeight, NumericConverter::mValueString, mWidth, ThemeBase::SetBrushColour(), ThemeBase::SetPenColour(), and theTheme.

Here is the call graph for this function:

◆ SetCustomFormat()

bool NumericTextCtrl::SetCustomFormat ( const TranslatableString customFormat)

Definition at line 257 of file NumericTextCtrl.cpp.

258{
259 if (!NumericConverter::SetCustomFormat(customFormat))
260 return false;
261
263
264 return true;
265}
bool SetCustomFormat(const TranslatableString &customFormat)

References HandleFormatterChanged(), and NumericConverter::SetCustomFormat().

Here is the call graph for this function:

◆ SetDigitSize()

void NumericTextCtrl::SetDigitSize ( int  width,
int  height 
)

Definition at line 274 of file NumericTextCtrl.cpp.

275{
276 mDigitBoxW = width;
277 mDigitBoxH = height;
278 Layout();
279 Fit();
280}

References Fit(), Layout(), mDigitBoxH, and mDigitBoxW.

Referenced by TimeToolBar::OnSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFieldFocus()

void NumericTextCtrl::SetFieldFocus ( int  digit)

Definition at line 907 of file NumericTextCtrl.cpp.

908{
909#if wxUSE_ACCESSIBILITY
910 if (!mFormatter || mBoxes.size() == 0)
911 {
912 mFocusedDigit = 0;
913 return;
914 }
915 mFocusedDigit = digit;
916
917 GetAccessible()->NotifyEvent(wxACC_EVENT_OBJECT_FOCUS,
918 this,
919 wxOBJID_CLIENT,
920 mFocusedDigit + 1);
921#endif
922}

References mBoxes, mFocusedDigit, and NumericConverter::mFormatter.

Referenced by OnKeyDown().

Here is the caller graph for this function:

◆ SetFormatName()

bool NumericTextCtrl::SetFormatName ( const NumericFormatID formatName)

Definition at line 247 of file NumericTextCtrl.cpp.

248{
249 if (!NumericConverter::SetFormatName(formatName))
250 return false;
251
253
254 return true;
255}
bool SetFormatName(const NumericFormatID &formatName)

References HandleFormatterChanged(), and NumericConverter::SetFormatName().

Referenced by OnContext(), EffectChangeSpeed::OnTimeCtrlUpdate(), TimeToolBar::SetAudioTimeFormat(), SpectralSelectionBar::SetBandwidthSelectionFormatName(), SpectralSelectionBar::SetFrequencySelectionFormatName(), TimeDialog::TransferDataToWindow(), EffectChangeSpeed::TransferDataToWindow(), and EffectChangeSpeed::Update_TimeCtrl_ToLength().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetInvalidValue()

void NumericTextCtrl::SetInvalidValue ( double  invalidValue)

Definition at line 305 of file NumericTextCtrl.cpp.

306{
307 const bool wasInvalid = mAllowInvalidValue && (mValue == mInvalidValue);
308 mAllowInvalidValue = true;
309 mInvalidValue = invalidValue;
310 if (wasInvalid)
311 SetValue(invalidValue);
312}

References mAllowInvalidValue, NumericConverter::mInvalidValue, NumericConverter::mValue, and SetValue().

Here is the call graph for this function:

◆ SetName()

void NumericTextCtrl::SetName ( const TranslatableString name)

Definition at line 212 of file NumericTextCtrl.cpp.

213{
214 wxControl::SetName( name.Translation() );
215}
wxString name
Definition: TagsEditor.cpp:166

References name.

Referenced by LV2Editor::BuildPlain(), VSTEditor::BuildPlain(), SpectralSelectionBar::Populate(), TimeToolBar::Populate(), LadspaEditor::PopulateUI(), and VST3Editor::VST3Editor().

Here is the caller graph for this function:

◆ SetReadOnly()

void NumericTextCtrl::SetReadOnly ( bool  readOnly = true)

Definition at line 282 of file NumericTextCtrl.cpp.

283{
284 mReadOnly = readOnly;
285}

References mReadOnly.

Referenced by TimeToolBar::Populate().

Here is the caller graph for this function:

◆ SetTypeAndFormatName()

bool NumericTextCtrl::SetTypeAndFormatName ( const NumericConverterType type,
const NumericFormatID formatName 
)

Definition at line 237 of file NumericTextCtrl.cpp.

238{
239 if (!NumericConverter::SetTypeAndFormatName(type, formatName))
240 return false;
241
243
244 return true;
245}
bool SetTypeAndFormatName(const NumericConverterType &type, const NumericFormatID &formatName)

References HandleFormatterChanged(), and NumericConverter::SetTypeAndFormatName().

Here is the call graph for this function:

◆ SetValue()

void NumericTextCtrl::SetValue ( double  newValue)

◆ UpdateAutoFocus()

void NumericTextCtrl::UpdateAutoFocus ( )
private

Definition at line 220 of file NumericTextCtrl.cpp.

221{
222 if (!mAutoPos || !mFormatter)
223 return;
224
225 auto& digits = mFormatter->GetDigitInfos();
226
227 mFocusedDigit = 0;
228 while (mFocusedDigit < ((int)digits.size() - 1)) {
229 wxChar dgt = mValueString[digits[mFocusedDigit].pos];
230 if (dgt != '0') {
231 break;
232 }
234 }
235}

References mAutoPos, mFocusedDigit, NumericConverter::mFormatter, and NumericConverter::mValueString.

Referenced by HandleFormatterChanged(), and OnFocus().

Here is the caller graph for this function:

◆ Updated()

void NumericTextCtrl::Updated ( bool  keyup = false)
private

Definition at line 924 of file NumericTextCtrl.cpp.

925{
926 wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
927
928 // This will give listeners the ability to do tasks when the
929 // update has been completed, like when the UP ARROW has been
930 // held down and is finally released.
931 event.SetInt(keyup);
932 event.SetEventObject(this);
933 GetEventHandler()->ProcessEvent(event);
934
935#if wxUSE_ACCESSIBILITY
936 if (!keyup) {
937 if (!mFormatter || mBoxes.size() == 0)
938 {
939 mFocusedDigit = 0;
940 return;
941 }
942
943 // The object_focus event is only needed by Window-Eyes
944 // and can be removed when we cease to support this screen reader.
945 GetAccessible()->NotifyEvent(wxACC_EVENT_OBJECT_FOCUS,
946 this,
947 wxOBJID_CLIENT,
948 mFocusedDigit + 1);
949
950 GetAccessible()->NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE,
951 this,
952 wxOBJID_CLIENT,
953 mFocusedDigit + 1);
954 }
955#endif
956}
wxEVT_COMMAND_TEXT_UPDATED
Definition: Nyquist.cpp:73

References mBoxes, mFocusedDigit, NumericConverter::mFormatter, and wxEVT_COMMAND_TEXT_UPDATED.

Referenced by OnKeyDown(), OnKeyUp(), and OnMouse().

Here is the caller graph for this function:

◆ ValueToControls()

void NumericTextCtrl::ValueToControls ( )
overrideprivatevirtual

Reimplemented from NumericConverter.

Definition at line 958 of file NumericTextCtrl.cpp.

959{
960 const wxString previousValueString = mValueString;
962 if (mValueString != previousValueString) {
963 // Doing this only when needed is an optimization.
964 // NumerixTextCtrls are used in the selection bar at the bottom
965 // of Audacity, and are updated at high frequency through
966 // SetValue() when Audacity is playing. This consumes a
967 // significant amount of CPU. Typically, when a track is
968 // playing, only one of the NumericTextCtrl actually changes
969 // (the audio position). We save CPU by updating the control
970 // only when needed.
971 Refresh(false);
972 }
973}
virtual void ValueToControls()

References NumericConverter::mValue, NumericConverter::mValueString, and NumericConverter::ValueToControls().

Referenced by HandleFormatterChanged(), OnKeyDown(), and SetValue().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ NumericTextCtrlAx

friend class NumericTextCtrlAx
friend

Definition at line 37 of file NumericTextCtrl.h.

Member Data Documentation

◆ mAllowInvalidValue

bool NumericTextCtrl::mAllowInvalidValue
private

Definition at line 178 of file NumericTextCtrl.h.

Referenced by OnKeyDown(), and SetInvalidValue().

◆ mAutoPos

bool NumericTextCtrl::mAutoPos
private

Definition at line 171 of file NumericTextCtrl.h.

Referenced by UpdateAutoFocus().

◆ mBackgroundBitmap

std::unique_ptr<wxBitmap> NumericTextCtrl::mBackgroundBitmap
private

Definition at line 153 of file NumericTextCtrl.h.

Referenced by Layout(), and OnPaint().

◆ mBorderBottom

int NumericTextCtrl::mBorderBottom
private

Definition at line 163 of file NumericTextCtrl.h.

Referenced by ComputeSizing().

◆ mBorderLeft

int NumericTextCtrl::mBorderLeft
private

Definition at line 160 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), and Layout().

◆ mBorderRight

int NumericTextCtrl::mBorderRight
private

Definition at line 162 of file NumericTextCtrl.h.

Referenced by ComputeSizing().

◆ mBorderTop

int NumericTextCtrl::mBorderTop
private

Definition at line 161 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), and Layout().

◆ mBoxes

std::vector<wxRect> NumericTextCtrl::mBoxes
private

◆ mButtonWidth

int NumericTextCtrl::mButtonWidth
private

Definition at line 166 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), EnableMenu(), Fit(), and Layout().

◆ mDigitBoxH

int NumericTextCtrl::mDigitBoxH
private

Definition at line 157 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), Layout(), OnPaint(), and SetDigitSize().

◆ mDigitBoxW

int NumericTextCtrl::mDigitBoxW
private

Definition at line 156 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), OnPaint(), and SetDigitSize().

◆ mDigitFont

std::unique_ptr<wxFont> NumericTextCtrl::mDigitFont
private

Definition at line 155 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), and OnPaint().

◆ mDigitH

int NumericTextCtrl::mDigitH
private

Definition at line 159 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), Layout(), and OnPaint().

◆ mDigitW

int NumericTextCtrl::mDigitW
private

Definition at line 158 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), and OnPaint().

◆ mFieldPositions

std::vector<FieldPosition> NumericTextCtrl::mFieldPositions
private

Definition at line 146 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), and Layout().

◆ mFocusedDigit

int NumericTextCtrl::mFocusedDigit { 0 }
private

◆ mHeight

int NumericTextCtrl::mHeight
private

Definition at line 165 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), Fit(), Layout(), and OnPaint().

◆ mLabelFont

std::unique_ptr<wxFont> NumericTextCtrl::mLabelFont
private

Definition at line 155 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), and Layout().

◆ mMenuEnabled

bool NumericTextCtrl::mMenuEnabled
private

Definition at line 150 of file NumericTextCtrl.h.

Referenced by EnableMenu(), Layout(), OnContext(), and OnMouse().

◆ mReadOnly

bool NumericTextCtrl::mReadOnly
private

Definition at line 151 of file NumericTextCtrl.h.

Referenced by OnKeyDown(), OnMouse(), and SetReadOnly().

◆ mScrollRemainder

double NumericTextCtrl::mScrollRemainder
private

Definition at line 174 of file NumericTextCtrl.h.

Referenced by OnMouse().

◆ mType

NumericConverterType NumericTextCtrl::mType
private

Definition at line 176 of file NumericTextCtrl.h.

Referenced by OnContext().

◆ mWidth

int NumericTextCtrl::mWidth
private

Definition at line 164 of file NumericTextCtrl.h.

Referenced by ComputeSizing(), Fit(), Layout(), OnMouse(), and OnPaint().


The documentation for this class was generated from the following files: