Audacity 3.2.0
|
Provides multiple views of keyboard shortcuts. More...
#include <KeyView.h>
Public Member Functions | |
KeyView (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize) | |
virtual | ~KeyView () |
wxString | GetName () const override |
void | RefreshBindings (const CommandIDs &names, const TranslatableStrings &categories, const TranslatableStrings &prefixes, const TranslatableStrings &labels, const std::vector< NormalizedKeyString > &keys, bool bSort) |
int | GetSelected () const |
wxString | GetLabel (int index) const |
wxString | GetFullLabel (int index) const |
int | GetIndexByName (const CommandID &name) const |
CommandID | GetName (int index) const |
CommandID | GetNameByKey (const NormalizedKeyString &key) const |
int | GetIndexByKey (const NormalizedKeyString &key) const |
NormalizedKeyString | GetKey (int index) const |
bool | CanSetKey (int index) const |
bool | SetKey (int index, const NormalizedKeyString &key) |
bool | SetKeyByName (const CommandID &name, const NormalizedKeyString &key) |
void | SetView (ViewByType type) |
void | SetFilter (const wxString &filter) |
void | ExpandAll () |
void | CollapseAll () |
void | SelectNode (int index) |
Private Member Functions | |
void | RecalcExtents () |
void | UpdateHScroll () |
void | RefreshLines (bool bSort=true) |
int | LineToIndex (int line) const |
int | IndexToLine (int index) const |
void | OnDrawBackground (wxDC &dc, const wxRect &rect, size_t line) const override |
void | OnDrawItem (wxDC &dc, const wxRect &rect, size_t line) const override |
wxCoord | OnMeasureItem (size_t line) const override |
void | OnSelected (wxCommandEvent &event) |
void | OnSetFocus (wxFocusEvent &event) |
void | OnKillFocus (wxFocusEvent &event) |
void | OnSize (wxSizeEvent &event) |
void | OnScroll (wxScrollWinEvent &event) |
void | OnKeyDown (wxKeyEvent &event) |
void | OnLeftDown (wxMouseEvent &event) |
Static Private Member Functions | |
static bool | CmpKeyNodeByTree (KeyNode *n1, KeyNode *n2) |
static bool | CmpKeyNodeByName (KeyNode *n1, KeyNode *n2) |
static bool | CmpKeyNodeByKey (KeyNode *n1, KeyNode *n2) |
Private Attributes | |
std::vector< KeyNode > | mNodes |
std::vector< KeyNode * > | mLines |
ViewByType | mViewType |
wxString | mFilter |
wxCoord | mScrollX |
wxCoord | mWidth |
size_t | mLineCount |
wxCoord | mLineHeight |
wxCoord | mKeyX |
int | mCommandWidth |
wxCoord | mKeyWidth |
KeyView::KeyView | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize |
||
) |
Definition at line 155 of file KeyView.cpp.
References safenew, and ViewByTree.
|
virtual |
Definition at line 177 of file KeyView.cpp.
bool KeyView::CanSetKey | ( | int | index | ) | const |
Definition at line 338 of file KeyView.cpp.
References mNodes.
Referenced by KeyConfigPrefs::OnSelected(), and KeyConfigPrefs::SetKeyForSelected().
Definition at line 1756 of file KeyView.cpp.
References NormalizedKeyString::Display(), KeyNode::key, KeyNode::label, KeyNode::prefix, and wxT().
Referenced by RefreshLines().
Definition at line 1722 of file KeyView.cpp.
References KeyNode::label, KeyNode::prefix, and wxT().
Referenced by RefreshLines().
Definition at line 1692 of file KeyView.cpp.
References KeyNode::category, CommandTranslated, KeyNode::isparent, KeyNode::label, and KeyNode::line.
Referenced by RefreshLines().
void KeyView::CollapseAll | ( | ) |
Definition at line 525 of file KeyView.cpp.
References KeyNode::isopen, KeyNode::isparent, mNodes, and RefreshLines().
void KeyView::ExpandAll | ( | ) |
Definition at line 503 of file KeyView.cpp.
References KeyNode::isopen, KeyNode::isparent, mNodes, and RefreshLines().
wxString KeyView::GetFullLabel | ( | int | index | ) | const |
Definition at line 220 of file KeyView.cpp.
References label, KeyNode::label, mNodes, KeyNode::prefix, and wxT().
Referenced by OnKeyDown().
int KeyView::GetIndexByKey | ( | const NormalizedKeyString & | key | ) | const |
Definition at line 302 of file KeyView.cpp.
int KeyView::GetIndexByName | ( | const CommandID & | name | ) | const |
Definition at line 246 of file KeyView.cpp.
Referenced by SetKeyByName().
NormalizedKeyString KeyView::GetKey | ( | int | index | ) | const |
Definition at line 322 of file KeyView.cpp.
References mNodes.
Referenced by KeyConfigPrefs::OnHotkeyKillFocus(), OnKeyDown(), and KeyConfigPrefs::OnSelected().
wxString KeyView::GetLabel | ( | int | index | ) | const |
Definition at line 204 of file KeyView.cpp.
References mNodes.
Referenced by OnKeyDown().
|
override |
Definition at line 194 of file KeyView.cpp.
Referenced by KeyConfigPrefs::OnSet(), and KeyConfigPrefs::SetKeyForSelected().
CommandID KeyView::GetName | ( | int | index | ) | const |
Definition at line 266 of file KeyView.cpp.
References mNodes.
CommandID KeyView::GetNameByKey | ( | const NormalizedKeyString & | key | ) | const |
Definition at line 282 of file KeyView.cpp.
Referenced by KeyConfigPrefs::NameFromKey().
int KeyView::GetSelected | ( | ) | const |
Definition at line 185 of file KeyView.cpp.
References LineToIndex().
Referenced by KeyConfigPrefs::OnSelected().
|
private |
Definition at line 1146 of file KeyView.cpp.
References mNodes.
Referenced by SelectNode().
|
private |
Definition at line 1132 of file KeyView.cpp.
References mLines.
Referenced by GetSelected(), OnKeyDown(), OnLeftDown(), RefreshBindings(), SetFilter(), and SetView().
|
overrideprivate |
Definition at line 1162 of file KeyView.cpp.
References KeyNode::depth, AColor::DrawFocus(), BasicUI::FindFocus(), KV_BITMAP_SIZE, KV_COLUMN_SPACER, AColor::Line(), mKeyWidth, mLines, mScrollX, mViewType, mWidth, and ViewByTree.
|
overrideprivate |
Definition at line 1235 of file KeyView.cpp.
References KeyNode::depth, NormalizedKeyString::Display(), BasicUI::FindFocus(), KeyNode::iscat, KeyNode::isopen, KeyNode::ispfx, KeyNode::key, KV_BITMAP_SIZE, KV_COLUMN_SPACER, KV_LEFT_MARGIN, label, KeyNode::label, AColor::Line(), mKeyWidth, mLines, mScrollX, mViewType, KeyNode::prefix, ViewByKey, ViewByName, ViewByTree, and wxT().
|
private |
Definition at line 1417 of file KeyView.cpp.
References NormalizedKeyString::Display(), GetFullLabel(), GetKey(), GetLabel(), KeyNode::isopen, KeyNode::isparent, label, LineToIndex(), mLines, mViewType, RefreshLines(), SelectNode(), ViewByKey, ViewByName, and ViewByTree.
|
private |
Definition at line 1369 of file KeyView.cpp.
|
private |
Definition at line 1622 of file KeyView.cpp.
References KeyNode::isopen, KeyNode::isparent, LineToIndex(), mLines, mViewType, RefreshLines(), SelectNode(), BasicUI::SetFocus(), and ViewByTree.
|
overrideprivate |
Definition at line 1319 of file KeyView.cpp.
References mLineHeight.
|
private |
Definition at line 1395 of file KeyView.cpp.
References mScrollX, and RefreshCode::RefreshAll.
|
private |
Definition at line 1331 of file KeyView.cpp.
|
private |
Definition at line 1346 of file KeyView.cpp.
|
private |
Definition at line 1385 of file KeyView.cpp.
References UpdateHScroll().
|
private |
Definition at line 547 of file KeyView.cpp.
References KeyNode::category, NormalizedKeyString::Display(), KeyNode::iscat, KeyNode::ispfx, KeyNode::key, label, KeyNode::label, mCommandWidth, mKeyWidth, mLineHeight, mNodes, mViewType, KeyNode::prefix, UpdateHScroll(), ViewByTree, and wxT().
Referenced by SetKey().
void KeyView::RefreshBindings | ( | const CommandIDs & | names, |
const TranslatableStrings & | categories, | ||
const TranslatableStrings & | prefixes, | ||
const TranslatableStrings & | labels, | ||
const std::vector< NormalizedKeyString > & | keys, | ||
bool | bSort | ||
) |
Definition at line 636 of file KeyView.cpp.
References _, KeyNode::category, CommandTranslated, KeyNode::depth, NormalizedKeyString::Display(), KeyNode::index, KeyNode::iscat, KeyNode::isopen, KeyNode::isparent, KeyNode::ispfx, KeyNode::key, label, KeyNode::label, KeyNode::line, LineToIndex(), mCommandWidth, mKeyWidth, mLineHeight, mNodes, name, KeyNode::name, names, KeyNode::prefix, RefreshLines(), SelectNode(), TranslatableString::Strip(), TranslatableString::Translation(), UpdateHScroll(), and wxT().
Referenced by KeyConfigPrefs::RefreshBindings().
|
private |
Definition at line 851 of file KeyView.cpp.
References _, KeyNode::category, CmpKeyNodeByKey(), CmpKeyNodeByName(), CmpKeyNodeByTree(), CommandTranslated, KeyNode::depth, NormalizedKeyString::Display(), KeyNode::index, KeyNode::iscat, KeyNode::isopen, KeyNode::isparent, KeyNode::ispfx, KeyNode::key, KeyNode::label, KeyNode::line, mFilter, mLines, mNodes, mViewType, KeyNode::name, KeyNode::prefix, RefreshCode::RefreshAll, ViewByKey, ViewByName, ViewByTree, and wxT().
Referenced by CollapseAll(), ExpandAll(), OnKeyDown(), OnLeftDown(), RefreshBindings(), SetFilter(), and SetView().
void KeyView::SelectNode | ( | int | index | ) |
Definition at line 1105 of file KeyView.cpp.
References IndexToLine().
Referenced by OnKeyDown(), OnLeftDown(), RefreshBindings(), SetFilter(), and SetView().
void KeyView::SetFilter | ( | const wxString & | filter | ) |
Definition at line 472 of file KeyView.cpp.
References LineToIndex(), mFilter, RefreshLines(), and SelectNode().
Referenced by KeyConfigPrefs::OnFilterKeyDown(), and KeyConfigPrefs::OnFilterTimer().
bool KeyView::SetKey | ( | int | index, |
const NormalizedKeyString & | key | ||
) |
Definition at line 355 of file KeyView.cpp.
References NormalizedKeyString::Display(), KeyNode::isparent, key, KeyNode::key, mKeyWidth, mLineHeight, mNodes, RecalcExtents(), and RefreshCode::RefreshAll.
Referenced by SetKeyByName(), and KeyConfigPrefs::SetKeyForSelected().
bool KeyView::SetKeyByName | ( | const CommandID & | name, |
const NormalizedKeyString & | key | ||
) |
Definition at line 396 of file KeyView.cpp.
References GetIndexByName(), key, name, and SetKey().
Referenced by KeyConfigPrefs::OnSet().
void KeyView::SetView | ( | ViewByType | type | ) |
Definition at line 414 of file KeyView.cpp.
References KeyNode::depth, KeyNode::index, LineToIndex(), mNodes, mViewType, RefreshLines(), SelectNode(), and ViewByTree.
Referenced by KeyConfigPrefs::OnViewBy(), and KeyConfigPrefs::Populate().
|
private |
Definition at line 602 of file KeyView.cpp.
References KV_COLUMN_SPACER, KV_LEFT_MARGIN, KV_VSCROLL_WIDTH, mCommandWidth, mKeyWidth, mScrollX, mWidth, and RefreshCode::RefreshAll.
Referenced by OnSize(), RecalcExtents(), and RefreshBindings().
|
private |
Definition at line 161 of file KeyView.h.
Referenced by RecalcExtents(), RefreshBindings(), and UpdateHScroll().
|
private |
Definition at line 153 of file KeyView.h.
Referenced by RefreshLines(), and SetFilter().
|
private |
Definition at line 162 of file KeyView.h.
Referenced by OnDrawBackground(), OnDrawItem(), RecalcExtents(), RefreshBindings(), SetKey(), and UpdateHScroll().
|
private |
Definition at line 159 of file KeyView.h.
Referenced by OnMeasureItem(), RecalcExtents(), RefreshBindings(), and SetKey().
|
private |
Definition at line 150 of file KeyView.h.
Referenced by LineToIndex(), OnDrawBackground(), OnDrawItem(), OnKeyDown(), OnLeftDown(), and RefreshLines().
|
private |
Definition at line 149 of file KeyView.h.
Referenced by CanSetKey(), CollapseAll(), ExpandAll(), GetFullLabel(), GetIndexByKey(), GetIndexByName(), GetKey(), GetLabel(), GetName(), GetNameByKey(), IndexToLine(), RecalcExtents(), RefreshBindings(), RefreshLines(), SetKey(), and SetView().
|
private |
Definition at line 155 of file KeyView.h.
Referenced by OnDrawBackground(), OnDrawItem(), OnScroll(), and UpdateHScroll().
|
private |
Definition at line 152 of file KeyView.h.
Referenced by OnDrawBackground(), OnDrawItem(), OnKeyDown(), OnLeftDown(), RecalcExtents(), RefreshLines(), and SetView().
|
private |
Definition at line 156 of file KeyView.h.
Referenced by OnDrawBackground(), and UpdateHScroll().