Hello chaps
I'd appreciate some advice, as trial and error is yielding no results.
The example code below describes a simple dialog, which I would like to:
be draggable when open
execute some code / call a function when the user double clicks anywhere on it
I am having trouble getting this simple setup to work, I'm not sure whether it's my approach or whether something is broken.
The dimensions and colours etc are arbitrary, I am just interested in behaviour for now.
config.cpp:
Using the config above, I can createDialog and drag it around in-game but the double-click handler doesn't seem to fire.
If I enable the control via onLoad, the double-click handler fires and prints to systemChat, but the dialog itself is no longer draggable.
config.cpp:
I have read through the BIKI pages on Dialogs and UI Event Handlers, and have searched the forums. I am also familiar with this ticket which is similar but not entirely applicable. After lots of trial and error, my next step would be to manually ctrlSetEventHandler outside of the config, but I thought I would ask here first:
Should I expect onMouseButtonDblClick to work as above?
Is onMouseButtonDblClick mutually exclusive with dragging by design?
Could this issue be related to RscText control in particular?
Is onMouseButtonDblClick broken somehow?
Is there a more 'proper' approach?
Many thanks.
---------- Post added at 19:44 ---------- Previous post was at 19:32 ----------
As a quick afterthought, I added a new RscText to class controls[], set moving=1. I was able to drag the dialog using this control, and fire the response by double-clicking on the background control - but only as long as they were not overlapping (ie, position and dimensions matching).