2009-01-19 19:08:42 +00:00
|
|
|
/**
|
|
|
|
* The common library
|
|
|
|
* @file common.h
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-19 19:08:42 +00:00
|
|
|
#ifndef __INCLUDE__COMMON_H__
|
|
|
|
#define __INCLUDE__COMMON_H__ 1
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2010-10-08 20:40:57 +00:00
|
|
|
#include "wx/wx.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
#include "wx/confbase.h"
|
|
|
|
#include "wx/fileconf.h"
|
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
class wxAboutDialogInfo;
|
|
|
|
class BASE_SCREEN;
|
2011-01-21 19:30:59 +00:00
|
|
|
class EDA_DRAW_FRAME;
|
|
|
|
class EDA_DRAW_PANEL;
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2007-08-27 08:07:44 +00:00
|
|
|
/* Flag for special keys */
|
2009-11-23 20:18:47 +00:00
|
|
|
#define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right
|
|
|
|
* shift key depressed */
|
|
|
|
#define GR_KB_LEFTSHIFT 0x20000000 /* left shift key depressed
|
|
|
|
*/
|
|
|
|
#define GR_KB_CTRL 0x40000000 /* CTRL depressed */
|
|
|
|
#define GR_KB_ALT 0x80000000 /* ALT depressed */
|
|
|
|
#define GR_KB_SHIFT (GR_KB_LEFTSHIFT | GR_KB_RIGHTSHIFT)
|
|
|
|
#define GR_KB_SHIFTCTRL (GR_KB_SHIFT | GR_KB_CTRL)
|
|
|
|
#define MOUSE_MIDDLE 0x08000000 /* Middle button mouse
|
|
|
|
* flag for block commands
|
|
|
|
*/
|
|
|
|
|
2010-02-24 15:33:03 +00:00
|
|
|
// default name for nameless projects
|
2010-07-11 16:24:44 +00:00
|
|
|
#define NAMELESS_PROJECT wxT( "noname" )
|
2010-02-24 15:33:03 +00:00
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
#define NB_ITEMS 11
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2007-08-27 08:07:44 +00:00
|
|
|
/* Pseudo key codes for command panning */
|
2007-05-06 16:03:28 +00:00
|
|
|
enum pseudokeys {
|
2007-08-27 08:07:44 +00:00
|
|
|
EDA_PANNING_UP_KEY = 1,
|
2007-08-14 19:24:48 +00:00
|
|
|
EDA_PANNING_DOWN_KEY,
|
|
|
|
EDA_PANNING_LEFT_KEY,
|
2007-08-27 08:07:44 +00:00
|
|
|
EDA_PANNING_RIGHT_KEY,
|
|
|
|
EDA_ZOOM_IN_FROM_MOUSE,
|
|
|
|
EDA_ZOOM_OUT_FROM_MOUSE,
|
|
|
|
EDA_ZOOM_CENTER_FROM_MOUSE
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define ESC 27
|
|
|
|
|
2009-01-19 19:08:42 +00:00
|
|
|
/* TODO Executable names TODO*/
|
2007-05-06 16:03:28 +00:00
|
|
|
#ifdef __WINDOWS__
|
2010-07-11 16:24:44 +00:00
|
|
|
#define CVPCB_EXE wxT( "cvpcb.exe" )
|
|
|
|
#define PCBNEW_EXE wxT( "pcbnew.exe" )
|
|
|
|
#define EESCHEMA_EXE wxT( "eeschema.exe" )
|
|
|
|
#define GERBVIEW_EXE wxT( "gerbview.exe" )
|
|
|
|
#define BITMAPCONVERTER_EXE wxT( "bitmap2component.exe" )
|
2011-08-05 19:53:42 +00:00
|
|
|
#define PCB_CALCULATOR_EXE wxT( "pcb_calculator.exe" )
|
2007-05-06 16:03:28 +00:00
|
|
|
#else
|
2010-07-11 16:24:44 +00:00
|
|
|
#ifndef __WXMAC__
|
|
|
|
#define CVPCB_EXE wxT( "cvpcb" )
|
|
|
|
#define PCBNEW_EXE wxT( "pcbnew" )
|
|
|
|
#define EESCHEMA_EXE wxT( "eeschema" )
|
|
|
|
#define GERBVIEW_EXE wxT( "gerbview" )
|
|
|
|
#define BITMAPCONVERTER_EXE wxT( "bitmap2component" )
|
2011-08-05 19:53:42 +00:00
|
|
|
#define PCB_CALCULATOR_EXE wxT( "pcb_calculator" )
|
2007-10-28 17:47:17 +00:00
|
|
|
#else
|
2010-07-11 16:24:44 +00:00
|
|
|
#define CVPCB_EXE wxT( "cvpcb.app/Contents/MacOS/cvpcb" )
|
|
|
|
#define PCBNEW_EXE wxT( "pcbnew.app/Contents/MacOS/pcbnew" )
|
|
|
|
#define EESCHEMA_EXE wxT( "eeschema.app/Contents/MacOS/eeschema" )
|
|
|
|
#define GERBVIEW_EXE wxT( "gerbview.app/Contents/MacOS/gerbview" )
|
|
|
|
#define BITMAPCONVERTER_EXE wxT( "bitmap2component.app/Contents/MacOS/bitmap2component" )
|
2011-08-05 19:53:42 +00:00
|
|
|
#define PCB_CALCULATOR_EXE wxT( "pcb_calculator.app/Contents/MacOS/pcb_calculator" )
|
2009-01-19 19:08:42 +00:00
|
|
|
# endif
|
2007-05-28 18:09:49 +00:00
|
|
|
#endif
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2007-08-27 08:07:44 +00:00
|
|
|
/* Graphic Texts Orientation in 0.1 degree*/
|
2009-11-23 20:18:47 +00:00
|
|
|
#define TEXT_ORIENT_HORIZ 0
|
|
|
|
#define TEXT_ORIENT_VERT 900
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-10-30 19:26:25 +00:00
|
|
|
#define ON 1
|
|
|
|
#define OFF 0
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-09-06 19:42:46 +00:00
|
|
|
|
|
|
|
enum EDA_UNITS_T {
|
2010-07-12 14:07:09 +00:00
|
|
|
INCHES = 0,
|
|
|
|
MILLIMETRES = 1,
|
|
|
|
UNSCALED_UNITS = 2
|
|
|
|
};
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-11-05 11:41:15 +00:00
|
|
|
#if defined(KICAD_GOST)
|
2010-07-13 13:18:13 +00:00
|
|
|
#define GOST_LEFTMARGIN 800 /* 20mm */
|
|
|
|
#define GOST_RIGHTMARGIN 200 /* 5mm */
|
|
|
|
#define GOST_TOPMARGIN 200 /* 5mm */
|
|
|
|
#define GOST_BOTTOMMARGIN 200 /* 5mm */
|
2008-11-05 11:41:15 +00:00
|
|
|
|
|
|
|
#endif
|
2007-05-06 16:03:28 +00:00
|
|
|
/* forward declarations: */
|
|
|
|
class LibNameList;
|
|
|
|
|
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
/* Class to handle pages sizes:
|
2007-09-13 11:55:46 +00:00
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
class Ki_PageDescr
|
2007-05-28 18:09:49 +00:00
|
|
|
{
|
2007-05-06 16:03:28 +00:00
|
|
|
// All sizes are in 1/1000 inch
|
|
|
|
public:
|
2007-09-13 11:55:46 +00:00
|
|
|
wxSize m_Size; /* page size in 1/1000 inch */
|
|
|
|
wxPoint m_Offset; /* plot offset in 1/1000 inch */
|
2007-08-14 19:24:48 +00:00
|
|
|
wxString m_Name;
|
2007-09-13 11:55:46 +00:00
|
|
|
int m_LeftMargin;
|
|
|
|
int m_RightMargin;
|
|
|
|
int m_TopMargin;
|
|
|
|
int m_BottomMargin;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
public:
|
2011-04-19 14:28:34 +00:00
|
|
|
Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name );
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
extern Ki_PageDescr g_Sheet_A4;
|
|
|
|
extern Ki_PageDescr g_Sheet_A3;
|
|
|
|
extern Ki_PageDescr g_Sheet_A2;
|
|
|
|
extern Ki_PageDescr g_Sheet_A1;
|
|
|
|
extern Ki_PageDescr g_Sheet_A0;
|
|
|
|
extern Ki_PageDescr g_Sheet_A;
|
|
|
|
extern Ki_PageDescr g_Sheet_B;
|
|
|
|
extern Ki_PageDescr g_Sheet_C;
|
|
|
|
extern Ki_PageDescr g_Sheet_D;
|
|
|
|
extern Ki_PageDescr g_Sheet_E;
|
|
|
|
extern Ki_PageDescr g_Sheet_GERBER;
|
|
|
|
extern Ki_PageDescr g_Sheet_user;
|
|
|
|
extern Ki_PageDescr* g_SheetSizeList[];
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
extern wxString g_ProductName;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-04-14 16:45:22 +00:00
|
|
|
/* Default user lib path can be left void, if the standard lib path is used */
|
2009-11-23 20:18:47 +00:00
|
|
|
extern wxString g_UserLibDirBuffer;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
extern bool g_ShowPageLimits; // TRUE to display the page limits
|
2009-03-28 20:02:34 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
/* File name extension definitions. */
|
|
|
|
extern const wxString ProjectFileExtension;
|
|
|
|
extern const wxString SchematicFileExtension;
|
|
|
|
extern const wxString NetlistFileExtension;
|
|
|
|
extern const wxString GerberFileExtension;
|
2010-05-17 20:35:46 +00:00
|
|
|
extern const wxString PcbFileExtension;
|
2009-04-23 15:02:18 +00:00
|
|
|
extern const wxString PdfFileExtension;
|
2011-09-07 09:27:02 +00:00
|
|
|
extern const wxString MacrosFileExtension;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
extern const wxString ProjectFileWildcard;
|
|
|
|
extern const wxString SchematicFileWildcard;
|
|
|
|
extern const wxString BoardFileWildcard;
|
|
|
|
extern const wxString NetlistFileWildcard;
|
|
|
|
extern const wxString GerberFileWildcard;
|
2010-05-17 20:35:46 +00:00
|
|
|
extern const wxString PcbFileWildcard;
|
2009-04-23 15:02:18 +00:00
|
|
|
extern const wxString PdfFileWildcard;
|
2011-09-07 09:27:02 +00:00
|
|
|
extern const wxString MacrosFileWildcard;
|
2009-04-05 20:49:15 +00:00
|
|
|
extern const wxString AllFilesWildcard;
|
2007-05-28 18:09:49 +00:00
|
|
|
|
|
|
|
|
2009-10-30 19:26:25 +00:00
|
|
|
// Name of default configuration file. (kicad.pro)
|
2009-11-23 20:18:47 +00:00
|
|
|
extern wxString g_Prj_Default_Config_FullFilename;
|
|
|
|
|
2009-10-30 19:26:25 +00:00
|
|
|
// Name of local configuration file. (<curr projet>.pro)
|
2009-11-23 20:18:47 +00:00
|
|
|
extern wxString g_Prj_Config_LocalFilename;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-09-06 19:42:46 +00:00
|
|
|
extern EDA_UNITS_T g_UserUnit; ///< display units
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* Draw color for moving objects: */
|
2009-11-23 20:18:47 +00:00
|
|
|
extern int g_GhostColor;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* COMMON.CPP */
|
2008-04-24 16:55:35 +00:00
|
|
|
|
2010-11-12 16:59:16 +00:00
|
|
|
/**
|
|
|
|
* Function SetLocaleTo_C_standard
|
2011-09-30 18:15:37 +00:00
|
|
|
* because KiCad is internationalized, switch internalization to "C" standard
|
2009-11-23 20:18:47 +00:00
|
|
|
* i.e. uses the . (dot) as separator in print/read float numbers
|
|
|
|
* (some countries (France, Germany ..) use , (comma) as separator)
|
|
|
|
* This function must be called before read or write ascii files using float
|
|
|
|
* numbers in data the SetLocaleTo_C_standard function must be called after
|
|
|
|
* reading or writing the file
|
|
|
|
*
|
|
|
|
* This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function,
|
2011-09-30 18:15:37 +00:00
|
|
|
* but could make more easier an optional use of locale in KiCad
|
2009-11-23 20:18:47 +00:00
|
|
|
*/
|
|
|
|
void SetLocaleTo_C_standard( void );
|
2008-06-06 16:39:45 +00:00
|
|
|
|
2010-11-12 16:59:16 +00:00
|
|
|
/**
|
|
|
|
* Function SetLocaleTo_Default
|
2011-09-30 18:15:37 +00:00
|
|
|
* because KiCad is internationalized, switch internalization to default
|
2009-11-23 20:18:47 +00:00
|
|
|
* to use the default separator in print/read float numbers
|
|
|
|
* (. (dot) but some countries (France, Germany ..) use , (comma) as
|
|
|
|
* separator)
|
|
|
|
* This function must be called after a call to SetLocaleTo_C_standard
|
|
|
|
*
|
|
|
|
* This is wrapper to the C setlocale( LC_NUMERIC, "" ) function,
|
2011-09-30 18:15:37 +00:00
|
|
|
* but could make more easier an optional use of locale in KiCad
|
2009-11-23 20:18:47 +00:00
|
|
|
*/
|
|
|
|
void SetLocaleTo_Default( void );
|
2008-04-24 16:55:35 +00:00
|
|
|
|
2009-01-29 17:30:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function EnsureTextCtrlWidth
|
2009-11-23 20:18:47 +00:00
|
|
|
* sets the minimum pixel width on a text control in order to make a text
|
|
|
|
* string be fully visible within it. The current font within the text
|
|
|
|
* control is considered.
|
2009-01-29 17:30:38 +00:00
|
|
|
* The text can come either from the control or be given as an argument.
|
|
|
|
* If the text control is larger than needed, then nothing is done.
|
|
|
|
* @param aCtrl the text control to potentially make wider.
|
2009-11-23 20:18:47 +00:00
|
|
|
* @param aString the text that is used in sizing the control's pixel width.
|
|
|
|
* If NULL, then
|
2009-01-29 17:30:38 +00:00
|
|
|
* the text already within the control is used.
|
|
|
|
* @return bool - true if the \a aCtrl had its size changed, else false.
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl,
|
|
|
|
const wxString* aString = NULL );
|
2009-01-29 17:30:38 +00:00
|
|
|
|
|
|
|
|
2008-05-05 19:47:58 +00:00
|
|
|
/**
|
|
|
|
* Operator << overload
|
|
|
|
* outputs a point to the argument string in a format resembling
|
|
|
|
* "@ (x,y)
|
|
|
|
* @param aString Where to put the text describing the point value
|
|
|
|
* @param aPoint The point to output.
|
|
|
|
* @return wxString& - the input string
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
wxString& operator <<( wxString& aString, const wxPoint& aPoint );
|
2008-05-05 19:47:58 +00:00
|
|
|
|
|
|
|
|
2008-04-24 16:55:35 +00:00
|
|
|
/**
|
|
|
|
* Function ProcessExecute
|
|
|
|
* runs a child process.
|
2009-11-23 20:18:47 +00:00
|
|
|
* @param aCommandLine The process and any arguments to it all in a single
|
|
|
|
* string.
|
2008-04-24 16:55:35 +00:00
|
|
|
* @param aFlags The same args as allowed for wxExecute()
|
|
|
|
* @return bool - true if success, else false
|
|
|
|
*/
|
2011-04-12 14:19:59 +00:00
|
|
|
bool ProcessExecute( const wxString& aCommandLine, int aFlags = wxEXEC_ASYNC );
|
2008-04-24 16:55:35 +00:00
|
|
|
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2008-08-15 16:38:05 +00:00
|
|
|
/*******************/
|
|
|
|
/* about_kicad.cpp */
|
|
|
|
/*******************/
|
2009-11-23 20:18:47 +00:00
|
|
|
void InitKiCadAbout( wxAboutDialogInfo& info );
|
2008-08-15 16:38:05 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/**************/
|
|
|
|
/* common.cpp */
|
2007-05-28 18:09:49 +00:00
|
|
|
/**************/
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
int GetTimeStamp();
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
int DisplayColorFrame( wxWindow* parent, int OldColor );
|
|
|
|
int GetCommandOptions( const int argc, const char** argv,
|
|
|
|
const char* stringtst, const char** optarg,
|
|
|
|
int* optind );
|
2007-09-13 11:55:46 +00:00
|
|
|
|
|
|
|
|
2009-10-30 19:26:25 +00:00
|
|
|
/* Returns to display the value of a parameter, by type of units selected
|
|
|
|
* Input: value in mils, buffer text
|
|
|
|
* Returns to buffer: text: value expressed in inches or millimeters
|
|
|
|
* Followed by " or mm
|
2007-09-13 11:55:46 +00:00
|
|
|
*/
|
2008-09-05 19:02:39 +00:00
|
|
|
const wxString& valeur_param( int valeur, wxString& buf_texte );
|
|
|
|
|
2011-03-25 19:16:05 +00:00
|
|
|
/**
|
|
|
|
* Function CoordinateToString
|
|
|
|
* is a helper to convert the integer coordinate \a aValue to a string in inches,
|
|
|
|
* millimeters, or unscaled units according to the current user units setting.
|
|
|
|
*
|
|
|
|
* @param aValue The coordinate to convert.
|
|
|
|
* @param aInternalUnits The internal units of the application. #EESCHEMA_INTERNAL_UNIT
|
|
|
|
* and #PCB_INTERNAL_UNIT are the only valid value.
|
|
|
|
* @param aConvertToMils Convert inch values to mils if true. This setting has no effect if
|
|
|
|
* the current user unit is millimeters.
|
|
|
|
* @return The converted string for display in user interface elements.
|
|
|
|
*/
|
|
|
|
wxString CoordinateToString( int aValue, int aInternalUnits, bool aConvertToMils = false );
|
|
|
|
|
2010-03-16 18:22:59 +00:00
|
|
|
/**
|
|
|
|
* Returns the units symbol.
|
|
|
|
*
|
|
|
|
* @param aUnits - Units type, default is current units setting.
|
|
|
|
* @param aFormatString - A formatting string to embed the units symbol into. Note:
|
|
|
|
* the format string must contain the %s format specifier.
|
|
|
|
* @return The formatted units symbol.
|
|
|
|
*/
|
2011-09-06 19:42:46 +00:00
|
|
|
wxString ReturnUnitSymbol( EDA_UNITS_T aUnits = g_UserUnit,
|
2010-12-14 15:56:30 +00:00
|
|
|
const wxString& aFormatString = _( " (%s):" ) );
|
2009-10-30 19:26:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a human readable units string.
|
|
|
|
*
|
|
|
|
* The strings returned are full text name and not abbreviations or symbolic
|
2010-03-16 18:22:59 +00:00
|
|
|
* representations of the units. Use ReturnUnitSymbol() for that.
|
2009-10-30 19:26:25 +00:00
|
|
|
*
|
2010-03-16 18:22:59 +00:00
|
|
|
* @param aUnits - The units text to return.
|
2009-10-30 19:26:25 +00:00
|
|
|
* @return The human readable units string.
|
|
|
|
*/
|
2011-09-06 19:42:46 +00:00
|
|
|
wxString GetUnitsLabel( EDA_UNITS_T aUnits );
|
|
|
|
wxString GetAbbreviatedUnitsLabel( EDA_UNITS_T aUnit = g_UserUnit );
|
2009-10-30 19:26:25 +00:00
|
|
|
|
2011-09-06 19:42:46 +00:00
|
|
|
int ReturnValueFromString( EDA_UNITS_T aUnit, const wxString& TextValue,
|
2009-11-23 20:18:47 +00:00
|
|
|
int Internal_Unit );
|
2008-09-09 11:32:21 +00:00
|
|
|
|
2010-11-12 16:59:16 +00:00
|
|
|
/**
|
|
|
|
* Function ReturnStringFromValue
|
2008-09-09 11:32:21 +00:00
|
|
|
* Return the string from Value, according to units (inch, mm ...) for display,
|
|
|
|
* and the initial unit for value
|
|
|
|
* @param aUnit = display units (INCHES, MILLIMETRE ..)
|
|
|
|
* @param aValue = value in Internal_Unit
|
|
|
|
* @param aInternal_Unit = units per inch for Value
|
|
|
|
* @param aAdd_unit_symbol = true to add symbol unit to the string value
|
2009-11-23 20:18:47 +00:00
|
|
|
* @return a wxString what contains value and optionally the symbol unit (like
|
|
|
|
* 2.000 mm)
|
2008-09-09 11:32:21 +00:00
|
|
|
*/
|
2011-09-06 19:42:46 +00:00
|
|
|
wxString ReturnStringFromValue( EDA_UNITS_T aUnit,
|
2009-11-23 20:18:47 +00:00
|
|
|
int aValue,
|
|
|
|
int aInternal_Unit,
|
|
|
|
bool aAdd_unit_symbol = false );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2011-09-06 19:42:46 +00:00
|
|
|
void AddUnitSymbol( wxStaticText& Stext, EDA_UNITS_T aUnit = g_UserUnit );
|
2008-09-09 11:32:21 +00:00
|
|
|
|
2007-09-13 11:55:46 +00:00
|
|
|
/* Add string " (mm):" or " ("):" to the static text Stext.
|
|
|
|
* Used in dialog boxes for entering values depending on selected units */
|
2009-11-23 20:18:47 +00:00
|
|
|
void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value,
|
|
|
|
int Internal_Unit );
|
2007-09-13 11:55:46 +00:00
|
|
|
|
|
|
|
/* Convert the number Value in a string according to the internal units
|
2010-07-12 14:07:09 +00:00
|
|
|
* and the selected unit (g_UserUnit) and put it in the wxTextCtrl TextCtrl
|
2009-11-23 20:18:47 +00:00
|
|
|
**/
|
|
|
|
int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr,
|
|
|
|
int Internal_Unit );
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
/* return a String List from a string, with a specific splitter*/
|
|
|
|
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
|
2009-04-28 19:34:42 +00:00
|
|
|
|
2009-03-12 15:24:52 +00:00
|
|
|
/**
|
|
|
|
* Function To_User_Unit
|
|
|
|
* Convert in inch or mm the variable "val" (double)given in internal units
|
|
|
|
* @return the converted value, in double
|
2010-07-12 14:07:09 +00:00
|
|
|
* @param aUnit : user unit to be converted to
|
2009-03-12 15:24:52 +00:00
|
|
|
* @param val : double : the given value
|
|
|
|
* @param internal_unit_value = internal units per inch
|
|
|
|
*/
|
2011-09-06 19:42:46 +00:00
|
|
|
double To_User_Unit( EDA_UNITS_T aUnit,
|
2009-11-23 20:18:47 +00:00
|
|
|
double val,
|
|
|
|
int internal_unit_value );
|
|
|
|
|
2011-09-06 19:42:46 +00:00
|
|
|
int From_User_Unit( EDA_UNITS_T aUnit,
|
2009-11-23 20:18:47 +00:00
|
|
|
double val,
|
|
|
|
int internal_unit_value );
|
|
|
|
wxString GenDate();
|
|
|
|
void MyFree( void* pt_mem );
|
|
|
|
void* MyZMalloc( size_t nb_octets );
|
|
|
|
void* MyMalloc( size_t nb_octets );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2010-08-03 02:13:33 +00:00
|
|
|
#endif // __INCLUDE__COMMON_H__
|