From 15734c19783fc5fc38e5c1cba485d756285161e0 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 12 Mar 2024 18:30:33 +0100 Subject: viewer#961 Add a notification appearing when user tries to insert a disallowed character --- indra/llui/lltimectrl.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'indra/llui/lltimectrl.h') diff --git a/indra/llui/lltimectrl.h b/indra/llui/lltimectrl.h index b5f268c76a..1c8ac78289 100644 --- a/indra/llui/lltimectrl.h +++ b/indra/llui/lltimectrl.h @@ -60,6 +60,18 @@ public: void setTime24(F32 time); // 0.0 - 23.98(3) + static std::string getHoursString(const std::string& str); + static std::string getMinutesString(const std::string& str); + static std::string getAMPMString(const std::string& str); + + static bool isHoursStringValid(const std::string& str); + static bool isMinutesStringValid(const std::string& str); + static bool isPMAMStringValid(const std::string& str); + + static U32 parseHours(const std::string& str); + static U32 parseMinutes(const std::string& str); + static bool parseAMPM(const std::string& str); + protected: LLTimeCtrl(const Params&); friend class LLUICtrlFactory; @@ -87,8 +99,6 @@ private: void onDownBtn(); void onTextEntry(LLLineEditor* line_editor); - bool isTimeStringValid(const LLWString& wstr); - void increaseMinutes(); void increaseHours(); @@ -102,18 +112,6 @@ private: EEditingPart getEditingPart(); - static std::string getHoursString(const std::string& str); - static std::string getMinutesString(const std::string& str); - static std::string getAMPMString(const std::string& str); - - static bool isHoursStringValid(const std::string& str); - static bool isMinutesStringValid(const std::string& str); - static bool isPMAMStringValid(const std::string& str); - - static U32 parseHours(const std::string& str); - static U32 parseMinutes(const std::string& str); - static bool parseAMPM(const std::string& str); - class LLTextBox* mLabelBox; class LLLineEditor* mEditor; -- cgit v1.2.3 From 1b68f71348ecf3983b76b40d7940da8377f049b7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 29 Apr 2024 07:43:28 +0300 Subject: #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed --- indra/llui/lltimectrl.h | 124 ++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'indra/llui/lltimectrl.h') diff --git a/indra/llui/lltimectrl.h b/indra/llui/lltimectrl.h index b5f268c76a..ff46bc76ca 100644 --- a/indra/llui/lltimectrl.h +++ b/indra/llui/lltimectrl.h @@ -37,95 +37,95 @@ class LLLineEditor; class LLTimeCtrl : public LLUICtrl { - LOG_CLASS(LLTimeCtrl); + LOG_CLASS(LLTimeCtrl); public: - struct Params : public LLInitParam::Block - { - Optional label_width; - Optional snap_to; - Optional allow_text_entry; + struct Params : public LLInitParam::Block + { + Optional label_width; + Optional snap_to; + Optional allow_text_entry; - Optional text_enabled_color; - Optional text_disabled_color; + Optional text_enabled_color; + Optional text_disabled_color; - Optional up_button; - Optional down_button; + Optional up_button; + Optional down_button; - Params(); - }; + Params(); + }; - F32 getTime24() const; // 0.0 - 24.0 - U32 getHours24() const; // 0 - 23 - U32 getMinutes() const; // 0 - 59 + F32 getTime24() const; // 0.0 - 24.0 + U32 getHours24() const; // 0 - 23 + U32 getMinutes() const; // 0 - 59 - void setTime24(F32 time); // 0.0 - 23.98(3) + void setTime24(F32 time); // 0.0 - 23.98(3) protected: - LLTimeCtrl(const Params&); - friend class LLUICtrlFactory; + LLTimeCtrl(const Params&); + friend class LLUICtrlFactory; private: - enum EDayPeriod - { - AM, - PM - }; + enum EDayPeriod + { + AM, + PM + }; - enum EEditingPart - { - HOURS, - MINUTES, - DAYPART, - NONE - }; + enum EEditingPart + { + HOURS, + MINUTES, + DAYPART, + NONE + }; - virtual void onFocusLost(); - virtual BOOL handleKeyHere(KEY key, MASK mask); + virtual void onFocusLost(); + virtual BOOL handleKeyHere(KEY key, MASK mask); - void onUpBtn(); - void onDownBtn(); - void onTextEntry(LLLineEditor* line_editor); + void onUpBtn(); + void onDownBtn(); + void onTextEntry(LLLineEditor* line_editor); - bool isTimeStringValid(const LLWString& wstr); + bool isTimeStringValid(const LLWString& wstr); - void increaseMinutes(); - void increaseHours(); + void increaseMinutes(); + void increaseHours(); - void decreaseMinutes(); - void decreaseHours(); + void decreaseMinutes(); + void decreaseHours(); - bool isPM() const; - void switchDayPeriod(); + bool isPM() const; + void switchDayPeriod(); - void updateText(); + void updateText(); - EEditingPart getEditingPart(); + EEditingPart getEditingPart(); - static std::string getHoursString(const std::string& str); - static std::string getMinutesString(const std::string& str); - static std::string getAMPMString(const std::string& str); + static std::string getHoursString(const std::string& str); + static std::string getMinutesString(const std::string& str); + static std::string getAMPMString(const std::string& str); - static bool isHoursStringValid(const std::string& str); - static bool isMinutesStringValid(const std::string& str); - static bool isPMAMStringValid(const std::string& str); + static bool isHoursStringValid(const std::string& str); + static bool isMinutesStringValid(const std::string& str); + static bool isPMAMStringValid(const std::string& str); - static U32 parseHours(const std::string& str); - static U32 parseMinutes(const std::string& str); - static bool parseAMPM(const std::string& str); + static U32 parseHours(const std::string& str); + static U32 parseMinutes(const std::string& str); + static bool parseAMPM(const std::string& str); - class LLTextBox* mLabelBox; + class LLTextBox* mLabelBox; - class LLLineEditor* mEditor; - LLUIColor mTextEnabledColor; - LLUIColor mTextDisabledColor; + class LLLineEditor* mEditor; + LLUIColor mTextEnabledColor; + LLUIColor mTextDisabledColor; - class LLButton* mUpBtn; - class LLButton* mDownBtn; + class LLButton* mUpBtn; + class LLButton* mDownBtn; - U32 mTime; // minutes since midnight: 0 - 1439 - U32 mSnapToMin; // interval in minutes to snap to + U32 mTime; // minutes since midnight: 0 - 1439 + U32 mSnapToMin; // interval in minutes to snap to - BOOL mAllowEdit; + BOOL mAllowEdit; }; #endif /* LLTIMECTRL_H_ */ -- cgit v1.2.3