@@ -48077,6 +48077,11 @@ void TableListBoxModel::listWasScrolled() | |||
{ | |||
} | |||
const String TableListBoxModel::getCellTooltip (int /*rowNumber*/, int /*columnId*/) | |||
{ | |||
return String::empty; | |||
} | |||
const String TableListBoxModel::getDragSourceDescription (const SparseSet<int>&) | |||
{ | |||
return String::empty; | |||
@@ -262439,6 +262444,8 @@ END_JUCE_NAMESPACE | |||
- (BOOL) resignFirstResponder; | |||
- (BOOL) acceptsFirstResponder; | |||
- (void) asyncRepaint: (id) rect; | |||
- (NSArray*) getSupportedDragTypes; | |||
- (BOOL) sendDragCallback: (int) type sender: (id <NSDraggingInfo>) sender; | |||
- (NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender; | |||
@@ -262559,7 +262566,7 @@ public: | |||
NSWindow* window; | |||
JuceNSView* view; | |||
bool isSharedWindow, fullScreen; | |||
bool isSharedWindow, fullScreen, insideDrawRect; | |||
}; | |||
END_JUCE_NAMESPACE | |||
@@ -262718,6 +262725,12 @@ END_JUCE_NAMESPACE | |||
owner->redirectMovedOrResized(); | |||
} | |||
- (void) asyncRepaint: (id) rect | |||
{ | |||
NSRect* r = (NSRect*) [((NSData*) rect) bytes]; | |||
[self setNeedsDisplayInRect: *r]; | |||
} | |||
- (void) keyDown: (NSEvent*) ev | |||
{ | |||
if (owner == 0 || ! owner->redirectKeyDown (ev)) | |||
@@ -263111,7 +263124,8 @@ NSViewComponentPeer::NSViewComponentPeer (Component* const component, | |||
window (0), | |||
view (0), | |||
isSharedWindow (viewToAttachTo != 0), | |||
fullScreen (false) | |||
fullScreen (false), | |||
insideDrawRect (false) | |||
{ | |||
NSRect r; | |||
r.origin.x = 0; | |||
@@ -263792,7 +263806,10 @@ void NSViewComponentPeer::drawRect (NSRect r) | |||
if (context.reduceClipRegion (clip)) | |||
{ | |||
insideDrawRect = true; | |||
handlePaint (context); | |||
insideDrawRect = false; | |||
temp.draw (r.origin.x, r.origin.y, clip, originX, originY); | |||
} | |||
} | |||
@@ -263834,9 +263851,19 @@ void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable | |||
void NSViewComponentPeer::repaint (int x, int y, int w, int h) | |||
{ | |||
[view setNeedsDisplayInRect: | |||
NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), | |||
(float) w, (float) h)]; | |||
NSRect r = NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), | |||
(float) w, (float) h); | |||
if (insideDrawRect) | |||
{ | |||
[view performSelectorOnMainThread: @selector (asyncRepaint:) | |||
withObject: [NSData dataWithBytes: &r length: sizeof (r)] | |||
waitUntilDone: NO]; | |||
} | |||
else | |||
{ | |||
[view setNeedsDisplayInRect: r]; | |||
} | |||
} | |||
void NSViewComponentPeer::performAnyPendingRepaintsNow() | |||
@@ -566,6 +566,11 @@ void TableListBoxModel::listWasScrolled() | |||
{ | |||
} | |||
const String TableListBoxModel::getCellTooltip (int /*rowNumber*/, int /*columnId*/) | |||
{ | |||
return String::empty; | |||
} | |||
const String TableListBoxModel::getDragSourceDescription (const SparseSet<int>&) | |||
{ | |||
return String::empty; | |||
@@ -76,6 +76,8 @@ END_JUCE_NAMESPACE | |||
- (BOOL) resignFirstResponder; | |||
- (BOOL) acceptsFirstResponder; | |||
- (void) asyncRepaint: (id) rect; | |||
- (NSArray*) getSupportedDragTypes; | |||
- (BOOL) sendDragCallback: (int) type sender: (id <NSDraggingInfo>) sender; | |||
- (NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender; | |||
@@ -202,7 +204,7 @@ public: | |||
NSWindow* window; | |||
JuceNSView* view; | |||
bool isSharedWindow, fullScreen; | |||
bool isSharedWindow, fullScreen, insideDrawRect; | |||
}; | |||
//============================================================================== | |||
@@ -364,6 +366,12 @@ END_JUCE_NAMESPACE | |||
owner->redirectMovedOrResized(); | |||
} | |||
- (void) asyncRepaint: (id) rect | |||
{ | |||
NSRect* r = (NSRect*) [((NSData*) rect) bytes]; | |||
[self setNeedsDisplayInRect: *r]; | |||
} | |||
//============================================================================== | |||
- (void) keyDown: (NSEvent*) ev | |||
{ | |||
@@ -765,7 +773,8 @@ NSViewComponentPeer::NSViewComponentPeer (Component* const component, | |||
window (0), | |||
view (0), | |||
isSharedWindow (viewToAttachTo != 0), | |||
fullScreen (false) | |||
fullScreen (false), | |||
insideDrawRect (false) | |||
{ | |||
NSRect r; | |||
r.origin.x = 0; | |||
@@ -1450,7 +1459,10 @@ void NSViewComponentPeer::drawRect (NSRect r) | |||
if (context.reduceClipRegion (clip)) | |||
{ | |||
insideDrawRect = true; | |||
handlePaint (context); | |||
insideDrawRect = false; | |||
temp.draw (r.origin.x, r.origin.y, clip, originX, originY); | |||
} | |||
} | |||
@@ -1494,9 +1506,19 @@ void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable | |||
//============================================================================== | |||
void NSViewComponentPeer::repaint (int x, int y, int w, int h) | |||
{ | |||
[view setNeedsDisplayInRect: | |||
NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), | |||
(float) w, (float) h)]; | |||
NSRect r = NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), | |||
(float) w, (float) h); | |||
if (insideDrawRect) | |||
{ | |||
[view performSelectorOnMainThread: @selector (asyncRepaint:) | |||
withObject: [NSData dataWithBytes: &r length: sizeof (r)] | |||
waitUntilDone: NO]; | |||
} | |||
else | |||
{ | |||
[view setNeedsDisplayInRect: r]; | |||
} | |||
} | |||
void NSViewComponentPeer::performAnyPendingRepaintsNow() | |||