lkundrak / rpms / kicad

Forked from rpms/kicad 5 years ago
Clone
Blob Blame History Raw
diff -ru kicad-2010.04.06/common/confirm.cpp kicad-2010.04.06-new/common/confirm.cpp
--- kicad-2010.04.06/common/confirm.cpp	2009-11-23 16:16:50.000000000 +0100
+++ kicad-2010.04.06-new/common/confirm.cpp	2010-05-03 22:16:32.000000000 +0200
@@ -119,9 +119,9 @@
  * Title = title to display
  * Buffer: enter text by user
  * Leading and trailing spaces are removed
- * If buffer != "Buffer is displayed
+ * Buffer is the initial text displayed, anr the returned text
  * Return:
- * 0 if OK
+ * 1 if OK
  * 0 if ESCAPE
  */
 int Get_Message( const wxString& title,           // The question
diff -ru kicad-2010.04.06/eeschema/edit_component_in_schematic.cpp kicad-2010.04.06-new/eeschema/edit_component_in_schematic.cpp
--- kicad-2010.04.06/eeschema/edit_component_in_schematic.cpp	2010-05-03 21:13:57.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/edit_component_in_schematic.cpp	2010-05-03 22:27:08.000000000 +0200
@@ -19,11 +19,11 @@
 
 
 /******************************************************************************/
+/* Prepare the displacement of the text being edited.
+/*
+/******************************************************************************/
 void WinEDA_SchematicFrame::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC )
 {
-/******************************************************************************/
-/* Prepare the displacement of the text being edited.
- */
     LIB_COMPONENT* Entry;
 
     SetCurrentField( aField );
@@ -82,10 +82,10 @@
 
 
 /******************************************************************************/
+/* Edit the field Field (text, size)  */
+/******************************************************************************/
 void WinEDA_SchematicFrame::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC )
 {
-/******************************************************************************/
-/* Edit the field Field (text, size)  */
     int            fieldNdx, flag;
     LIB_COMPONENT* Entry;
 
@@ -122,7 +122,6 @@
         }
     }
 
-
     /* save old cmp in undo list if not already in edit, or moving ... */
     if( Field->m_Flags == 0 )
         SaveCopyInUndoList( Cmp, UR_CHANGED );
@@ -167,16 +166,15 @@
 
     Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
     Cmp->DisplayInfo( this );
-    OnModify( );
+    OnModify();
 }
 
 
-/************************************************************************/
+/*
+ * Move standard text field.  This routine is normally attached to the cursor.
+ */
 static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
 {
-/************************************************************************/
-/* Move standard text field.  This routine is normally attached to the cursor.
- **/
     wxPoint pos;
     int x1, y1;
     int fieldNdx;
@@ -211,10 +209,8 @@
 }
 
 
-/******************************************************************/
 static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC )
 {
-/******************************************************************/
     Panel->ForceCloseManageCurseur = NULL;
     Panel->ManageCurseur = NULL;
 
@@ -236,10 +232,8 @@
 }
 
 
-/*********************************************************************************/
 void WinEDA_SchematicFrame::RotateCmpField( SCH_FIELD* Field, wxDC* DC )
 {
-/*********************************************************************************/
     int            fieldNdx, flag;
     LIB_COMPONENT* Entry;
 
@@ -277,16 +271,15 @@
         Field->m_Orient = TEXT_ORIENT_HORIZ;
     Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
 
-    OnModify( );
+    OnModify();
 }
 
 
 /****************************************************************************/
-void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp,
-                                                    wxDC*          DC )
-{
-/****************************************************************************/
 /* Edit the component text reference*/
+/****************************************************************************/
+void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
+{
     LIB_COMPONENT* Entry;
     int            flag = 0;
 
@@ -312,25 +305,22 @@
         Cmp->SetRef( GetSheet(), ref );
 
         Cmp->GetField( REFERENCE )->m_AddExtraText = flag;
-        Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0,
-                                                                  0 ),
-                                          g_XorMode );
+        Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
         Cmp->SetRef( GetSheet(), ref );
-        Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0,
-                                                                  0 ),
-                                          Cmp->m_Flags ? g_XorMode :
-                                          GR_DEFAULT_DRAWMODE );
-        OnModify( );
+        Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
+                                          Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
+        OnModify();
     }
+
     Cmp->DisplayInfo( this );
 }
 
 
 /*****************************************************************************/
+/* Routine to change the selected text */
+/*****************************************************************************/
 void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
 {
-/*****************************************************************************/
-/* Routine to change the selected text */
     wxString       message;
     LIB_COMPONENT* Entry;
 
@@ -348,7 +338,7 @@
     if( Get_Message( _( "Value" ), _( "Component value" ), message, this ) )
         message.Empty();  //allow the user to remove the value.
 
-    if( !message.IsEmpty() && !message.IsEmpty() )
+    if( !message.IsEmpty() )
     {
         /* save old cmp in undo list if not already in edit, or moving ... */
         if( Cmp->m_Flags == 0 )
@@ -358,18 +348,15 @@
         TextField->m_Text = message;
         TextField->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
                          Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
-        OnModify( );
+        OnModify();
     }
 
     Cmp->DisplayInfo( this );
 }
 
 
-/*****************************************************************************/
-void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp,
-                                                    wxDC*          DC )
+void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
 {
-/*****************************************************************************/
     wxString       message;
     LIB_COMPONENT* Entry;
     bool           wasEmpty = false;
@@ -388,15 +375,13 @@
     if( message.IsEmpty() )
         wasEmpty = true;
 
-    if( Get_Message( _( "Footprint" ), _( "Component footprint" ), message,
-                     this ) )
+    if( Get_Message( _( "Footprint" ), _( "Component footprint" ), message, this ) )
         message.Empty();    // allow the user to remove the value.
 
     // save old cmp in undo list if not already in edit, or moving ...
     if( Cmp->m_Flags == 0 )
         SaveCopyInUndoList( Cmp, UR_CHANGED );
-    Cmp->GetField( FOOTPRINT )->Draw( DrawPanel, DC, wxPoint( 0,
-                                                              0 ), g_XorMode );
+    Cmp->GetField( FOOTPRINT )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
 
     // move the field if it was new.
     if( wasEmpty && !message.IsEmpty() )
@@ -421,7 +406,7 @@
         Cmp->GetField( FOOTPRINT )->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
                                           Cmp->m_Flags ? g_XorMode :
                                           GR_DEFAULT_DRAWMODE );
-        OnModify( );
+        OnModify();
     }
 
     Cmp->DisplayInfo( this );
diff -ru kicad-2010.04.06/eeschema/libedit_plot_component.cpp kicad-2010.04.06-new/eeschema/libedit_plot_component.cpp
--- kicad-2010.04.06/eeschema/libedit_plot_component.cpp	2010-03-28 17:46:49.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/libedit_plot_component.cpp	2010-05-03 22:28:31.000000000 +0200
@@ -53,6 +53,9 @@
         if( FullFileName.IsEmpty() )
             return;
 
+        // calling wxYield is mandatory under Linux, after closing the file selector dialog
+        // to refresh the screen before creating the PNG or JPEG image from screen
+        wxYield();
         CreatePNGorJPEGFile( FullFileName, fmt_is_jpeg );
     }
         break;
diff -ru kicad-2010.04.06/pcbnew/class_dimension.cpp kicad-2010.04.06-new/pcbnew/class_dimension.cpp
--- kicad-2010.04.06/pcbnew/class_dimension.cpp	2010-05-03 21:13:57.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/class_dimension.cpp	2010-05-03 22:29:50.000000000 +0200
@@ -354,7 +354,7 @@
     const char keyWordLine[] = "$COTATION\n";
     const char keyWordLineEnd[] = "$endCOTATION\n";
 
-    if( fprintf( aFile, keyWordLineEnd ) != sizeof(keyWordLineEnd)-1 )
+    if( fputs( keyWordLine, aFile ) == EOF )
         goto out;
 
     fprintf( aFile, "Ge %d %d %lX\n", m_Shape, m_Layer, m_TimeStamp );
@@ -401,7 +401,7 @@
              FlecheG2_ox, FlecheG2_oy,
              FlecheG2_fx, FlecheG2_fy, m_Width );
 
-    if( fprintf( aFile, "$EndCOTATION\n" ) != sizeof("$EndCOTATION\n")-1 )
+    if( fputs( keyWordLineEnd, aFile ) == EOF )
         goto out;
 
     rc = true;