KiCad PCB EDA Suite
|
#include <panel_package.h>
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_DATA & | GetPackageData () const |
Protected Attributes | |
wxStaticBitmap * | m_bitmap |
wxStaticText * | m_name |
wxBoxSizer * | m_descSizer |
wxStaticText * | m_desc |
wxButton * | m_button |
SPLIT_BUTTON * | m_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 ActionCallback & | m_actionCallback |
const PinCallback & | m_pinCallback |
PACKAGE_VIEW_DATA | m_data |
int | m_minHeight |
Definition at line 63 of file panel_package.h.
PANEL_PACKAGE::PANEL_PACKAGE | ( | wxWindow * | parent, |
const ActionCallback & | aCallback, | ||
const PinCallback & | aPinCallback, | ||
const PACKAGE_VIEW_DATA & | aData | ||
) |
Sets callback for OnClick action.
Definition at line 26 of file panel_package.cpp.
References _, PACKAGE_VIEW_DATA::bitmap, PCM_PACKAGE::description, SPLIT_BUTTON::GetSplitButtonMenu(), KiROUND(), m_actionMenuItem, PANEL_PACKAGE_BASE::m_bitmap, m_data, PANEL_PACKAGE_BASE::m_desc, PANEL_PACKAGE_BASE::m_descSizer, m_minHeight, PANEL_PACKAGE_BASE::m_name, m_pinVersionMenuItem, PANEL_PACKAGE_BASE::m_splitButton, minSize, PCM_PACKAGE::name, OnButtonClicked(), OnClick(), OnPinVersionClick(), PACKAGE_VIEW_DATA::package, PACKAGE_VIEW_DATA::pinned, SPLIT_BUTTON::SetLabel(), SetState(), and PACKAGE_VIEW_DATA::state.
|
inline |
Definition at line 92 of file panel_package.h.
References m_data.
Referenced by PANEL_PACKAGES_VIEW::canRunAction(), PANEL_PACKAGES_VIEW::OnVersionActionClicked(), and PANEL_PACKAGES_VIEW::SetData().
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().
|
overridevirtual |
Changes state of the (un)install button.
Reimplemented from PANEL_PACKAGE_BASE.
Definition at line 183 of file panel_package.cpp.
References PACKAGE_VIEW_DATA::current_version, GetPreferredVersion(), m_actionCallback, m_data, PPA_INSTALL, PPA_UNINSTALL, PPA_UPDATE, PPS_AVAILABLE, PPS_UPDATE_AVAILABLE, PACKAGE_VIEW_DATA::state, and PACKAGE_VIEW_DATA::update_version.
Referenced by PANEL_PACKAGE(), and SetState().
|
overridevirtual |
Reimplemented from PANEL_PACKAGE_BASE.
Definition at line 234 of file panel_package.cpp.
References m_selectCallback.
Referenced by PANEL_PACKAGES_VIEW::OnShowAllVersionsClicked(), PANEL_PACKAGE(), and PANEL_PACKAGES_VIEW::SetPackageState().
|
overrideprivatevirtual |
Reimplemented from PANEL_PACKAGE_BASE.
Definition at line 240 of file panel_package.cpp.
References m_selected.
void PANEL_PACKAGE::OnPinVersionClick | ( | wxCommandEvent & | event | ) |
Definition at line 205 of file panel_package.cpp.
References PCM_PACKAGE::identifier, m_data, m_pinCallback, PACKAGE_VIEW_DATA::package, PACKAGE_VIEW_DATA::pinned, and PACKAGE_VIEW_DATA::state.
Referenced by PANEL_PACKAGE().
|
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.
void PANEL_PACKAGE::OnUninstallClick | ( | wxCommandEvent & | event | ) |
Definition at line 213 of file panel_package.cpp.
References PACKAGE_VIEW_DATA::current_version, m_actionCallback, m_data, PPA_UNINSTALL, PPS_UPDATE_AVAILABLE, and PACKAGE_VIEW_DATA::state.
Referenced by SetState().
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().
void PANEL_PACKAGE::SetSelected | ( | bool | aSelected | ) |
Definition at line 257 of file panel_package.cpp.
References m_selected, and Refresh().
Referenced by PANEL_PACKAGES_VIEW::OnSearchTextChanged(), and PANEL_PACKAGES_VIEW::SetData().
void PANEL_PACKAGE::SetState | ( | PCM_PACKAGE_STATE | aState, |
bool | aPinned | ||
) |
Called when anywhere on the panel is clicked (except install button)
Definition at line 100 of file panel_package.cpp.
References _, SPLIT_BUTTON::GetSplitButtonMenu(), m_actionMenuItem, PANEL_PACKAGE_BASE::m_button, m_data, m_pinVersionMenuItem, PANEL_PACKAGE_BASE::m_splitButton, OnButtonClicked(), OnUninstallClick(), PACKAGE_VIEW_DATA::pinned, SPLIT_BUTTON::SetLabel(), and PACKAGE_VIEW_DATA::state.
Referenced by PANEL_PACKAGE().
|
private |
Definition at line 102 of file panel_package.h.
Referenced by OnButtonClicked(), and OnUninstallClick().
|
private |
Definition at line 99 of file panel_package.h.
Referenced by PANEL_PACKAGE(), and SetState().
|
protectedinherited |
Definition at line 39 of file panel_package_base.h.
Referenced by PANEL_PACKAGE(), and PANEL_PACKAGE_BASE::PANEL_PACKAGE_BASE().
|
protectedinherited |
Definition at line 43 of file panel_package_base.h.
Referenced by PANEL_PACKAGE_BASE::PANEL_PACKAGE_BASE(), SetState(), and PANEL_PACKAGE_BASE::~PANEL_PACKAGE_BASE().
|
private |
Definition at line 104 of file panel_package.h.
Referenced by GetPackageData(), GetPreferredVersion(), OnButtonClicked(), OnPinVersionClick(), OnSize(), OnUninstallClick(), PANEL_PACKAGE(), and SetState().
|
protectedinherited |
Definition at line 42 of file panel_package_base.h.
Referenced by OnSize(), PANEL_PACKAGE(), and PANEL_PACKAGE_BASE::PANEL_PACKAGE_BASE().
|
protectedinherited |
Definition at line 41 of file panel_package_base.h.
Referenced by OnSize(), PANEL_PACKAGE(), and PANEL_PACKAGE_BASE::PANEL_PACKAGE_BASE().
|
private |
Definition at line 105 of file panel_package.h.
Referenced by OnSize(), and PANEL_PACKAGE().
|
protectedinherited |
Definition at line 40 of file panel_package_base.h.
Referenced by OnSize(), PANEL_PACKAGE(), and PANEL_PACKAGE_BASE::PANEL_PACKAGE_BASE().
|
private |
Definition at line 103 of file panel_package.h.
Referenced by OnPinVersionClick().
|
private |
Definition at line 98 of file panel_package.h.
Referenced by PANEL_PACKAGE(), and SetState().
|
private |
Definition at line 100 of file panel_package.h.
Referenced by OnClick(), and SetSelectCallback().
|
private |
Definition at line 101 of file panel_package.h.
Referenced by OnPaint(), and SetSelected().
|
protectedinherited |
Definition at line 44 of file panel_package_base.h.
Referenced by PANEL_PACKAGE(), PANEL_PACKAGE_BASE::PANEL_PACKAGE_BASE(), and SetState().