Show the pencil cursor when placing an item, but it isn't created yet

This commit is contained in:
Ian McInerney 2020-04-01 18:24:58 +01:00
parent 4b647ba6b1
commit 0d79ada3ec
2 changed files with 20 additions and 4 deletions

View File

@ -86,6 +86,11 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
// Main loop: keep receiving events // Main loop: keep receiving events
while( TOOL_EVENT* evt = Wait() ) while( TOOL_EVENT* evt = Wait() )
{ {
if( !newItem )
frame()->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
else
frame()->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
VECTOR2I cursorPos = controls()->GetCursorPosition(); VECTOR2I cursorPos = controls()->GetCursorPosition();
aPlacer->m_modifiers = evt->Modifier(); aPlacer->m_modifiers = evt->Modifier();

View File

@ -110,11 +110,22 @@ public:
protected: protected:
/**
* Options for placing items interactively.
*/
enum INTERACTIVE_PLACEMENT_OPTIONS { enum INTERACTIVE_PLACEMENT_OPTIONS {
IPO_ROTATE = 1, /// Handle the rotate action in the loop by calling the item's rotate method
IPO_FLIP = 2, IPO_ROTATE = 0x01,
IPO_SINGLE_CLICK = 4,
IPO_REPEAT = 8 /// Handle flip action in the loop by calling the item's flip method
IPO_FLIP = 0x02,
/// Create an item immediately on placement starting, otherwise show the pencil cursor
/// until the item is created
IPO_SINGLE_CLICK = 0x04,
/// Allow repeat placement of the item
IPO_REPEAT = 0x08
}; };