2000-09-10 12:30:16 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/tipwin.h
|
|
|
|
// Purpose: wxTipWindow is a window like the one typically used for
|
|
|
|
// showing the tooltips
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 10.09.00
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
|
|
|
// Licence: wxWindows license
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_TIPWIN_H_
|
|
|
|
#define _WX_TIPWIN_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "tipwin.h"
|
|
|
|
#endif
|
|
|
|
|
2001-12-01 20:54:38 -05:00
|
|
|
#if wxUSE_TIPWINDOW
|
2000-09-10 12:30:16 -04:00
|
|
|
|
2001-11-30 18:02:27 -05:00
|
|
|
#if wxUSE_POPUPWIN
|
2001-12-01 20:54:38 -05:00
|
|
|
#include "wx/popupwin.h"
|
|
|
|
#else
|
|
|
|
#include "wx/frame.h"
|
|
|
|
#endif
|
2001-11-30 22:18:24 -05:00
|
|
|
|
2000-09-10 12:30:16 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxTipWindow
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2001-12-01 20:54:38 -05:00
|
|
|
#if wxUSE_POPUPWIN
|
2001-11-30 18:02:27 -05:00
|
|
|
class WXDLLEXPORT wxTipWindow : public wxPopupTransientWindow
|
2001-12-01 20:54:38 -05:00
|
|
|
#else
|
|
|
|
class WXDLLEXPORT wxTipWindow : public wxFrame
|
|
|
|
#endif
|
2000-09-10 12:30:16 -04:00
|
|
|
{
|
2001-12-01 20:54:38 -05:00
|
|
|
friend class wxTipWindowView;
|
2000-09-10 12:30:16 -04:00
|
|
|
public:
|
2001-02-22 12:29:51 -05:00
|
|
|
// Supply windowPtr for it to null the given address
|
|
|
|
// when the window has closed.
|
2000-09-10 12:30:16 -04:00
|
|
|
wxTipWindow(wxWindow *parent,
|
|
|
|
const wxString& text,
|
2001-02-22 12:29:51 -05:00
|
|
|
wxCoord maxLength = 100, wxTipWindow** windowPtr = NULL);
|
|
|
|
~wxTipWindow();
|
|
|
|
|
|
|
|
void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; }
|
2000-09-10 12:30:16 -04:00
|
|
|
|
2001-11-30 18:02:27 -05:00
|
|
|
void Close();
|
|
|
|
|
2000-09-10 12:30:16 -04:00
|
|
|
protected:
|
|
|
|
// event handlers
|
|
|
|
void OnMouseClick(wxMouseEvent& event);
|
2001-12-01 20:54:38 -05:00
|
|
|
#if !wxUSE_POPUPWIN
|
|
|
|
void OnActivate(wxActivateEvent& event);
|
|
|
|
void OnKillFocus(wxFocusEvent& event);
|
|
|
|
#endif
|
2000-09-10 12:30:16 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
wxArrayString m_textLines;
|
|
|
|
wxCoord m_heightLine;
|
2001-02-22 12:29:51 -05:00
|
|
|
wxTipWindow** m_windowPtr;
|
2000-09-10 12:30:16 -04:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2001-12-01 20:54:38 -05:00
|
|
|
#endif // wxUSE_TIPWINDOW
|
2000-09-10 12:30:16 -04:00
|
|
|
#endif // _WX_TIPWIN_H_
|