Discussion of article "How to create a graphical panel of any complexity level" - page 15

 
Stanislav Korotky #:
See /MQL5/Include/Controls/Defines.mqh file - all constants there are defined as pixels(!), so everything "floats" when changing DPI. If you want to fix it quickly, you need to redefine all these constants in your code.

Thank you. I made in my code like this, it became convenient to drag the window and hit the cross to close the window.

But to scale the icons of the buttons (minimise/close) you need to dig somewhere else, apparently: BmpButton.mqh, ChartObjectsBmpControls.mqh, etc.

#include <Controls\Defines.mqh>
// remove old values
#undef   CONTROLS_DIALOG_CAPTION_HEIGHT
#undef   CONTROLS_DIALOG_BUTTON_OFF
#undef   CONTROLS_BUTTON_SIZE                

// redefine new values
#define  CONTROLS_DIALOG_CAPTION_HEIGHT   60   // window title height
#define  CONTROLS_DIALOG_BUTTON_OFF       20   // button indentation/position (cross, collapse)
//--- BmpButton
#define  CONTROLS_BUTTON_SIZE             40   // default size of button (16 x 16)


 
Sunriser #:

Thank you. I made it in my code like this, it became convenient to drag the window and hit the cross to close the window.

But to scale the icons of the buttons (minimise/close) you need to dig somewhere else, apparently: BmpButton.mqh, ChartObjectsBmpControls.mqh, etc.

Icons are bitmap - they are stored as bmp files in the MQL5/Include/Controls/res/ directory - if you enlarge them, they will look bad. Ideally, you need a separate subdirectory (like /hires/) and generate images with good quality for it and direct resource links from sources to it.

Only if you redefine it all rigidly, as they did for macros, then on a normal monitor will be a giant size. That is, the solution is only "for yourself". In a good way, it is necessary to define sizes and images dynamically, i.e. write a MQL5 wrapper that analyses the current DPI.