Skip to content

Commit 9e69b61

Browse files
Tinyu-Zhaolbuque
authored andcommitted
lib/m5ui: Add LVGL Calendar widget docs and example.
Signed-off-by: [email protected] <[email protected]>
1 parent 957350e commit 9e69b61

File tree

8 files changed

+415
-138
lines changed

8 files changed

+415
-138
lines changed

docs/en/m5ui/calendar.rst

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ UiFlow2 Example
1313
event calendar
1414
^^^^^^^^^^^^^^
1515

16-
Open the |cores3_calendar_event_example.m5f2| project in UiFlow2.
16+
Open the |calendar_core2_example.m5f2| project in UiFlow2.
1717

1818
This example creates a calendar that triggers an event when the date is changed.
1919

2020
UiFlow2 Code Block:
2121

22-
|cores3_calendar_event_example.png|
22+
|calendar_core2_example.png|
2323

2424
Example output:
2525

@@ -36,7 +36,7 @@ This example creates a calendar that triggers an event when the date is changed.
3636

3737
MicroPython Code Block:
3838

39-
.. literalinclude:: ../../../examples/m5ui/calendar/cores3_calendar_event_example.py
39+
.. literalinclude:: ../../../examples/m5ui/calendar/calendar_core2_example.py
4040
:language: python
4141
:linenos:
4242

@@ -138,38 +138,6 @@ M5Calendar
138138
139139
calendar_0.set_size(100, 50)
140140
141-
.. py:method:: set_width(width)
142-
143-
Set the width of the calendar.
144-
145-
:param int width: The width of the calendar.
146-
147-
UiFlow2 Code Block:
148-
149-
|set_width.png|
150-
151-
MicroPython Code Block:
152-
153-
.. code-block:: python
154-
155-
calendar_0.set_width(100)
156-
157-
.. py:method:: set_height(height)
158-
159-
Set the height of the calendar.
160-
161-
:param int height: The height of the calendar.
162-
163-
UiFlow2 Code Block:
164-
165-
|set_height.png|
166-
167-
MicroPython Code Block:
168-
169-
.. code-block:: python
170-
171-
calendar_0.set_height(50)
172-
173141
.. py:method:: align_to(obj, align, x, y)
174142
175143
Align the calendar to another object.

docs/en/refs/m5ui.calendar.ref

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
.. |align_to.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/align_to.png
2-
.. |event.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/event.png
3-
.. |set_calendar_style.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_calendar_style.png
4-
.. |set_today_date.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_today_date.png
5-
.. |set_month_shown.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_month_shown.png
6-
.. |set_highlighted_dates.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_highlighted_dates.png
7-
.. |set_height.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_height.png
8-
.. |set_pos.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_pos.png
9-
.. |set_size.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_size.png
10-
.. |set_width.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_width.png
11-
.. |set_x.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_x.png
12-
.. |set_y.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/set_y.png
1+
.. |align_to.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/align_to.png
2+
.. |event.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/event.png
3+
.. |set_calendar_style.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_calendar_style.png
4+
.. |set_today_date.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_today_date.png
5+
.. |set_month_shown.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_month_shown.png
6+
.. |set_highlighted_dates.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_highlighted_dates.png
7+
.. |set_pos.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_pos.png
8+
.. |set_size.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_size.png
9+
.. |set_x.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_x.png
10+
.. |set_y.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/set_y.png
1311

14-
.. |cores3_calendar_event_example.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/switch/example.png
12+
.. |calendar_core2_example.png| image:: https://static-cdn.m5stack.com/mpy_docs/m5ui/calendar/example.png
1513

16-
.. |cores3_calendar_event_example.m5f2| raw:: html
14+
.. |calendar_core2_example.m5f2| raw:: html
1715

1816
<a
19-
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/m5ui/switch/cores3_calendar_event_example.m5f2"
17+
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/m5ui/calendar/calendar_core2_example.m5f2"
2018
target="_blank"
2119
>
22-
cores3_calendar_event_example.m5f2
20+
calendar_core2_example.m5f2
2321
</a>

0 commit comments

Comments
 (0)