Files
MuditaOS/module-apps/widgets/DateWidget.hpp
Mateusz Grzegorzek 8f0797218f [EGD-5312] Add Time selection window
- add ChangeDateAndTimeWindow,
- extract EventTimeItem to common widgets folder
  and rename it to TimeWidget,
- extract EventDateItem to common widgets folder
  and rename it to DateWidget,
- replace timeWidget with common TimeWidget
  in NightshiftWindow,
- refactor time setting in
  DesktopMainWindow and TopBar,
- Remove dead code from EventManager
  (GetNextAlarmTimestamp and HandleAlarmTrigger)
2021-02-23 15:59:51 +01:00

42 lines
1.2 KiB
C++

// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <BoxLayout.hpp>
#include <Label.hpp>
#include <module-utils/date/include/date/date.h>
namespace gui
{
class DateWidget : public VBox
{
public:
DateWidget(Item *parent);
void loadData(const date::year_month_day &yearMonthDay);
const date::year_month_day getChosenDate();
private:
VBox *vBox = nullptr;
HBox *labelsHBox = nullptr;
HBox *dateHBox = nullptr;
Label *dayLabel = nullptr;
Label *monthLabel = nullptr;
Label *yearLabel = nullptr;
Label *dayInput = nullptr;
Label *monthInput = nullptr;
Label *yearInput = nullptr;
void buildInterface();
void applyItemSpecificProperties(Label *item);
void applyLabelSpecificProperties(Label *label);
void applyCallbacks();
date::year_month_day validateDate();
void setDate(int keyValue, Label &item);
void setOnInputCallback(Label &dateInput);
void clearInput(Label &dateInput);
};
} /* namespace gui */