21 #include <wx/dcclient.h> 29 m_actionCallback( aCallback ),
37 wxColour bgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
38 m_desc->SetBackgroundColour( bgColor );
39 m_name->SetBackgroundColour( bgColor );
40 m_bitmap->SetBackgroundColour( bgColor );
48 m_desc->SetMinSize( wxSize( 0, -1 ) );
63 int nameLineHeight =
m_name->GetTextExtent( wxT(
"X" ) ).GetHeight();
64 double descLineHeight =
m_desc->GetTextExtent( wxT(
"X" ) ).GetHeight() * 1.2 ;
68 descLineHeight = wxSplit(
m_desc->GetLabel(),
'\n' ).size() * descLineHeight;
97 m_button->SetLabel(
_(
"Pending install" ) );
101 m_button->SetLabel(
_(
"Pending uninstall" ) );
118 if( version.IsEmpty() )
144 wxRect rect( wxPoint( 1, 1 ), GetClientSize() - wxSize( 1, 1 ) );
145 wxPaintDC dc(
this );
146 dc.SetBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK ) );
147 dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ), 1 ) );
152 dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT ), 3 ) );
155 dc.DrawRectangle( rect );
174 return ver.compatible && ver.status ==
PVS_STABLE;
183 return ver.compatible;
188 return wxEmptyString;
190 return ver_it->version;
< Package version metadata Package metadata
wxStaticBitmap * m_bitmap
void OnPaint(wxPaintEvent &event) override
std::function< void()> m_selectCallback
void SetState(PCM_PACKAGE_STATE aState)
Called when anywhere on the panel is clicked (except install button)
const int minSize
Push and Shove router track width and via size dialog.
const PCM_PACKAGE package
const ActionCallback & m_actionCallback
< Collection of data relevant to the package display panel Callback for (un)install button
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
void SetSelected(bool aSelected)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
void OnClick(wxMouseEvent &event) override
void SetSelectCallback(const std::function< void()> &aCallback)
Marks panel as selected.
std::vector< PACKAGE_VERSION > versions
void OnButtonClicked(wxCommandEvent &event) override
Changes state of the (un)install button.
Class PANEL_PACKAGE_BASE.
void OnSize(wxSizeEvent &event) override
Get preferred version. If criteria are not met, return wxEmptyString.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
std::function< void(const PACKAGE_VIEW_DATA &aData, PCM_PACKAGE_ACTION aAction, const wxString &aVersion)> ActionCallback
PANEL_PACKAGE(wxWindow *parent, const ActionCallback &aCallback, const PACKAGE_VIEW_DATA &aData)
Sets callback for OnClick action.
wxString GetPreferredVersion() const