Global variable reduction and minor code cleaning.

* Remove global variables used by the library editor.
* Add SetWidth() method to library draw objects.
This commit is contained in:
stambaughw 2009-10-19 19:00:47 +00:00
parent 6424910217
commit 502f3160cb
11 changed files with 97 additions and 97 deletions

View File

@ -1239,36 +1239,38 @@ LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int unit, int convert,
* Otherwise NULL. * Otherwise NULL.
*/ */
LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int unit, int convert, LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int unit, int convert,
KICAD_T type, const wxPoint& pt, const int aTransMat[2][2] ) KICAD_T type, const wxPoint& pt,
const int aTransMat[2][2] )
{ {
/* we use LocateDrawItem( int unit, int convert, KICAD_T type, const wxPoint& pt ) /* we use LocateDrawItem( int unit, int convert, KICAD_T type, const
* to search items. * wxPoint& pt ) to search items.
* because this function uses DefaultTransformMatrix as orient/mirror matrix * because this function uses DefaultTransformMatrix as orient/mirror matrix
* we temporary copy aTransMat in DefaultTransformMatrix * we temporary copy aTransMat in DefaultTransformMatrix
*/ */
LIB_DRAW_ITEM * item; LIB_DRAW_ITEM * item;
int matrix[2][2]; int matrix[2][2];
for ( int ii =0; ii<2;ii++ ) for ( int ii = 0; ii < 2; ii++ )
{ {
for ( int jj =0; jj<2;jj++ ) for ( int jj = 0; jj < 2; jj++ )
{ {
matrix[ii][jj] = aTransMat[ii][jj]; matrix[ii][jj] = aTransMat[ii][jj];
EXCHG(matrix[ii][jj], DefaultTransformMatrix[ii][jj]); EXCHG( matrix[ii][jj], DefaultTransformMatrix[ii][jj] );
} }
} }
item = LocateDrawItem( unit, convert, type, pt ); item = LocateDrawItem( unit, convert, type, pt );
//Restore matrix //Restore matrix
for ( int ii =0; ii<2;ii++ ) for ( int ii = 0; ii < 2; ii++ )
{ {
for ( int jj =0; jj<2;jj++ ) for ( int jj = 0; jj < 2; jj++ )
{ {
EXCHG(matrix[ii][jj], DefaultTransformMatrix[ii][jj]); EXCHG( matrix[ii][jj], DefaultTransformMatrix[ii][jj] );
} }
} }
return item; return item;
} }
void LIB_COMPONENT::SetPartCount( int count ) void LIB_COMPONENT::SetPartCount( int count )
{ {
LIB_DRAW_ITEM_LIST::iterator i; LIB_DRAW_ITEM_LIST::iterator i;
@ -1335,7 +1337,8 @@ void LIB_COMPONENT::SetConversion( bool asConvert )
} }
else else
{ {
// Delete converted shape items becuase the converted shape does not exist // Delete converted shape items becuase the converted shape does
// not exist
LIB_DRAW_ITEM_LIST::iterator i = m_Drawings.begin(); LIB_DRAW_ITEM_LIST::iterator i = m_Drawings.begin();
while( i != m_Drawings.end() ) while( i != m_Drawings.end() )

View File

@ -194,8 +194,9 @@ public:
* @param transformMatrix - Cooridinate adjustment settings. * @param transformMatrix - Cooridinate adjustment settings.
* @param showPinText - Show pin text if true. * @param showPinText - Show pin text if true.
* @param drawFields - Draw field text if true otherwise just draw * @param drawFields - Draw field text if true otherwise just draw
* body items (useful to draw a body in schematic, * body items (useful to draw a body in schematic,
* because fields of schematic components replace the lib component fields). * because fields of schematic components replace
* the lib component fields).
* @param onlySelected - Draws only the body items that are selected. * @param onlySelected - Draws only the body items that are selected.
* Used for block move redraws. * Used for block move redraws.
*/ */
@ -401,7 +402,8 @@ public:
* Otherwise NULL. * Otherwise NULL.
*/ */
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type, LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
const wxPoint& pt, const int aTransMat[2][2] ); const wxPoint& pt,
const int aTransMat[2][2] );
/** /**
* Return a reference to the draw item list. * Return a reference to the draw item list.
@ -444,10 +446,6 @@ public:
* *
* Component aliases are not really components. They are references * Component aliases are not really components. They are references
* to an actual component object. * to an actual component object.
*
* @todo Alias objects should really be defined as children of a component
* object not as children of a library object. This would greatly
* simplify searching for components in libraries.
*/ */
class LIB_ALIAS : public CMP_LIB_ENTRY class LIB_ALIAS : public CMP_LIB_ENTRY
{ {

View File

@ -154,6 +154,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
#endif // CLASS_LIBENTRY_FIELDS_H #endif // CLASS_LIBENTRY_FIELDS_H

View File

@ -301,7 +301,7 @@ public:
* @return int - Width of draw object. * @return int - Width of draw object.
*/ */
int GetWidth( void ) { return DoGetWidth(); } int GetWidth( void ) { return DoGetWidth(); }
void SetWidth( int width ) { DoSetWidth( width ); }
protected: protected:
virtual LIB_DRAW_ITEM* DoGenCopy() = 0; virtual LIB_DRAW_ITEM* DoGenCopy() = 0;
@ -326,6 +326,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ) = 0; const int transform[2][2] ) = 0;
virtual int DoGetWidth( void ) = 0; virtual int DoGetWidth( void ) = 0;
virtual void DoSetWidth( int width ) = 0;
}; };
@ -474,6 +475,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
@ -563,6 +565,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
@ -648,6 +651,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
@ -744,6 +748,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
@ -829,6 +834,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
/**********************************/ /**********************************/
@ -913,6 +919,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
@ -1006,6 +1013,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
/**********************************************************/ /**********************************************************/
@ -1099,6 +1107,7 @@ protected:
virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill, virtual void DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
const int transform[2][2] ); const int transform[2][2] );
virtual int DoGetWidth( void ) { return m_Width; } virtual int DoGetWidth( void ) { return m_Width; }
virtual void DoSetWidth( int width ) { m_Width = width; }
}; };
#endif // CLASSES_BODY_ITEMS_H #endif // CLASSES_BODY_ITEMS_H

View File

@ -62,7 +62,7 @@ WinEDA_bodygraphics_PropertiesFrame::WinEDA_bodygraphics_PropertiesFrame( WinEDA
if ( CurrentItem->m_Unit == 0 ) if ( CurrentItem->m_Unit == 0 )
m_CommonUnit->SetValue( TRUE ); m_CommonUnit->SetValue( TRUE );
} }
else if ( ! g_FlDrawSpecificUnit ) else if ( ! m_Parent->m_drawSpecificUnit )
{ {
m_CommonUnit->SetValue( TRUE ); m_CommonUnit->SetValue( TRUE );
} }
@ -72,7 +72,7 @@ WinEDA_bodygraphics_PropertiesFrame::WinEDA_bodygraphics_PropertiesFrame( WinEDA
if ( CurrentItem->m_Convert == 0 ) if ( CurrentItem->m_Convert == 0 )
m_CommonConvert->SetValue( TRUE ); m_CommonConvert->SetValue( TRUE );
} }
else if ( !g_FlDrawSpecificConvert ) else if ( !m_Parent->m_drawSpecificConvert )
{ {
m_CommonConvert->SetValue( TRUE ); m_CommonConvert->SetValue( TRUE );
} }

View File

@ -112,15 +112,15 @@ void Dialog_BodyGraphicText_Properties::InitDialog( )
} }
else else
{ {
msg = ReturnStringFromValue( g_UnitMetric, g_LastTextSize, msg = ReturnStringFromValue( g_UnitMetric, m_Parent->m_textSize,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
m_TextSize->SetValue( msg ); m_TextSize->SetValue( msg );
if ( ! g_FlDrawSpecificUnit ) if ( ! m_Parent->m_drawSpecificUnit )
m_CommonUnit->SetValue( TRUE ); m_CommonUnit->SetValue( TRUE );
if ( ! g_FlDrawSpecificConvert ) if ( ! m_Parent->m_drawSpecificConvert )
m_CommonConvert->SetValue( TRUE ); m_CommonConvert->SetValue( TRUE );
if ( g_LastTextOrient == TEXT_ORIENT_VERT ) if ( m_Parent->m_textOrientation == TEXT_ORIENT_VERT )
m_Orient->SetValue( TRUE ); m_Orient->SetValue( TRUE );
} }
@ -149,12 +149,13 @@ void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
wxString Line; wxString Line;
Line = m_TextValue->GetValue(); Line = m_TextValue->GetValue();
g_LastTextOrient = m_Orient->GetValue() ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ; m_Parent->m_textOrientation =
m_Orient->GetValue() ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ;
wxString msg = m_TextSize->GetValue(); wxString msg = m_TextSize->GetValue();
g_LastTextSize = ReturnValueFromString(g_UnitMetric, msg, m_Parent->m_textSize = ReturnValueFromString( g_UnitMetric, msg,
m_Parent->m_InternalUnits); m_Parent->m_InternalUnits );
g_FlDrawSpecificConvert = m_CommonConvert->GetValue() ? FALSE : TRUE; m_Parent->m_drawSpecificConvert = m_CommonConvert->GetValue() ? false : true;
g_FlDrawSpecificUnit = m_CommonUnit->GetValue() ? FALSE : TRUE; m_Parent->m_drawSpecificUnit = m_CommonUnit->GetValue() ? false : true;
if ( m_GraphicText ) if ( m_GraphicText )
{ {
@ -163,15 +164,15 @@ void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
else else
m_GraphicText->m_Text = wxT("[null]"); m_GraphicText->m_Text = wxT("[null]");
m_GraphicText->m_Size.x = m_GraphicText->m_Size.y = g_LastTextSize; m_GraphicText->m_Size.x = m_GraphicText->m_Size.y = m_Parent->m_textSize;
m_GraphicText->m_Orient = g_LastTextOrient; m_GraphicText->m_Orient = m_Parent->m_textOrientation;
if( g_FlDrawSpecificUnit ) if( m_Parent->m_drawSpecificUnit )
m_GraphicText->m_Unit = m_Parent->GetUnit(); m_GraphicText->m_Unit = m_Parent->GetUnit();
else else
m_GraphicText->m_Unit = 0; m_GraphicText->m_Unit = 0;
if( g_FlDrawSpecificConvert ) if( m_Parent->m_drawSpecificConvert )
m_GraphicText->m_Convert = m_Parent->GetConvert(); m_GraphicText->m_Convert = m_Parent->GetConvert();
else else
m_GraphicText->m_Convert = 0; m_GraphicText->m_Convert = 0;

View File

@ -47,13 +47,6 @@ struct EESchemaVariables g_EESchemaVar;
/* Variables globales pour Schematic Edit */ /* Variables globales pour Schematic Edit */
int g_DefaultTextLabelSize = DEFAULT_SIZE_TEXT; int g_DefaultTextLabelSize = DEFAULT_SIZE_TEXT;
/* Variables globales pour LibEdit */
int g_LastTextSize = DEFAULT_SIZE_TEXT;
int g_LastTextOrient = TEXT_ORIENT_HORIZ;
bool g_FlDrawSpecificUnit = FALSE;
bool g_FlDrawSpecificConvert = TRUE;
HPGL_Pen_Descr_Struct g_HPGL_Pen_Descr; HPGL_Pen_Descr_Struct g_HPGL_Pen_Descr;
//SCH_SCREEN * ScreenSch; //SCH_SCREEN * ScreenSch;

View File

@ -129,12 +129,6 @@ extern struct EESchemaVariables g_EESchemaVar;
/* Variables globales pour Schematic Edit */ /* Variables globales pour Schematic Edit */
extern int g_DefaultTextLabelSize; extern int g_DefaultTextLabelSize;
/* Variables globales pour LibEdit */
extern int g_LastTextSize;
extern int g_LastTextOrient;
extern bool g_FlDrawSpecificUnit;
extern bool g_FlDrawSpecificConvert;
/********************************************************/ /********************************************************/
/* Description des structures des parametres principaux */ /* Description des structures des parametres principaux */

View File

@ -13,6 +13,9 @@ class CMP_LIBRARY;
class LIB_COMPONENT; class LIB_COMPONENT;
class LIB_ALIAS; class LIB_ALIAS;
class LIB_DRAW_ITEM; class LIB_DRAW_ITEM;
class WinEDA_bodygraphics_PropertiesFrame;
class Dialog_BodyGraphicText_Properties;
/** /**
* The component library editor main window. * The component library editor main window.
@ -187,21 +190,44 @@ protected:
wxString m_LastLibImportPath; wxString m_LastLibImportPath;
wxString m_LastLibExportPath; wxString m_LastLibExportPath;
static LIB_COMPONENT* m_component; // The current edited component (NULL if no component) /// Convert of the item currently being drawn.
static CMP_LIBRARY* m_library; // The current active libary (NULL if none) bool m_drawSpecificConvert;
bool m_drawSpecificUnit;
// The current edited component (NULL if no component)
static LIB_COMPONENT* m_component;
// The current active libary (NULL if none)
static CMP_LIBRARY* m_library;
static LIB_DRAW_ITEM* m_lastDrawItem; static LIB_DRAW_ITEM* m_lastDrawItem;
static LIB_DRAW_ITEM* m_drawItem; static LIB_DRAW_ITEM* m_drawItem;
static wxString m_aliasName; static wxString m_aliasName;
static int m_unit; // The unit number to edit and show
static int m_convert; // Show the normal shape ( m_convert <= 1 ) // The unit number to edit and show
// or the converted shape ( m_convert > 1 ) static int m_unit;
static bool m_showDeMorgan; // true to force DeMorgan/normal tools selection enabled
// They are enabled when the loaded component has // Show the normal shape ( m_convert <= 1 ) or the converted shape
// Graphic items for converted shape // ( m_convert > 1 )
// But under some circumstances (New component created) static int m_convert;
// these tools must left enable
// true to force DeMorgan/normal tools selection enabled.
// They are enabled when the loaded component has
// Graphic items for converted shape
// But under some circumstances (New component created)
// these tools must left enable
static bool m_showDeMorgan;
/// The current text size setting.
static int m_textSize;
/// Current text orientation setting.
static int m_textOrientation;
static wxSize m_clientSize; static wxSize m_clientSize;
friend class WinEDA_bodygraphics_PropertiesFrame;
friend class Dialog_BodyGraphicText_Properties;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@ -48,6 +48,8 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::m_lastDrawItem = NULL;
LIB_DRAW_ITEM* WinEDA_LibeditFrame::m_drawItem = NULL; LIB_DRAW_ITEM* WinEDA_LibeditFrame::m_drawItem = NULL;
bool WinEDA_LibeditFrame::m_showDeMorgan = false; bool WinEDA_LibeditFrame::m_showDeMorgan = false;
wxSize WinEDA_LibeditFrame::m_clientSize = wxSize( -1, -1 ); wxSize WinEDA_LibeditFrame::m_clientSize = wxSize( -1, -1 );
int WinEDA_LibeditFrame::m_textSize = DEFAULT_SIZE_TEXT;
int WinEDA_LibeditFrame::m_textOrientation = TEXT_ORIENT_HORIZ;
/*****************************/ /*****************************/
@ -155,6 +157,8 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
m_Draw_Grid = true; // true pour avoir la axes dessinee m_Draw_Grid = true; // true pour avoir la axes dessinee
m_ConfigPath = wxT( "LibraryEditor" ); m_ConfigPath = wxT( "LibraryEditor" );
SetShowDeMorgan( false ); SetShowDeMorgan( false );
m_drawSpecificConvert = true;
m_drawSpecificUnit = false;
// Give an icon // Give an icon
SetIcon( wxIcon( libedit_xpm ) ); SetIcon( wxIcon( libedit_xpm ) );

View File

@ -51,8 +51,8 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma
if( item == NULL ) if( item == NULL )
return; return;
g_FlDrawSpecificConvert = m_CommonConvert->GetValue() ? FALSE : TRUE; m_Parent->m_drawSpecificConvert = m_CommonConvert->GetValue() ? false : true;
g_FlDrawSpecificUnit = m_CommonUnit->GetValue() ? FALSE : TRUE; m_Parent->m_drawSpecificUnit = m_CommonUnit->GetValue() ? false : true;
if( m_Filled ) if( m_Filled )
FlSymbol_Fill = (FILL_T) m_Filled->GetSelection(); FlSymbol_Fill = (FILL_T) m_Filled->GetSelection();
@ -68,49 +68,20 @@ void WinEDA_bodygraphics_PropertiesFrame::bodygraphics_PropertiesAccept( wxComma
item->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), -1, g_XorMode, item->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), -1, g_XorMode,
NULL, DefaultTransformMatrix ); NULL, DefaultTransformMatrix );
if( g_FlDrawSpecificUnit ) if( m_Parent->m_drawSpecificUnit )
item->m_Unit = m_Parent->GetUnit(); item->m_Unit = m_Parent->GetUnit();
else else
item->m_Unit = 0; item->m_Unit = 0;
if( g_FlDrawSpecificConvert ) if( m_Parent->m_drawSpecificConvert )
item->m_Convert = m_Parent->GetConvert(); item->m_Convert = m_Parent->GetConvert();
else else
item->m_Convert = 0; item->m_Convert = 0;
if( m_Filled ) if( m_Filled )
{ {
switch( item->Type() ) item->m_Fill = FlSymbol_Fill;
{ item->SetWidth( m_GraphicShapeWidthCtrl->GetValue() );
case COMPONENT_ARC_DRAW_TYPE:
( (LIB_ARC*) item )->m_Fill = FlSymbol_Fill;
( (LIB_ARC*) item )->m_Width =
m_GraphicShapeWidthCtrl->GetValue();
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
( (LIB_CIRCLE*) item )->m_Fill = FlSymbol_Fill;
( (LIB_CIRCLE*) item )->m_Width =
m_GraphicShapeWidthCtrl->GetValue();
break;
case COMPONENT_RECT_DRAW_TYPE:
( (LIB_RECTANGLE*) item )->m_Fill = FlSymbol_Fill;
( (LIB_RECTANGLE*) item )->m_Width =
m_GraphicShapeWidthCtrl->GetValue();
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
( (LIB_POLYLINE*) item )->m_Fill =
FlSymbol_Fill;
( (LIB_POLYLINE*) item )->m_Width =
m_GraphicShapeWidthCtrl->GetValue();
break;
default:
break;
}
item->GetParent()->GetDrawItemList().sort(); item->GetParent()->GetDrawItemList().sort();
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
@ -254,8 +225,8 @@ LIB_DRAW_ITEM* WinEDA_LibeditFrame::CreateGraphicItem( LIB_COMPONENT* LibEntry,
LIB_TEXT* Text = new LIB_TEXT( LibEntry ); LIB_TEXT* Text = new LIB_TEXT( LibEntry );
m_drawItem = Text; m_drawItem = Text;
Text->m_Size.x = Text->m_Size.y = g_LastTextSize; Text->m_Size.x = Text->m_Size.y = m_textSize;
Text->m_Orient = g_LastTextOrient; Text->m_Orient = m_textOrientation;
Text->m_Pos = GetScreen()->m_Curseur; Text->m_Pos = GetScreen()->m_Curseur;
NEGATE( Text->m_Pos.y ); NEGATE( Text->m_Pos.y );
EditSymbolText( NULL, Text ); EditSymbolText( NULL, Text );
@ -284,9 +255,9 @@ error" ) );
if( m_drawItem ) if( m_drawItem )
{ {
m_drawItem->m_Flags |= IS_NEW; m_drawItem->m_Flags |= IS_NEW;
if( g_FlDrawSpecificUnit ) if( m_drawSpecificUnit )
m_drawItem->m_Unit = m_unit; m_drawItem->m_Unit = m_unit;
if( g_FlDrawSpecificConvert ) if( m_drawSpecificConvert )
m_drawItem->m_Convert = m_convert; m_drawItem->m_Convert = m_convert;
} }