Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class time_picker

boost::ui::time_picker — Time picker widget.

Synopsis

// In header: <boost/ui/datetime.hpp>


class time_picker : public boost::ui::widget {
public:
  // construct/copy/destruct
  explicit time_picker(widget &);
  time_picker();

  // public member functions
  std::time_t get_time_t() const;
  time_picker & set_time_t(std::time_t);
  std::tm get_tm() const;
  time_picker & set_tm(const std::tm &);
  boost::posix_time::time_duration posix_time_duration() const;
  time_picker & posix_time_duration(const boost::posix_time::time_duration &);
  template<typename Rep, typename Period> 
    boost::chrono::duration< Rep, Period > boost_chrono_duration() const;
  template<typename Rep, typename Period> 
    time_picker & 
    chrono_duration(const boost::chrono::duration< Rep, Period > &);
  template<typename Rep, typename Period> 
    std::chrono::duration< Rep, Period > chrono_duration() const;
  template<typename Rep, typename Period> 
    time_picker & 
    chrono_duration(const std::chrono::duration< Rep, Period > &);
  template<typename T> void get_time(T, T, T);
  time_picker & set_time(int, int, int);
  template<typename F, class ... Args> 
    time_picker & on_change(F &&, Args &&...);

  // private member functions
  void get_time_raw(int *, int *, int *) const;
  int get_seconds() const;
  void set_seconds(boost::intmax_t);
  void on_change_raw(const boost::function< void()> &);
  detail_impl * get_impl();
  const detail_impl * get_impl() const;
};

Description

Works with time in range [0 hours, 24 hours)

time_picker public construct/copy/destruct

  1. explicit time_picker(widget & parent);
    Creates widget.
  2. time_picker();

time_picker public member functions

  1. std::time_t get_time_t() const;
    Returns count of seconds since midnight in std::time_t format.

    Throws:

    std::out_of_range If selected time is not compatible with std::time_t format
  2. time_picker & set_time_t(std::time_t t);
    Sets time in std::time_t format.

    Throws:

    std::out_of_range If requested time is invalid
  3. std::tm get_tm() const;
    Returns local time in std::tm format at epoch start day (1900-01-01)

    Throws:

    std::out_of_range If selected time is not compatible with std::tm format
  4. time_picker & set_tm(const std::tm & t);
    Sets local time in std::tm format.

    Throws:

    std::out_of_range If requested time is invalid
  5. boost::posix_time::time_duration posix_time_duration() const;
    Returns boost::posix_time::time_duration.

    See Also:

    BOOST_UI_USE_DATE_TIME

    Throws:

    std::out_of_range If time is out of range
  6. time_picker & posix_time_duration(const boost::posix_time::time_duration & d);
    Sets boost::posix_time::time_duration.

    See Also:

    BOOST_UI_USE_DATE_TIME

    Throws:

    std::out_of_range If requested time is invalid
  7. template<typename Rep, typename Period> 
      boost::chrono::duration< Rep, Period > boost_chrono_duration() const;
    Returns boost::chrono::duration.

    See Also:

    BOOST_UI_USE_CHRONO

    Throws:

    std::out_of_range If time is out of range
  8. template<typename Rep, typename Period> 
      time_picker & 
      chrono_duration(const boost::chrono::duration< Rep, Period > & d);
    Sets boost::chrono::duration.

    See Also:

    BOOST_UI_USE_CHRONO

    Throws:

    std::out_of_range If requested time is invalid
  9. template<typename Rep, typename Period> 
      std::chrono::duration< Rep, Period > chrono_duration() const;
    Returns std::chrono::duration.

    Throws:

    std::out_of_range If time is out of range
  10. template<typename Rep, typename Period> 
      time_picker & 
      chrono_duration(const std::chrono::duration< Rep, Period > & d);
    Sets std::chrono::duration.

    Throws:

    std::out_of_range If requested time is invalid
  11. template<typename T> void get_time(T hours_ptr, T minutes_ptr, T seconds_ptr);
    Returns time.
  12. time_picker & set_time(int hours, int minutes, int seconds);
    Sets time.

    Throws:

    std::out_of_range If time is out of range
  13. template<typename F, class ... Args> 
      time_picker & on_change(F && f, Args &&... args);
    Connects time change handler.

time_picker private member functions

  1. void get_time_raw(int * hours_ptr, int * minutes_ptr, int * seconds_ptr) const;
  2. int get_seconds() const;
  3. void set_seconds(boost::intmax_t seconds);
  4. void on_change_raw(const boost::function< void()> & handler);
  5. detail_impl * get_impl();
  6. const detail_impl * get_impl() const;

PrevUpHomeNext