2#ifndef __CXDATEPICKER_H__
3#define __CXDATEPICKER_H__
140 virtual std::string
cxTypeStr()
const override;
149 virtual long showModal(
bool pShowSelf =
true,
150 bool pBringToTop =
true,
151 bool pShowSubwindows =
true)
override;
157 virtual void hide(
bool pHideSubwindows =
true)
override;
165 virtual void unhide(
bool pUnhideSubwindows =
true)
override;
174 virtual bool move(
int pNewRow,
int pNewCol,
bool pRefresh =
true)
override;
177 virtual void draw()
override;
190 return mSelectedDate;
217 cxDate mSelectedDate;
220 FocusItem mFocusItem = FocusItem::CALENDAR;
225 std::shared_ptr<cxComboBox> mMonthCombo;
226 std::shared_ptr<cxInput> mYearInput;
227 std::shared_ptr<cxButton> mPrevBtn;
228 std::shared_ptr<cxButton> mNextBtn;
229 std::shared_ptr<cxButton> mCancelBtn;
230 std::shared_ptr<cxButton> mOKBtn;
244 void redrawDay(
int pDay);
247 void getDayWinPos(
int pDay,
int& pWinRow,
int& pWinCol)
const;
250 int getDayAtScreenPos(
int pScreenRow,
int pScreenCol)
const;
253 void setFocusItem(FocusItem pItem);
256 void moveFocusDay(
int pDelta);
259 void navigateMonth(
int pDelta);
262 void highlightButton(std::shared_ptr<cxButton>& pBtn,
bool pOn);
265 void applyYearInput();
268 void applyMonthCombo();
274 void refreshCalendar();
This is a dialog that displays a calendar, allowing the user to choose a date while viewing a calenda...
Definition cxDatePicker.h:57
static constexpr int ROW_BTN_BOT
Definition cxDatePicker.h:76
static constexpr int COL_MONTH_COMBO
Definition cxDatePicker.h:84
static constexpr int NAV_BTN_H
Definition cxDatePicker.h:83
static constexpr int ROW_SEPARATOR
Definition cxDatePicker.h:67
static constexpr int ROW_BTN_TOP
Definition cxDatePicker.h:74
static constexpr int ROW_DATE_HEADER
Definition cxDatePicker.h:66
virtual void hide(bool pHideSubwindows=true) override
Hides the date picker and all its child widgets.
Definition cxDatePicker.cpp:132
virtual bool move(int pNewRow, int pNewCol, bool pRefresh=true) override
Moves the date picker window and repositions all child widgets.
Definition cxDatePicker.cpp:156
static constexpr int COL_YEAR_INPUT
Definition cxDatePicker.h:88
static constexpr int COL_NEXT_BTN
Definition cxDatePicker.h:87
static constexpr int COL_CAL
Definition cxDatePicker.h:80
static constexpr int COL_CANCEL_BTN
Definition cxDatePicker.h:92
static constexpr int NAV_BTN_W
Definition cxDatePicker.h:82
virtual ~cxDatePicker()
Definition cxDatePicker.cpp:66
static constexpr int ROW_CTRL_MID
Definition cxDatePicker.h:69
static constexpr int COL_PREV_BTN
Definition cxDatePicker.h:81
virtual std::string cxTypeStr() const override
Definition cxDatePicker.cpp:76
static constexpr int ROW_DAY_HEADERS
Definition cxDatePicker.h:71
static constexpr int ROW_CTRL_BOT
Definition cxDatePicker.h:70
static constexpr int OK_BTN_W
Definition cxDatePicker.h:91
static constexpr int MONTH_COMBO_W
Definition cxDatePicker.h:85
static constexpr int PICKER_HEIGHT
Definition cxDatePicker.h:63
virtual void draw() override
Draws the window border and calendar content.
Definition cxDatePicker.cpp:81
static constexpr int MONTH_COMBO_H
Definition cxDatePicker.h:86
void setDate(const cxDate &pDate)
Pre-sets the date shown when the picker opens.
Definition cxDatePicker.cpp:179
static constexpr int CANCEL_BTN_W
Definition cxDatePicker.h:93
static constexpr int PICKER_WIDTH
Definition cxDatePicker.h:62
virtual void unhide(bool pUnhideSubwindows=true) override
Shows the date picker and its child widgets. Note: the month combo drop-down list stays hidden until ...
Definition cxDatePicker.cpp:143
static constexpr int ROW_CTRL_TOP
Definition cxDatePicker.h:68
static constexpr int YEAR_INPUT_W
Definition cxDatePicker.h:89
static constexpr int COL_OK_BTN
Definition cxDatePicker.h:90
static constexpr int ROW_BTN_MID
Definition cxDatePicker.h:75
static constexpr int ROW_CAL_FIRST
Definition cxDatePicker.h:72
static constexpr int ROW_CAL_LAST
Definition cxDatePicker.h:73
virtual long showModal(bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=true) override
Shows the date picker and enters the interactive input loop.
Definition cxDatePicker.cpp:89
static constexpr int DAY_CELL_W
Definition cxDatePicker.h:95
const cxDate & getSelectedDate() const noexcept
Returns the date the user confirmed. Only meaningful after showModal() returned cxID_OK.
Definition cxDatePicker.h:188
Enables easy management of dates. C++17-enhanced version of the original 'date' class.
Definition cxDate.h:84
static cxDate today() noexcept
Definition cxDate.cpp:646
Represents a text-based window on the screen. Can contain a title, status, and a message to appear wi...
Definition cxWindow.h:195
cxBorderChars.h - Defines border characters to be used in drawing a box (i.e., in cxWindow and all it...
Definition cxApp.cpp:5