removed some warning when compiling. Added comments

This commit is contained in:
charras 2009-01-18 10:15:10 +00:00
parent 21faf9d370
commit 9f8e1d9d1c
8 changed files with 58 additions and 82 deletions

View File

@ -1,9 +1,10 @@
/* TODO ENGLISH BRIEF TODO */
/***************/
/* edaappl.cpp */
/***************/
/***
* @file edaapl.cpp
* @brief methodes relative a la classe winEDA_App, communes
* aux environements window et linux
* @brief For the main application: init functions, and language selection (locale handling)
***/
#define EDA_BASE
@ -649,8 +650,8 @@ void WinEDA_App::SaveSettings()
* the files are in kicad/internat/xx or kicad/internat/xx_XX
* and are named kicad.mo
*
* @param first_time TODO
* @return TODO
* @param first_time must be set to true the first time this funct is called, false otherwise
* @return true if the language can be set (i.e. if the locale is available)
*/
/*********************************************/
bool WinEDA_App::SetLanguage( bool first_time )
@ -705,10 +706,10 @@ bool WinEDA_App::SetLanguage( bool first_time )
}
/**
* Return in m_LanguageId the wxWidgets language identifier Id
/** Function SetLanguageIdentifier
* Set in .m_LanguageId member the wxWidgets language identifier Id
* 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
*/
/**************************************************/
@ -731,45 +732,46 @@ void WinEDA_App::SetLanguageIdentifier( int menu_id )
}
/**
* Create menu list for language choice.
* @param MasterMenu TODO
* @return TODO
/** 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 none
*/
/*********************************************************/
wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
/*********************************************************/
{
wxMenu* menu;
wxMenu* menu = NULL;
wxMenuItem* item;
unsigned int ii;
item = MasterMenu->FindItem( ID_LANGUAGE_CHOICE );
if( item == NULL )
if( item ) // This menu exists, do nothing
return;
menu = new wxMenu;
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{
menu = new wxMenu;
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{
wxString label = s_Language_List[ii].m_DoNotTranslate ?
s_Language_List[ii].m_Lang_Label :
wxGetTranslation( s_Language_List[ii].m_Lang_Label );
wxString label = s_Language_List[ii].m_DoNotTranslate ?
s_Language_List[ii].m_Lang_Label :
wxGetTranslation( s_Language_List[ii].m_Lang_Label );
item = new wxMenuItem( menu,
s_Language_List[ii].m_KI_Lang_Identifier,
label, wxEmptyString, wxITEM_CHECK );
item = new wxMenuItem( menu,
s_Language_List[ii].m_KI_Lang_Identifier,
label, wxEmptyString, wxITEM_CHECK );
SETBITMAPS( s_Language_List[ii].m_Lang_Icon );
menu->Append( item );
}
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, menu,
ID_LANGUAGE_CHOICE,
_( "Language" ),
_( "Select application language (only for testing!)" ),
language_xpm );
SETBITMAPS( s_Language_List[ii].m_Lang_Icon );
menu->Append( item );
}
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, menu,
ID_LANGUAGE_CHOICE,
_( "Language" ),
_( "Select application language (only for testing!)" ),
language_xpm );
// Set Check mark on current selected language
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{
if( m_LanguageId == s_Language_List[ii].m_WX_Lang_Identifier )
@ -777,14 +779,12 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
else
menu->Check( s_Language_List[ii].m_KI_Lang_Identifier, false );
}
return menu;
}
/**
* 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()

View File

@ -100,7 +100,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
*/
{
wxMenuItem* item;
wxMenuBar* menuBar;
wxMenuBar* menuBar = GetMenuBar();
/* Destroy the existing menu bar so it can be rebuilt. This allows
* language changes of the menu text on the fly. */
if( menuBar )
@ -141,7 +141,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
// Font selection and setup
AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu );
wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,

View File

@ -302,7 +302,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
// Font selection and setup
AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu );
wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ),

View File

@ -97,7 +97,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
// Font selection and setup
AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu );
wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( configmenu, ID_CONFIG_SAVE, _( "&Save Setup" ),

View File

@ -62,7 +62,13 @@ public:
void SetDefaultSearchPaths( void );
void InitEDA_Appl( const wxString& name );
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 InitOnLineHelp();

View File

@ -247,7 +247,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
datasheet_xpm );
PreferencesMenu->AppendSeparator();
wxGetApp().SetLanguageList( PreferencesMenu );
wxGetApp().AddMenuLanguageList( PreferencesMenu );
/**********************************************************************/

View File

@ -65,7 +65,6 @@ private:
void OnButtonCancelClick( wxCommandEvent& event ){ Close(); }
void SetScale( wxCommandEvent& event );
void SetPenWidth();
wxString BuildPrintTitle();
public:
bool IsMirrored() { return m_Print_Mirror->IsChecked(); }
bool ExcludeEdges() { return m_Exclude_Edges_Pcb->IsChecked(); }
@ -111,8 +110,8 @@ public:
void WinEDA_DrawFrame::ToPrinter( wxCommandEvent& event )
/*******************************************************/
/* Prepare les structures de donn<6E>es de gestion de l'impression
* et affiche la fenetre de dialogue de gestion de l'impression des feuilles
/* Virtual function:
* Display the print dialog
*/
{
if( g_PrintData == NULL ) // First print
@ -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 )
/******************************************************************/
@ -387,10 +370,6 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
/* Open and display a previewer frame for printing
*/
{
wxSize WSize;
wxPoint WPos;
int x, y;
SetScale( event );
SetPenWidth();
@ -402,7 +381,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
s_Print_Sheet_Ref = m_Print_Sheet_Ref->GetValue();
// Pass two printout objects: for preview, and possible printing.
wxString title = BuildPrintTitle();
wxString title = _("Print Preview");
wxPrintPreview* preview =
new wxPrintPreview( 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 )
if( s_OptionPrintPage )
SetLayerMaskFromListSelection();
m_Parent->GetPosition( &x, &y );
WPos.x = x + 4;
WPos.y = y + 25;
// Uses the parent position and size.
// @todo uses last position and size ans store them when exit in m_Config
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,
title, WPos, WSize );
wxPreviewFrame* frame = new wxPreviewFrame( preview, this, title, WPos, WSize );
frame->Initialize();
frame->Show( TRUE );
@ -458,7 +433,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
wxPrinter printer( &printDialogData );
wxString title = BuildPrintTitle();
wxString title = _("Print");
EDA_Printout printout( this, m_Parent, title, s_Print_Sheet_Ref );
#ifndef __WINDOWS__

View File

@ -1,11 +1,6 @@
/******************************************************************/
/* menubarpcb.cpp - creation du menu general de l'editeur de board*/
/******************************************************************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h"
#include "common.h"
@ -198,7 +193,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
// Font selection and setup
AddFontSelectionMenu( configmenu );
wxGetApp().SetLanguageList( configmenu );
wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save Preferences" ),