Commit 9f8e1d9d authored by charras's avatar charras

removed some warning when compiling. Added comments

parent 21faf9d3
/* TODO ENGLISH BRIEF TODO */ /***************/
/* edaappl.cpp */
/***************/
/*** /***
* @file edaapl.cpp * @file edaapl.cpp
* @brief methodes relative a la classe winEDA_App, communes * @brief For the main application: init functions, and language selection (locale handling)
* aux environements window et linux
***/ ***/
#define EDA_BASE #define EDA_BASE
...@@ -649,8 +650,8 @@ void WinEDA_App::SaveSettings() ...@@ -649,8 +650,8 @@ void WinEDA_App::SaveSettings()
* the files are in kicad/internat/xx or kicad/internat/xx_XX * the files are in kicad/internat/xx or kicad/internat/xx_XX
* and are named kicad.mo * and are named kicad.mo
* *
* @param first_time TODO * @param first_time must be set to true the first time this funct is called, false otherwise
* @return TODO * @return true if the language can be set (i.e. if the locale is available)
*/ */
/*********************************************/ /*********************************************/
bool WinEDA_App::SetLanguage( bool first_time ) bool WinEDA_App::SetLanguage( bool first_time )
...@@ -705,10 +706,10 @@ bool WinEDA_App::SetLanguage( bool first_time ) ...@@ -705,10 +706,10 @@ bool WinEDA_App::SetLanguage( bool first_time )
} }
/** /** Function SetLanguageIdentifier
* Return in m_LanguageId the wxWidgets language identifier Id * Set in .m_LanguageId member the wxWidgets language identifier Id
* from the kicad menu id (internal menu identifier) * from the kicad menu id (internal menu identifier)
* @param menu_id TODO * @param menu_id = the kicad menuitem id (returned by Menu Event, when clicking on a menu item)
* @return none * @return none
*/ */
/**************************************************/ /**************************************************/
...@@ -731,23 +732,24 @@ void WinEDA_App::SetLanguageIdentifier( int menu_id ) ...@@ -731,23 +732,24 @@ void WinEDA_App::SetLanguageIdentifier( int menu_id )
} }
/** /** Function AddMenuLanguageList
* Create menu list for language choice. * Create menu list for language choice, and add it as submenu to a main menu
* @param MasterMenu TODO * @param MasterMenu : The main menu. The sub menu list will be accessible from the menu item with id ID_LANGUAGE_CHOICE
* @return TODO * @return none
*/ */
/*********************************************************/ /*********************************************************/
wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu ) void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
/*********************************************************/ /*********************************************************/
{ {
wxMenu* menu; wxMenu* menu = NULL;
wxMenuItem* item; wxMenuItem* item;
unsigned int ii; unsigned int ii;
item = MasterMenu->FindItem( ID_LANGUAGE_CHOICE ); item = MasterMenu->FindItem( ID_LANGUAGE_CHOICE );
if( item == NULL ) if( item ) // This menu exists, do nothing
{ return;
menu = new wxMenu; menu = new wxMenu;
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ ) for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{ {
...@@ -768,8 +770,8 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu ) ...@@ -768,8 +770,8 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
_( "Language" ), _( "Language" ),
_( "Select application language (only for testing!)" ), _( "Select application language (only for testing!)" ),
language_xpm ); language_xpm );
}
// Set Check mark on current selected language
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ ) for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{ {
if( m_LanguageId == s_Language_List[ii].m_WX_Lang_Identifier ) if( m_LanguageId == s_Language_List[ii].m_WX_Lang_Identifier )
...@@ -777,14 +779,12 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu ) ...@@ -777,14 +779,12 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
else else
menu->Check( s_Language_List[ii].m_KI_Lang_Identifier, false ); menu->Check( s_Language_List[ii].m_KI_Lang_Identifier, false );
} }
return menu;
} }
/** /**
* Run init scripts * Run init scripts
* @return TODO * @return the defualt OnRun() value (exit codes not used in kicad, so value has no special mening)
*/ */
/**********************/ /**********************/
int WinEDA_App::OnRun() int WinEDA_App::OnRun()
......
...@@ -100,7 +100,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar() ...@@ -100,7 +100,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
*/ */
{ {
wxMenuItem* item; wxMenuItem* item;
wxMenuBar* menuBar; wxMenuBar* menuBar = GetMenuBar();
/* Destroy the existing menu bar so it can be rebuilt. This allows /* Destroy the existing menu bar so it can be rebuilt. This allows
* language changes of the menu text on the fly. */ * language changes of the menu text on the fly. */
if( menuBar ) if( menuBar )
...@@ -141,7 +141,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar() ...@@ -141,7 +141,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
// Font selection and setup // Font selection and setup
AddFontSelectionMenu( configmenu ); AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator(); configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,
......
...@@ -302,7 +302,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() ...@@ -302,7 +302,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
// Font selection and setup // Font selection and setup
AddFontSelectionMenu( configmenu ); AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator(); configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ), item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ),
......
...@@ -97,7 +97,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -97,7 +97,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
// Font selection and setup // Font selection and setup
AddFontSelectionMenu( configmenu ); AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator(); configmenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( configmenu, ID_CONFIG_SAVE, _( "&Save Setup" ), ADD_MENUITEM_WITH_HELP( configmenu, ID_CONFIG_SAVE, _( "&Save Setup" ),
......
...@@ -62,7 +62,13 @@ public: ...@@ -62,7 +62,13 @@ public:
void SetDefaultSearchPaths( void ); void SetDefaultSearchPaths( void );
void InitEDA_Appl( const wxString& name ); void InitEDA_Appl( const wxString& name );
bool SetLanguage( bool first_time = FALSE ); bool SetLanguage( bool first_time = FALSE );
wxMenu* SetLanguageList( wxMenu* MasterMenu );
/** Function AddMenuLanguageList
* Create menu list for language choice, and add it as submenu to a main menu
* @param MasterMenu : The main menu. The sub menu list will be accessible from the menu item with id ID_LANGUAGE_CHOICE
* @return the sub menu Language list
*/
void AddMenuLanguageList( wxMenu* MasterMenu );
void SetLanguageIdentifier( int menu_id ); void SetLanguageIdentifier( int menu_id );
void InitOnLineHelp(); void InitOnLineHelp();
......
...@@ -247,7 +247,7 @@ void WinEDA_MainFrame::ReCreateMenuBar() ...@@ -247,7 +247,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
datasheet_xpm ); datasheet_xpm );
PreferencesMenu->AppendSeparator(); PreferencesMenu->AppendSeparator();
wxGetApp().SetLanguageList( PreferencesMenu ); wxGetApp().AddMenuLanguageList( PreferencesMenu );
/**********************************************************************/ /**********************************************************************/
......
...@@ -65,7 +65,6 @@ private: ...@@ -65,7 +65,6 @@ private:
void OnButtonCancelClick( wxCommandEvent& event ){ Close(); } void OnButtonCancelClick( wxCommandEvent& event ){ Close(); }
void SetScale( wxCommandEvent& event ); void SetScale( wxCommandEvent& event );
void SetPenWidth(); void SetPenWidth();
wxString BuildPrintTitle();
public: public:
bool IsMirrored() { return m_Print_Mirror->IsChecked(); } bool IsMirrored() { return m_Print_Mirror->IsChecked(); }
bool ExcludeEdges() { return m_Exclude_Edges_Pcb->IsChecked(); } bool ExcludeEdges() { return m_Exclude_Edges_Pcb->IsChecked(); }
...@@ -111,8 +110,8 @@ public: ...@@ -111,8 +110,8 @@ public:
void WinEDA_DrawFrame::ToPrinter( wxCommandEvent& event ) void WinEDA_DrawFrame::ToPrinter( wxCommandEvent& event )
/*******************************************************/ /*******************************************************/
/* Prepare les structures de donn�es de gestion de l'impression /* Virtual function:
* et affiche la fenetre de dialogue de gestion de l'impression des feuilles * Display the print dialog
*/ */
{ {
if( g_PrintData == NULL ) // First print if( g_PrintData == NULL ) // First print
...@@ -302,22 +301,6 @@ void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event ) ...@@ -302,22 +301,6 @@ void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event )
} }
/*****************************************************/
wxString DIALOG_PRINT_USING_PRINTER::BuildPrintTitle()
/*****************************************************/
/* return a valid filename to create a print file
*/
{
wxString name, ext;
wxFileName::SplitPath( m_Parent->GetBaseScreen()->m_FileName,
(wxString*) NULL, &name, &ext );
name += wxT( "-" ) + ext;
return name;
}
/******************************************************************/ /******************************************************************/
void DIALOG_PRINT_USING_PRINTER::SetScale( wxCommandEvent& event ) void DIALOG_PRINT_USING_PRINTER::SetScale( wxCommandEvent& event )
/******************************************************************/ /******************************************************************/
...@@ -387,10 +370,6 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event ) ...@@ -387,10 +370,6 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
/* Open and display a previewer frame for printing /* Open and display a previewer frame for printing
*/ */
{ {
wxSize WSize;
wxPoint WPos;
int x, y;
SetScale( event ); SetScale( event );
SetPenWidth(); SetPenWidth();
...@@ -402,7 +381,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event ) ...@@ -402,7 +381,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
s_Print_Sheet_Ref = m_Print_Sheet_Ref->GetValue(); s_Print_Sheet_Ref = m_Print_Sheet_Ref->GetValue();
// Pass two printout objects: for preview, and possible printing. // Pass two printout objects: for preview, and possible printing.
wxString title = BuildPrintTitle(); wxString title = _("Print Preview");
wxPrintPreview* preview = wxPrintPreview* preview =
new wxPrintPreview( new EDA_Printout( this, m_Parent, title, s_Print_Sheet_Ref ), new wxPrintPreview( new EDA_Printout( this, m_Parent, title, s_Print_Sheet_Ref ),
new EDA_Printout( this, m_Parent, title, s_Print_Sheet_Ref ), new EDA_Printout( this, m_Parent, title, s_Print_Sheet_Ref ),
...@@ -416,16 +395,12 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event ) ...@@ -416,16 +395,12 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
if( s_OptionPrintPage ) if( s_OptionPrintPage )
SetLayerMaskFromListSelection(); SetLayerMaskFromListSelection();
m_Parent->GetPosition( &x, &y ); // Uses the parent position and size.
WPos.x = x + 4; // @todo uses last position and size ans store them when exit in m_Config
WPos.y = y + 25; wxPoint WPos = m_Parent->GetPosition();
wxSize WSize = m_Parent->GetSize();
WSize = m_Parent->GetSize();
WSize.x -= 3;
WSize.y += 6;
wxPreviewFrame* frame = new wxPreviewFrame( preview, this, wxPreviewFrame* frame = new wxPreviewFrame( preview, this, title, WPos, WSize );
title, WPos, WSize );
frame->Initialize(); frame->Initialize();
frame->Show( TRUE ); frame->Show( TRUE );
...@@ -458,7 +433,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event ) ...@@ -458,7 +433,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
wxPrinter printer( &printDialogData ); wxPrinter printer( &printDialogData );
wxString title = BuildPrintTitle(); wxString title = _("Print");
EDA_Printout printout( this, m_Parent, title, s_Print_Sheet_Ref ); EDA_Printout printout( this, m_Parent, title, s_Print_Sheet_Ref );
#ifndef __WINDOWS__ #ifndef __WINDOWS__
......
/******************************************************************/ /******************************************************************/
/* menubarpcb.cpp - creation du menu general de l'editeur de board*/ /* menubarpcb.cpp - creation du menu general de l'editeur de board*/
/******************************************************************/ /******************************************************************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -198,7 +193,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -198,7 +193,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
// Font selection and setup // Font selection and setup
AddFontSelectionMenu( configmenu ); AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator(); configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save Preferences" ), item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save Preferences" ),
......
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