HtmlHelpController.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 » HtmlHelpController.cs
//-----------------------------------------------------------------------------
// wx.NET - HtmlHelpController.cs
//
// The wxHtmlHelpController wrapper class
//
// Written by Alexander Olk (xenomorph2@onlinehome.de)
// (C) 2004 by Alexander Olk
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: HtmlHelpController.cs,v 1.5 2007/07/02 20:53:00 harald_meyer Exp $
//-----------------------------------------------------------------------------

using System;
using System.Runtime.InteropServices;

namespace wx{
  public class HtmlHelpController : Object
  {
        #region Enumerations
        public enum Style
        {
            TOOLBAR = 0x0001,
            CONTENTS = 0x0002,
            INDEX = 0x0004,
            SEARCH = 0x0008,
            BOOKMARKS = 0x0010,
            OPEN_FILES = 0x0020,
            PRINT = 0x0040,
            FLAT_TOOLBAR = 0x0080,
            MERGE_BOOKS = 0x0100,
            ICONS_BOOK = 0x0200,
            ICONS_BOOK_CHAPTER = 0x0400,
            ICONS_FOLDER = 0x0000, //!< this is 0 since it is default
            DEFAULT_STYLE = (int) (TOOLBAR | CONTENTS | INDEX | SEARCH | BOOKMARKS |PRINT)
        }
        #endregion

        //-----------------------------------------------------------------------------
  
    [DllImport("wx-c")] static extern IntPtr wxHtmlHelpController_ctor(uint style);
        [DllImport("wx-c")] static extern void wxHtmlHelpController_SetTitleFormat(IntPtr self, IntPtr format);
        [DllImport("wx-c")] static extern void wxHtmlHelpController_SetTempDir(IntPtr self, IntPtr path);
        [DllImport("wx-c")] static extern bool wxHtmlHelpController_AddBook(IntPtr self, IntPtr book_url);
        [DllImport("wx-c")] static extern bool wxHtmlHelpController_Display(IntPtr self, IntPtr x);
    [DllImport("wx-c")] static extern bool   wxHtmlHelpController_DisplayInt(IntPtr self, int id);
    [DllImport("wx-c")] static extern bool   wxHtmlHelpController_DisplayContents(IntPtr self);
    [DllImport("wx-c")] static extern bool   wxHtmlHelpController_DisplayIndex(IntPtr self);
        [DllImport("wx-c")] static extern bool wxHtmlHelpController_KeywordSearch(IntPtr self, IntPtr keyword, int mode);
        [DllImport("wx-c")] static extern void wxHtmlHelpController_UseConfig(IntPtr self, IntPtr config, IntPtr rootpath);
        [DllImport("wx-c")] static extern void wxHtmlHelpController_ReadCustomization(IntPtr self, IntPtr cfg, IntPtr path);
        [DllImport("wx-c")] static extern void wxHtmlHelpController_WriteCustomization(IntPtr self, IntPtr cfg, IntPtr path);
    [DllImport("wx-c")] static extern IntPtr wxHtmlHelpController_GetFrame(IntPtr self);
        [DllImport("wx-c")] static extern void wxHtmlHelpController_OnCloseFrame(IntPtr self, IntPtr closeEvent);
    //-----------------------------------------------------------------------------
    
    public HtmlHelpController(IntPtr wxObject)
      : base(wxObject) {}
      
    public HtmlHelpController()
      : this(Style.DEFAULT_STYLE) {}
      
    public HtmlHelpController(Style style)
      : base(wxHtmlHelpController_ctor((uint)style)) {}
      
    //-----------------------------------------------------------------------------
    
        /** This property is for writing only and set the title format.
         */
    public string TitleFormat
    {
      set
            {
                wxString wxValue = new wxString(value);
                wxHtmlHelpController_SetTitleFormat(this.wxObject, wxValue.wxObject);
            }
    }
    
    //-----------------------------------------------------------------------------
    
        /** Write-only property to set the directory for temporary files (option for better performance).
         */
    public string TempDir 
    {
      set
            {
                wxString wxValue = new wxString(value);
                wxHtmlHelpController_SetTempDir(this.wxObject, wxValue.wxObject);
            }
    }
    
    //-----------------------------------------------------------------------------
    
    /** Adds the book at the provided file name.
      * In contrast to the \e wxWidgets version, this method
      * silently installs the \e wx file handler for zip file
      * entries. The file system is currently not wrapped since
      * the .NET framework implements most of the provided functions.
      * However, handling of zip-archives is required to deal with
      * hyper text books (HTB), so this ability will be installed on
      * using it.
    */
    public bool AddBook(string book_url)
    {
      return AddBook(new wxString(book_url));
    }
        public bool AddBook(wxString book_url)
        {
            return wxHtmlHelpController_AddBook(wxObject, book_url.wxObject);
        }
    
    //-----------------------------------------------------------------------------
    
    public bool Display(string x)
    {
      return this.Display(new wxString(x));
    }
        public bool Display(wxString x)
        {
            return wxHtmlHelpController_Display(this.wxObject, x.wxObject);
        }
    
    //-----------------------------------------------------------------------------
    
    public bool Display(int id)
    {
      return wxHtmlHelpController_DisplayInt(wxObject, id); 
    }
    
    //-----------------------------------------------------------------------------
    
    public bool DisplayContents()
    {
      return wxHtmlHelpController_DisplayContents(wxObject);
    }
    
    //-----------------------------------------------------------------------------
    
    public bool DisplayIndex()
    {
      return wxHtmlHelpController_DisplayIndex(wxObject);
    }
    
    //-----------------------------------------------------------------------------
    
    public bool KeywordSearch(string keyword)
    {
      return KeywordSearch(keyword, HelpSearchMode.wxHELP_SEARCH_ALL);
    }
    
    public bool KeywordSearch(string keyword, HelpSearchMode mode)
    {
      return this.KeywordSearch(new wxString(keyword), mode);
    }
        public bool KeywordSearch(wxString keyword, HelpSearchMode mode)
        {
            return wxHtmlHelpController_KeywordSearch(wxObject, keyword.wxObject, (int)mode);
        }
    
    //-----------------------------------------------------------------------------
    
    public void UseConfig(Config config)
    {
      UseConfig(config, "");
    }
    
    public void UseConfig(Config config, string rootpath)
    {
      this.UseConfig(config, new wxString(rootpath));
    }
        public void UseConfig(Config config, wxString rootpath)
        {
            wxHtmlHelpController_UseConfig(wxObject, Object.SafePtr(config), rootpath.wxObject);
        }
    
    //-----------------------------------------------------------------------------
    
    public void ReadCustomization(Config cfg)
    {
      ReadCustomization(cfg, "");
    }
    
    public void ReadCustomization(Config cfg, string path)
    {
      this.ReadCustomization(cfg, new wxString(path));
    }
        public void ReadCustomization(Config cfg, wxString path)
        {
            wxHtmlHelpController_ReadCustomization(wxObject, Object.SafePtr(cfg), path.wxObject);
        }
    
    //-----------------------------------------------------------------------------
    
    public void WriteCustomization(Config cfg)
    {
      WriteCustomization(cfg, "");
    }
    
    public void WriteCustomization(Config cfg, string path)
    {
      this.WriteCustomization(cfg, new wxString(path));
    }
        public void WriteCustomization(Config cfg, wxString path)
        {
            wxHtmlHelpController_WriteCustomization(wxObject, Object.SafePtr(cfg), path.wxObject);
        }

        public void OnCloseFrame(CloseEvent evt)
        {
            wxHtmlHelpController_OnCloseFrame(this.wxObject, evt.wxObject);
        }

    //-----------------------------------------------------------------------------
    
    public Frame Frame
    {
      get { 
        IntPtr tmp = wxHtmlHelpController_GetFrame(wxObject); 
        if ( tmp != IntPtr.Zero )
          return (Frame)FindObject(tmp, typeof(Frame)); // this instance might have been selected before
        else
          return null;
      }
    }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.