mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-28 11:50:19 +02:00
Update to v098r09 release.
byuu says: Changelog: - fixed major nall/vector/prepend bug - renamed hiro/ListView to hiro/TableView - added new hiro/ListView control which is a simplified abstraction of hiro/TableView - updated higan's cheat database window and icarus' scan dialog to use the new ListView control - compilation works once again on all platforms (Windows, Cocoa, GTK, Qt) - the loki skeleton compiles once again (removed nall/DSP references; updated port/device ID names) Small catch: need to capture layout resize events internally in Windows to call resizeColumns. For now, just resize the icarus window to get it to use the full window width for list view items.
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
#define decimal CocoaDecimal
|
||||
#define decimal decimal_cocoa
|
||||
#define uint8 uint8_cocoa
|
||||
#define uint16 uint16_cocoa
|
||||
#define uint32 uint32_cocoa
|
||||
#define uint64 uint64_cocoa
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
#undef decimal
|
||||
#undef uint8
|
||||
#undef uint16
|
||||
#undef uint32
|
||||
#undef uint64
|
||||
|
||||
#include <nall/run.hpp>
|
||||
|
@@ -42,16 +42,16 @@
|
||||
#include "widget/horizontal-slider.cpp"
|
||||
#include "widget/label.cpp"
|
||||
#include "widget/line-edit.cpp"
|
||||
#include "widget/list-view.cpp"
|
||||
#include "widget/list-view-header.cpp"
|
||||
#include "widget/list-view-column.cpp"
|
||||
#include "widget/list-view-item.cpp"
|
||||
#include "widget/list-view-cell.cpp"
|
||||
#include "widget/progress-bar.cpp"
|
||||
#include "widget/radio-button.cpp"
|
||||
#include "widget/radio-label.cpp"
|
||||
#include "widget/tab-frame.cpp"
|
||||
#include "widget/tab-frame-item.cpp"
|
||||
#include "widget/table-view.cpp"
|
||||
#include "widget/table-view-header.cpp"
|
||||
#include "widget/table-view-column.cpp"
|
||||
#include "widget/table-view-item.cpp"
|
||||
#include "widget/table-view-cell.cpp"
|
||||
#include "widget/text-edit.cpp"
|
||||
#include "widget/vertical-scroll-bar.cpp"
|
||||
#include "widget/vertical-slider.cpp"
|
||||
|
@@ -54,16 +54,16 @@ namespace hiro {
|
||||
#include "widget/horizontal-slider.hpp"
|
||||
#include "widget/label.hpp"
|
||||
#include "widget/line-edit.hpp"
|
||||
#include "widget/list-view.hpp"
|
||||
#include "widget/list-view-header.hpp"
|
||||
#include "widget/list-view-column.hpp"
|
||||
#include "widget/list-view-item.hpp"
|
||||
#include "widget/list-view-cell.hpp"
|
||||
#include "widget/progress-bar.hpp"
|
||||
#include "widget/radio-button.hpp"
|
||||
#include "widget/radio-label.hpp"
|
||||
#include "widget/tab-frame.hpp"
|
||||
#include "widget/tab-frame-item.hpp"
|
||||
#include "widget/table-view.hpp"
|
||||
#include "widget/table-view-header.hpp"
|
||||
#include "widget/table-view-column.hpp"
|
||||
#include "widget/table-view-item.hpp"
|
||||
#include "widget/table-view-cell.hpp"
|
||||
#include "widget/text-edit.hpp"
|
||||
#include "widget/vertical-scroll-bar.hpp"
|
||||
#include "widget/vertical-slider.hpp"
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
-(BOOL) performDragOperation:(id<NSDraggingInfo>)sender {
|
||||
lstring paths = DropPaths(sender);
|
||||
if(paths.empty()) return NO;
|
||||
if(!paths) return NO;
|
||||
canvas->doDrop(paths);
|
||||
return YES;
|
||||
}
|
||||
|
@@ -1,50 +0,0 @@
|
||||
#if defined(Hiro_ListView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pListViewCell::construct() -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::setAlignment(Alignment alignment) -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::setBackgroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::setCheckable(bool checkable) -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::setChecked(bool checked) -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::setForegroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::setIcon(const image& icon) -> void {
|
||||
}
|
||||
|
||||
auto pListViewCell::setText(const string& text) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto pListView = _grandparent()) {
|
||||
[[pListView->cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pListViewCell::_grandparent() -> maybe<pListView&> {
|
||||
if(auto parent = _parent()) return parent->_parent();
|
||||
}
|
||||
|
||||
auto pListViewCell::_parent() -> maybe<pListViewItem&> {
|
||||
if(auto parent = self().parentListViewItem()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,87 +0,0 @@
|
||||
#if defined(Hiro_ListView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pListViewColumn::construct() -> void {
|
||||
@autoreleasepool {
|
||||
if(auto listView = _grandparent()) {
|
||||
[listView->cocoaView reloadColumns];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pListViewColumn::destruct() -> void {
|
||||
@autoreleasepool {
|
||||
if(auto listView = _grandparent()) {
|
||||
[listView->cocoaView reloadColumns];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pListViewColumn::setActive() -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setAlignment(Alignment alignment) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setBackgroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setEditable(bool editable) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setExpandable(bool expandable) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setFont(const Font& font) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setForegroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setHorizontalAlignment(double alignment) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setIcon(const image& icon) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setResizable(bool resizable) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setSortable(bool sortable) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setText(const string& text) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto pListView = _grandparent()) {
|
||||
NSTableColumn* tableColumn = [[pListView->cocoaView content] tableColumnWithIdentifier:[[NSNumber numberWithInteger:self().offset()] stringValue]];
|
||||
[[tableColumn headerCell] setStringValue:[NSString stringWithUTF8STring:text]];
|
||||
[[pListView->cocoaView headerView] setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pListViewColumn::setVerticalAlignment(double alignment) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setVisible(bool visible) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::setWidth(signed width) -> void {
|
||||
}
|
||||
|
||||
auto pListViewColumn::_grandparent() -> maybe<pListView&> {
|
||||
if(auto parent = _parent()) return parent->_parent();
|
||||
return nothing;
|
||||
}
|
||||
|
||||
auto pListViewColumn::_parent() -> maybe<pListViewHeader&> {
|
||||
if(auto parent = self().parentListViewHeader()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,38 +0,0 @@
|
||||
#if defined(Hiro_ListView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pListViewHeader::construct() -> void {
|
||||
}
|
||||
|
||||
auto pListViewHeader::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pListViewHeader::append(sListViewColumn column) -> void {
|
||||
}
|
||||
|
||||
auto pListViewHeader::remove(sListViewColumn column) -> void {
|
||||
}
|
||||
|
||||
auto pListViewHeader::setVisible(bool visible) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto pListView = _parent()) {
|
||||
if(visible) {
|
||||
[[pListView->cocoaView content] setHeaderView:[[[NSTableHeaderView alloc] init] autorelease]];
|
||||
} else {
|
||||
[[pListView->cocoaView content] setHeaderView:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pListViewHeader::_parent() -> maybe<pListView&> {
|
||||
if(auto parent = self().parentListView()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,17 +0,0 @@
|
||||
#if defined(Hiro_ListView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pListViewHeader : pObject {
|
||||
Declare(ListViewHeader, Object)
|
||||
|
||||
auto append(sListViewColumn column) -> void;
|
||||
auto remove(sListViewColumn column) -> void;
|
||||
auto setVisible(bool visible) -> void override;
|
||||
|
||||
auto _parent() -> maybe<pListView&>;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,51 +0,0 @@
|
||||
#if defined(Hiro_ListView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pListViewItem::construct() -> void {
|
||||
}
|
||||
|
||||
auto pListViewItem::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pListViewItem::append(sListViewCell cell) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto listView = _parent()) {
|
||||
[[listView->cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pListViewItem::remove(sListViewCell cell) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto listView = _parent()) {
|
||||
[[listView->cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pListViewItem::setAlignment(Alignment alignment) -> void {
|
||||
}
|
||||
|
||||
auto pListViewItem::setBackgroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListViewItem::setFocused() -> void {
|
||||
}
|
||||
|
||||
auto pListViewItem::setForegroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListViewItem::setSelected(bool selected) -> void {
|
||||
}
|
||||
|
||||
auto pListViewItem::_parent() -> maybe<pListView&> {
|
||||
if(auto parent = self().parentListView()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
50
hiro/cocoa/widget/table-view-cell.cpp
Normal file
50
hiro/cocoa/widget/table-view-cell.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pTableViewCell::construct() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::setAlignment(Alignment alignment) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::setBackgroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::setCheckable(bool checkable) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::setChecked(bool checked) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::setForegroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::setIcon(const image& icon) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewCell::setText(const string& text) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto pTableView = _grandparent()) {
|
||||
[[pTableView->cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTableViewCell::_grandparent() -> maybe<pTableView&> {
|
||||
if(auto parent = _parent()) return parent->_parent();
|
||||
}
|
||||
|
||||
auto pTableViewCell::_parent() -> maybe<pTableViewItem&> {
|
||||
if(auto parent = self().parentTableViewItem()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,9 +1,9 @@
|
||||
#if defined(Hiro_ListView)
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pListViewCell : pObject {
|
||||
Declare(ListViewCell, Object)
|
||||
struct pTableViewCell : pObject {
|
||||
Declare(TableViewCell, Object)
|
||||
|
||||
auto setAlignment(Alignment alignment) -> void;
|
||||
auto setBackgroundColor(Color color) -> void;
|
||||
@@ -13,8 +13,8 @@ struct pListViewCell : pObject {
|
||||
auto setIcon(const image& icon) -> void;
|
||||
auto setText(const string& text) -> void;
|
||||
|
||||
auto _grandparent() -> maybe<pListView&>;
|
||||
auto _parent() -> maybe<pListViewItem&>;
|
||||
auto _grandparent() -> maybe<pTableView&>;
|
||||
auto _parent() -> maybe<pTableViewItem&>;
|
||||
};
|
||||
|
||||
}
|
87
hiro/cocoa/widget/table-view-column.cpp
Normal file
87
hiro/cocoa/widget/table-view-column.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pTableViewColumn::construct() -> void {
|
||||
@autoreleasepool {
|
||||
if(auto tableView = _grandparent()) {
|
||||
[tableView->cocoaView reloadColumns];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTableViewColumn::destruct() -> void {
|
||||
@autoreleasepool {
|
||||
if(auto tableView = _grandparent()) {
|
||||
[tableView->cocoaView reloadColumns];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setActive() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setAlignment(Alignment alignment) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setBackgroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setEditable(bool editable) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setExpandable(bool expandable) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setFont(const Font& font) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setForegroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setHorizontalAlignment(double alignment) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setIcon(const image& icon) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setResizable(bool resizable) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setSortable(bool sortable) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setText(const string& text) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto pTableView = _grandparent()) {
|
||||
NSTableColumn* tableColumn = [[pTableView->cocoaView content] tableColumnWithIdentifier:[[NSNumber numberWithInteger:self().offset()] stringValue]];
|
||||
[[tableColumn headerCell] setStringValue:[NSString stringWithUTF8STring:text]];
|
||||
[[pTableView->cocoaView headerView] setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setVerticalAlignment(double alignment) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setVisible(bool visible) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::setWidth(signed width) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewColumn::_grandparent() -> maybe<pTableView&> {
|
||||
if(auto parent = _parent()) return parent->_parent();
|
||||
return nothing;
|
||||
}
|
||||
|
||||
auto pTableViewColumn::_parent() -> maybe<pTableViewHeader&> {
|
||||
if(auto parent = self().parentTableViewHeader()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,9 +1,9 @@
|
||||
#if defined(Hiro_ListView)
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pListViewColumn : pObject {
|
||||
Declare(ListViewColumn, Object)
|
||||
struct pTableViewColumn : pObject {
|
||||
Declare(TableViewColumn, Object)
|
||||
|
||||
auto setActive() -> void;
|
||||
auto setAlignment(Alignment alignment) -> void;
|
||||
@@ -21,8 +21,8 @@ struct pListViewColumn : pObject {
|
||||
auto setVisible(bool visible) -> void override;
|
||||
auto setWidth(signed width) -> void;
|
||||
|
||||
auto _grandparent() -> maybe<pListView&>;
|
||||
auto _parent() -> maybe<pListViewHeader&>;
|
||||
auto _grandparent() -> maybe<pTableView&>;
|
||||
auto _parent() -> maybe<pTableViewHeader&>;
|
||||
};
|
||||
|
||||
}
|
38
hiro/cocoa/widget/table-view-header.cpp
Normal file
38
hiro/cocoa/widget/table-view-header.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pTableViewHeader::construct() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewHeader::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewHeader::append(sTableViewColumn column) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewHeader::remove(sTableViewColumn column) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewHeader::setVisible(bool visible) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto pTableView = _parent()) {
|
||||
if(visible) {
|
||||
[[pTableView->cocoaView content] setHeaderView:[[[NSTableHeaderView alloc] init] autorelease]];
|
||||
} else {
|
||||
[[pTableView->cocoaView content] setHeaderView:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTableViewHeader::_parent() -> maybe<pTableView&> {
|
||||
if(auto parent = self().parentTableView()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
17
hiro/cocoa/widget/table-view-header.hpp
Normal file
17
hiro/cocoa/widget/table-view-header.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pTableViewHeader : pObject {
|
||||
Declare(TableViewHeader, Object)
|
||||
|
||||
auto append(sTableViewColumn column) -> void;
|
||||
auto remove(sTableViewColumn column) -> void;
|
||||
auto setVisible(bool visible) -> void override;
|
||||
|
||||
auto _parent() -> maybe<pTableView&>;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
51
hiro/cocoa/widget/table-view-item.cpp
Normal file
51
hiro/cocoa/widget/table-view-item.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pTableViewItem::construct() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewItem::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewItem::append(sTableViewCell cell) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto tableView = _parent()) {
|
||||
[[tableView->cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTableViewItem::remove(sTableViewCell cell) -> void {
|
||||
@autoreleasepool {
|
||||
if(auto tableView = _parent()) {
|
||||
[[tableView->cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTableViewItem::setAlignment(Alignment alignment) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewItem::setBackgroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewItem::setFocused() -> void {
|
||||
}
|
||||
|
||||
auto pTableViewItem::setForegroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewItem::setSelected(bool selected) -> void {
|
||||
}
|
||||
|
||||
auto pTableViewItem::_parent() -> maybe<pTableView&> {
|
||||
if(auto parent = self().parentTableView()) {
|
||||
if(auto self = parent->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,19 +1,19 @@
|
||||
#if defined(Hiro_ListView)
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pListViewItem : pObject {
|
||||
Declare(ListViewItem, Object)
|
||||
struct pTableViewItem : pObject {
|
||||
Declare(TableViewItem, Object)
|
||||
|
||||
auto append(sListViewCell cell) -> void;
|
||||
auto remove(sListViewCell cell) -> void;
|
||||
auto append(sTableViewCell cell) -> void;
|
||||
auto remove(sTableViewCell cell) -> void;
|
||||
auto setAlignment(Alignment alignment) -> void;
|
||||
auto setBackgroundColor(Color color) -> void;
|
||||
auto setFocused() -> void;
|
||||
auto setForegroundColor(Color color) -> void;
|
||||
auto setSelected(bool selected) -> void;
|
||||
|
||||
auto _parent() -> maybe<pListView&>;
|
||||
auto _parent() -> maybe<pTableView&>;
|
||||
};
|
||||
|
||||
}
|
@@ -1,11 +1,11 @@
|
||||
#if defined(Hiro_ListView)
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
@implementation CocoaListView : NSScrollView
|
||||
@implementation CocoaTableView : NSScrollView
|
||||
|
||||
-(id) initWith:(hiro::mListView&)listViewReference {
|
||||
-(id) initWith:(hiro::mTableView&)tableViewReference {
|
||||
if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) {
|
||||
listView = &listViewReference;
|
||||
content = [[CocoaListViewContent alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)];
|
||||
tableView = &tableViewReference;
|
||||
content = [[CocoaTableViewContent alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)];
|
||||
|
||||
[self setDocumentView:content];
|
||||
[self setBorderType:NSBezelBorder];
|
||||
@@ -34,7 +34,7 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
-(CocoaListViewContent*) content {
|
||||
-(CocoaTableViewContent*) content {
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -59,13 +59,13 @@
|
||||
[content removeTableColumn:[[content tableColumns] lastObject]];
|
||||
}
|
||||
|
||||
if(auto listViewHeader = listView->state.header) {
|
||||
for(auto& listViewColumn : listViewHeader->state.columns) {
|
||||
auto column = listViewColumn->offset();
|
||||
if(auto tableViewHeader = tableView->state.header) {
|
||||
for(auto& tableViewColumn : tableViewHeader->state.columns) {
|
||||
auto column = tableViewColumn->offset();
|
||||
|
||||
NSTableColumn* tableColumn = [[NSTableColumn alloc] initWithIdentifier:[[NSNumber numberWithInteger:column] stringValue]];
|
||||
NSTableHeaderCell* headerCell = [[NSTableHeaderCell alloc] initTextCell:[NSString stringWithUTF8String:listViewColumn->state.text]];
|
||||
CocoaListViewCell* dataCell = [[CocoaListViewCell alloc] initWith:*listView];
|
||||
NSTableHeaderCell* headerCell = [[NSTableHeaderCell alloc] initTextCell:[NSString stringWithUTF8String:tableViewColumn->state.text]];
|
||||
CocoaTableViewCell* dataCell = [[CocoaTableViewCell alloc] initWith:*tableView];
|
||||
|
||||
[dataCell setEditable:NO];
|
||||
|
||||
@@ -79,13 +79,13 @@
|
||||
}
|
||||
|
||||
-(NSInteger) numberOfRowsInTableView:(NSTableView*)table {
|
||||
return listView->state.items.size();
|
||||
return tableView->state.items.size();
|
||||
}
|
||||
|
||||
-(id) tableView:(NSTableView*)table objectValueForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row {
|
||||
if(auto listViewItem = listView->item(row)) {
|
||||
if(auto listViewCell = listViewItem->cell([[tableColumn identifier] integerValue])) {
|
||||
NSString* text = [NSString stringWithUTF8String:listViewCell->state.text];
|
||||
if(auto tableViewItem = tableView->item(row)) {
|
||||
if(auto tableViewCell = tableViewItem->cell([[tableColumn identifier] integerValue])) {
|
||||
NSString* text = [NSString stringWithUTF8String:tableViewCell->state.text];
|
||||
return @{ @"text":text }; //used by type-ahead
|
||||
}
|
||||
}
|
||||
@@ -105,14 +105,14 @@
|
||||
}
|
||||
|
||||
-(void) tableViewSelectionDidChange:(NSNotification*)notification {
|
||||
for(auto& listViewItem : listView->state.items) {
|
||||
listViewItem->state.selected = listViewItem->offset() == [content selectedRow];
|
||||
for(auto& tableViewItem : tableView->state.items) {
|
||||
tableViewItem->state.selected = tableViewItem->offset() == [content selectedRow];
|
||||
}
|
||||
listView->doChange();
|
||||
tableView->doChange();
|
||||
}
|
||||
|
||||
-(IBAction) activate:(id)sender {
|
||||
listView->doActivate();
|
||||
tableView->doActivate();
|
||||
}
|
||||
|
||||
-(IBAction) doubleAction:(id)sender {
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation CocoaListViewContent : NSTableView
|
||||
@implementation CocoaTableViewContent : NSTableView
|
||||
|
||||
-(void) keyDown:(NSEvent*)event {
|
||||
auto character = [[event characters] characterAtIndex:0];
|
||||
@@ -139,11 +139,11 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation CocoaListViewCell : NSCell
|
||||
@implementation CocoaTableViewCell : NSCell
|
||||
|
||||
-(id) initWith:(hiro::mListView&)listViewReference {
|
||||
-(id) initWith:(hiro::mTableView&)tableViewReference {
|
||||
if(self = [super initTextCell:@""]) {
|
||||
listView = &listViewReference;
|
||||
tableView = &tableViewReference;
|
||||
buttonCell = [[NSButtonCell alloc] initTextCell:@""];
|
||||
[buttonCell setButtonType:NSSwitchButton];
|
||||
[buttonCell setControlSize:NSSmallControlSize];
|
||||
@@ -159,27 +159,27 @@
|
||||
}
|
||||
|
||||
-(void) drawWithFrame:(NSRect)frame inView:(NSView*)view {
|
||||
if(auto listViewItem = listView->item([view rowAtPoint:frame.origin])) {
|
||||
if(auto listViewCell = listViewItem->cell([view columnAtPoint:frame.origin])) {
|
||||
if(auto tableViewItem = tableView->item([view rowAtPoint:frame.origin])) {
|
||||
if(auto tableViewCell = tableViewItem->cell([view columnAtPoint:frame.origin])) {
|
||||
NSColor* backgroundColor = nil;
|
||||
if([self isHighlighted]) backgroundColor = [NSColor alternateSelectedControlColor];
|
||||
else if(!listView->enabled(true)) backgroundColor = [NSColor controlBackgroundColor];
|
||||
else if(auto color = listViewCell->state.backgroundColor) backgroundColor = NSMakeColor(color);
|
||||
else if(!tableView->enabled(true)) backgroundColor = [NSColor controlBackgroundColor];
|
||||
else if(auto color = tableViewCell->state.backgroundColor) backgroundColor = NSMakeColor(color);
|
||||
else backgroundColor = [NSColor controlBackgroundColor];
|
||||
|
||||
[backgroundColor set];
|
||||
[NSBezierPath fillRect:frame];
|
||||
|
||||
if(listViewCell->state.checkable) {
|
||||
if(tableViewCell->state.checkable) {
|
||||
[buttonCell setHighlighted:YES];
|
||||
[buttonCell setState:(listViewCell->state.checked ? NSOnState : NSOffState)];
|
||||
[buttonCell setState:(tableViewCell->state.checked ? NSOnState : NSOffState)];
|
||||
[buttonCell drawWithFrame:frame inView:view];
|
||||
frame.origin.x += frame.size.height + 2;
|
||||
frame.size.width -= frame.size.height + 2;
|
||||
}
|
||||
|
||||
if(listViewCell->state.icon) {
|
||||
NSImage* image = NSMakeImage(listViewCell->state.icon, frame.size.height, frame.size.height);
|
||||
if(tableViewCell->state.icon) {
|
||||
NSImage* image = NSMakeImage(tableViewCell->state.icon, frame.size.height, frame.size.height);
|
||||
[[NSGraphicsContext currentContext] saveGraphicsState];
|
||||
NSRect targetRect = NSMakeRect(frame.origin.x, frame.origin.y, frame.size.height, frame.size.height);
|
||||
NSRect sourceRect = NSMakeRect(0, 0, [image size].width, [image size].height);
|
||||
@@ -189,21 +189,21 @@
|
||||
frame.size.width -= frame.size.height + 2;
|
||||
}
|
||||
|
||||
if(listViewCell->state.text) {
|
||||
if(tableViewCell->state.text) {
|
||||
NSMutableParagraphStyle* paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
paragraphStyle.alignment = NSTextAlignmentCenter;
|
||||
if(listViewCell->state.alignment.horizontal() < 0.333) paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||
if(listViewCell->state.alignment.horizontal() > 0.666) paragraphStyle.alignment = NSTextAlignmentRight;
|
||||
if(tableViewCell->state.alignment.horizontal() < 0.333) paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||
if(tableViewCell->state.alignment.horizontal() > 0.666) paragraphStyle.alignment = NSTextAlignmentRight;
|
||||
NSColor* foregroundColor = nil;
|
||||
if([self isHighlighted]) foregroundColor = [NSColor alternateSelectedControlTextColor];
|
||||
else if(!listView->enabled(true)) foregroundColor = [NSColor disabledControlTextColor];
|
||||
else if(auto color = listViewCell->state.foregroundColor) foregroundColor = NSMakeColor(color);
|
||||
else if(!tableView->enabled(true)) foregroundColor = [NSColor disabledControlTextColor];
|
||||
else if(auto color = tableViewCell->state.foregroundColor) foregroundColor = NSMakeColor(color);
|
||||
else foregroundColor = [NSColor textColor];
|
||||
NSString* text = [NSString stringWithUTF8String:listViewCell->state.text];
|
||||
NSString* text = [NSString stringWithUTF8String:tableViewCell->state.text];
|
||||
[text drawInRect:frame withAttributes:@{
|
||||
NSBackgroundColorAttributeName:backgroundColor,
|
||||
NSForegroundColorAttributeName:foregroundColor,
|
||||
NSFontAttributeName:hiro::pFont::create(listViewCell->font(true)),
|
||||
NSFontAttributeName:hiro::pFont::create(tableViewCell->font(true)),
|
||||
NSParagraphStyleAttributeName:paragraphStyle
|
||||
}];
|
||||
}
|
||||
@@ -233,10 +233,10 @@
|
||||
NSPoint point = [view convertPointFromBase:[nextEvent locationInWindow]];
|
||||
NSRect rect = NSMakeRect(frame.origin.x, frame.origin.y, frame.size.height, frame.size.height);
|
||||
if(NSMouseInRect(point, rect, [view isFlipped])) {
|
||||
if(auto listViewItem = listView->item([view rowAtPoint:point])) {
|
||||
if(auto listViewCell = listViewItem->cell([view columnAtPoint:point])) {
|
||||
listViewCell->state.checked = !listViewCell->state.checked;
|
||||
listView->doToggle(listViewCell->instance);
|
||||
if(auto tableViewItem = tableView->item([view rowAtPoint:point])) {
|
||||
if(auto tableViewCell = tableViewItem->cell([view columnAtPoint:point])) {
|
||||
tableViewCell->state.checked = !tableViewCell->state.checked;
|
||||
tableView->doToggle(tableViewCell->instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,9 +255,9 @@
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pListView::construct() -> void {
|
||||
auto pTableView::construct() -> void {
|
||||
@autoreleasepool {
|
||||
cocoaView = cocoaListView = [[CocoaListView alloc] initWith:self()];
|
||||
cocoaView = cocoaTableView = [[CocoaTableView alloc] initWith:self()];
|
||||
pWidget::construct();
|
||||
|
||||
setAlignment(state().alignment);
|
||||
@@ -269,14 +269,14 @@ auto pListView::construct() -> void {
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::destruct() -> void {
|
||||
auto pTableView::destruct() -> void {
|
||||
@autoreleasepool {
|
||||
[cocoaView removeFromSuperview];
|
||||
[cocoaView release];
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::append(sListViewHeader header) -> void {
|
||||
auto pTableView::append(sTableViewHeader header) -> void {
|
||||
@autoreleasepool {
|
||||
[cocoaView reloadColumns];
|
||||
|
||||
@@ -284,25 +284,25 @@ auto pListView::append(sListViewHeader header) -> void {
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::append(sListViewItem item) -> void {
|
||||
auto pTableView::append(sTableViewItem item) -> void {
|
||||
@autoreleasepool {
|
||||
[[cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::remove(sListViewHeader header) -> void {
|
||||
auto pTableView::remove(sTableViewHeader header) -> void {
|
||||
@autoreleasepool {
|
||||
[cocoaView reloadColumns];
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::remove(sListViewItem item) -> void {
|
||||
auto pTableView::remove(sTableViewItem item) -> void {
|
||||
@autoreleasepool {
|
||||
[[cocoaView content] reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::resizeColumns() -> void {
|
||||
auto pTableView::resizeColumns() -> void {
|
||||
@autoreleasepool {
|
||||
if(auto& header = state().header) {
|
||||
vector<int> widths;
|
||||
@@ -333,71 +333,71 @@ auto pListView::resizeColumns() -> void {
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::setAlignment(Alignment alignment) -> void {
|
||||
auto pTableView::setAlignment(Alignment alignment) -> void {
|
||||
}
|
||||
|
||||
auto pListView::setBackgroundColor(Color color) -> void {
|
||||
auto pTableView::setBackgroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListView::setBatchable(bool batchable) -> void {
|
||||
auto pTableView::setBatchable(bool batchable) -> void {
|
||||
@autoreleasepool {
|
||||
[[cocoaView content] setAllowsMultipleSelection:(batchable ? YES : NO)];
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::setBordered(bool bordered) -> void {
|
||||
auto pTableView::setBordered(bool bordered) -> void {
|
||||
}
|
||||
|
||||
auto pListView::setEnabled(bool enabled) -> void {
|
||||
auto pTableView::setEnabled(bool enabled) -> void {
|
||||
pWidget::setEnabled(enabled);
|
||||
@autoreleasepool {
|
||||
[[cocoaView content] setEnabled:enabled];
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::setFont(const Font& font) -> void {
|
||||
auto pTableView::setFont(const Font& font) -> void {
|
||||
@autoreleasepool {
|
||||
[cocoaView setFont:pFont::create(font)];
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::setForegroundColor(Color color) -> void {
|
||||
auto pTableView::setForegroundColor(Color color) -> void {
|
||||
}
|
||||
|
||||
auto pListView::_cellWidth(uint row, uint column) -> uint {
|
||||
auto pTableView::_cellWidth(uint row, uint column) -> uint {
|
||||
uint width = 8;
|
||||
if(auto pListViewItem = self().item(row)) {
|
||||
if(auto pListViewCell = pListViewItem->cell(column)) {
|
||||
if(pListViewCell->state.checkable) {
|
||||
if(auto pTableViewItem = self().item(row)) {
|
||||
if(auto pTableViewCell = pTableViewItem->cell(column)) {
|
||||
if(pTableViewCell->state.checkable) {
|
||||
width += 24;
|
||||
}
|
||||
if(auto& icon = pListViewCell->state.icon) {
|
||||
if(auto& icon = pTableViewCell->state.icon) {
|
||||
width += icon.width() + 2;
|
||||
}
|
||||
if(auto& text = pListViewCell->state.text) {
|
||||
width += pFont::size(pListViewCell->font(true), text).width();
|
||||
if(auto& text = pTableViewCell->state.text) {
|
||||
width += pFont::size(pTableViewCell->font(true), text).width();
|
||||
}
|
||||
}
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
auto pListView::_columnWidth(uint column) -> uint {
|
||||
auto pTableView::_columnWidth(uint column) -> uint {
|
||||
uint width = 8;
|
||||
if(auto& header = state().header) {
|
||||
if(auto pListViewColumn = header->column(column)) {
|
||||
if(auto& icon = pListViewColumn->state.icon) {
|
||||
if(auto pTableViewColumn = header->column(column)) {
|
||||
if(auto& icon = pTableViewColumn->state.icon) {
|
||||
width += icon.width() + 2;
|
||||
}
|
||||
if(auto& text = pListViewColumn->state.text) {
|
||||
width += pFont::size(pListViewColumn->font(true), text).width();
|
||||
if(auto& text = pTableViewColumn->state.text) {
|
||||
width += pFont::size(pTableViewColumn->font(true), text).width();
|
||||
}
|
||||
}
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
auto pListView::_width(uint column) -> uint {
|
||||
auto pTableView::_width(uint column) -> uint {
|
||||
if(auto& header = state().header) {
|
||||
if(auto width = header->column(column).width()) return width;
|
||||
uint width = 1;
|
||||
@@ -412,20 +412,20 @@ auto pListView::_width(uint column) -> uint {
|
||||
}
|
||||
|
||||
/*
|
||||
auto pListView::autoSizeColumns() -> void {
|
||||
auto pTableView::autoSizeColumns() -> void {
|
||||
@autoreleasepool {
|
||||
if(listView.state.checkable) {
|
||||
if(tableView.state.checkable) {
|
||||
NSTableColumn* tableColumn = [[cocoaView content] tableColumnWithIdentifier:@"check"];
|
||||
[tableColumn setWidth:20.0];
|
||||
}
|
||||
|
||||
unsigned height = [[cocoaView content] rowHeight];
|
||||
for(unsigned column = 0; column < max(1u, listView.state.headerText.size()); column++) {
|
||||
for(unsigned column = 0; column < max(1u, tableView.state.headerText.size()); column++) {
|
||||
NSTableColumn* tableColumn = [[cocoaView content] tableColumnWithIdentifier:[[NSNumber numberWithInteger:column] stringValue]];
|
||||
unsigned minimumWidth = pFont::size([[tableColumn headerCell] font], listView.state.headerText(column)).width + 4;
|
||||
for(unsigned row = 0; row < listView.state.text.size(); row++) {
|
||||
unsigned width = pFont::size([cocoaView font], listView.state.text(row)(column)).width + 2;
|
||||
if(listView.state.image(row)(height).empty() == false) width += height + 2;
|
||||
unsigned minimumWidth = pFont::size([[tableColumn headerCell] font], tableView.state.headerText(column)).width + 4;
|
||||
for(unsigned row = 0; row < tableView.state.text.size(); row++) {
|
||||
unsigned width = pFont::size([cocoaView font], tableView.state.text(row)(column)).width + 2;
|
||||
if(tableView.state.image(row)(height).empty() == false) width += height + 2;
|
||||
if(width > minimumWidth) minimumWidth = width;
|
||||
}
|
||||
[tableColumn setWidth:minimumWidth];
|
||||
@@ -435,7 +435,7 @@ auto pListView::autoSizeColumns() -> void {
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::setSelected(bool selected) -> void {
|
||||
auto pTableView::setSelected(bool selected) -> void {
|
||||
@autoreleasepool {
|
||||
if(selected == false) {
|
||||
[[cocoaView content] deselectAll:nil];
|
||||
@@ -443,7 +443,7 @@ auto pListView::setSelected(bool selected) -> void {
|
||||
}
|
||||
}
|
||||
|
||||
auto pListView::setSelection(unsigned selection) -> void {
|
||||
auto pTableView::setSelection(unsigned selection) -> void {
|
||||
@autoreleasepool {
|
||||
[[cocoaView content] selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(selection, 1)] byExtendingSelection:NO];
|
||||
}
|
@@ -1,16 +1,16 @@
|
||||
#if defined(Hiro_ListView)
|
||||
#if defined(Hiro_TableView)
|
||||
|
||||
@class CocoaListViewContent;
|
||||
@class CocoaTableViewContent;
|
||||
|
||||
@interface CocoaListView : NSScrollView <NSTableViewDelegate, NSTableViewDataSource> {
|
||||
@interface CocoaTableView : NSScrollView <NSTableViewDelegate, NSTableViewDataSource> {
|
||||
@public
|
||||
hiro::mListView* listView;
|
||||
CocoaListViewContent* content;
|
||||
hiro::mTableView* tableView;
|
||||
CocoaTableViewContent* content;
|
||||
NSFont* font;
|
||||
}
|
||||
-(id) initWith:(hiro::mListView&)listView;
|
||||
-(id) initWith:(hiro::mTableView&)tableView;
|
||||
-(void) dealloc;
|
||||
-(CocoaListViewContent*) content;
|
||||
-(CocoaTableViewContent*) content;
|
||||
-(NSFont*) font;
|
||||
-(void) setFont:(NSFont*)font;
|
||||
-(void) reloadColumns;
|
||||
@@ -24,16 +24,16 @@
|
||||
-(IBAction) doubleAction:(id)sender;
|
||||
@end
|
||||
|
||||
@interface CocoaListViewContent : NSTableView {
|
||||
@interface CocoaTableViewContent : NSTableView {
|
||||
}
|
||||
-(void) keyDown:(NSEvent*)event;
|
||||
@end
|
||||
|
||||
@interface CocoaListViewCell : NSCell {
|
||||
hiro::mListView* listView;
|
||||
@interface CocoaTableViewCell : NSCell {
|
||||
hiro::mTableView* tableView;
|
||||
NSButtonCell* buttonCell;
|
||||
}
|
||||
-(id) initWith:(hiro::mListView&)listViewReference;
|
||||
-(id) initWith:(hiro::mTableView&)tableViewReference;
|
||||
-(NSString*) stringValue;
|
||||
-(void) drawWithFrame:(NSRect)frame inView:(NSView*)view;
|
||||
-(NSUInteger) hitTestForEvent:(NSEvent*)event inRect:(NSRect)frame ofView:(NSView*)view;
|
||||
@@ -43,13 +43,13 @@
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pListView : pWidget {
|
||||
Declare(ListView, Widget)
|
||||
struct pTableView : pWidget {
|
||||
Declare(TableView, Widget)
|
||||
|
||||
auto append(sListViewHeader header) -> void;
|
||||
auto append(sListViewItem item) -> void;
|
||||
auto remove(sListViewHeader header) -> void;
|
||||
auto remove(sListViewItem item) -> void;
|
||||
auto append(sTableViewHeader header) -> void;
|
||||
auto append(sTableViewItem item) -> void;
|
||||
auto remove(sTableViewHeader header) -> void;
|
||||
auto remove(sTableViewItem item) -> void;
|
||||
auto resizeColumns() -> void;
|
||||
auto setAlignment(Alignment alignment) -> void;
|
||||
auto setBackgroundColor(Color color) -> void;
|
||||
@@ -63,7 +63,7 @@ struct pListView : pWidget {
|
||||
auto _columnWidth(uint column) -> uint;
|
||||
auto _width(uint column) -> uint;
|
||||
|
||||
CocoaListView* cocoaListView = nullptr;
|
||||
CocoaTableView* cocoaTableView = nullptr;
|
||||
};
|
||||
|
||||
}
|
@@ -24,7 +24,7 @@
|
||||
|
||||
-(BOOL) performDragOperation:(id<NSDraggingInfo>)sender {
|
||||
lstring paths = DropPaths(sender);
|
||||
if(paths.empty()) return NO;
|
||||
if(!paths) return NO;
|
||||
viewport->doDrop(paths);
|
||||
return YES;
|
||||
}
|
||||
|
@@ -122,7 +122,7 @@
|
||||
|
||||
-(BOOL) performDragOperation:(id<NSDraggingInfo>)sender {
|
||||
lstring paths = DropPaths(sender);
|
||||
if(paths.empty()) return NO;
|
||||
if(!paths) return NO;
|
||||
window->doDrop(paths);
|
||||
return YES;
|
||||
}
|
||||
|
Reference in New Issue
Block a user