Skip to content

Commit b50f82e

Browse files
FitzerIRLMichael Fiess
authored andcommitted
Enhanced Drag and Drop support (macOS) (#1754)
* Enhanced Drag and Drop support * Adding Drag'n'Drop TEXT support ... via new insertText() method * Corrected some behaviors * Correction to URL from native * Fixes to Edit.js * No focus - FILE drop - behavior * Fix leak * Tidy up WS * Fix crash * Adding drag&drop highlight to textbox * Changes per PR comments
1 parent a82712a commit b50f82e

File tree

17 files changed

+1080
-451
lines changed

17 files changed

+1080
-451
lines changed

examples/pxScene2d/src/Spark.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,38 @@ class sceneWindow : public pxWindow, public pxIViewContainer
356356
EXITSCENELOCK()
357357
}
358358

359+
virtual void onDragMove(int32_t x, int32_t y, int32_t type)
360+
{
361+
ENTERSCENELOCK()
362+
if (mView)
363+
mView->onDragMove(x, y, type);
364+
EXITSCENELOCK()
365+
}
366+
367+
virtual void onDragEnter(int32_t x, int32_t y, int32_t type)
368+
{
369+
ENTERSCENELOCK()
370+
if (mView)
371+
mView->onDragEnter(x, y, type);
372+
EXITSCENELOCK()
373+
}
374+
375+
virtual void onDragLeave(int32_t x, int32_t y, int32_t type)
376+
{
377+
ENTERSCENELOCK()
378+
if (mView)
379+
mView->onDragLeave(x, y, type);
380+
EXITSCENELOCK()
381+
}
382+
383+
virtual void onDragDrop(int32_t x, int32_t y, int32_t type, const char* dropped)
384+
{
385+
ENTERSCENELOCK()
386+
if (mView)
387+
mView->onDragDrop(x, y, type, dropped);
388+
EXITSCENELOCK()
389+
}
390+
359391
virtual void onScrollWheel(float dx, float dy)
360392
{
361393
ENTERSCENELOCK()

examples/pxScene2d/src/about.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ px.import({ scene: 'px:scene.1.js' }).then( function importsAreReady(imports)
5858
font: fontRes, pixelSize: 12, wordWrap: true,
5959
text: "Press SPACE to dismiss",
6060
alignHorizontal: scene.alignHorizontal.CENTER,
61-
alignVertical: scene.alignVertical.CENTER})
61+
alignVertical: scene.alignVertical.CENTER});
62+
6263
var dismissM = fontRes.measureText(12, dismissTXT.text);
6364
dismissTXT.h = dismissM.h;
6465
dismissTXT.w = dismissM.w;

0 commit comments

Comments
 (0)