KiCad PCB EDA Suite
status_popup.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2014-2015 CERN
5  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef __STATUS_POPUP_H_
26 #define __STATUS_POPUP_H_
27 
28 
29 #include <common.h>
30 #include <math/vector2d.h>
31 #include <wx/popupwin.h>
32 
33 class EDA_DRAW_FRAME;
34 
42 class STATUS_POPUP: public wxPopupWindow
43 {
44 public:
45  STATUS_POPUP( wxWindow* aParent );
46  virtual ~STATUS_POPUP() {}
47 
48  virtual void Popup( wxWindow* aFocus = nullptr );
49  virtual void PopupFor( int aMsecs );
50  virtual void Move( const wxPoint &aWhere );
51  virtual void Move( const VECTOR2I& aWhere );
52 
58  void Expire( int aMsecs );
59 
60 protected:
61  void updateSize();
62 
63  void onCharHook( wxKeyEvent& aEvent );
64 
66  void onExpire( wxTimerEvent& aEvent );
67 
68  wxPanel* m_panel;
69  wxBoxSizer* m_topSizer;
70  wxTimer m_expireTimer;
71 };
72 
73 
80 {
81 public:
82  STATUS_TEXT_POPUP( wxWindow* aParent );
83  virtual ~STATUS_TEXT_POPUP() {}
84 
89  void SetText( const wxString& aText );
90 
95  void SetTextColor( const wxColour& aColor );
96 
97 protected:
98  wxStaticText* m_statusLine;
99 };
100 
101 #endif /* __STATUS_POPUP_H_*/
void onExpire(wxTimerEvent &aEvent)
Expire timer even handler
void SetTextColor(const wxColour &aColor)
Change text color.
STATUS_POPUP(wxWindow *aParent)
Transient mouse following popup window implementation.
Class STATUS_TEXT_POPUP.
Definition: status_popup.h:79
The base class for create windows for drawing purpose.
wxPanel * m_panel
Definition: status_popup.h:68
void onCharHook(wxKeyEvent &aEvent)
wxStaticText * m_statusLine
Definition: status_popup.h:98
wxTimer m_expireTimer
Definition: status_popup.h:70
virtual void Popup(wxWindow *aFocus=nullptr)
virtual void Move(const wxPoint &aWhere)
Class STATUS_POPUP.
Definition: status_popup.h:42
void Expire(int aMsecs)
Hides the popup after a specified time.
virtual void PopupFor(int aMsecs)
wxBoxSizer * m_topSizer
Definition: status_popup.h:69
virtual ~STATUS_POPUP()
Definition: status_popup.h:46
virtual ~STATUS_TEXT_POPUP()
Definition: status_popup.h:83
The common library.
STATUS_TEXT_POPUP(wxWindow *aParent)
void SetText(const wxString &aText)
Display a text.