Example #1
0
        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            #if DESIGN_MODE
            gr.Save ();
            gr.Color = new Cairo.Color (1, 0, 0);
            gr.Rectangle (0, 0, Width, Height);
            gr.Stroke ();
            gr.Restore ();
            #endif

            if (hoover == true)
              			{
                double lw = gr.LineWidth;
                double [] dashes = {0.01,  /* ink */
                           0.01,  /* skip */ };

                gr.Save ();

                gr.Color = new Cairo.Color (0.5, 0.5, 0.5, 1);
                gr.SetDash (dashes, 0);

                if (SelectedArea.Width == 0 && SelectedArea.Height == 0)
                    gr.Rectangle (-lw, -lw, Width + lw * 2, Height + lw * 2);
                else
                    gr.Rectangle (SelectedArea.X -lw, SelectedArea.Y -lw, SelectedArea.Width + lw * 2, SelectedArea.Height + lw * 2);

                gr.Stroke ();
                gr.Restore ();
            }

            if (DrawEventHandler == null)
                return;

            DrawEventHandler (this, new DrawEventArgs (gr, Width, Height, rtl, Data));
        }