FindReplaceDialog.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 » FindReplaceDialog.cs
//-----------------------------------------------------------------------------
// wx.NET - FindReplaceDialog.cs
//
// The wxFindReplaceDialog wrapper class.
//
// Written by Bryan Bulten (bryan@bulten.ca)
// (C) 2003 Bryan Bulten
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: FindReplaceDialog.cs,v 1.10 2007/11/11 14:14:46 harald_meyer Exp $
//-----------------------------------------------------------------------------

using System;
using System.Drawing;
using System.Runtime.InteropServices;

namespace wx{
    public class FindReplaceDialog : Dialog
    {
        public const int wxFR_DOWN       = 1;
        public const int wxFR_WHOLEWORD  = 2;
        public const int wxFR_MATCHCASE  = 4;

        public const int wxFR_REPLACEDIALOG = 1;
        public const int wxFR_NOUPDOWN      = 2;
        public const int wxFR_NOMATCHCASE   = 4;
        public const int wxFR_NOWHOLEWORD   = 8;

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

        [DllImport("wx-c")] static extern IntPtr wxFindReplaceDialog_ctor();
        [DllImport("wx-c")] static extern bool   wxFindReplaceDialog_Create(IntPtr self, IntPtr parent, IntPtr data, IntPtr title, uint style);

        [DllImport("wx-c")] static extern IntPtr wxFindReplaceDialog_GetData(IntPtr self);
        [DllImport("wx-c")] static extern void   wxFindReplaceDialog_SetData(IntPtr self, IntPtr data);

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

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

        public FindReplaceDialog()
            : base(wxFindReplaceDialog_ctor()) { }

        public FindReplaceDialog(Window parent, FindReplaceData data, string title)
            : this(parent, data, title, 0) { }

        public FindReplaceDialog(Window parent, FindReplaceData data, string title, uint style)
            : base(wxFindReplaceDialog_ctor())
        {
            if (!Create(parent, data, title, style))
            {
                throw new InvalidOperationException("Could not create FindReplaceDialog");
            }
        }

        public bool Create(Window parent, FindReplaceData data, string title, uint style)
        {
            wxString wxTitle = wxString.SafeNew(title);
            return wxFindReplaceDialog_Create(wxObject, Object.SafePtr(parent), Object.SafePtr(data), Object.SafePtr(wxTitle), (uint)style);
        }

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

        public FindReplaceData Data
        {
            get { return (FindReplaceData)FindObject(wxFindReplaceDialog_GetData(wxObject), typeof(FindReplaceData)); }
            set { wxFindReplaceDialog_SetData(wxObject, Object.SafePtr(value)); } 
        }

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

    public event EventListener Find
    {
      add { AddCommandListener(Event.wxEVT_COMMAND_FIND, ID, value, this); }
      remove { RemoveHandler(value, this); }
    }

    public event EventListener FindNext
    {
      add { AddCommandListener(Event.wxEVT_COMMAND_FIND_NEXT, ID, value, this); }
      remove { RemoveHandler(value, this); }
    }

    public event EventListener FindReplace
    {
      add { AddCommandListener(Event.wxEVT_COMMAND_FIND_REPLACE, ID, value, this); }
      remove { RemoveHandler(value, this); }
    }

    public event EventListener FindReplaceAll
    {
      add { AddCommandListener(Event.wxEVT_COMMAND_FIND_REPLACE_ALL, ID, value, this); }
      remove { RemoveHandler(value, this); }
    }

    public event EventListener FindClose
    {
      add { AddCommandListener(Event.wxEVT_COMMAND_FIND_CLOSE, ID, value, this); }
      remove { RemoveHandler(value, this); }
    }
    }

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

    public class FindDialogEvent : CommandEvent
    {
        [DllImport("wx-c")] static extern IntPtr wxFindDialogEvent_ctor(int commandType, int id);

        [DllImport("wx-c")] static extern int    wxFindDialogEvent_GetFlags(IntPtr self);
        [DllImport("wx-c")] static extern void   wxFindDialogEvent_SetFlags(IntPtr self, int flags);

        [DllImport("wx-c")] static extern IntPtr wxFindDialogEvent_GetFindString(IntPtr self);
        [DllImport("wx-c")] static extern void   wxFindDialogEvent_SetFindString(IntPtr self, IntPtr str);

        [DllImport("wx-c")] static extern IntPtr wxFindDialogEvent_GetReplaceString(IntPtr self);
        [DllImport("wx-c")] static extern void   wxFindDialogEvent_SetReplaceString(IntPtr self, IntPtr str);

        [DllImport("wx-c")] static extern IntPtr wxFindDialogEvent_GetDialog(IntPtr self);

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

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

        public FindDialogEvent(int commandType, int id)
            : base(wxFindDialogEvent_ctor(commandType, id)) { }

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

        public int Flags
        {
            get { return wxFindDialogEvent_GetFlags(wxObject); }
            set { wxFindDialogEvent_SetFlags(wxObject, value); }
        }

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

        public string FindString
        {
            get { return new wxString(wxFindDialogEvent_GetFindString(wxObject), true); }
            set
            {
                wxString wxValue = wxString.SafeNew(value);
                wxFindDialogEvent_SetFindString(wxObject, Object.SafePtr(wxValue));
            }
        }

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

        public string ReplaceString
        {
            get { return new wxString(wxFindDialogEvent_GetReplaceString(wxObject), true); }
            set
            {
                wxString wxValue = wxString.SafeNew(value);
                wxFindDialogEvent_SetReplaceString(wxObject, Object.SafePtr(wxValue));
            }
        }

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

        public FindReplaceDialog Dialog
        {
            get { return (FindReplaceDialog)FindObject(wxFindDialogEvent_GetDialog(wxObject)); }
        }
    }

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

    public class FindReplaceData : Object
    {
        [DllImport("wx-c")] static extern IntPtr wxFindReplaceData_ctor(uint flags);

        [DllImport("wx-c")] static extern IntPtr wxFindReplaceData_GetFindString(IntPtr self);
        [DllImport("wx-c")] static extern void   wxFindReplaceData_SetFindString(IntPtr self, IntPtr str);

        [DllImport("wx-c")] static extern int    wxFindReplaceData_GetFlags(IntPtr self);
        [DllImport("wx-c")] static extern void   wxFindReplaceData_SetFlags(IntPtr self, int flags);

        [DllImport("wx-c")] static extern void   wxFindReplaceData_SetReplaceString(IntPtr self, IntPtr str);
        [DllImport("wx-c")] static extern IntPtr wxFindReplaceData_GetReplaceString(IntPtr self);

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

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

        public FindReplaceData()
            : this(0) { }

        public FindReplaceData(int flags)
            : base(wxFindReplaceData_ctor((uint)flags)) {}

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

        public string FindString
        {
            get { return new wxString(wxFindReplaceData_GetFindString(wxObject), true); }
            set
            {
                wxString wxValue = wxString.SafeNew(value);
                wxFindReplaceData_SetFindString(wxObject, Object.SafePtr(wxValue));
            }
        }

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

        public string ReplaceString
        {
            get { return new wxString(wxFindReplaceData_GetReplaceString(wxObject), true); }
            set
            {
                wxString wxValue = wxString.SafeNew(value);
                wxFindReplaceData_SetReplaceString(wxObject, Object.SafePtr(wxValue));
            }
        }

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

        public int Flags
        {
            get { return wxFindReplaceData_GetFlags(wxObject); }
            set { wxFindReplaceData_SetFlags(wxObject, value); }
        }
    }
}

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