Commit fa9230e2 authored by jerryjacobs's avatar jerryjacobs

Changed 3D module author after mail contact. Cleanup of function...

Changed 3D module author after mail contact. Cleanup of function implementions. WinEDA_TextFrame color change (text black, background, white)
parent 8a5da43c
...@@ -41,4 +41,4 @@ Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke ...@@ -41,4 +41,4 @@ Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke
== Programm credits for icons and others == Programm credits for icons and others
Icons by Iigo Zuluagaz <inigo_zuluaga@yahoo.es> Icons by Iigo Zuluagaz <inigo_zuluaga@yahoo.es>
3D modules by Renie Marquet <reniemarquet@uol.com.br> 3D modules by Renie Marquet <reniemarquet@uol.com.br>
3D modules by Cyril Frausti <cyril.frausti@gmail.com> 3D modules by Christophe Boschat <nox454@hotmail.fr>
...@@ -140,5 +140,5 @@ void InitKiCadAbout( wxAboutDialogInfo& info ) ...@@ -140,5 +140,5 @@ void InitKiCadAbout( wxAboutDialogInfo& info )
/* Add programm credits for icons */ /* Add programm credits for icons */
info.AddArtist( wxT( "Icons by Iñigo Zuluagaz <inigo_zuluaga@yahoo.es>" ) ); info.AddArtist( wxT( "Icons by Iñigo Zuluagaz <inigo_zuluaga@yahoo.es>" ) );
info.AddArtist( SetMsg( wxT( "3D modules by Renie Marquet <reniemarquet@uol.com.br>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Renie Marquet <reniemarquet@uol.com.br>" ) ) );
info.AddArtist( SetMsg( wxT( "3D modules by Cyril Frausti <cyril.frausti@gmail.com>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Christophe Boschat <nox454@hotmail.fr>" ) ) );
} }
...@@ -53,7 +53,8 @@ BASE_SCREEN::~BASE_SCREEN() ...@@ -53,7 +53,8 @@ BASE_SCREEN::~BASE_SCREEN()
/*******************************/ /*******************************/
void BASE_SCREEN::InitDatas() void
BASE_SCREEN::InitDatas()
/*******************************/ /*******************************/
{ {
if( m_Center ) if( m_Center )
...@@ -79,19 +80,23 @@ void BASE_SCREEN::InitDatas() ...@@ -79,19 +80,23 @@ void BASE_SCREEN::InitDatas()
m_FlagSave = 1; // Used in auto save: set when an auto save is made m_FlagSave = 1; // Used in auto save: set when an auto save is made
} }
/* /**
* Get screen units scalar. * Get screen units scalar.
* *
* Default implimentation returns scalar used for schematic screen. The * Default implimentation returns scalar used for schematic screen. The
* internal units used by the schematic screen is 1 mil (0.001"). Override * internal units used by the schematic screen is 1 mil (0.001"). Override
* this in derived classes that require internal units other than 1 mil. * this in derived classes that require internal units other than 1 mil.
*/ */
int BASE_SCREEN::GetInternalUnits( void ) int
BASE_SCREEN::GetInternalUnits( void )
{ {
return EESCHEMA_INTERNAL_UNIT; return EESCHEMA_INTERNAL_UNIT;
} }
wxSize BASE_SCREEN::ReturnPageSize( void ) /************************************/
wxSize
BASE_SCREEN::ReturnPageSize( void )
/************************************/
{ {
int internal_units = GetInternalUnits(); int internal_units = GetInternalUnits();
...@@ -99,13 +104,16 @@ wxSize BASE_SCREEN::ReturnPageSize( void ) ...@@ -99,13 +104,16 @@ wxSize BASE_SCREEN::ReturnPageSize( void )
( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 ); ( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 );
} }
/******************************************************************/
wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /**
/******************************************************************/ * Function CursorRealPosition
/** Function CursorRealPosition
* @return the position in user units of location ScreenPos * @return the position in user units of location ScreenPos
* @param ScreenPos = the screen (in pixel) position co convert * @param ScreenPos = the screen (in pixel) position co convert
*/ */
/******************************************************************/
wxPoint
BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
/******************************************************************/
{ {
wxPoint curpos = ScreenPos; wxPoint curpos = ScreenPos;
Unscale( curpos ); Unscale( curpos );
......
/******************************************************************/ /**
/* basicframe.cpp - fonctions des classes du type WinEDA_BasicFrame */ * WinEDA_BasicFrame Class Functions
/******************************************************************/ * @file basicframe.cpp
*/
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation # pragma implementation
#endif #endif
/* wxWidgets about dialog */
#include <wx/aboutdlg.h> #include <wx/aboutdlg.h>
#include <wx/fontdlg.h>
#include "wx/statline.h" #include "wx/statline.h"
#include "wx/generic/aboutdlgg.h" #include "wx/generic/aboutdlgg.h"
#include <wx/fontdlg.h>
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
...@@ -22,15 +23,18 @@ ...@@ -22,15 +23,18 @@
#include "wxstruct.h" #include "wxstruct.h"
/*******************************************************/ /*
/* Constructeur de WinEDA_BasicFrame: la fenetre generale */ * Class constructor for WinEDA_BasicFrame general options
/*******************************************************/ */
/**********************************************************/
WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,
int idtype,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos,
const wxSize& size,
long style ) : long style ) :
wxFrame( father, -1, title, pos, size, style ) wxFrame( father, -1, title, pos, size, style )
/**********************************************************/
{ {
wxSize minsize; wxSize minsize;
...@@ -56,6 +60,9 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, ...@@ -56,6 +60,9 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype,
} }
/*
*
*/
/******************************************/ /******************************************/
WinEDA_BasicFrame::~WinEDA_BasicFrame() WinEDA_BasicFrame::~WinEDA_BasicFrame()
/******************************************/ /******************************************/
...@@ -66,18 +73,22 @@ WinEDA_BasicFrame::~WinEDA_BasicFrame() ...@@ -66,18 +73,22 @@ WinEDA_BasicFrame::~WinEDA_BasicFrame()
} }
/********************************************/ /*
void WinEDA_BasicFrame::ReCreateMenuBar() * Virtual function
/********************************************/ */
/***********************************/
// Virtual function void
WinEDA_BasicFrame::ReCreateMenuBar()
/***********************************/
{ {
} }
/*********************************************/ /*******************************/
void WinEDA_BasicFrame::GetSettings() void
/*********************************************/ WinEDA_BasicFrame::GetSettings()
/*******************************/
{ {
wxString text; wxString text;
int Ypos_min; int Ypos_min;
...@@ -110,9 +121,10 @@ void WinEDA_BasicFrame::GetSettings() ...@@ -110,9 +121,10 @@ void WinEDA_BasicFrame::GetSettings()
} }
/*****************************************/ /********************************/
void WinEDA_BasicFrame::SaveSettings() void
/*****************************************/ WinEDA_BasicFrame::SaveSettings()
/********************************/
{ {
wxString text; wxString text;
wxConfig* config; wxConfig* config;
...@@ -137,19 +149,22 @@ void WinEDA_BasicFrame::SaveSettings() ...@@ -137,19 +149,22 @@ void WinEDA_BasicFrame::SaveSettings()
/******************************************************/ /******************************************************/
void WinEDA_BasicFrame::PrintMsg( const wxString& text ) void
WinEDA_BasicFrame::PrintMsg( const wxString& text )
/******************************************************/ /******************************************************/
{ {
SetStatusText( text ); SetStatusText( text );
} }
/*
* Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100
*/
/*************************************************************************/ /*************************************************************************/
void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) void
WinEDA_BasicFrame::DisplayActivity( int PerCent,
const wxString& Text )
/*************************************************************************/ /*************************************************************************/
/* Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100
*/
{ {
wxString Line; wxString Line;
...@@ -165,23 +180,26 @@ void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) ...@@ -165,23 +180,26 @@ void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text )
} }
/*
* Met a jour la liste des anciens projets
*/
/*******************************************************************/ /*******************************************************************/
void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName ) void
WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName )
/*******************************************************************/ /*******************************************************************/
/* Met a jour la liste des anciens projets
*/
{ {
wxGetApp().m_fileHistory.AddFileToHistory( FullFileName ); wxGetApp().m_fileHistory.AddFileToHistory( FullFileName );
ReCreateMenuBar(); ReCreateMenuBar();
} }
/** /*
* Fetch the file name from the file history list. * Fetch the file name from the file history list.
*/ */
/*********************************************************************/
wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId,
const wxString& type ) const wxString& type )
/*********************************************************************/
{ {
wxString fn, msg; wxString fn, msg;
size_t i; size_t i;
...@@ -209,12 +227,18 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, ...@@ -209,12 +227,18 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId,
} }
/*
*
*/
/**************************************************************/ /**************************************************************/
void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) void
WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
/**************************************************************/ /**************************************************************/
{ {
wxString msg; wxString msg;
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
if( wxGetApp().m_HtmlCtrl == NULL ) if( wxGetApp().m_HtmlCtrl == NULL )
{ {
wxGetApp().InitOnLineHelp(); wxGetApp().InitOnLineHelp();
...@@ -231,6 +255,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) ...@@ -231,6 +255,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() );
DisplayError( this, msg ); DisplayError( this, msg );
} }
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
// wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; // wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName;
// if ( wxFileExists(fullfilename) ) // if ( wxFileExists(fullfilename) )
...@@ -252,12 +277,17 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) ...@@ -252,12 +277,17 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
GetAssociatedDocument( this, wxEmptyString, helpFile ); GetAssociatedDocument( this, wxEmptyString, helpFile );
#else #else
#error Help files format not defined # error Help files format not defined
#endif #endif
} }
/*
*
*/
/***********************************************************************/ /***********************************************************************/
void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) void
WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) )
/***********************************************************************/ /***********************************************************************/
{ {
wxAboutDialogInfo info; wxAboutDialogInfo info;
...@@ -266,8 +296,12 @@ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) ...@@ -266,8 +296,12 @@ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) )
} }
/*
*
*/
/********************************************************************/ /********************************************************************/
void WinEDA_BasicFrame::ProcessFontPreferences( int id ) void
WinEDA_BasicFrame::ProcessFontPreferences( int id )
/********************************************************************/ /********************************************************************/
{ {
wxFont font; wxFont font;
...@@ -308,3 +342,4 @@ void WinEDA_BasicFrame::ProcessFontPreferences( int id ) ...@@ -308,3 +342,4 @@ void WinEDA_BasicFrame::ProcessFontPreferences( int id )
break; break;
} }
} }
This diff is collapsed.
/*************************************************/ /**
/* drawtxt.cpp : Function to draw and plot texts */ * Functions to draw and plot text on screen
/*************************************************/ * @file drawtxt.cpp
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -14,24 +14,12 @@ ...@@ -14,24 +14,12 @@
#include "class_base_screen.h" #include "class_base_screen.h"
#ifndef DEFAULT_SIZE_TEXT #ifndef DEFAULT_SIZE_TEXT
#define DEFAULT_SIZE_TEXT 50 # define DEFAULT_SIZE_TEXT 50
#endif #endif
#define EDA_DRAWBASE #define EDA_DRAWBASE
#include "grfonte.h" #include "grfonte.h"
/* fonctions locales : */
/****************************************************************************************************/
void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aPos, EDA_Colors aColor, const wxString& aText,
int aOrient, const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth, bool aItalic,
void (* aCallback) (int x0, int y0, int xf, int yf))
/****************************************************************************************************/
/** Function DrawGraphicText /** Function DrawGraphicText
* Draw a graphic text (like module texts) * Draw a graphic text (like module texts)
...@@ -50,6 +38,20 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -50,6 +38,20 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
* @param aCallback() = function called (if non null) to draw each segment. * @param aCallback() = function called (if non null) to draw each segment.
* used to draw 3D texts or for plotting, NULL for normal drawings * used to draw 3D texts or for plotting, NULL for normal drawings
*/ */
/****************************************************************************************************/
void DrawGraphicText( WinEDA_DrawPanel* aPanel,
wxDC* aDC,
const wxPoint& aPos,
EDA_Colors aColor,
const wxString& aText,
int aOrient,
const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth,
bool aItalic,
void (* aCallback) (int x0, int y0, int xf, int yf))
/****************************************************************************************************/
{ {
int ii, kk, char_count, AsciiCode, endcar; int ii, kk, char_count, AsciiCode, endcar;
int x0, y0; int x0, y0;
...@@ -313,8 +315,18 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -313,8 +315,18 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
/* functions used to plot texts, using DrawGraphicText() with a call back function */ /* functions used to plot texts, using DrawGraphicText() with a call back function */
static void (*MovePenFct)( wxPoint pos, int state ); // a pointer to actual plot function (HPGL, PS, ..) static void (*MovePenFct)( wxPoint pos, int state ); // a pointer to actual plot function (HPGL, PS, ..)
static bool s_Plotbegin; // Flag to init plot static bool s_Plotbegin; // Flag to init plot
/* The call back function */
static void s_Callback_plot(int x0, int y0, int xf, int yf)
/*
* The call back function
*/
/**********************/
static void
s_Callback_plot(int x0,
int y0,
int xf,
int yf)
/**********************/
{ {
static wxPoint PenLastPos; static wxPoint PenLastPos;
wxPoint pstart; wxPoint pstart;
...@@ -347,15 +359,6 @@ static void s_Callback_plot(int x0, int y0, int xf, int yf) ...@@ -347,15 +359,6 @@ static void s_Callback_plot(int x0, int y0, int xf, int yf)
} }
/******************************************************************************************/
void PlotGraphicText( int aFormat_plot, const wxPoint& aPos, enum EDA_Colors aColor,
const wxString& aText,
int aOrient, const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth, bool aItalic )
/******************************************************************************************/
/** Function PlotGraphicText /** Function PlotGraphicText
* same as DrawGraphicText, but plot graphic text insteed of draw it * same as DrawGraphicText, but plot graphic text insteed of draw it
* @param aFormat_plot = plot format (PLOT_FORMAT_POST, PLOT_FORMAT_HPGL, PLOT_FORMAT_GERBER) * @param aFormat_plot = plot format (PLOT_FORMAT_POST, PLOT_FORMAT_HPGL, PLOT_FORMAT_GERBER)
...@@ -370,6 +373,18 @@ void PlotGraphicText( int aFormat_plot, const wxPoint& aPos, enum EDA_Colors aCo ...@@ -370,6 +373,18 @@ void PlotGraphicText( int aFormat_plot, const wxPoint& aPos, enum EDA_Colors aCo
* if width < 0 : draw segments in sketch mode, width = abs(width) * if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
*/ */
/******************************************************************************************/
void PlotGraphicText( int aFormat_plot,
const wxPoint& aPos,
enum EDA_Colors aColor,
const wxString& aText,
int aOrient,
const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth,
bool aItalic )
/******************************************************************************************/
{ {
// Initialise the actual function used to plot lines: // Initialise the actual function used to plot lines:
switch( aFormat_plot ) switch( aFormat_plot )
...@@ -403,3 +418,4 @@ void PlotGraphicText( int aFormat_plot, const wxPoint& aPos, enum EDA_Colors aCo ...@@ -403,3 +418,4 @@ void PlotGraphicText( int aFormat_plot, const wxPoint& aPos, enum EDA_Colors aCo
/* end text : pen UP ,no move */ /* end text : pen UP ,no move */
MovePenFct( wxPoint( 0, 0 ), 'Z' ); MovePenFct( wxPoint( 0, 0 ), 'Z' );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment