Example #1
0
 public TextAttr(Colour colText, Colour colBack)
     : this(colText, colBack, null, TextAttrAlignment.wxTEXT_ALIGNMENT_DEFAULT)
 {
 }
Example #2
0
File: Pen.cs Project: wshcdr/wxnet
 public Pen(Colour colour, int width)
     : this(colour, width, FillStyle.wxSOLID)
 {
 }
Example #3
0
File: Pen.cs Project: wshcdr/wxnet
 public Pen(Colour col, int width, FillStyle style)
     : base(wxPen_ctor(Object.SafePtr(col), width, style))
 {
 }
Example #4
0
        public void OnColorChoice(object sender, Event evt)
        {
            wx.Object        obj = evt.EventObject;
            SkinElementColor el  = null;

            if (obj == m_background.m_rgbSelector)
            {
                el = m_background;
            }
            else if (obj == m_freeTrack.m_rgbSelector)
            {
                el = m_freeTrack;
            }
            else if (obj == m_reservedTrack.m_rgbSelector)
            {
                el = m_reservedTrack;
            }
            else if (obj == m_reservedShunting.m_rgbSelector)
            {
                el = m_reservedShunting;
            }
            else if (obj == m_occupiedTrack.m_rgbSelector)
            {
                el = m_occupiedTrack;
            }
            else if (obj == m_workingTrack.m_rgbSelector)
            {
                el = m_workingTrack;
            }
            else if (obj == m_outline.m_rgbSelector)
            {
                el = m_outline;
            }
            else if (obj == m_text.m_rgbSelector)
            {
                el = m_text;
            }
            else
            {
                return;
            }

            byte   rv, gv, bv;
            String str;

            str = el.m_r.Value;
            rv  = Globals.wxStrtoul(str, 0, 0);
            str = el.m_g.Value;
            gv  = Globals.wxStrtoul(str, 0, 0);
            str = el.m_b.Value;
            bv  = Globals.wxStrtoul(str, 0, 0);
            Colour     elCol = new wx.Colour(rv, gv, bv);
            ColourData data  = new ColourData();

            data.ChooseFull = (true);
            data.Colour     = (elCol);

            ColourDialog dialog = new ColourDialog(this, data);

            if (dialog.ShowModal() == ShowModalResult.OK)
            {
                ColourData retData = dialog.ColourData;
                wx.Colour  col     = retData.Colour;
                byte       v       = col.Red;
                str          = String.Format(wxPorting.T("%d"), v);
                el.m_r.Value = (str);

                v            = col.Green;
                str          = String.Format(wxPorting.T("%d"), v);
                el.m_g.Value = (str);

                v            = col.Blue;
                str          = String.Format(wxPorting.T("%d"), v);
                el.m_b.Value = (str);
            }
        }
Example #5
0
File: Pen.cs Project: wshcdr/wxnet
 public Pen(Colour colour)
     : this(colour, 1, FillStyle.wxSOLID)
 {
 }
Example #6
0
        //-----------------------------------------------------------------------------

        public string FindName(Colour colour)
        {
            return(new wxString(wxColourDatabase_FindName(wxObject, Object.SafePtr(colour)), true));
        }
Example #7
0
        //-----------------------------------------------------------------------------

        public Pen FindOrCreatePen(Colour colour, int width, int style)
        {
            return(new Pen(wxPenList_FindOrCreatePen(wxObject, Object.SafePtr(colour), width, style)));
        }
Example #8
0
        //---------------------------------------------------------------------

        public bool GetPixel(int x, int y, Colour col)
        {
            return(wxDC_GetPixel(wxObject, x, y, Object.SafePtr(col)));
        }
Example #9
0
 public bool GetPixel(Point pt, Colour col)
 {
     return(GetPixel(pt.X, pt.Y, col));
 }
Example #10
0
 public bool FloodFill(Point pt, Colour col)
 {
     return(FloodFill(pt, col, FloodStyle.wxFLOOD_SURFACE));
 }
Example #11
0
 public bool FloodFill(Point pt, Colour col, int style)
 {
     return(FloodFill(pt.X, pt.Y, col, style));
 }
Example #12
0
 public bool FloodFill(int x, int y, Colour col, int style)
 {
     return(wxDC_FloodFill(wxObject, x, y, Object.SafePtr(col), style));
 }
Example #13
0
        //---------------------------------------------------------------------

        public bool FloodFill(int x, int y, Colour col)
        {
            return(FloodFill(x, y, col, FloodStyle.wxFLOOD_SURFACE));
        }
Example #14
0
        //---------------------------------------------------------------------

        public void SetTextBackground(Colour colour)
        {
            wxWindowDC_SetTextBackground(wxObject, Object.SafePtr(colour));
        }
Example #15
0
 public TextAttr(Colour colText, Colour colBack, Font font)
     : this(colText, colBack, font, TextAttrAlignment.wxTEXT_ALIGNMENT_DEFAULT)
 {
 }
Example #16
0
        public static void setBackgroundColor(wx.Colour col)
        {
            int rgb = curSkin.background;

            col.Set((byte)(rgb >> 16), (byte)((rgb >> 8) & 0xFF), (byte)(rgb & 0xFF));
        }
Example #17
0
 public TextAttr(Colour colText, Colour colBack, Font font, TextAttrAlignment alignment)
     : this(wxTextAttr_ctor(Object.SafePtr(colText), Object.SafePtr(colBack), Object.SafePtr(font), (int)alignment), true)
 {
 }
Example #18
0
 public Mask(Bitmap bitmap, Colour colour)
     : this(wxMask_ctorByBitmpaColour(Object.SafePtr(bitmap), Object.SafePtr(colour)))
 {
 }
Example #19
0
        //-----------------------------------------------------------------------------

        public void AddColour(string name, Colour colour)
        {
            wxColourDatabase_AddColour(wxObject, name, Object.SafePtr(colour));
        }
Example #20
0
        //---------------------------------------------------------------------

        public bool Create(Bitmap bitmap, Colour colour)
        {
            return(wxMask_CreateByBitmapColour(wxObject, Object.SafePtr(bitmap), Object.SafePtr(colour)));
        }
Example #21
0
        //-----------------------------------------------------------------------------

        public Brush FindOrCreateBrush(Colour colour, int style)
        {
            return(new Brush(wxBrushList_FindOrCreateBrush(wxObject, Object.SafePtr(colour), style)));
        }
Example #22
0
        //---------------------------------------------------------------------

        public bool Read(string key, ref Colour val)
        {
            Colour def = new Colour(0, 0, 0);

            return(Read(key, ref val, def));
        }