Hi, here is a function that allows you to drag a panel across the screen...
Code:
public IEnumerable DragPanel()
{
PANEL sender = EngVar.mouse_panel;
int startx = EngVar.mouse_cursor.x.IntValue - sender.pos_x.IntValue;
int starty = EngVar.mouse_cursor.y.IntValue - sender.pos_y.IntValue;

while (EngVar.mouse_left.IntValue == 1)
{
if (EngVar.mouse_moving.IntValue == 1)
{
sender.pos_x.IntValue = EngVar.mouse_cursor.x.IntValue- startx;
sender.pos_y.IntValue = EngVar.mouse_cursor.y.IntValue -starty;
}
yield return 1;
}
}


and it is assigned to a PANEL's 'event' property...
Code:
PANEL pnl = EngFun.pan_create("bmap = hi.bmp;",(Var)1);
pnl.pos_x.IntValue = 0;
pnl.pos_y.IntValue = 0;
pnl.event_ = DragPanel;
pnl.SHOW = true;


Maybe i'm doing something wrong or it's a bug or something but i can only ever drag the panel once. So it seems the event function is only being called once.

I think the while loop may be a contributing factor because if i just have a function that calls a messageBox, then i can click the panel infinite times and it will show the MessageBox.

While we are on the subject. In Lite-C, when you call a PANEL event you can pass the PANEL pointer to the function allowing you to see which panel called the function. I don't know if this is possible with the wrapper because the event property expects an EventVoid signature, so no paramter passing. I do have a workaround with mouse_panel, but it would make things a little easier. Just a thought.