You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

555 lines
20 KiB

14 years ago
14 years ago
14 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file modedit_onclick.cpp
  26. */
  27. #include <fctsys.h>
  28. #include <class_drawpanel.h>
  29. #include <confirm.h>
  30. #include <wxPcbStruct.h>
  31. #include <gr_basic.h>
  32. #include <class_board.h>
  33. #include <class_module.h>
  34. #include <class_edge_mod.h>
  35. #include <pcbnew.h>
  36. #include <pcbnew_id.h>
  37. #include <hotkeys.h>
  38. #include <module_editor_frame.h>
  39. #include <dialog_edit_module_for_Modedit.h>
  40. #include <menus_helpers.h>
  41. void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
  42. {
  43. BOARD_ITEM* item = GetCurItem();
  44. m_canvas->CrossHairOff( DC );
  45. if( GetToolId() == ID_NO_TOOL_SELECTED )
  46. {
  47. if( item && item->GetFlags() ) // Move item command in progress
  48. {
  49. switch( item->Type() )
  50. {
  51. case PCB_MODULE_TEXT_T:
  52. PlaceTexteModule( static_cast<TEXTE_MODULE*>( item ), DC );
  53. break;
  54. case PCB_MODULE_EDGE_T:
  55. SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
  56. Place_EdgeMod( static_cast<EDGE_MODULE*>( item ) );
  57. break;
  58. case PCB_PAD_T:
  59. PlacePad( static_cast<D_PAD*>( item ), DC );
  60. break;
  61. default:
  62. {
  63. wxString msg;
  64. msg.Printf( wxT( "WinEDA_ModEditFrame::OnLeftClick err:Struct %d, m_Flag %X" ),
  65. item->Type(), item->GetFlags() );
  66. DisplayError( this, msg );
  67. item->ClearFlags();
  68. break;
  69. }
  70. }
  71. }
  72. else
  73. {
  74. if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
  75. && !wxGetKeyState( WXK_CONTROL ) )
  76. item = ModeditLocateAndDisplay();
  77. SetCurItem( item );
  78. }
  79. }
  80. item = GetCurItem();
  81. bool no_item_edited = item == NULL || item->GetFlags() == 0;
  82. switch( GetToolId() )
  83. {
  84. case ID_NO_TOOL_SELECTED:
  85. break;
  86. case ID_MODEDIT_CIRCLE_TOOL:
  87. case ID_MODEDIT_ARC_TOOL:
  88. case ID_MODEDIT_LINE_TOOL:
  89. if( no_item_edited )
  90. {
  91. STROKE_T shape = S_SEGMENT;
  92. if( GetToolId() == ID_MODEDIT_CIRCLE_TOOL )
  93. shape = S_CIRCLE;
  94. if( GetToolId() == ID_MODEDIT_ARC_TOOL )
  95. shape = S_ARC;
  96. SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) NULL, DC, shape ) );
  97. }
  98. else if( item->IsNew() )
  99. {
  100. if( ( (EDGE_MODULE*) item )->GetShape() == S_CIRCLE )
  101. {
  102. End_Edge_Module( (EDGE_MODULE*) item );
  103. SetCurItem( NULL );
  104. m_canvas->Refresh();
  105. }
  106. else if( ( (EDGE_MODULE*) item )->GetShape() == S_ARC )
  107. {
  108. End_Edge_Module( (EDGE_MODULE*) item );
  109. SetCurItem( NULL );
  110. m_canvas->Refresh();
  111. }
  112. else if( ( (EDGE_MODULE*) item )->GetShape() == S_SEGMENT )
  113. {
  114. SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) item, DC, S_SEGMENT ) );
  115. }
  116. else
  117. {
  118. wxMessageBox( wxT( "ProcessCommand error: unknown shape" ) );
  119. }
  120. }
  121. break;
  122. case ID_MODEDIT_DELETE_TOOL:
  123. if( ! no_item_edited ) // Item in edit, cannot delete it
  124. break;
  125. item = ModeditLocateAndDisplay();
  126. if( item && item->Type() != PCB_MODULE_T ) // Cannot delete the module itself
  127. {
  128. SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
  129. RemoveStruct( item );
  130. SetCurItem( NULL );
  131. }
  132. break;
  133. case ID_MODEDIT_ANCHOR_TOOL:
  134. {
  135. MODULE* module = GetBoard()->m_Modules;
  136. if( module == NULL // No module loaded
  137. || (module->GetFlags() != 0) )
  138. break;
  139. SaveCopyInUndoList( module, UR_CHANGED );
  140. // set the new relative internal local coordinates of footprint items
  141. wxPoint moveVector = module->GetPosition() - GetCrossHairPosition();
  142. module->MoveAnchorPosition( moveVector );
  143. // Usually, we do not need to change twice the anchor position,
  144. // so deselect the active tool
  145. SetNoToolSelected();
  146. SetCurItem( NULL );
  147. m_canvas->Refresh();
  148. }
  149. break;
  150. case ID_MODEDIT_PLACE_GRID_COORD:
  151. m_canvas->DrawGridAxis( DC, GR_XOR, GetBoard()->GetGridOrigin() );
  152. SetGridOrigin( GetCrossHairPosition() );
  153. m_canvas->DrawGridAxis( DC, GR_COPY, GetBoard()->GetGridOrigin() );
  154. GetScreen()->SetModify();
  155. break;
  156. case ID_MODEDIT_TEXT_TOOL:
  157. if( GetBoard()->m_Modules == NULL )
  158. break;
  159. SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
  160. CreateTextModule( GetBoard()->m_Modules, DC );
  161. break;
  162. case ID_MODEDIT_PAD_TOOL:
  163. if( GetBoard()->m_Modules )
  164. {
  165. SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
  166. AddPad( GetBoard()->m_Modules, true );
  167. }
  168. break;
  169. case ID_MODEDIT_MEASUREMENT_TOOL:
  170. DisplayError( this, wxT( "Unsupported tool in legacy canvas" ) );
  171. SetNoToolSelected();
  172. break;
  173. default:
  174. DisplayError( this, wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) );
  175. SetNoToolSelected();
  176. }
  177. m_canvas->CrossHairOn( DC );
  178. }
  179. bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
  180. {
  181. BOARD_ITEM* item = GetCurItem();
  182. wxString msg;
  183. bool blockActive = !GetScreen()->m_BlockLocate.IsIdle();
  184. // Simple location of elements where possible.
  185. if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
  186. {
  187. SetCurItem( item = ModeditLocateAndDisplay() );
  188. }
  189. // End command in progress.
  190. if( GetToolId() != ID_NO_TOOL_SELECTED )
  191. {
  192. if( item && item->GetFlags() )
  193. AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
  194. KiBitmap( cancel_xpm ) );
  195. else
  196. AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ),
  197. KiBitmap( cursor_xpm ) );
  198. PopMenu->AppendSeparator();
  199. }
  200. else
  201. {
  202. if( (item && item->GetFlags()) || blockActive )
  203. {
  204. if( blockActive ) // Put block commands in list
  205. {
  206. AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
  207. _( "Cancel Block" ), KiBitmap( cancel_xpm ) );
  208. AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK,
  209. _( "Zoom Block (drag middle mouse)" ),
  210. KiBitmap( zoom_area_xpm ) );
  211. PopMenu->AppendSeparator();
  212. AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
  213. _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
  214. AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK,
  215. _( "Copy Block (shift + drag mouse)" ),
  216. KiBitmap( copy_xpm ) );
  217. AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK,
  218. _( "Mirror Block (alt + drag mouse)" ),
  219. KiBitmap( mirror_h_xpm ) );
  220. AddMenuItem( PopMenu, ID_POPUP_ROTATE_BLOCK,
  221. _( "Rotate Block (ctrl + drag mouse)" ),
  222. KiBitmap( rotate_ccw_xpm ) );
  223. AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK,
  224. _( "Delete Block (shift+ctrl + drag mouse)" ),
  225. KiBitmap( delete_xpm ) );
  226. msg = AddHotkeyName( _("Move Block Exactly" ),
  227. g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  228. AddMenuItem( PopMenu, ID_POPUP_MOVE_BLOCK_EXACT,
  229. msg, KiBitmap( move_xpm ) );
  230. }
  231. else
  232. {
  233. AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
  234. _( "Cancel" ), KiBitmap( cancel_xpm ) );
  235. }
  236. PopMenu->AppendSeparator();
  237. }
  238. }
  239. if( blockActive )
  240. return true;
  241. if( item )
  242. {
  243. STATUS_FLAGS flags = item->GetFlags();
  244. switch( item->Type() )
  245. {
  246. case PCB_MODULE_T:
  247. {
  248. wxMenu* transform_choice = new wxMenu;
  249. AddMenuItem( transform_choice, ID_MODEDIT_MODULE_ROTATE, _( "Rotate" ),
  250. KiBitmap( rotate_ccw_xpm ) );
  251. AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ),
  252. KiBitmap( mirror_footprint_axisY_xpm ) );
  253. AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MOVE_EXACT, _( "Move Exactly" ),
  254. KiBitmap( move_module_xpm ) );
  255. msg = AddHotkeyName( _( "Edit Footprint" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
  256. AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) );
  257. AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
  258. _( "Transform Footprint" ), KiBitmap( edit_xpm ) );
  259. break;
  260. }
  261. case PCB_PAD_T:
  262. if( !flags )
  263. {
  264. msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
  265. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, msg, KiBitmap( move_pad_xpm ) );
  266. }
  267. msg = AddHotkeyName( _("Edit Pad" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
  268. AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
  269. AddMenuItem( PopMenu, ID_POPUP_PCB_COPY_PAD_SETTINGS,
  270. _( "Copy Pad Settings" ), KiBitmap( copy_pad_settings_xpm ) );
  271. AddMenuItem( PopMenu, ID_POPUP_PCB_APPLY_PAD_SETTINGS,
  272. _( "Apply Pad Settings" ), KiBitmap( apply_pad_settings_xpm ) );
  273. msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
  274. AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, KiBitmap( delete_pad_xpm ) );
  275. msg = AddHotkeyName( _( "Duplicate Pad" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
  276. AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_pad_xpm ) );
  277. msg = AddHotkeyName( _("Move Pad Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  278. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_pad_xpm ) );
  279. msg = AddHotkeyName( _("Create Pad Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
  280. AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_pad_xpm ) );
  281. if( !flags )
  282. {
  283. PopMenu->AppendSeparator();
  284. AddMenuItem( PopMenu, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
  285. _( "Push Pad Settings" ), KiBitmap( push_pad_settings_xpm ) );
  286. }
  287. break;
  288. case PCB_MODULE_TEXT_T:
  289. if( !flags )
  290. {
  291. msg = AddHotkeyName( _("Move Text" ), g_Module_Editor_Hokeys_Descr,
  292. HK_MOVE_ITEM );
  293. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, msg,
  294. KiBitmap( move_field_xpm ) );
  295. }
  296. msg = AddHotkeyName( _("Rotate Text" ), g_Module_Editor_Hokeys_Descr,
  297. HK_ROTATE_ITEM );
  298. AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_cw_xpm ) );
  299. {
  300. // Do not show option to replicate value or reference fields
  301. // (there can only be one of each)
  302. const MODULE* module = static_cast<MODULE*>( item->GetParent() );
  303. const TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
  304. if( &module->Reference() != text && &module->Value() != text )
  305. {
  306. msg = AddHotkeyName( _( "Duplicate Text" ),
  307. g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
  308. AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
  309. msg, KiBitmap( duplicate_text_xpm ) );
  310. msg = AddHotkeyName( _("Create Text Array" ),
  311. g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
  312. AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY,
  313. msg, KiBitmap( array_text_xpm ) );
  314. }
  315. }
  316. msg = AddHotkeyName( _("Move Text Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  317. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_field_xpm ) );
  318. if( !flags )
  319. {
  320. msg = AddHotkeyName( _("Edit Text" ), g_Module_Editor_Hokeys_Descr,
  321. HK_EDIT_ITEM );
  322. AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, KiBitmap( edit_text_xpm ) );
  323. if( ( static_cast<TEXTE_MODULE*>( item ) )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
  324. {
  325. msg = AddHotkeyName( _("Delete Text" ), g_Module_Editor_Hokeys_Descr,
  326. HK_DELETE );
  327. AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_TEXTMODULE, msg,
  328. KiBitmap( delete_text_xpm ) );
  329. }
  330. }
  331. break;
  332. case PCB_MODULE_EDGE_T:
  333. {
  334. if( (flags & IS_NEW) )
  335. AddMenuItem( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End edge" ),
  336. KiBitmap( checked_ok_xpm ) );
  337. if( !flags )
  338. {
  339. msg = AddHotkeyName( _("Move Edge" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
  340. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, KiBitmap( move_line_xpm ) );
  341. }
  342. msg = AddHotkeyName( _( "Duplicate Edge" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
  343. AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_line_xpm ) );
  344. msg = AddHotkeyName( _("Move Edge Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  345. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_line_xpm ) );
  346. msg = AddHotkeyName( _("Create Edge Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
  347. AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_line_xpm ) );
  348. if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED )
  349. AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place edge" ),
  350. KiBitmap( checked_ok_xpm ) );
  351. msg = AddHotkeyName( _("Edit" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
  352. AddMenuItem( PopMenu, ID_POPUP_MODEDIT_EDIT_BODY_ITEM,
  353. msg, KiBitmap( options_segment_xpm ) );
  354. msg = AddHotkeyName( _("Delete Edge" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
  355. AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_EDGE, msg, KiBitmap( delete_xpm ) );
  356. wxMenu* edit_global_mnu = new wxMenu;
  357. AddMenuItem( PopMenu, edit_global_mnu, ID_POPUP_MODEDIT_GLOBAL_EDIT_EDGE,
  358. _( "Global Changes" ), KiBitmap( edit_xpm ) );
  359. AddMenuItem( edit_global_mnu, ID_POPUP_MODEDIT_EDIT_WIDTH_ALL_EDGE,
  360. _( "Change Body Items Width" ), KiBitmap( width_segment_xpm ) );
  361. AddMenuItem( edit_global_mnu, ID_POPUP_MODEDIT_EDIT_LAYER_ALL_EDGE,
  362. _( "Change Body Items Layer" ), KiBitmap( select_layer_pair_xpm ) );
  363. }
  364. break;
  365. case PCB_LINE_T:
  366. case PCB_TEXT_T:
  367. case PCB_VIA_T:
  368. case PCB_TRACE_T:
  369. case PCB_ZONE_T:
  370. case PCB_MARKER_T:
  371. case PCB_DIMENSION_T:
  372. case PCB_TARGET_T:
  373. msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: Unexpected DrawType %d" ),
  374. item->Type() );
  375. DisplayError( this, msg );
  376. break;
  377. case SCREEN_T:
  378. case TYPE_NOT_INIT:
  379. case PCB_T:
  380. msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ),
  381. item->Type() );
  382. DisplayError( this, msg );
  383. break;
  384. default:
  385. msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
  386. item->Type() );
  387. DisplayError( this, msg );
  388. break;
  389. }
  390. PopMenu->AppendSeparator();
  391. }
  392. if( ( GetToolId() == ID_MODEDIT_LINE_TOOL ) ||
  393. ( GetToolId() == ID_MODEDIT_CIRCLE_TOOL ) ||
  394. ( GetToolId() == ID_MODEDIT_ARC_TOOL ) )
  395. {
  396. AddMenuItem( PopMenu, ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH, _("Set Line Width" ),
  397. KiBitmap( width_segment_xpm ) );
  398. PopMenu->AppendSeparator();
  399. }
  400. return true;
  401. }
  402. /*
  403. * Called on a mouse left button double click
  404. */
  405. void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
  406. {
  407. BOARD_ITEM* item = GetCurItem();
  408. switch( GetToolId() )
  409. {
  410. case ID_NO_TOOL_SELECTED:
  411. if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
  412. {
  413. item = ModeditLocateAndDisplay();
  414. }
  415. if( ( item == NULL ) || ( item->GetFlags() != 0 ) )
  416. break;
  417. // Item found
  418. SetCurItem( item );
  419. OnEditItemRequest( DC, item );
  420. break; // end case 0
  421. case ID_PCB_ADD_LINE_BUTT:
  422. {
  423. if( item && item->IsNew() )
  424. {
  425. End_Edge_Module( (EDGE_MODULE*) item );
  426. SetCurItem( NULL );
  427. m_canvas->Refresh();
  428. }
  429. break;
  430. }
  431. default:
  432. break;
  433. }
  434. }
  435. void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem )
  436. {
  437. switch( aItem->Type() )
  438. {
  439. case PCB_PAD_T:
  440. InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
  441. m_canvas->MoveCursorToCrossHair();
  442. break;
  443. case PCB_MODULE_T:
  444. {
  445. DIALOG_MODULE_MODULE_EDITOR dialog( this, static_cast<MODULE*>( aItem ) );
  446. dialog.ShowModal();
  447. GetScreen()->GetCurItem()->ClearFlags();
  448. m_canvas->MoveCursorToCrossHair();
  449. m_canvas->Refresh();
  450. }
  451. break;
  452. case PCB_MODULE_TEXT_T:
  453. InstallTextModOptionsFrame( static_cast<TEXTE_MODULE*>( aItem ), aDC );
  454. m_canvas->MoveCursorToCrossHair();
  455. break;
  456. case PCB_MODULE_EDGE_T :
  457. m_canvas->MoveCursorToCrossHair();
  458. InstallFootprintBodyItemPropertiesDlg( static_cast<EDGE_MODULE*>( aItem ) );
  459. m_canvas->Refresh();
  460. break;
  461. default:
  462. break;
  463. }
  464. }