FontDialog.cs :  » GUI » wx-NET » wx » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » GUI » wx NET 
wx NET » wx » FontDialog.cs
//-----------------------------------------------------------------------------
// wx.NET - Fontdlg.cs
// 
// The wxFontDialog wrapper class.
//
// Written by Bryan Bulten (bryan@bulten.ca)
// (C) 2003 Bryan Bulten
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: FontDialog.cs,v 1.4 2004/11/26 21:39:51 olkalex Exp $
//-----------------------------------------------------------------------------

using System;
using System.Runtime.InteropServices;

namespace wx{
    public class FontData : Object
    {
        [DllImport("wx-c")] static extern IntPtr wxFontData_ctor();
    [DllImport("wx-c")] static extern void   wxFontData_dtor(IntPtr self);

    [DllImport("wx-c")] static extern void   wxFontData_SetAllowSymbols(IntPtr self, bool flag);
    [DllImport("wx-c")] static extern bool   wxFontData_GetAllowSymbols(IntPtr self);

    [DllImport("wx-c")] static extern void   wxFontData_SetColour(IntPtr self, IntPtr colour);
    [DllImport("wx-c")] static extern IntPtr wxFontData_GetColour(IntPtr self);

    [DllImport("wx-c")] static extern void   wxFontData_SetShowHelp(IntPtr self, bool flag);
    [DllImport("wx-c")] static extern bool   wxFontData_GetShowHelp(IntPtr self);

    [DllImport("wx-c")] static extern void   wxFontData_EnableEffects(IntPtr self, bool flag);
    [DllImport("wx-c")] static extern bool   wxFontData_GetEnableEffects(IntPtr self);

    [DllImport("wx-c")] static extern void   wxFontData_SetInitialFont(IntPtr self, IntPtr font);
    [DllImport("wx-c")] static extern IntPtr wxFontData_GetInitialFont(IntPtr self);

    [DllImport("wx-c")] static extern void   wxFontData_SetChosenFont(IntPtr self, IntPtr font);
    [DllImport("wx-c")] static extern IntPtr wxFontData_GetChosenFont(IntPtr self);

    [DllImport("wx-c")] static extern void   wxFontData_SetRange(IntPtr self, int minRange, int maxRange);

        //---------------------------------------------------------------------

        public FontData(IntPtr wxObject) 
            : base(wxObject) { }

        public FontData()
            : base(wxFontData_ctor()) { }

        //---------------------------------------------------------------------

        public bool AllowSymbols
        {
            get { return wxFontData_GetAllowSymbols(wxObject); }
            set { wxFontData_SetAllowSymbols(wxObject, value); }
        }

        //---------------------------------------------------------------------

        public bool EffectsEnabled
        {
            get { return wxFontData_GetEnableEffects(wxObject); }
            set { wxFontData_EnableEffects(wxObject, value); }
        }

        //---------------------------------------------------------------------

        public bool ShowHelp
        {
            get { return wxFontData_GetShowHelp(wxObject); }
            set { wxFontData_SetShowHelp(wxObject, value); }
        }

        //---------------------------------------------------------------------

        public Colour Colour
        {
            get 
            {
                return new Colour(wxFontData_GetColour(wxObject), true);
            }
            set 
            {
                wxFontData_SetColour(wxObject, Object.SafePtr(value)); 
            }
        }

        //---------------------------------------------------------------------
        
        public Font InitialFont
        {
            get
            {
                return new Font(wxFontData_GetInitialFont(wxObject));
            }
            set
            {
                wxFontData_SetInitialFont(wxObject, Object.SafePtr(value));
            }
        }

        //---------------------------------------------------------------------

        public Font ChosenFont
        {
            get
            {
                return new Font(wxFontData_GetChosenFont(wxObject));
            }
            set
            {
                wxFontData_SetChosenFont(wxObject, Object.SafePtr(value));
            }
        }

        //---------------------------------------------------------------------

        public void SetRange(int min, int max)
        {
            wxFontData_SetRange(wxObject, min, max);
        }

        //---------------------------------------------------------------------
    }

  public class FontDialog : Dialog
  {
    [DllImport("wx-c")] static extern IntPtr wxFontDialog_ctor();
    [DllImport("wx-c")] static extern bool   wxFontDialog_Create(IntPtr self, IntPtr parent, IntPtr data);
    [DllImport("wx-c")] static extern void   wxFontDialog_dtor(IntPtr self);

    [DllImport("wx-c")] static extern int    wxFontDialog_ShowModal(IntPtr self);
    [DllImport("wx-c")] static extern IntPtr wxFontDialog_GetFontData(IntPtr self);

        //---------------------------------------------------------------------

        public FontDialog(IntPtr wxObject)
            : base(wxObject) { }

        public FontDialog()
            : base(wxFontDialog_ctor()) { }

        public FontDialog(Window parent)
            : this(parent, null) { }

        public FontDialog(Window parent, FontData data)
            : this()
        {
            if (!Create(parent, data)) 
            {
                throw new InvalidOperationException("Failed to create FontDialog");
            }
        }

        public bool Create(Window parent, FontData data)
        {
            return wxFontDialog_Create(wxObject, Object.SafePtr(parent), Object.SafePtr(data));
        }

        //---------------------------------------------------------------------

        public FontData FontData
        {
            get
            {
                IntPtr ptr = wxFontDialog_GetFontData(wxObject);
                return (FontData)FindObject(ptr, typeof(FontData));
            }
        }

        //---------------------------------------------------------------------

        public override int ShowModal()
        {
            return wxFontDialog_ShowModal(wxObject);
        }

        //---------------------------------------------------------------------
  }

}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.