Browse Source

PCB_TOOL_BASE: allow casting the frame to types other than PCB_BASE_DRAW_FRAME.

This is useful when testing pcbnew's TOOLs outside the real pcbnew window (example: P&S log viewer/playground), as
with the default cast, all of pcbnew UI would have to be linked in for the tests to build.
jobs
Tomasz Wlostowski 2 years ago
parent
commit
43c8ecd77f
  1. 5
      pcbnew/tools/pcb_tool_base.h

5
pcbnew/tools/pcb_tool_base.h

@ -162,9 +162,10 @@ protected:
return getViewControls();
}
PCB_BASE_EDIT_FRAME* frame() const
template<class T = PCB_BASE_EDIT_FRAME>
T* frame() const
{
return getEditFrame<PCB_BASE_EDIT_FRAME>();
return getEditFrame<T>();
}
BOARD* board() const { return getModel<BOARD>(); }

Loading…
Cancel
Save