Dayselector¶
Widget description¶
Dayselector displays all seven days of the week and allows the user to select multiple days.
The selection can be toggle by just clicking on the day.
Dayselector also provides the functionality to check whether a day is selected or not.
First day of the week is taken from config settings by default. It can be
altered by using the API week_start
API.
APIs are provided for setting the duration of weekend
weekend_start
and weekend_length
does this job.
Two styles of weekdays and weekends are supported in Dayselector. Application can emit signals on individual check objects for setting the weekday, weekend styles.
Once the weekend start day or weekend length changes, all the weekday & weekend styles will be reset to default style. It’s the application’s responsibility to set the styles again by sending corresponding signals.
“day0” indicates Sunday, “day1” indicates Monday etc. continues and so, “day6” indicates the Saturday part name.
Application can change individual day display string by using the API
part_text_set()
.
part_content_set()
API sets the
individual day object only if the passed one is a Check widget.
Check object representing a day can be set/get by the application by using the elm_object_part_content_set/get APIs thus providing a way to handle the different check styles for individual days.
Emitted signals¶
dayselector,changed
- when the user changes the state of a day.
Enumerations¶
Dayselector days¶
- efl.elementary.ELM_DAYSELECTOR_SUN¶
Sunday
- efl.elementary.ELM_DAYSELECTOR_MON¶
Monday
- efl.elementary.ELM_DAYSELECTOR_TUE¶
Tuesday
- efl.elementary.ELM_DAYSELECTOR_WED¶
Wednesday
- efl.elementary.ELM_DAYSELECTOR_THU¶
Thursday
- efl.elementary.ELM_DAYSELECTOR_FRI¶
Friday
- efl.elementary.ELM_DAYSELECTOR_SAT¶
Saturday
Inheritance diagram¶
- class efl.elementary.Dayselector(Object parent, *args, **kwargs)¶
Bases:
efl.elementary.__init__.LayoutClass
This is the class that actually implements the widget.
- Parameters
parent (
efl.evas.Object
) – The parent object**kwargs – All the remaining keyword arguments are interpreted as properties of the instance
- callback_dayselector_changed_add(func, *args, **kwargs)¶
when the user changes the state of a day.
- callback_dayselector_changed_del(func)¶
- day_selected_get(day)¶
Get the state of given Dayselector_Day.
- Parameters
day (Dayselector days) – The day that the user want to know state.
- Returns
True
, if the Day is selected- Return type
bool
- day_selected_set(day, selected)¶
Set the state of given Dayselector_Day.
- Parameters
day (Dayselector days) – The day that the user want to set state.
selected (bool) – state of the day.
True
is selected.
- week_start¶
The starting day of Dayselector.
- Type
- weekdays_names¶
Set weekdays names to be displayed by the Dayselector.
- Parameters
weekdays – List of seven strings to be used as weekday names.
Warning
It must have 7 elements, or it will access invalid memory.
By default or if set to None, weekdays abbreviations get from system are displayed: E.g. for an en_US locale: “Sun, Mon, Tue, Wed, Thu, Fri, Sat”
The first string should be related to Sunday, the second to Monday…
The usage should be like this:
dayselector.weekdays_names = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
- See
New in version 1.8.
- weekend_length¶
The weekend length of Dayselector.
- Type
int
- weekend_start¶
The weekend starting day of Dayselector.
- Type