You will be introduced to two projects that focus on the use of the ListView class.
Claus Dietrich's project demonstrates how you can present the data to be displayed in a special way with RichText and images on the elements in a ListView.
The context menu of the ListView allows you to
The following three pictures show three different designs:
Figures 17.4.2.1: Watches with different designs
With the order:
Shell "timedatectl --no-pager list-timezones" To sTimeZoneList
the list of available time zones is imported from the operating system.
With the order:
Shell "zdump " & sTimeZone To sTime
the data of a time zone is retrieved from the operating system (database tzdata), then split into a string array, then parsed according to weekday, date and time for the time zone to be displayed and finally formatted for display in a suitable way:
Asia/Seoul Wed May 18 20:48:18 2016 KST
Ingo Beckert's project also displays data with rich text and images that are interactively loaded from the Internet. These basic data provide a selection of cities, countries or regions in the ListView and also display the corresponding national flag:
Figure 17.4.2.2: Selection' Wellington'.
A double-click on an element in the ListView - in the example Wellington Point - shows the time zone, the day of the week, the date and the current local time. The data is supplemented by the time zone for the location and the differences to other time zones.
Figure 17.4.2.3: Dates for Wellington Point
A click on the yellow display changes back to the selection → figure 17.4.2.2.2.
The complete projects can be found in the download area.
Es werden Ihnen zwei Projekte vorgestellt, bei denen der Einsatz der Klasse ListView im Fokus steht.
Das Projekt von Claus Dietrich demonstriert, wie Sie mit RichText und Bildern auf den Elementen in einer ListView die anzuzeigenden Daten in besonderer Weise präsentieren können.
Über das Kontext-Menü der ListView können Sie
Die folgenden drei Bilder zeigen drei unterschiedliche Designs:
Abbildungen 17.4.2.1: Uhren mit unterschiedlichem Design
Mit dem Befehl:
Shell "timedatectl --no-pager list-timezones" To sTimeZoneList
wird die Liste der verfügbaren Zeitzonen aus dem Betriebssystem importiert.
Mit dem Befehl:
Shell "zdump " & sTimeZone To sTime
werden die Daten einer Zeitzone aus dem Betriebssystem (Datenbank tzdata) geholt, dann in ein String-Array gesplittet, anschließend nach Wochentag, Datum und Uhrzeit für die anzuzeigende Zeitzone geparst und abschließend in geeigneter Weise für die Anzeige formatiert:
Asia/Seoul Wed May 18 20:48:18 2016 KST
Das Projekt von Ingo Beckert zeigt auch Daten mit Richtext und Bildern an, die interaktiv aus dem Internet geladen werden. Diese Basis-Daten stellen eine Auswahl von Städten, Ländern oder Regionen in der ListView bereit und zeigen auch die entsprechende Landesflagge:
Abbildung 17.4.2.2: Auswahl 'Wellington'
Ein Doppelklick auf ein Element in der ListView – im Beispiel Wellington Point – zeigt neben der Zeitzone auch den Wochentag sowie das Datum und die aktuelle Ortszeit an. Ergänzt werden die Daten durch die Zeitzone für den Ort und die Differenzen zu anderen Zeitzonen.
Abbildung 17.4.2.3: Daten für 'Wellington Point'
Ein Klick auf die gelbe Anzeigefläche wechselt wieder zur Auswahl → Abbildung 17.4.2.2 .
Die vollständigen Projekte finden Sie im Downloadbereich.