KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_shim.h File Reference
#include <kicommon.h>
#include <eda_units.h>
#include <kiway_holder.h>
#include <wx/dialog.h>
#include <map>
#include <set>
#include <vector>
#include <wx/variant.h>
#include <core/raii.h>

Go to the source code of this file.

Classes

class  DIALOG_SHIM
 Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormBuilder. More...
 
struct  DIALOG_SHIM::UNDO_STEP
 

Functions

KICOMMON_API wxRect ClampRectToDisplay (const wxRect &aRect, const wxRect &aClientArea)
 Constrain a window rectangle so it fits entirely within a display's client area.
 

Function Documentation

◆ ClampRectToDisplay()

KICOMMON_API wxRect ClampRectToDisplay ( const wxRect & aRect,
const wxRect & aClientArea )

Constrain a window rectangle so it fits entirely within a display's client area.

The size is capped to the client area, then the top-left corner is pulled back so the whole rectangle is visible (the corner is preferred over the bottom-right edge so the title bar stays reachable). Used to tame geometry restored from a different, possibly higher-DPI, monitor that would otherwise land off-screen or oversized.

Parameters
aRectThe window rectangle to constrain, in screen coordinates.
aClientAreaThe target display's client (work) area, in screen coordinates.
Returns
The constrained rectangle.

Definition at line 352 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::clampToWorkArea().