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.

189 lines
4.9 KiB

  1. /**********************************************************/
  2. /* Routines d'affichage de parametres et caracteristiques */
  3. /**********************************************************/
  4. /* Fichier AFFICHE.CPP */
  5. #include "fctsys.h"
  6. #include "gr_basic.h"
  7. #include "common.h"
  8. #include "program.h"
  9. #include "libcmp.h"
  10. #include "general.h"
  11. #include "protos.h"
  12. /***********************************************************/
  13. void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame )
  14. /************************************************************/
  15. {
  16. frame->MsgPanel->EraseMsgBox();
  17. Affiche_1_Parametre( frame, 1, _( "Name" ), m_SheetName, CYAN );
  18. Affiche_1_Parametre( frame, 30, _( "FileName" ), m_FileName, BROWN );
  19. }
  20. /***************************************************************/
  21. void SCH_COMPONENT::Display_Infos( WinEDA_DrawFrame* frame )
  22. /***************************************************************/
  23. {
  24. EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;
  25. wxString msg;
  26. frame->MsgPanel->EraseMsgBox();
  27. Affiche_1_Parametre( frame, 1, _( "Ref" ),
  28. GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet()), DARKCYAN );
  29. if( Entry && Entry->m_Options == ENTRY_POWER )
  30. msg = _( "Pwr Symb" );
  31. else
  32. msg = _( "Val" );
  33. Affiche_1_Parametre( frame, 10, msg, GetField(VALUE)->m_Text, DARKCYAN );
  34. Affiche_1_Parametre( frame, 28, _( "RefLib" ), m_ChipName.GetData(), BROWN );
  35. msg = FindLibName;
  36. Affiche_1_Parametre( frame, 40, _( "Lib" ), msg, DARKRED );
  37. if( Entry )
  38. {
  39. Affiche_1_Parametre( frame, 52, Entry->m_Doc, Entry->m_KeyWord, DARKCYAN );
  40. }
  41. }
  42. /*******************************************************/
  43. void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
  44. /*******************************************************/
  45. /* Affiche en bas d'ecran les caracteristiques de la pin
  46. */
  47. {
  48. wxString Text;
  49. int ii;
  50. frame->MsgPanel->EraseMsgBox();
  51. /* Affichage du nom */
  52. Affiche_1_Parametre( frame, 30, _( "PinName" ), m_PinName, DARKCYAN );
  53. /* Affichage du numero */
  54. if( m_PinNum == 0 )
  55. Text = wxT( "?" );
  56. else
  57. ReturnPinStringNum( Text );
  58. Affiche_1_Parametre( frame, 38, _( "PinNum" ), Text, DARKCYAN );
  59. /* Affichage du type */
  60. ii = m_PinType;
  61. Affiche_1_Parametre( frame, 44, _( "PinType" ), MsgPinElectricType[ii], RED );
  62. /* Affichage de la visiblite */
  63. ii = m_Attributs;
  64. if( ii & 1 )
  65. Text = _( "no" );
  66. else
  67. Text = _( "yes" );
  68. Affiche_1_Parametre( frame, 50, _( "Display" ), Text, DARKGREEN );
  69. /* Display pin length */
  70. Text = ReturnStringFromValue( g_UnitMetric, m_PinLen, EESCHEMA_INTERNAL_UNIT, true );
  71. Affiche_1_Parametre( frame, 56, _( "Length" ), Text, MAGENTA );
  72. /* Affichage de l'orientation */
  73. switch( m_Orient )
  74. {
  75. case PIN_UP:
  76. Text = _( "Up" ); break;
  77. case PIN_DOWN:
  78. Text = _( "Down" ); break;
  79. case PIN_LEFT:
  80. Text = _( "Left" ); break;
  81. case PIN_RIGHT:
  82. Text = _( "Right" ); break;
  83. default:
  84. Text = wxT( "??" ); break;
  85. }
  86. Affiche_1_Parametre( frame, 62, _( "Orient" ), Text, MAGENTA );
  87. }
  88. /***********************************************************************/
  89. void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
  90. /***********************************************************************/
  91. /* Affiche en bas d'ecran les caracteristiques de l'element
  92. */
  93. {
  94. wxString msg;
  95. frame->MsgPanel->EraseMsgBox();
  96. /* affichage du type */
  97. msg = wxT( "??" );
  98. switch( Type() )
  99. {
  100. case COMPONENT_ARC_DRAW_TYPE:
  101. msg = wxT( "Arc" ); break;
  102. case COMPONENT_CIRCLE_DRAW_TYPE:
  103. msg = wxT( "Circle" ); break;
  104. case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
  105. msg = wxT( "Text" ); break;
  106. case COMPONENT_RECT_DRAW_TYPE:
  107. msg = wxT( "Rect" ); break;
  108. case COMPONENT_POLYLINE_DRAW_TYPE:
  109. msg = wxT( "PolyLine" ); break;
  110. case COMPONENT_LINE_DRAW_TYPE:
  111. msg = wxT( "Segment" ); break;
  112. case COMPONENT_PIN_DRAW_TYPE:
  113. ( (LibDrawPin*) this )->Display_Infos( frame );
  114. msg = wxT( "Pin" );
  115. break;
  116. default:
  117. ;
  118. }
  119. Affiche_1_Parametre( frame, 1, wxT( "Type" ), msg, CYAN );
  120. /* Affichage de l'appartenance */
  121. if( m_Unit == 0 )
  122. msg = _( "All" );
  123. else
  124. msg.Printf( wxT( "%d" ), m_Unit );
  125. Affiche_1_Parametre( frame, 8, _( "Unit" ), msg, BROWN );
  126. if( m_Convert == 0 )
  127. msg = _( "All" );
  128. else if( m_Convert == 1 )
  129. msg = _( "no" );
  130. else if( m_Convert == 2 )
  131. msg = _( "yes" );
  132. else
  133. msg = wxT( "?" );
  134. Affiche_1_Parametre( frame, 14, _( "Convert" ), msg, BROWN );
  135. if( m_Width )
  136. msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true );
  137. else
  138. msg = _( "default" );
  139. Affiche_1_Parametre( frame, 20, _( "Width" ), msg, BLUE );
  140. }