CDialog interface - avoid chart interaction

 

Firstly, thank you for keeping this forum as resourceful as it is. I have a question regarding the CDialog visual GUI, but I could not find an answer. Apologies if this has been addressed somewhere else already. 

Once you create an interface using the standard examples on this website, one can still click anywhere on the surface of the Dialog and drag the mouse button to the left/right. When doing so, the charts behind the Dialog will scroll to the left/right as if the body of the Dialog does not exist. After clicking with the left mouse button over the surface of the Dialog, one will also notice that the mouse pointer changes to suggest they can scroll left/right on the charts. I have attached a photo of the mouse pointer whilst clicking on the Dialog's background.

My question is: Is there a way to avoid that behaviour and make the Dialog firmly hold its ground when someone clicks on its background?

Thank you,

Bogdan Ciocoiu

Mouse pointer after clicking and dragging the background of a Dialog

 
Using standard library the scrolling is automatically disabled when the left mouse button is pressed over a drag object. additionally you can disable the scrolling when mouse pointer enters the Dialog container and enable when mouse pointer outs.

// disable scrolling
ChartSetInteger(0,CHART_MOUSE_SCROLL,false);

// enable scrolling
ChartSetInteger(0,CHART_MOUSE_SCROLL,true);
 
Samuel Manoel De Souza #:
Using standard library the scrolling is automatically disabled when the left mouse button is pressed over a drag object. additionally you can disable the scrolling when mouse pointer enters the Dialog container and enable when mouse pointer outs.


Spot on, thank you!