Example #1
0
        public Board(SpiderView spiderView)
        {
            this.SpiderView = spiderView;
            this.Stylesheet = (this.SpiderView).Stylesheet;
            this.Click += Board_Click;
            this.MouseUp += Board_MouseUp;
            this.MouseClick += Board_MouseClick;
            this.MinimumSize = new Size(640, 480);
            this.MouseDown += Board_MouseDown;
            InitializeComponent();
            this.DragDrop += Board_DragDrop;
            this.DragOver += Board_DragOver;
            this.Paint += Board_Paint;
            this.Resize += Board_Resize;
            this.DragEnter += Board_DragEnter;
            this.Block = Stylesheet.Blocks["Body"];
            tmrDraw = new Timer();
            tmrDraw.Tick += tmrDraw_Tick;
            tmrDraw.Interval = 100;
            tmrDraw.Start();
            this.MouseMove += Board_MouseMove;
            spiderView.Scripting.RegisterFunction("getInput", new lua_delegate_get_input(lua_get_input), this);

            // Register some other goodies here::?
            spiderView.Scripting.RegisterFunction("getWebResource", new lua_delegate_download_http(lua_download_http), this);
            spiderView.Scripting.RegisterFunction("sendToWeb", new lua_delegate_send_http_request(lua_send_http_request), this);
            spiderView.Scripting.RegisterFunction("json", new get_obj(get_json), this);
            this.MouseDoubleClick += Board_MouseDoubleClick;
            this.KeyDown += Board_KeyDown;
            Timer t = new Timer();
            t.Tick += t_Tick;
        }
Example #2
0
 public infobar(Style style)
 {
     stylesheet = style;
     this.InfoBlock = (Block)style.Blocks["infobar::info"].Clone();
     this.Height = this.InfoBlock.Height;
     blinkTimer.Tick += blinkTimer_Tick;
     blinkTimer.Interval = 50;
 }
Example #3
0
        public SPListView(Spider.Skinning.Style stylesheet, SpiderHost host)
        {
            this.Host = host;
            InitializeComponent();
            this.Items = new List<SPListItem>();

            this.stylesheet = stylesheet;
            this.SelectedBlock = (Block)stylesheet.Blocks["::selection"].Clone();
            this.Block = (Block)stylesheet.Blocks["ListView"].Clone();
            this.AllowDrop = true;
            this.DragEnter += SPListView_DragEnter;
            this.DragOver += SPListView_DragOver;
            this.DragDrop += SPListView_DragDrop;
            this.MouseMove +=SPListView_MouseMove;
        }
Example #4
0
        public AppHeader(Style stylesheet)
        {
            InitializeComponent();
            this.Stylesheet =stylesheet;
            this.Paint += AppHead_Paint;
            this.Background = Stylesheet.Blocks["header"];
            this.MouseDown += AppHead_MouseDown;
            this.MouseClick += AppHead_MouseClick;

            Control backButton = new Control(this, "backbtn", new Rectangle(7, 28, 27, 21));
            backButton.MouseClick += backButton_MouseClick;
            Control foreButton = new Control(this, "forebtn", new Rectangle(35, 28, 27, 21));
            foreButton.MouseClick += foreButton_MouseClick;
            this.SubControls.Add(backButton);
            this.SubControls.Add(foreButton);
        }
Example #5
0
        public Board()
        {
            InitializeComponent();

            this.Paint += Board_Paint;
            this.Stylesheet = SpiderView.Stylesheet;
            this.Block = (Spider.Skinning.Block)Stylesheet.Blocks["body"].Clone();
            this.ForeColor = Block.ForeColor;
            this.ForeColor = Block.BackColor;
            tmrDraw = new Timer();
            tmrDraw.Tick += tmrDraw_Tick;
            tmrDraw.Interval = 100;
            tmrDraw.Start();
            this.MouseMove += Board_MouseMove;
            this.MouseDoubleClick += Board_MouseDoubleClick;
            SetStyle(ControlStyles.AllPaintingInWmPaint |
               ControlStyles.UserPaint |
               ControlStyles.DoubleBuffer,
               true);
        }
Example #6
0
        public Board()
        {
            InitializeComponent();

            this.Paint += Board_Paint;
            this.Stylesheet = SpiderView.Stylesheet;
            this.Block = (Spider.Skinning.Block)Stylesheet.Blocks["body"].Clone();
            this.ForeColor = Block.ForeColor;
            this.ForeColor = Block.BackColor;
            tmrDraw = new Timer();
            tmrDraw.Tick += tmrDraw_Tick;
            tmrDraw.Interval = 100;
            tmrDraw.Start();
            this.MouseMove += Board_MouseMove;
            this.MouseDoubleClick += Board_MouseDoubleClick;
        }
Example #7
0
        public virtual void Draw(Graphics g, ref int x, ref int y)
        {
            if (this.Stylesheet == null)
            {
                this.Stylesheet = (Parent.Stylesheet != null ? Parent.Stylesheet : Board.Stylesheet);
            }
            //g.FillRectangle(new SolidBrush(BackColor), this.X - this.Margin.Left - (this.Parent != null ? this.Parent.Padding.Left : 0), this.Y - Margin.Top - (this.Parent != null ? this.Parent.Padding.Top : 0), this.Width + Margin.Right, this.Height + Margin.Bottom);
               foreach(Element elm in this.Children)
               {
                x += elm.X;
               y +=elm.Y;
                if (elm.BackColor != null)
                {
                  //  g.FillRectangle(new SolidBrush(elm.BackColor), new Rectangle(x + elm.X , y +elm.Y + this.Padding.Top, elm.Width - this.Padding.Left * 2, elm.Height - this.Padding.Top * 2));
                }

                    elm.Draw(g, ref x, ref y);
                elm.AbsoluteLeft = x;
                elm.AbsoluteTop = y;
                if (elm.GetType() == typeof(columnheader))
                {
                    Board.overflows.Add(new Spider.Board.DrawBuffer() { x = x, y = y, elm = elm });
                }
               x -= elm.X;
               y -=elm.Y;
               }
              // g.DrawRectangle(new Pen(Color.Red), new Rectangle(X, Y, Width, Height));
            #if(DEBUG)
            if(mouseOver) {
            //        g.DrawRectangle(new Pen(Color.Red), new Rectangle(X, Y, Width, Height));
            }
            #endif
        }