~aleteoryx/muditaos

ref: 7c1c7395e3e62f8ce6a81c325c529993fb5ef7bb muditaos/module-apps/application-calendar/widgets/EventTimeItem.hpp -rw-r--r-- 1.1 KiB
7c1c7395 — KacperLewandowski [EGD-3314] Develop new/edit event and custom repeat windows 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <Label.hpp>
#include <Text.hpp>
#include <ListItem.hpp>
#include <BoxLayout.hpp>

namespace gui
{
    class EventTimeItem : public ListItem
    {
        gui::HBox *hBox              = nullptr;
        gui::Label *colonLabel       = nullptr;
        gui::Label *descriptionLabel = nullptr;
        gui::Text *hourInput         = nullptr;
        gui::Text *minuteInput       = nullptr;
        gui::Text *mode12hInput      = nullptr;

        std::function<void(const UTF8 &text)> bottomBarTemporaryMode = nullptr;
        std::function<void()> bottomBarRestoreFromTemporaryMode      = nullptr;

      public:
        EventTimeItem(const std::string &description,
                      std::function<void(const UTF8 &text)> bottomBarTemporaryMode = nullptr,
                      std::function<void()> bottomBarRestoreFromTemporaryMode      = nullptr);
        virtual ~EventTimeItem() = default;

        // virtual methods from Item
        bool onActivated(void *data) override;
        bool onDimensionChanged(const BoundingBox &oldDim, const BoundingBox &newDim) override;
    };

} /* namespace gui */