How to create a Button that works like a Tool button? - mql4

I'm trying to create a button that works exactly like when I click on rectangle Tool on Tools bar. Meaning I don't want it to create a rectangle by just pressing the button, I'm not gonna use Objectcreate() function. Instead, I want it to wait for the user to push the mouse button on chart and drag it to create a rectangle. Just like when you choose the rectangle tool and the cursor-shape changes.
I've looked the WndObj.mqh, Wnd.mqh and Rect.mqh and couldn't figure it out how does this work.
I appreciate if anyone can tell me how to do it
enter image description here
enter image description here

Related

How to add an clickable button on top of a MapView in Delphi FireMonkey?

I need to add a clickable button with a custom image on top of the TMapView, is this possible?
ps: even if I leave the TImage on top of the view, the map overlays it, that is, the button appears quickly until the map rendering overlays it...
edit ps2: There is no code for the example, I simply put a TImage on the Form, either as a child of TMapView, or as a child of TForm, when I test it on android, when opening the app the image appears quickly before the map and then when the map starts to appear it overlays the image...
edit ps3: I don't know if a TImage is the correct way to do this, is this any component to leave on top of the map, that keeps showing up, serving as a button? Just like on Google Maps...
You can't show anything on TMapView because of "z-order" problem. I looked for while to find a solution.
See : Delphi object over TMapView

How to hide components when clicking outside your area

I have a form with green edit, when the user clicks the search button, the components in red are displayed on the screen. But I want that when the user clicks out of the component area, they disappear. I have no idea how to do this. I saw some people using a layout to cover the whole screen, but wanted to know if there was another way.
Or use the
OnFormclick event with object.visible:=false;

Pie chart center click disable

When I clicks on pieChart chartValueSelected() method called. But now my need is when I click in center in pieChartView, there will be no action perform.
I don't know what kind of chart (or Library) you used.
In this situation, the contents of function you written seem not to matter.
So I will explain the general situation.
You can place a transparent button in the middle of the pie-chart.
Then link that button to your "chartValueSelected()" function.

Home button in PowerPoint to show on mouseover using VBA

I use a home button on most of my slides with a link back to the agenda for quick jumps during my presentation. That way I avoid flipping through the individual slides and get straight back to the overview.
However, I don't want the home button in my lower right corner to show on each page as it spoils the clean look. I tried to use the mouseover event in combination with a macro but can't get it to run. I thought about making the home button completely transparent and on mouseover I would set the transparency to zero so the button shows up. When I click on it, it would follow the link.
Any help to get me there is highly appreciated.
You do know that you can simply press 1 then Enter to return to the first slide in the show, right?
But to follow up on your "I thought about .." idea, why not add a shape on the slide master in a place that won't get covered up by content in any of the slides, then assign it a Go To Slide 1 action setting. After testing to make sure it does what you want, give it any color you like then make it 99% transparent.
As long as you don't forget where to click, you're good to go.

OL3 - Draw rectangle using single drag movement

I'm looking for a way to draw a rectangle in a single drag movement, so the user click and hold the mouse pressed then move the mouse and the rectangle is painting as he go and the drawing is finished when he stop pressing the mouse.
Currently it's done using mouse click -> drag -> mouse click again to finish, not that intuitive.
I'm using the latest OpenLayers 3.
Thanks!
The functionality asked for is already present in latest openlayers version (v3.19). Use ol.interaction.Draw.createBox() to create a rectangle with 2 clicks one for start and another for end. See the below example for more details
http://openlayers.org/en/latest/examples/draw-shapes.html?q=draw
You can create your style for the rectangle by creating style object and declaring it in ol.interaction.Draw().
Instead of using the built-in interaction use an instance of https://github.com/openlayers/ol3/blob/master/src/ol/interaction/dragzoom.js but pass in an option/condition to not use the shift key. Here are the conditions https://github.com/openlayers/ol3/blob/master/src/ol/events/condition.js
Have you looked into the DragBox interaction? This will give the user an outline of the box as they are drawing it with click, drag, and release being the interaction.

Resources