Drag/Drop Text Not working
Drag/Drop Text Not working
Can some member tell me why the following code is not working now.
The exact same code in another program written some time ago
compiled quite O.K under PB5.11
Here is my entries in the window creation section.
;****************************************************************
EnableGadgetDrop(#Gadget_GSolutionBox1,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox2,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox3,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox4,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox5,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox6,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox7,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox8,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox9,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox10,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox11,#PB_Drop_Text,#PB_Drag_Copy)
;This section is for Drag & Drop operation into StringGadgets
;****************************************************************
Here is the code which will not work now in my .pb file.
;===========================================
; WINDOW DRAG & DROP TEXT EVENT SECTION
;===========================================
;===========================================
;Grid WordGame Event
;===========================================
;******************************************************
;NOTE!!! #PB_Event_GadgetDrop has to appear BEFORE
;section to get Dragged Text
;******************************************************
;-----------------------------------------------------------------
;This section drops dragged "Text" into Grid Game StringGadget
;-----------------------------------------------------------------
Case #PB_Event_GadgetDrop
Select GadgetID
Case #Gadget_GSolutionBox1 To #Gadget_GSolutionBox11
SetGadgetText(GadgetID, EventDropText())
EndSelect
Case #PB_Event_Gadget
;--------------------------------------------------------------------------
;This section gets TextGadget "Text" to be Dragged
;--------------------------------------------------------------------------
Select GadgetID
Case #TextGadget_GBox1 To #TextGadget_GBox77
Item = GetGadgetText(GadgetID) : Result = DragText(Item)
EndSelect
Here is the start section of my .pb file.
Repeat
EventID = WaitWindowEvent()
MenuID = EventMenu()
GadgetID = EventGadget()
WindowID = EventWindow()
Select EventID
The complete program code is far too large to show here.
(Using Single Handler code).
Windows7 Professional 32Bit PB Version 5.11
The exact same code in another program written some time ago
compiled quite O.K under PB5.11
Here is my entries in the window creation section.
;****************************************************************
EnableGadgetDrop(#Gadget_GSolutionBox1,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox2,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox3,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox4,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox5,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox6,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox7,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox8,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox9,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox10,#PB_Drop_Text,#PB_Drag_Copy)
EnableGadgetDrop(#Gadget_GSolutionBox11,#PB_Drop_Text,#PB_Drag_Copy)
;This section is for Drag & Drop operation into StringGadgets
;****************************************************************
Here is the code which will not work now in my .pb file.
;===========================================
; WINDOW DRAG & DROP TEXT EVENT SECTION
;===========================================
;===========================================
;Grid WordGame Event
;===========================================
;******************************************************
;NOTE!!! #PB_Event_GadgetDrop has to appear BEFORE
;section to get Dragged Text
;******************************************************
;-----------------------------------------------------------------
;This section drops dragged "Text" into Grid Game StringGadget
;-----------------------------------------------------------------
Case #PB_Event_GadgetDrop
Select GadgetID
Case #Gadget_GSolutionBox1 To #Gadget_GSolutionBox11
SetGadgetText(GadgetID, EventDropText())
EndSelect
Case #PB_Event_Gadget
;--------------------------------------------------------------------------
;This section gets TextGadget "Text" to be Dragged
;--------------------------------------------------------------------------
Select GadgetID
Case #TextGadget_GBox1 To #TextGadget_GBox77
Item = GetGadgetText(GadgetID) : Result = DragText(Item)
EndSelect
Here is the start section of my .pb file.
Repeat
EventID = WaitWindowEvent()
MenuID = EventMenu()
GadgetID = EventGadget()
WindowID = EventWindow()
Select EventID
The complete program code is far too large to show here.
(Using Single Handler code).
Windows7 Professional 32Bit PB Version 5.11
Re: Drag/Drop Text Not working
Zach
Did not think necessary for this post.
Not working code only snippets here and there from program
which is far too large to post here.
Thanks for looking anyway.
Did not think necessary for this post.
Not working code only snippets here and there from program
which is far too large to post here.
Thanks for looking anyway.
Re: Drag/Drop Text Not working
You mentioned old code that worked when compiled, but does that old compiled code still work now on the system you are testing on? That would help narrow down the problem.
You might want to search as I posted some fixes for similar issues that may help in your case, or it may not. If the fixes I posted are the issue. The short of it is, Drag and Drop really shouldn't be used anymore due to the protections in Windows. For it to function properly for many of your end users, they will have to override security settings on their OS which will leave their OS open and vulnerable just to get your program to run properly.
You might want to search as I posted some fixes for similar issues that may help in your case, or it may not. If the fixes I posted are the issue. The short of it is, Drag and Drop really shouldn't be used anymore due to the protections in Windows. For it to function properly for many of your end users, they will have to override security settings on their OS which will leave their OS open and vulnerable just to get your program to run properly.
Best wishes to the PB community. Thank you for the memories. 
Re: Drag/Drop Text Not working
Kuron
Thanks for reply.
Old code was written and working early 1913 using PB 4.61
Trying to use the identical code as posted in current project.
Yes the old code program will compile and run O.K under PB Version 5.11
Can you tell me where and when you posted the issues you refer to.
Maybe because of the differences in PB Versions used I need some
updated code to achieve Drag/Drop in my present project.
Can any member show me an example to Drag text from a TextGadget
and Drop the text into a StringGadget using PB 5.11. Thanks
Thanks for reply.
Old code was written and working early 1913 using PB 4.61
Trying to use the identical code as posted in current project.
Yes the old code program will compile and run O.K under PB Version 5.11
Can you tell me where and when you posted the issues you refer to.
Maybe because of the differences in PB Versions used I need some
updated code to achieve Drag/Drop in my present project.
Can any member show me an example to Drag text from a TextGadget
and Drop the text into a StringGadget using PB 5.11. Thanks
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Drag/Drop Text Not working
Things have changed a bit since then........Old code was written and working early 1913

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Drag/Drop Text Not working
Windows hasn't improved for the better since then.Old code was written and working early 1913 using PB 4.61
I didn't ask if it would compile under PB, I asked if the old EXE would run on the same OS you are having issues with. However, if the old code will compile and run okay under 5.11, it is likely user error which nobody can help you with when only a snippet of code has been shown. Somewhere you have something knackered in your new program. Carefully compare your old code with your new code.Yes the old code program will compile and run O.K under PB Version 5.11
I would also suggest using the latest version of PB so you have any relevant bug fixes.
Best wishes to the PB community. Thank you for the memories. 
Re: Drag/Drop Text Not working
What? Can you explain this, please? Are you talking about the whole of PB's Drag and Drop library? I haven't used Windows extensively in a while, but a project I'm working on relies quite heavily on it. I tested it on a fresh install of Windows 7 last night without any need to override security settings.Kuron wrote:The short of it is, Drag and Drop really shouldn't be used anymore due to the protections in Windows. For it to function properly for many of your end users, they will have to override security settings on their OS which will leave their OS open and vulnerable just to get your program to run properly.
Re: Drag/Drop Text Not working
I have explained it in the past and provided relative links in an old post here. I would have to search for it the same as you would, but it should be easy for you to find.What? Can you explain this, please?
I am talking about anything written for Windows that uses drag and drop functionality. What language it is written in doesn't matter as the issue is in the operating system.Are you talking about the whole of PB's Drag and Drop library?
Unless you are writing software solely for yourself, you are not your own end user. So unless all of your end users will be using your system, "It works for me" has no relevancy. The issue is one that is known and documented. It is hit or miss and does not exist for everybody. It was enough of a nuisance for me in an app that was in use by thousands of people, that I disabled drag and drop. I have also seen it affect others in the various programming communities and require the disabling of security features for it to work.I tested it on a fresh install of Windows 7 last night without any need to override security settings
Me either and I don't miss it.I haven't used Windows extensively in a while
Best wishes to the PB community. Thank you for the memories. 
- Fangbeast
- PureBasic Protozoa
- Posts: 4792
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: Drag/Drop Text Not working
Wombats, Kuron is right. When I graduated up to windows 8, drag and drop fell over 90% of the time on the same code that worked 100% on Windows 7 and earlier.wombats wrote:Kuron wrote:The short of it is, Drag and Drop really shouldn't be used anymore due to the protections in Windows. For it to function properly for many of your end users, they will have to override security settings on their OS which will leave their OS open and vulnerable just to get your program to run properly.
Then I visited various Windows 8 support forums and there were many horrible ways of altering critical secure functions just to get drag and drop to work that it wasn't viable. None of which worked here I might add.
It is just not consistently working enough to be able to get a program out to customers and hope it works on their computers without having to get into huge support issues. And I don't think Microsoft are going to fix this anytime soon.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: Drag/Drop Text Not working
It is not something for MS to fix. It is by design and I actually support their reasons for doing it.
Best wishes to the PB community. Thank you for the memories. 
- Fangbeast
- PureBasic Protozoa
- Posts: 4792
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: Drag/Drop Text Not working
That is your opinion. Drag and drop has worked on every version of their O/S ever released and there is no reason that it should not work properly now. The details or the reason behind it are unimportant, they gave us a feature that we used for a decade at least and we pushed it onto our customers, got used to the convenience in thousands of applications and now we can't have it and our customers have to eat it and like it??Kuron wrote:It is not something for MS to fix. It is by design and I actually support their reasons for doing it.
The absurdity of this situation is beyond laughter. It should and could be fixed by any competent programmer at ms given the billions of dollars that they have to spend, especially when they quote security as an issue. But, this is ms we are talking about, kill features they cannot get to work right.
There are so many ways that this could be gotten working again.
Now, I don't want to talk any more. I have to take my heart pills, get my cane, resolder my knee replacements, relube my hips, suture my blown arteries, put on my magnifying lens glasses, eat my 3 tonnes of fibre, go to the loo every 5 minutes.... I am too busy to code!
What day is it again?
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: Drag/Drop Text Not working
I had a read through this thread, but it's not clear to me (perhaps because it's 4:30AM), but is drag and drop between applications the only thing affected, or also drag and drop within an application? For example, if in a PureBasic application you dragged from a TreeGadget to a ListIconGadget, would that be affected?Kuron wrote:I have explained it in the past and provided relative links in an old post here. I would have to search for it the same as you would, but it should be easy for you to find.What? Can you explain this, please?
What I meant by this is by testing it on a fresh install of Windows 7, I would not have touched any of the security settings that could affect the drag and drop functions. PureBasic was literally the first thing I downloaded and installed after Windows was done installing its updates. I was ignorant to such an issue with drag and drop on Windows 8. The only times I've used it were at college and I did not enjoy the experience.Kuron wrote:Unless you are writing software solely for yourself, you are not your own end user. So unless all of your end users will be using your system, "It works for me" has no relevancy. The issue is one that is known and documented. It is hit or miss and does not exist for everybody. It was enough of a nuisance for me in an app that was in use by thousands of people, that I disabled drag and drop. I have also seen it affect others in the various programming communities and require the disabling of security features for it to work.wombats wrote:I tested it on a fresh install of Windows 7 last night without any need to override security settings
Re: Drag/Drop Text Not working
It is not my opinion, it is by design. For the record, I fully support anything MS does to shoot themselves in the foot and piss off their users.Fangbeast wrote:That is your opinion.

You do realize you are talking about Windows and Microsoft, right?Fangbeast wrote:now we can't have it and our customers have to eat it and like it??
Best wishes to the PB community. Thank you for the memories. 
Re: Drag/Drop Text Not working
> The absurdity of this situation is beyond laughter
If I understand correctly, then I agree. Is this discussion saying that drag/drop
no longer exists on Windows 8? So we can't even drag an image onto a paint
program to open it? I seriously hope I'm misunderstanding this.
If I understand correctly, then I agree. Is this discussion saying that drag/drop
no longer exists on Windows 8? So we can't even drag an image onto a paint
program to open it? I seriously hope I'm misunderstanding this.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.