Logo Search packages:      
Sourcecode: wxwindows2.4 version File versions


// 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: tipwin.h,v 2005/06/20 17:36:33 MR Exp $
// Copyright:   (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence:     wxWindows license

#ifndef _WX_TIPWIN_H_
#define _WX_TIPWIN_H_


    #include "wx/popupwin.h"

    #define wxTipWindowBase wxPopupTransientWindow
    #include "wx/frame.h"

    #define wxTipWindowBase wxFrame

class WXDLLEXPORT wxTipWindowView;

// ----------------------------------------------------------------------------
// wxTipWindow
// ----------------------------------------------------------------------------

class WXDLLEXPORT wxTipWindow : public wxTipWindowBase
    // the mandatory ctor parameters are: the parent window and the text to
    // show
    // optionally you may also specify the length at which the lines are going
    // to be broken in rows (100 pixels by default)
    // windowPtr and rectBound are just passed to SetTipWindowPtr() and
    // SetBoundingRect() - see below
    wxTipWindow(wxWindow *parent,
                const wxString& text,
                wxCoord maxLength = 100,
                wxTipWindow** windowPtr = NULL,
                wxRect *rectBound = NULL);

    virtual ~wxTipWindow();

    // If windowPtr is not NULL the given address will be NULLed when the
    // window has closed
    void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; }

    // If rectBound is not NULL, the window will disappear automatically when
    // the mouse leave the specified rect: note that rectBound should be in the
    // screen coordinates!
    void SetBoundingRect(const wxRect& rectBound);

    // Hide and destroy the window
    void Close();

    // called by wxTipWindowView only
    bool CheckMouseInBounds(const wxPoint& pos);

    // event handlers
    void OnMouseClick(wxMouseEvent& event);

    void OnActivate(wxActivateEvent& event);
    void OnKillFocus(wxFocusEvent& event);
#else // wxUSE_POPUPWIN
    virtual void OnDismiss();

    wxArrayString m_textLines;
    wxCoord m_heightLine;

    wxTipWindowView *m_view;

    wxTipWindow** m_windowPtr;
    wxRect m_rectBound;


    friend class wxTipWindowView;

#endif // wxUSE_TIPWINDOW

#endif // _WX_TIPWIN_H_

Generated by  Doxygen 1.6.0   Back to index