Added context help stuff to wxPython
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
166
wxPython/src/help.i
Normal file
166
wxPython/src/help.i
Normal file
@@ -0,0 +1,166 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: help.i
|
||||
// Purpose: Context sensitive help classes, and etc.
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 28-July-2001
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
%module help
|
||||
|
||||
%{
|
||||
#include "export.h"
|
||||
#include <wx/cshelp.h>
|
||||
%}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%include typemaps.i
|
||||
%include my_typemaps.i
|
||||
|
||||
// Import some definitions of other classes, etc.
|
||||
%import _defs.i
|
||||
%import windows.i
|
||||
%import misc.i
|
||||
%import controls.i
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
wxFRAME_EX_CONTEXTHELP,
|
||||
wxDIALOG_EX_CONTEXTHELP,
|
||||
wxID_CONTEXT_HELP,
|
||||
wxEVT_HELP,
|
||||
wxEVT_DETAILED_HELP,
|
||||
wxEVT_CONTEXT_MENU,
|
||||
};
|
||||
|
||||
|
||||
%pragma(python) code = "
|
||||
# Help events
|
||||
def EVT_HELP(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_HELP, func)
|
||||
|
||||
def EVT_HELP_RANGE(win, id, id2, func):
|
||||
win.Connect(id, id2, wxEVT_HELP, func)
|
||||
|
||||
def EVT_DETAILED_HELP(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_DETAILED_HELP, func)
|
||||
|
||||
def EVT_DETAILED_HELP_RANGE(win, id, id2, func):
|
||||
win.Connect(id, id2, wxEVT_DETAILED_HELP, func)
|
||||
|
||||
def EVT_CONTEXT_MENU(win, func):
|
||||
win.Connect(-1, -1, wxEVT_CONTEXT_MENU, func)
|
||||
"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class wxHelpEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxHelpEvent(wxEventType type = wxEVT_NULL,
|
||||
wxWindowID id = 0,
|
||||
const wxPoint& pt = wxDefaultPosition);
|
||||
const wxPoint& GetPosition();
|
||||
void SetPosition(const wxPoint& pos);
|
||||
const wxString& GetLink();
|
||||
void SetLink(const wxString& link);
|
||||
const wxString& GetTarget();
|
||||
void SetTarget(const wxString& target);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class wxContextMenuEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxContextMenuEvent(wxEventType type = wxEVT_NULL,
|
||||
wxWindowID id = 0,
|
||||
const wxPoint& pt = wxDefaultPosition);
|
||||
const wxPoint& GetPosition();
|
||||
void SetPosition(const wxPoint& pos);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class wxContextHelp : public wxObject {
|
||||
public:
|
||||
wxContextHelp(wxWindow* window = NULL, bool doNow = TRUE);
|
||||
~wxContextHelp();
|
||||
|
||||
bool BeginContextHelp(wxWindow* window = NULL);
|
||||
bool EndContextHelp();
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class wxContextHelpButton : public wxBitmapButton {
|
||||
public:
|
||||
wxContextHelpButton(wxWindow* parent, wxWindowID id = wxID_CONTEXT_HELP,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxBU_AUTODRAW);
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class wxHelpProvider
|
||||
{
|
||||
public:
|
||||
static wxHelpProvider *Set(wxHelpProvider *helpProvider);
|
||||
static wxHelpProvider *Get();
|
||||
|
||||
// Virtuals...
|
||||
wxString GetHelp(const wxWindow *window);
|
||||
bool ShowHelp(wxWindowBase *window);
|
||||
void AddHelp(wxWindowBase *window, const wxString& text);
|
||||
%name(AddHelpById)void AddHelp(wxWindowID id, const wxString& text);
|
||||
|
||||
%addmethods { void Destroy() { delete self; } }
|
||||
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class wxSimpleHelpProvider : public wxHelpProvider
|
||||
{
|
||||
public:
|
||||
wxSimpleHelpProvider();
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// TODO: Add this once the wxHelpController is in wxPython...
|
||||
|
||||
// class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider
|
||||
// {
|
||||
// public:
|
||||
// wxHelpControllerHelpProvider(wxHelpController* hc = NULL);
|
||||
// void SetHelpController(wxHelpController* hc);
|
||||
// wxHelpController* GetHelpController();
|
||||
// };
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
// This file gets appended to the shadow class file.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%pragma(python) include="_helpextras.py";
|
||||
|
||||
//---------------------------------------------------------------------------
|
Reference in New Issue
Block a user