Click Drop from Palette?


#1

Warning: Extreme newbie here. Hopefully this question hasn’t been asked, and I’ve just missed the post - if so, I apologize in advance.
I would like to add a “click drop” functionality that would essentially work the same as a “drag drop” from a palette to the View. I can capture the selected “clicked” object in my palette using “palette ObjectSingleClicked”, where I’ve been trying to Copy it to my View’s clipboard using view.CopyToClipboard. Then on a “View BackgroundSingleClicked” event, I’m attempting to paste, using view.PasteFromClipboard(). This isn’t working.
Does anyone have any other ideas?
Is this functionality already built in and I just don’t have it turned on?
Any insight is appreciated. Thanks!


#2

Actually, the IconicApp sample does this already. It isn’t standard behavior, but as that sample shows, it’s pretty easy to implement.
The interesting behavior is defined by:
private void goView1_BackgroundSingleClicked(object sender, Northwoods.Go.GoInputEventArgs e) {
GoObject obj = goPalette1.Selection.Primary;
if (obj != null) {
goView1.Document.AddCopy(obj, e.DocPoint);
}
}

There isn’t any event handler defined on the GoPalette control.