Screen
Controls
Control
SetVisible(false)
SuperpositionImage
Image
class SuperpositionImage : Image { void RafraichirImage(String nomFichier, String nomFichierSuperpose) { //chargement de l'image initiale Surface.LoadFromFile(nomFichier); //chargement de l'image superposée Surface superpose; superpose.LoadFromFile(nomFichierSuperpose); //Dessin de l'image superposée sur l'image initiale Renderer.Draw(Surface, superpose, 0, 0); } }
Button
Label
TaskRow
lblSubject
Controls.Add()
class TaskRow : Button { Label lblSubject; int x, y, w, h; String s; int ObjectID; bool isComplete; void Load() { OnClick = OnClick_Handler; Image.LoadFromFile("Row.Background.jif"); ImageSelected.LoadFromFile("Row.Background.Selected.jif"); lblSubject.SetAlign("Left", "Center"); lblSubject.SetFont("Font.Large"); Controls.Add(lblSubject); } void Set(DataTable tbl, int y, int delay) { w = Image.GetWidth(); h = Image.GetHeight(); //position correctly SetBounds(0, y); //get data from the table tbl.GetValue("Subject", s); lblSubject.SetText(s); tbl.GetValue("ObjectID", ObjectID); tbl.GetValue("Complete", isComplete); w = GetWidth(); x = w / 24; Image img; img.Surface.LoadFromFile("Icon.Ring.Tick.jif"); img.SetBounds(x, y); img.AnimateClear(); if (isComplete) { img.AnimateFade(0, 100, 5, delay); } else { img.AnimateFade(0, 30, 5, delay); } Controls.Add(img); int padding, left; padding = 20; left = img.GetWidth() + padding; lblSubject.SetBounds(0, 0, GetWidth(), GetHeight()); lblSubject.SetPadding(0, padding, 0, left); lblSubject.AnimateClear(); lblSubject.AnimateFade(0, 100, 5, delay); //show SetVisible(true); } void OnClick_Handler(Control sender, int x, int y) { //show task Tasks.Display(ObjectID); } }