Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: HaikuArchives/Hare
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2a0a0a221adc
Choose a base ref
...
head repository: HaikuArchives/Hare
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ff093663ba2c
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Oct 10, 2021

  1. Add support for removing entries in encoderview (#36)

    Using DELETE or BACKSPACE keys will removing all
    selected entries from encoderview
    This fixes #22.
    scottmc authored Oct 10, 2021
    Copy the full SHA
    ff09366 View commit details
Showing with 27 additions and 0 deletions.
  1. +26 −0 src/Hare/EncoderListView.cpp
  2. +1 −0 src/Hare/EncoderListView.h
26 changes: 26 additions & 0 deletions src/Hare/EncoderListView.cpp
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include "EncoderListView.h"
#include "RefRow.h"

#include <string.h>

@@ -129,6 +130,31 @@ EncoderListView::SelectionChanged()
delete listSelectMsg;
}

void
EncoderListView::KeyDown(const char* bytes, int32 numBytes)
{
uint8 byte = bytes[0];

switch(byte)
{
case B_BACKSPACE:
// fallthrough
case B_DELETE:
{
for (int32 i = CountRows()-1; i >= 0; i--) {
BRow* currentrow = this->RowAt(i);
if (currentrow->IsSelected()) {
RemoveRow(currentrow);
}
// May need to add code to delete associated BRefRow?
}
}
break;
default:
break;
}
}

BBitmap*
EncoderListView::GetCheckMark()
{
1 change: 1 addition & 0 deletions src/Hare/EncoderListView.h
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ class EncoderListView : public BColumnListView {
virtual void MessageDropped(BMessage* message, BPoint point);
virtual void MessageReceived(BMessage* message);
virtual void SelectionChanged();
virtual void KeyDown(const char* bytes, int32 numBytes);
BBitmap* GetCheckMark();
private:
void InitView();