KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
6
* Author: Tomasz Wlostowski <
[email protected]
>
7
*
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License
10
* as published by the Free Software Foundation; either version 2
11
* of the License, or (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, you may find one here:
20
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21
* or you may search the http://www.gnu.org website for the version 2 license,
22
* or you may write to the Free Software Foundation, Inc.,
23
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24
*/
25
26
#ifndef __STATUS_POPUP_H_
27
#define __STATUS_POPUP_H_
28
29
30
#include <
math/vector2d.h
>
31
#include <wx/popupwin.h>
32
#include <wx/timer.h>
33
#include <wx/panel.h>
34
#include <wx/stattext.h>
35
#include <wx/sizer.h>
36
#include <wx/statbmp.h>
37
38
class
EDA_DRAW_FRAME
;
39
45
class
STATUS_POPUP
:
public
wxPopupWindow
46
{
47
public
:
48
STATUS_POPUP
( wxWindow* aParent );
49
virtual
~STATUS_POPUP
() { Hide(); }
50
51
virtual
void
Popup
( wxWindow* aFocus =
nullptr
);
52
virtual
void
PopupFor
(
int
aMsecs );
53
virtual
void
Move
(
const
wxPoint& aWhere );
54
virtual
void
Move
(
const
VECTOR2I
& aWhere );
55
61
void
Expire
(
int
aMsecs );
62
63
wxWindow*
GetPanel
() {
return
m_panel
; }
64
65
protected
:
66
void
updateSize
();
67
68
void
onCharHook
( wxKeyEvent& aEvent );
69
71
void
onExpire
( wxTimerEvent& aEvent );
72
73
protected
:
74
wxPanel*
m_panel
;
75
wxBoxSizer*
m_topSizer
;
76
wxTimer
m_expireTimer
;
77
};
78
79
83
class
STATUS_TEXT_POPUP
:
public
STATUS_POPUP
84
{
85
public
:
86
STATUS_TEXT_POPUP
( wxWindow* aParent );
87
virtual
~STATUS_TEXT_POPUP
() {}
88
94
void
SetText
(
const
wxString& aText );
95
101
void
SetTextColor
(
const
wxColour& aColor );
102
103
protected
:
104
wxStaticText*
m_statusLine
;
105
};
106
107
108
#endif
/* __STATUS_POPUP_H_*/
EDA_DRAW_FRAME
The base class for create windows for drawing purpose.
Definition:
eda_draw_frame.h:84
STATUS_POPUP
A tiny, headerless popup window used to display useful status (e.g.
Definition:
status_popup.h:46
STATUS_POPUP::onExpire
void onExpire(wxTimerEvent &aEvent)
Definition:
status_popup.cpp:113
STATUS_POPUP::GetPanel
wxWindow * GetPanel()
Definition:
status_popup.h:63
STATUS_POPUP::Expire
void Expire(int aMsecs)
Hide the popup after a specified time.
Definition:
status_popup.cpp:100
STATUS_POPUP::PopupFor
virtual void PopupFor(int aMsecs)
Definition:
status_popup.cpp:81
STATUS_POPUP::m_topSizer
wxBoxSizer * m_topSizer
Definition:
status_popup.h:75
STATUS_POPUP::m_expireTimer
wxTimer m_expireTimer
Definition:
status_popup.h:76
STATUS_POPUP::updateSize
void updateSize()
Definition:
status_popup.cpp:106
STATUS_POPUP::m_panel
wxPanel * m_panel
Definition:
status_popup.h:74
STATUS_POPUP::Popup
virtual void Popup(wxWindow *aFocus=nullptr)
Definition:
status_popup.cpp:74
STATUS_POPUP::Move
virtual void Move(const wxPoint &aWhere)
Definition:
status_popup.cpp:94
STATUS_POPUP::onCharHook
void onCharHook(wxKeyEvent &aEvent)
Expire timer even handler.
Definition:
status_popup.cpp:58
STATUS_POPUP::~STATUS_POPUP
virtual ~STATUS_POPUP()
Definition:
status_popup.h:49
STATUS_TEXT_POPUP
Extension of STATUS_POPUP for displaying a single line text.
Definition:
status_popup.h:84
STATUS_TEXT_POPUP::SetTextColor
void SetTextColor(const wxColour &aColor)
Change text color.
Definition:
status_popup.cpp:138
STATUS_TEXT_POPUP::SetText
void SetText(const wxString &aText)
Display a text.
Definition:
status_popup.cpp:131
STATUS_TEXT_POPUP::~STATUS_TEXT_POPUP
virtual ~STATUS_TEXT_POPUP()
Definition:
status_popup.h:87
STATUS_TEXT_POPUP::m_statusLine
wxStaticText * m_statusLine
Definition:
status_popup.h:104
VECTOR2< int32_t >
vector2d.h
src
include
status_popup.h
Generated on Thu Nov 21 2024 00:06:43 for KiCad PCB EDA Suite by
1.9.6