KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_choice.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) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or (at your
9
* option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef FOOTPRINT_CHOICE_H
21
#define FOOTPRINT_CHOICE_H
22
23
#include <wx/odcombo.h>
24
38
class
FOOTPRINT_CHOICE
:
public
wxOwnerDrawnComboBox
39
{
40
public
:
41
FOOTPRINT_CHOICE
( wxWindow* aParent,
int
aId );
42
43
virtual
~FOOTPRINT_CHOICE
();
44
45
protected
:
46
virtual
void
DoSetPopupControl
( wxComboPopup* aPopup )
override
;
47
virtual
void
OnDrawItem
( wxDC& aDC,
const
wxRect& aRect,
int
aItem,
int
aFlags )
const override
;
48
virtual
wxCoord
OnMeasureItem
(
size_t
aItem )
const override
;
49
virtual
wxCoord
OnMeasureItemWidth
(
size_t
aItem )
const override
;
50
54
static
wxCoord
DrawTextFragment
( wxDC& aDC, wxCoord x, wxCoord y,
const
wxString& aText );
55
57
void
TryVetoMouse
( wxMouseEvent& aEvent );
58
65
void
TryVetoSelect
( wxCommandEvent& aEvent,
bool
aInner );
66
70
wxString
SafeGetString
(
int
aItem )
const
;
71
75
int
GetSelectionEither
(
bool
aInner )
const
;
76
81
void
SetSelectionEither
(
bool
aInner,
int
aSel );
82
83
static
wxColour
m_grey
;
84
85
private
:
86
int
m_last_selection
;
87
};
88
89
#endif
// FOOTPRINT_CHOICE_H
FOOTPRINT_CHOICE
Customized combo box for footprint selection.
Definition:
footprint_choice.h:39
FOOTPRINT_CHOICE::SafeGetString
wxString SafeGetString(int aItem) const
Safely get a string for an item, returning wxEmptyString if the item doesn't exist.
Definition:
footprint_choice.cpp:179
FOOTPRINT_CHOICE::OnMeasureItem
virtual wxCoord OnMeasureItem(size_t aItem) const override
Definition:
footprint_choice.cpp:124
FOOTPRINT_CHOICE::TryVetoSelect
void TryVetoSelect(wxCommandEvent &aEvent, bool aInner)
Veto a select event for the separator.
Definition:
footprint_choice.cpp:158
FOOTPRINT_CHOICE::m_grey
static wxColour m_grey
Definition:
footprint_choice.h:83
FOOTPRINT_CHOICE::~FOOTPRINT_CHOICE
virtual ~FOOTPRINT_CHOICE()
Definition:
footprint_choice.cpp:36
FOOTPRINT_CHOICE::DrawTextFragment
static wxCoord DrawTextFragment(wxDC &aDC, wxCoord x, wxCoord y, const wxString &aText)
Draw a fragment of text, then return the next x coordinate to continue drawing.
Definition:
footprint_choice.cpp:142
FOOTPRINT_CHOICE::SetSelectionEither
void SetSelectionEither(bool aInner, int aSel)
Safely set selection for either the outer (combo box) or inner (popup) list, doing nothing for invali...
Definition:
footprint_choice.cpp:197
FOOTPRINT_CHOICE::OnMeasureItemWidth
virtual wxCoord OnMeasureItemWidth(size_t aItem) const override
Definition:
footprint_choice.cpp:133
FOOTPRINT_CHOICE::TryVetoMouse
void TryVetoMouse(wxMouseEvent &aEvent)
Veto a mouseover event if in the separator.
Definition:
footprint_choice.cpp:149
FOOTPRINT_CHOICE::m_last_selection
int m_last_selection
Definition:
footprint_choice.h:86
FOOTPRINT_CHOICE::DoSetPopupControl
virtual void DoSetPopupControl(wxComboPopup *aPopup) override
Definition:
footprint_choice.cpp:41
FOOTPRINT_CHOICE::GetSelectionEither
int GetSelectionEither(bool aInner) const
Get selection from either the outer (combo box) or inner (popup) list.
Definition:
footprint_choice.cpp:188
FOOTPRINT_CHOICE::OnDrawItem
virtual void OnDrawItem(wxDC &aDC, const wxRect &aRect, int aItem, int aFlags) const override
Definition:
footprint_choice.cpp:57
src
include
widgets
footprint_choice.h
Generated on Sun Dec 22 2024 00:05:24 for KiCad PCB EDA Suite by
1.9.6