KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PANEL_PACKAGE Class Reference

#include <panel_package.h>

Inheritance diagram for PANEL_PACKAGE:
PANEL_PACKAGE_BASE

Public Member Functions

 PANEL_PACKAGE (wxWindow *parent, const ActionCallback &aCallback, const PinCallback &aPinCallback, const PACKAGE_VIEW_DATA &aData)
 Sets callback for OnClick action.
 
void SetSelectCallback (const std::function< void()> &aCallback)
 Marks panel as selected.
 
void SetSelected (bool aSelected)
 
void OnButtonClicked (wxCommandEvent &event) override
 Changes state of the (un)install button.
 
void SetState (PCM_PACKAGE_STATE aState, bool aPinned)
 Called when anywhere on the panel is clicked (except install button)
 
void OnClick (wxMouseEvent &event) override
 
void OnUninstallClick (wxCommandEvent &event)
 
void OnPinVersionClick (wxCommandEvent &event)
 
void OnSize (wxSizeEvent &event) override
 Get preferred version. If criteria are not met, return wxEmptyString.
 
wxString GetPreferredVersion () const
 
const PACKAGE_VIEW_DATAGetPackageData () const
 

Protected Attributes

wxStaticBitmap * m_bitmap
 
wxStaticText * m_name
 
wxBoxSizer * m_descSizer
 
wxStaticText * m_desc
 
wxButton * m_button
 
SPLIT_BUTTONm_splitButton
 

Private Member Functions

void OnPaint (wxPaintEvent &event) override
 

Private Attributes

wxMenuItem * m_pinVersionMenuItem
 
wxMenuItem * m_actionMenuItem
 
std::function< void()> m_selectCallback
 
bool m_selected = false
 
const ActionCallbackm_actionCallback
 
const PinCallbackm_pinCallback
 
PACKAGE_VIEW_DATA m_data
 
int m_minHeight
 

Detailed Description

Definition at line 63 of file panel_package.h.

Constructor & Destructor Documentation

◆ PANEL_PACKAGE()

Member Function Documentation

◆ GetPackageData()

const PACKAGE_VIEW_DATA & PANEL_PACKAGE::GetPackageData ( ) const
inline

◆ GetPreferredVersion()

wxString PANEL_PACKAGE::GetPreferredVersion ( ) const

Definition at line 264 of file panel_package.cpp.

References m_data, PACKAGE_VIEW_DATA::package, and PCM_PACKAGE::versions.

Referenced by OnButtonClicked().

◆ OnButtonClicked()

void PANEL_PACKAGE::OnButtonClicked ( wxCommandEvent &  event)
overridevirtual

◆ OnClick()

void PANEL_PACKAGE::OnClick ( wxMouseEvent &  event)
overridevirtual

◆ OnPaint()

void PANEL_PACKAGE::OnPaint ( wxPaintEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PACKAGE_BASE.

Definition at line 240 of file panel_package.cpp.

References m_selected.

◆ OnPinVersionClick()

void PANEL_PACKAGE::OnPinVersionClick ( wxCommandEvent &  event)

◆ OnSize()

void PANEL_PACKAGE::OnSize ( wxSizeEvent &  event)
overridevirtual

Get preferred version. If criteria are not met, return wxEmptyString.

Reimplemented from PANEL_PACKAGE_BASE.

Definition at line 84 of file panel_package.cpp.

References PCM_PACKAGE::description, KiROUND(), m_data, PANEL_PACKAGE_BASE::m_desc, PANEL_PACKAGE_BASE::m_descSizer, m_minHeight, PANEL_PACKAGE_BASE::m_name, minSize, and PACKAGE_VIEW_DATA::package.

◆ OnUninstallClick()

void PANEL_PACKAGE::OnUninstallClick ( wxCommandEvent &  event)

◆ SetSelectCallback()

void PANEL_PACKAGE::SetSelectCallback ( const std::function< void()> &  aCallback)

Marks panel as selected.

Definition at line 228 of file panel_package.cpp.

References m_selectCallback.

Referenced by PANEL_PACKAGES_VIEW::SetData().

◆ SetSelected()

void PANEL_PACKAGE::SetSelected ( bool  aSelected)

◆ SetState()

void PANEL_PACKAGE::SetState ( PCM_PACKAGE_STATE  aState,
bool  aPinned 
)

Member Data Documentation

◆ m_actionCallback

const ActionCallback& PANEL_PACKAGE::m_actionCallback
private

Definition at line 102 of file panel_package.h.

Referenced by OnButtonClicked(), and OnUninstallClick().

◆ m_actionMenuItem

wxMenuItem* PANEL_PACKAGE::m_actionMenuItem
private

Definition at line 99 of file panel_package.h.

Referenced by PANEL_PACKAGE(), and SetState().

◆ m_bitmap

wxStaticBitmap* PANEL_PACKAGE_BASE::m_bitmap
protectedinherited

Definition at line 39 of file panel_package_base.h.

Referenced by PANEL_PACKAGE(), and PANEL_PACKAGE_BASE::PANEL_PACKAGE_BASE().

◆ m_button

wxButton* PANEL_PACKAGE_BASE::m_button
protectedinherited

◆ m_data

◆ m_desc

wxStaticText* PANEL_PACKAGE_BASE::m_desc
protectedinherited

◆ m_descSizer

wxBoxSizer* PANEL_PACKAGE_BASE::m_descSizer
protectedinherited

◆ m_minHeight

int PANEL_PACKAGE::m_minHeight
private

Definition at line 105 of file panel_package.h.

Referenced by OnSize(), and PANEL_PACKAGE().

◆ m_name

wxStaticText* PANEL_PACKAGE_BASE::m_name
protectedinherited

◆ m_pinCallback

const PinCallback& PANEL_PACKAGE::m_pinCallback
private

Definition at line 103 of file panel_package.h.

Referenced by OnPinVersionClick().

◆ m_pinVersionMenuItem

wxMenuItem* PANEL_PACKAGE::m_pinVersionMenuItem
private

Definition at line 98 of file panel_package.h.

Referenced by PANEL_PACKAGE(), and SetState().

◆ m_selectCallback

std::function<void()> PANEL_PACKAGE::m_selectCallback
private

Definition at line 100 of file panel_package.h.

Referenced by OnClick(), and SetSelectCallback().

◆ m_selected

bool PANEL_PACKAGE::m_selected = false
private

Definition at line 101 of file panel_package.h.

Referenced by OnPaint(), and SetSelected().

◆ m_splitButton

SPLIT_BUTTON* PANEL_PACKAGE_BASE::m_splitButton
protectedinherited

The documentation for this class was generated from the following files: