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.

552 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. SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
  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. default:
  170. DisplayError( this, wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) );
  171. SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
  172. }
  173. m_canvas->CrossHairOn( DC );
  174. }
  175. bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
  176. {
  177. BOARD_ITEM* item = GetCurItem();
  178. wxString msg;
  179. bool blockActive = !GetScreen()->m_BlockLocate.IsIdle();
  180. // Simple location of elements where possible.
  181. if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
  182. {
  183. SetCurItem( item = ModeditLocateAndDisplay() );
  184. }
  185. // End command in progress.
  186. if( GetToolId() != ID_NO_TOOL_SELECTED )
  187. {
  188. if( item && item->GetFlags() )
  189. AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
  190. KiBitmap( cancel_xpm ) );
  191. else
  192. AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ),
  193. KiBitmap( cursor_xpm ) );
  194. PopMenu->AppendSeparator();
  195. }
  196. else
  197. {
  198. if( (item && item->GetFlags()) || blockActive )
  199. {
  200. if( blockActive ) // Put block commands in list
  201. {
  202. AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
  203. _( "Cancel Block" ), KiBitmap( cancel_xpm ) );
  204. AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK,
  205. _( "Zoom Block (drag middle mouse)" ),
  206. KiBitmap( zoom_area_xpm ) );
  207. PopMenu->AppendSeparator();
  208. AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK,
  209. _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
  210. AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK,
  211. _( "Copy Block (shift + drag mouse)" ),
  212. KiBitmap( copyblock_xpm ) );
  213. AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK,
  214. _( "Mirror Block (alt + drag mouse)" ),
  215. KiBitmap( mirror_h_xpm ) );
  216. AddMenuItem( PopMenu, ID_POPUP_ROTATE_BLOCK,
  217. _( "Rotate Block (ctrl + drag mouse)" ),
  218. KiBitmap( rotate_ccw_xpm ) );
  219. AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK,
  220. _( "Delete Block (shift+ctrl + drag mouse)" ),
  221. KiBitmap( delete_xpm ) );
  222. msg = AddHotkeyName( _("Move Block Exactly" ),
  223. g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  224. AddMenuItem( PopMenu, ID_POPUP_MOVE_BLOCK_EXACT,
  225. msg, KiBitmap( move_xpm ) );
  226. }
  227. else
  228. {
  229. AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
  230. _( "Cancel" ), KiBitmap( cancel_xpm ) );
  231. }
  232. PopMenu->AppendSeparator();
  233. }
  234. }
  235. if( blockActive )
  236. return true;
  237. if( item )
  238. {
  239. STATUS_FLAGS flags = item->GetFlags();
  240. switch( item->Type() )
  241. {
  242. case PCB_MODULE_T:
  243. {
  244. wxMenu* transform_choice = new wxMenu;
  245. AddMenuItem( transform_choice, ID_MODEDIT_MODULE_ROTATE, _( "Rotate" ),
  246. KiBitmap( rotate_module_ccw_xpm ) );
  247. AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ),
  248. KiBitmap( mirror_footprint_axisY_xpm ) );
  249. AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MOVE_EXACT, _( "Move Exactly" ),
  250. KiBitmap( move_module_xpm ) );
  251. msg = AddHotkeyName( _( "Edit Footprint" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
  252. AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) );
  253. AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
  254. _( "Transform Footprint" ), KiBitmap( edit_xpm ) );
  255. break;
  256. }
  257. case PCB_PAD_T:
  258. if( !flags )
  259. {
  260. msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
  261. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, msg, KiBitmap( move_pad_xpm ) );
  262. }
  263. msg = AddHotkeyName( _("Edit Pad" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
  264. AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
  265. AddMenuItem( PopMenu, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
  266. _( "New Pad Settings" ), KiBitmap( options_new_pad_xpm ) );
  267. AddMenuItem( PopMenu, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
  268. _( "Export Pad Settings" ), KiBitmap( export_options_pad_xpm ) );
  269. msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
  270. AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, KiBitmap( delete_pad_xpm ) );
  271. msg = AddHotkeyName( _( "Duplicate Pad" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
  272. AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_pad_xpm ) );
  273. msg = AddHotkeyName( _("Move Pad Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  274. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_pad_xpm ) );
  275. msg = AddHotkeyName( _("Create Pad Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
  276. AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_pad_xpm ) );
  277. if( !flags )
  278. {
  279. PopMenu->AppendSeparator();
  280. AddMenuItem( PopMenu, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
  281. _( "Global Pad Settings" ), KiBitmap( global_options_pad_xpm ) );
  282. }
  283. break;
  284. case PCB_MODULE_TEXT_T:
  285. if( !flags )
  286. {
  287. msg = AddHotkeyName( _("Move Text" ), g_Module_Editor_Hokeys_Descr,
  288. HK_MOVE_ITEM );
  289. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, msg,
  290. KiBitmap( move_field_xpm ) );
  291. }
  292. msg = AddHotkeyName( _("Rotate Text" ), g_Module_Editor_Hokeys_Descr,
  293. HK_ROTATE_ITEM );
  294. AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_field_xpm ) );
  295. {
  296. // Do not show option to replicate value or reference fields
  297. // (there can only be one of each)
  298. const MODULE* module = static_cast<MODULE*>( item->GetParent() );
  299. const TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
  300. if( &module->Reference() != text && &module->Value() != text )
  301. {
  302. msg = AddHotkeyName( _( "Duplicate Text" ),
  303. g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
  304. AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
  305. msg, KiBitmap( duplicate_text_xpm ) );
  306. msg = AddHotkeyName( _("Create Text Array" ),
  307. g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
  308. AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY,
  309. msg, KiBitmap( array_text_xpm ) );
  310. }
  311. }
  312. msg = AddHotkeyName( _("Move Text Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  313. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_field_xpm ) );
  314. if( !flags )
  315. {
  316. msg = AddHotkeyName( _("Edit Text" ), g_Module_Editor_Hokeys_Descr,
  317. HK_EDIT_ITEM );
  318. AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, KiBitmap( edit_text_xpm ) );
  319. if( ( static_cast<TEXTE_MODULE*>( item ) )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
  320. {
  321. msg = AddHotkeyName( _("Delete Text" ), g_Module_Editor_Hokeys_Descr,
  322. HK_DELETE );
  323. AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_TEXTMODULE, msg,
  324. KiBitmap( delete_text_xpm ) );
  325. }
  326. }
  327. break;
  328. case PCB_MODULE_EDGE_T:
  329. {
  330. if( (flags & IS_NEW) )
  331. AddMenuItem( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End edge" ),
  332. KiBitmap( checked_ok_xpm ) );
  333. if( !flags )
  334. {
  335. msg = AddHotkeyName( _("Move Edge" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
  336. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, KiBitmap( move_line_xpm ) );
  337. }
  338. msg = AddHotkeyName( _( "Duplicate Edge" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
  339. AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_line_xpm ) );
  340. msg = AddHotkeyName( _("Move Edge Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
  341. AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_line_xpm ) );
  342. msg = AddHotkeyName( _("Create Edge Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
  343. AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_line_xpm ) );
  344. if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED )
  345. AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place edge" ),
  346. KiBitmap( checked_ok_xpm ) );
  347. msg = AddHotkeyName( _("Edit" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
  348. AddMenuItem( PopMenu, ID_POPUP_MODEDIT_EDIT_BODY_ITEM,
  349. msg, KiBitmap( options_segment_xpm ) );
  350. msg = AddHotkeyName( _("Delete Edge" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
  351. AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_EDGE, msg, KiBitmap( delete_xpm ) );
  352. wxMenu* edit_global_mnu = new wxMenu;
  353. AddMenuItem( PopMenu, edit_global_mnu, ID_POPUP_MODEDIT_GLOBAL_EDIT_EDGE,
  354. _( "Global Changes" ), KiBitmap( edit_xpm ) );
  355. AddMenuItem( edit_global_mnu, ID_POPUP_MODEDIT_EDIT_WIDTH_ALL_EDGE,
  356. _( "Change Body Items Width" ), KiBitmap( width_segment_xpm ) );
  357. AddMenuItem( edit_global_mnu, ID_POPUP_MODEDIT_EDIT_LAYER_ALL_EDGE,
  358. _( "Change Body Items Layer" ), KiBitmap( select_layer_pair_xpm ) );
  359. }
  360. break;
  361. case PCB_LINE_T:
  362. case PCB_TEXT_T:
  363. case PCB_VIA_T:
  364. case PCB_TRACE_T:
  365. case PCB_ZONE_T:
  366. case PCB_MARKER_T:
  367. case PCB_DIMENSION_T:
  368. case PCB_TARGET_T:
  369. msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: Unexpected DrawType %d" ),
  370. item->Type() );
  371. DisplayError( this, msg );
  372. break;
  373. case SCREEN_T:
  374. case TYPE_NOT_INIT:
  375. case PCB_T:
  376. msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ),
  377. item->Type() );
  378. DisplayError( this, msg );
  379. break;
  380. default:
  381. msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
  382. item->Type() );
  383. DisplayError( this, msg );
  384. break;
  385. }
  386. PopMenu->AppendSeparator();
  387. }
  388. if( ( GetToolId() == ID_MODEDIT_LINE_TOOL ) ||
  389. ( GetToolId() == ID_MODEDIT_CIRCLE_TOOL ) ||
  390. ( GetToolId() == ID_MODEDIT_ARC_TOOL ) )
  391. {
  392. AddMenuItem( PopMenu, ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH, _("Set Line Width" ),
  393. KiBitmap( width_segment_xpm ) );
  394. PopMenu->AppendSeparator();
  395. }
  396. return true;
  397. }
  398. /*
  399. * Called on a mouse left button double click
  400. */
  401. void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
  402. {
  403. BOARD_ITEM* item = GetCurItem();
  404. switch( GetToolId() )
  405. {
  406. case ID_NO_TOOL_SELECTED:
  407. if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
  408. {
  409. item = ModeditLocateAndDisplay();
  410. }
  411. if( ( item == NULL ) || ( item->GetFlags() != 0 ) )
  412. break;
  413. // Item found
  414. SetCurItem( item );
  415. OnEditItemRequest( DC, item );
  416. break; // end case 0
  417. case ID_PCB_ADD_LINE_BUTT:
  418. {
  419. if( item && item->IsNew() )
  420. {
  421. End_Edge_Module( (EDGE_MODULE*) item );
  422. SetCurItem( NULL );
  423. m_canvas->Refresh();
  424. }
  425. break;
  426. }
  427. default:
  428. break;
  429. }
  430. }
  431. void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem )
  432. {
  433. switch( aItem->Type() )
  434. {
  435. case PCB_PAD_T:
  436. InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
  437. m_canvas->MoveCursorToCrossHair();
  438. break;
  439. case PCB_MODULE_T:
  440. {
  441. DIALOG_MODULE_MODULE_EDITOR dialog( this, static_cast<MODULE*>( aItem ) );
  442. int ret = dialog.ShowModal();
  443. GetScreen()->GetCurItem()->ClearFlags();
  444. m_canvas->MoveCursorToCrossHair();
  445. if( ret > 0 )
  446. m_canvas->Refresh();
  447. }
  448. break;
  449. case PCB_MODULE_TEXT_T:
  450. InstallTextModOptionsFrame( static_cast<TEXTE_MODULE*>( aItem ), aDC );
  451. m_canvas->MoveCursorToCrossHair();
  452. break;
  453. case PCB_MODULE_EDGE_T :
  454. m_canvas->MoveCursorToCrossHair();
  455. InstallFootprintBodyItemPropertiesDlg( static_cast<EDGE_MODULE*>( aItem ) );
  456. m_canvas->Refresh();
  457. break;
  458. default:
  459. break;
  460. }
  461. }