summaryrefslogtreecommitdiff
path: root/indra/llui/lltimectrl.h
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-06-01 16:53:19 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-06-01 16:53:19 +0300
commitaf1b7a4ac87f81b56fe1ff49d29c6bd7c3bffa9c (patch)
tree3a8688a673b5db5c82d5add696f5d51ca7b0b3a0 /indra/llui/lltimectrl.h
parent6d4198b89a3edf28e208391bbdde90a7a000d936 (diff)
STORM-1253 WIP Time control: the up/down buttons now work consistently across the whole day; time values are snapped to 5 minutes.
Diffstat (limited to 'indra/llui/lltimectrl.h')
-rw-r--r--indra/llui/lltimectrl.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/indra/llui/lltimectrl.h b/indra/llui/lltimectrl.h
index aebc5b6eab..b5f268c76a 100644
--- a/indra/llui/lltimectrl.h
+++ b/indra/llui/lltimectrl.h
@@ -42,6 +42,7 @@ public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
Optional<S32> label_width;
+ Optional<S32> snap_to;
Optional<bool> allow_text_entry;
Optional<LLUIColor> text_enabled_color;
@@ -84,32 +85,35 @@ private:
void onUpBtn();
void onDownBtn();
-
void onTextEntry(LLLineEditor* line_editor);
- void validateHours(const LLWString& wstr);
- void validateMinutes(const LLWString& wstr);
bool isTimeStringValid(const LLWString& wstr);
- bool isPMAMStringValid(const LLWString& wstr);
- bool isHoursStringValid(const LLWString& wstr);
- bool isMinutesStringValid(const LLWString& wstr);
-
- LLWString getHoursWString(const LLWString& wstr);
- LLWString getMinutesWString(const LLWString& wstr);
-
void increaseMinutes();
void increaseHours();
void decreaseMinutes();
void decreaseHours();
+ bool isPM() const;
void switchDayPeriod();
void updateText();
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;
@@ -119,9 +123,8 @@ private:
class LLButton* mUpBtn;
class LLButton* mDownBtn;
- U32 mHours; // 1 - 12
- U32 mMinutes; // 0 - 59
- EDayPeriod mCurrentDayPeriod; // AM/PM
+ U32 mTime; // minutes since midnight: 0 - 1439
+ U32 mSnapToMin; // interval in minutes to snap to
BOOL mAllowEdit;
};