Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
File open dialog
Is there a way from RBasic to open the standard Windows file open dialog with large icons displayed, so that the user can select a file?
Comments
However, this gives me something that looks like this
What I want is something that looks like this:
Maybe I have to call the Win API directly to get this modern file open dialog? I was hoping OI had some simple to use wrapper.
That doesn't seem to work.
From the above link:
ENABLEDROP
Applies to
All Controls except OLE controls.
I think when I implemented it, I didn't restrict it to a specific control. I enabled it for the window, and this seemed to work for all controls on the window. Will that suffice?
I have never used the dragdrop functionality before. I created a test form. Added an edittable. In create event set ENABLEDROP property of edittable to 1. Add a debug event to DROPFILES event. Then run the form. Then drop a file on the table. I get a drop to the debugger in a POSCHANGED event. What on earth am I doing wrong?
Thanks for the help btw this is driving me nuts, I thought this would be easy :)
I got rid of the POSCHANGED event, no idea where that was coming from. I deleted the form and started with a new form from scratch.
I set the ENABLEDROP on an editline and a standard edittable on the form and confirm property is set by doing a get_property. Add debugs to both DROPFILES and DRAGDROP events on both controls.
Drag and drop a png file from explorer to each control and nothing happens. I get a stop icon when hovering over the control.
Does it need to be told somehow what files can be dropped?
Maybe i need to enable it for the entire window. Let me test.
Nope enabled it for entire window. Still no event fires.
ACCEPTDROPFILES
Ah ha, let me try that tomorrow.
An alternative that will work in OI 9 and OI 10 is putting the SRP Picture control on your form and using its OnFileDrop event. This isn't as convenient of a solution because you are creating space on your form specifically to be a dropzone rather than the form itself being the dropzone.
Is it likely that the Ribbon can be made to see this event, or should I look at another way of doing this?
What I was trying to do was find a way of adding icons to the ribbon without a lot of typing in the XML file.
Help me understand your use case. You want to add icons to the ribbon without typing in the XML file. How exactly would this work out? Let's say the DROPFILES event worked. Then what?
Well I was hoping the event would report the button that the png file was dropped on, then I would write code to modify the xml accordingly.