Ejemplo n.º 1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || context.Instance == null || provider == null)
                return value;

            wxFont wfnt = (wxFont)value;
            wx.FontData fntdata = new wx.FontData();
            fntdata.InitialFont = wfnt;
            wx.FontDialog fntdialog = new wx.FontDialog(null, fntdata);
            fntdialog.Font = wfnt;
            if (fntdialog.ShowModal() != wx.Dialog.wxCANCEL)
            {
                wx.FontData rfd = fntdialog.FontData;
                wxFont retfont = new wxFont();
                retfont.Family = rfd.ChosenFont.Family;
                retfont.FaceName = rfd.ChosenFont.FaceName;
                retfont.Encoding = rfd.ChosenFont.Encoding;
                retfont.PointSize = rfd.ChosenFont.PointSize;
                retfont.Style = rfd.ChosenFont.Style;
                return retfont;
            }
            return value;
        }
Ejemplo n.º 2
0
 public wxWindowProps()
 {
     _fc = new wxColor(0, 0, 0);
     _bc = new wxColor(100, 100, 100);
     _font = new wxFont("Arial", 8);
     _wstyle = new wxFlags();
     _wstyle.AddItem("wxCLIP_CHILDREN", wx.Window.wxCLIP_CHILDREN, false);
     _wstyle.AddItem("wxNO_BORDER", wx.Window.wxNO_BORDER, false);
     _wstyle.AddItem("wxRAISED_BORDER", wx.Window.wxRAISED_BORDER, false);
     _wstyle.AddItem("wxSIMPLE_BORDER", wx.Window.wxSIMPLE_BORDER, false);
     _wstyle.AddItem("wxSTATIC_BORDER", wx.Window.wxSTATIC_BORDER, false);
     _wstyle.AddItem("wxSUNKEN_BORDER", wx.Window.wxSUNKEN_BORDER, false);
     _wstyle.AddItem("wxDOUBLE_BORDER", wx.Window.wxDOUBLE_BORDER, false);
     _wstyle.AddItem("wxHSCROLL", wx.Window.wxHSCROLL, false);
     _wstyle.AddItem("wxVSCROLL", wx.Window.wxVSCROLL, false);
     _wstyle.AddItem("wxTAB_TRAVERSAL", wx.Window.wxTAB_TRAVERSAL, true);
     _wstyle.AddItem("wxWANTS_CHARS", wx.Window.wxWANTS_CHARS, false);
 }