Focus not returning after dragdrop
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Focus not returning after dragdrop
Has anyone else noticed this odd behaviour.
After performing a dragdrop of an image, the screen becomes unresponsive to the mouse. Responsiveness is only restored by clicking the titlebar or another window and then returning to the window where the dragdrop occurred. It is a great nuisance.
The following is in the image's handler.
on dragEnter
set the dragAction to "copy"
end dragEnter
command dragdrop
doDragDrop the long id of me
end dragdrop
-- this code is held elsewhere
command doDragEnter
set the dragAction to "copy"
end doDragEnter
command doDragDrop theImage
put the dragData["files"] into theFile
put url ("binfile:" & theFile) into theImageData
mPlaceImage theImage,theImageData
end doDragDrop
command mPlaceImage thePlaceHolder,theImageData
lock screen
put the width of thePlaceHolder into thePDim
put the left of thePlaceHolder into theLeft
put the top of thePlaceHolder into theTop
set the text of thePlaceHolder to theImageData
put the width of thePlaceHolder into theImageWidth
put the height of thePlaceHolder into theImageHeight
if theImageWidth > theImageHeight then
put thePDim into theNewWidth
put theImageHeight * thePDim/theImageWidth into theNewHeight
else
put thePDim into theNewHeight
put theImageWidth * thePDim/theImageHeight into theNewWidth
end if
set the width of thePlaceHolder to theNewWidth
set the height of thePlaceHolder to theNewHeight
set the left of thePlaceHolder to theLeft
set the top of thePlaceHolder to theTop
unlock screen
end mPlaceImage
Using Livecode 7.1.1 rc2 on a MacAir with El Capitan
After performing a dragdrop of an image, the screen becomes unresponsive to the mouse. Responsiveness is only restored by clicking the titlebar or another window and then returning to the window where the dragdrop occurred. It is a great nuisance.
The following is in the image's handler.
on dragEnter
set the dragAction to "copy"
end dragEnter
command dragdrop
doDragDrop the long id of me
end dragdrop
-- this code is held elsewhere
command doDragEnter
set the dragAction to "copy"
end doDragEnter
command doDragDrop theImage
put the dragData["files"] into theFile
put url ("binfile:" & theFile) into theImageData
mPlaceImage theImage,theImageData
end doDragDrop
command mPlaceImage thePlaceHolder,theImageData
lock screen
put the width of thePlaceHolder into thePDim
put the left of thePlaceHolder into theLeft
put the top of thePlaceHolder into theTop
set the text of thePlaceHolder to theImageData
put the width of thePlaceHolder into theImageWidth
put the height of thePlaceHolder into theImageHeight
if theImageWidth > theImageHeight then
put thePDim into theNewWidth
put theImageHeight * thePDim/theImageWidth into theNewHeight
else
put thePDim into theNewHeight
put theImageWidth * thePDim/theImageHeight into theNewWidth
end if
set the width of thePlaceHolder to theNewWidth
set the height of thePlaceHolder to theNewHeight
set the left of thePlaceHolder to theLeft
set the top of thePlaceHolder to theTop
unlock screen
end mPlaceImage
Using Livecode 7.1.1 rc2 on a MacAir with El Capitan
Re: Focus not returning after dragdrop
Hi skindoc4,
I think this is correct behaviour!
Other apps also show this, e.g. drag and drop anything from the FInder to an open TextEdti document.
TextEdit will not come into foreground after dropping something onto it, all this happens in the background.
Maybe you can add an AppleScript which will bring your app into the foregound again dorectly after dropping?
Best
Klaus
I think this is correct behaviour!
Other apps also show this, e.g. drag and drop anything from the FInder to an open TextEdti document.
TextEdit will not come into foreground after dropping something onto it, all this happens in the background.
Maybe you can add an AppleScript which will bring your app into the foregound again dorectly after dropping?
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Hi Klaus
I see it now. Thanks. Applescript sounds like an option. I shall have play.
Cheers
Alex
I see it now. Thanks. Applescript sounds like an option. I shall have play.
Cheers
Alex
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Nothing I have tried so far works. I have to manually click the titlebar to get anything on my sheeted substack to work. Applescript doesn't do it - at least that which I have tried so far. The window just remains hung until I click in the titlebar or in the finder or somewhere other than where I want to click, namely in the window where I have just dragged an image.
I have another problem. The buttons which switch on tools (brush, pencil) do not work in either sheet or modal mode but only in editable window mode??
When I add an image to a patient's notes, I want this to be in a modal modal mode so that when I close the image inserting stack, I return to the text field in the patient's notes. So this gotcha is in the way at the moment.
Any advice gratefully received.
Cheers
Alex
community LC 7.1.1 rc2 on El Capitan
I have another problem. The buttons which switch on tools (brush, pencil) do not work in either sheet or modal mode but only in editable window mode??
When I add an image to a patient's notes, I want this to be in a modal modal mode so that when I close the image inserting stack, I return to the text field in the patient's notes. So this gotcha is in the way at the moment.
Any advice gratefully received.
Cheers
Alex
community LC 7.1.1 rc2 on El Capitan
Re: Focus not returning after dragdrop
Hi Alex,
If in development mode you need to open all your stack you want to work on in TOPLEVEL mode!
Best
Klaus
This is exspected and correct behaviour, modal stacks, and sheets are modal "the Mac way", are not editable!skindoc4 wrote:The buttons which switch on tools (brush, pencil) do not work in either sheet or modal mode but only in editable window mode?
If in development mode you need to open all your stack you want to work on in TOPLEVEL mode!
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Thanks Klaus
I shall tell you what I want to do. Say I want to describe the distribution of a person's back pain. I want to be able to import a generic outline image of the human body and mark the areas where the patient reports pain, and then move the image into the patient's notes. All this I can do when the stack is the top stack but not as you say when the stack is modal or sheet. The advantage of using modal or sheet is that the stack I am working on stays at the toplevel until I am finished with it which is a much neater solution than having stray windows floating on the desktop.
I found the section in the User Guide which explains all this and yes you are right - only the browse tool is available in other than editable windows. I have an idea which will make it work in a neat fashion. Thanks for your guidance.
Cheers
Alex
I shall tell you what I want to do. Say I want to describe the distribution of a person's back pain. I want to be able to import a generic outline image of the human body and mark the areas where the patient reports pain, and then move the image into the patient's notes. All this I can do when the stack is the top stack but not as you say when the stack is modal or sheet. The advantage of using modal or sheet is that the stack I am working on stays at the toplevel until I am finished with it which is a much neater solution than having stray windows floating on the desktop.
I found the section in the User Guide which explains all this and yes you are right - only the browse tool is available in other than editable windows. I have an idea which will make it work in a neat fashion. Thanks for your guidance.
Cheers
Alex
Re: Focus not returning after dragdrop
Hi Alex,
just to be sure: YOU are using the LC IDE, but your customers will probably not! (Will they?)
So your users can only do what you let them do via your scripting.
And you can script to let the user do all this even in a modal window, but it's up to you!
Best
Klaus
just to be sure: YOU are using the LC IDE, but your customers will probably not! (Will they?)
So your users can only do what you let them do via your scripting.
And you can script to let the user do all this even in a modal window, but it's up to you!
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Hi Klaus
I am the only customer since I long ago decided that I preferred being a clinician than a full time supporter of software that I write. I did enough of that when I ran a medical practice with software I wrote in 4D some years ago. But yes I do use a standalone version when I am seeing patients.
So far I have found the same issues in the IDE as in the standalone so I do not quite know what you mean about being able to script the use of the brush and pencil tools in modal/screen/palette windows as I have not found a way.
Cheers
Alex
I am the only customer since I long ago decided that I preferred being a clinician than a full time supporter of software that I write. I did enough of that when I ran a medical practice with software I wrote in 4D some years ago. But yes I do use a standalone version when I am seeing patients.
So far I have found the same issues in the IDE as in the standalone so I do not quite know what you mean about being able to script the use of the brush and pencil tools in modal/screen/palette windows as I have not found a way.
Cheers
Alex
Re: Focus not returning after dragdrop
Hi Alex,
Best
Klaus
it IS possible somehow, that's for sure, but probably not worth the enormous efforts, at least I would not want to do itskindoc4 wrote:...So far I have found the same issues in the IDE as in the standalone so I do not quite know what you mean about being able to script the use of the brush and pencil tools in modal/screen/palette windows as I have not found a way.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Yes Klaus
Desktop real estate is at a premium on my MacAir which I use in my clinical work so I am pursuing alternative ways of achieving my outcome.
Thanks for all your advice.
Cheers
Alex
Desktop real estate is at a premium on my MacAir which I use in my clinical work so I am pursuing alternative ways of achieving my outcome.
Thanks for all your advice.
Cheers
Alex
-
- VIP Livecode Opensource Backer
- Posts: 4001
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Focus not returning after dragdrop
Hi Alex,
I thought I give it a try what I understood you wanted to do and made a demo stack that opens a substack as sheet on MacOSX. The substack has an image that you can draw with graphics on, once you are done you can export the image (currently to the main stack)
The stack I used is a slight modifications of
http://livecodeshare.runrev.com/stack/3 ... on-Graphic
an old stack I made.
you can choose the color of the graphic, the line size, transparency of the graphic you use to annotate the image. Use button "topLevel" to get out of sheet mode. Use button "exportToMain" to export an image to the main stack. Use button "setModelImage" to set different images. (currently only one image is stored as custom property of the substack, so the button is actually "useless" but shows how to have different images to annotate).
You can option-click on a graphic to select the graphic and move it with the arrowKeys. Opaque closes the polygon and the background color will be visible (probably not so useful in your case.
I tested in LC 7.1.1 rc1, the stack is in LC 5.5 format. It is a long time since I used sheet, but Livecode is still a bit finicky with sheet, sometimes it took the properties inspector to show the sheet. If that happens close the properties inspector.
You would probably have to adapt the substack to your needs but basically I think it lets you annotate an image.
Kind regards
Bernd
I thought I give it a try what I understood you wanted to do and made a demo stack that opens a substack as sheet on MacOSX. The substack has an image that you can draw with graphics on, once you are done you can export the image (currently to the main stack)
The stack I used is a slight modifications of
http://livecodeshare.runrev.com/stack/3 ... on-Graphic
an old stack I made.
you can choose the color of the graphic, the line size, transparency of the graphic you use to annotate the image. Use button "topLevel" to get out of sheet mode. Use button "exportToMain" to export an image to the main stack. Use button "setModelImage" to set different images. (currently only one image is stored as custom property of the substack, so the button is actually "useless" but shows how to have different images to annotate).
You can option-click on a graphic to select the graphic and move it with the arrowKeys. Opaque closes the polygon and the background color will be visible (probably not so useful in your case.
I tested in LC 7.1.1 rc1, the stack is in LC 5.5 format. It is a long time since I used sheet, but Livecode is still a bit finicky with sheet, sometimes it took the properties inspector to show the sheet. If that happens close the properties inspector.
You would probably have to adapt the substack to your needs but basically I think it lets you annotate an image.
Kind regards
Bernd
- Attachments
-
- theMain.livecode.zip
- (15.34 KiB) Downloaded 235 times
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Hi Bernd
Thanks so much for this. I shall have a play.
Cheers
Alex
Thanks so much for this. I shall have a play.
Cheers
Alex
-
- VIP Livecode Opensource Backer
- Posts: 4001
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Focus not returning after dragdrop
Hi Alex,
did you see that I attached a stack to the previous message?
Kind regards
Bernd
did you see that I attached a stack to the previous message?
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Actually Bernd I had not seen it - thank you.
Alex
Alex
-
- VIP Livecode Opensource Backer
- Posts: 77
- Joined: Mon Jul 07, 2008 1:22 am
- Location: Brisbane, Queensland
Re: Focus not returning after dragdrop
Neat. There are clearly a few parts of the language that I need to learn.
Cheers
Alex
Cheers
Alex