BaseElement create_line(string text)
 {
     BaseElement element = new BaseElement();
     element.set_size(UserInterface.Instance.screen_width-8, line_height);
     element.set_colours(BackgroundColor, BackgroundColor);
     element.set_text(text, log_font, BorderColor, 1);
     return element;
 }
 public TextWidget(int x, int y, int width, int height, string text)
     : base()
 {
     base_element = new BaseElement();
     base_element.set_position(x, y);
     base_element.set_size(width, height);
     base_element.set_colours(BackgroundColor, BorderColor);
     base_element.set_text(text, font, BorderColor);
     base_element.ClickDown += new EventHandler(OnClickDown);
     base_element.ClickUp += new EventHandler(OnClickUp);
     elements.Add(base_element);
     this.register_elements();
 }
        public ImageWidget(int x, int y, int width, int height)
            : base()
        {
            Image kisi = new Image(Resources.GetBitmap(Resources.BitmapResources.kisi));

            BaseElement element = new BaseElement();
            element.set_position(x, y);
            element.set_colours(BackgroundColor, BorderColor);
            element.set_image(kisi);
            element.ClickDown += new EventHandler(OnClickDown);
            element.ClickUp += new EventHandler(OnClickUp);
            elements.Add(element);
            this.register_elements();
        }
        public DropDownWidget(int x, int y, int width, int height, Image img)
            : base()
        {
            this.x = x;
            this.y = y;
            this.options_width = width;
            this.options_height = height;

            start_image = new BaseElement();
            start_image.set_position(x, y);
            start_image.set_colours(BackgroundColor, BorderColor);
            start_image.set_image(img);
            start_image.ClickUp += new EventHandler(toggle_dropdown);
            elements.Add(start_image);
            this.register_elements();
        }
Esempio n. 5
0
        public void update_hotspots()
        {
            hotspots.Clear();
            GHI.Premium.Net.WiFiNetworkInfo[] scanResults = wifi_RS21.Interface.Scan();
            foreach (GHI.Premium.Net.WiFiNetworkInfo result in scanResults)
            {
                BaseElement element = create_line("SSID: " + result.SSID);
                hotspots.Add(element);
            }

            int line_y = 30;

            elements.Clear();
            elements.Add(background);
            foreach (BaseElement hotspot in hotspots)
            {
                hotspot.set_position(5, line_y);
                elements.Add(hotspot);
                line_y += 18;
            }
            register_elements();
        }