Exemplo n.º 1
0
        public SliderWidget(double x1, double y1, double x2, double y2)
            : base(x1, y1, x2, y2)
        {
            m_border_width   = 1.0;
            m_border_extra   = ((y2 - y1) / 2);
            m_text_thickness = (1.0);
            m_pdx            = (0.0);
            m_mouse_move     = false;
            m_value          = (0.5);
            m_preview_value  = (0.5);
            m_min            = (0.0);
            m_max            = (1.0);
            m_num_steps      = (0);
            m_descending     = (false);
            m_ellipse        = new VertexSource.Ellipse();
            m_storage        = new PathStorage();
            m_text           = new GsvText();
            m_text_poly      = new StrokeConverter(m_text);

            CalculateBox();

            m_background_color      = (new RGBA_Doubles(1.0, 0.9, 0.8));
            m_triangle_color        = (new RGBA_Doubles(0.7, 0.6, 0.6));
            m_text_color            = (new RGBA_Doubles(0.0, 0.0, 0.0));
            m_pointer_preview_color = (new RGBA_Doubles(0.6, 0.4, 0.4, 0.4));
            m_pointer_color         = (new RGBA_Doubles(0.8, 0.0, 0.0, 0.6));
        }
Exemplo n.º 2
0
 public void Line(double x1, double y1, double x2, double y2, RGBA_Bytes color)
 {
     PathStorage m_LinesToDraw = new PathStorage(); 
     m_LinesToDraw.RemoveAll();
     m_LinesToDraw.move_to(x1, y1);
     m_LinesToDraw.line_to(x2, y2);
     StrokeConverter StrockedLineToDraw = new StrokeConverter(m_LinesToDraw);
     Render(StrockedLineToDraw, color);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="PixelFormat"></param>
        /// <param name="Rasterizer"></param>
        /// <param name="Scanline"></param>
        public Renderer(IPixelFormat PixelFormat, AntiAliasedScanlineRasterizer Rasterizer, IScanline Scanline)
        {
        	m_PixelFormat = PixelFormat;
        	m_Rasterizer = Rasterizer;
        	m_Scanline = Scanline;

            TextPath = new GsvText();
            StrockedText = new StrokeConverter(TextPath);
            m_AffineTransformStack.Push(Affine.NewIdentity());
        }
Exemplo n.º 4
0
        public CheckBoxWidget(double x, double y, string label)
            : base(x, y, x + 9.0 * 1.5, y + 9.0 * 1.5)
        {
            m_text_thickness = (1.5);
            m_FontSize       = (9.0);
            m_status         = (false);
            m_text           = new GsvText();
            m_text_poly      = new StrokeConverter(m_text);
            m_label          = label;

            m_text_color     = new RGBA_Doubles(0.0, 0.0, 0.0);
            m_inactive_color = new RGBA_Doubles(0.0, 0.0, 0.0);
            m_active_color   = new RGBA_Doubles(0.4, 0.0, 0.0);
        }
Exemplo n.º 5
0
        public Layer(LayerStack layerStack, Lessons.Lesson lessonModel, AbstractLayer layerModel)
        {
            this.layerStack  = layerStack;
            this.lessonModel = lessonModel;
            this.layerModel  = layerModel;
            Strokes          = StrokeConverter.ToWindowsStrokes(layerModel.Strokes);

            if (layerModel.GetType() == typeof(QuizAnswerLayer))
            {
                DisplayChart();
            }
            else if (layerModel.GetType() == typeof(GraphicalAnswerLayer))
            {
                DisplaySaliencyMap();
            }
        }
Exemplo n.º 6
0
        public TextWidget(string Text, double left, double bottom, double CapitalHeight)
            : base(0, 0, 0, 0)
        {
            m_text_color = (new RGBA_Doubles(0.0, 0.0, 0.0));
            m_BorderSize = CapitalHeight * .2;
            m_Thickness  = CapitalHeight / 8;
            m_CapsHeight = CapitalHeight;
            m_text       = new GsvText();
            m_text.Text  = Text;
            m_text_poly  = new StrokeConverter(m_text);
            m_idx        = (0);
            double MinX, MinY, MaxX, MaxY;

            GetTextBounds(out MinX, out MinY, out MaxX, out MaxY);
            double FullWidth  = MaxX - MinX + m_BorderSize * 2;
            double FullHeight = m_CapsHeight + m_text.AscenderHeight + m_text.DescenderHeight + m_BorderSize * 2;

            Bounds = new RectD(left, bottom, left + FullWidth, bottom + FullHeight);
        }
Exemplo n.º 7
0
 public void Save()
 {
     layerModel.Strokes = StrokeConverter.ToNineStrokes(Strokes);
 }
Exemplo n.º 8
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     // From Windows Strokes to Nine Strokes (from View to Model)
     return(StrokeConverter.ToNineStrokes(value as WindowsInk.StrokeCollection));
 }
Exemplo n.º 9
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     // From Nine Strokes to Windows Strokes (from Model to View)
     return(StrokeConverter.ToWindowsStrokes(value as Collection <NineInk.Stroke>));
 }