diff --git a/common/dialog_about/dialog_about.cpp b/common/dialog_about/dialog_about.cpp index 9fc8233efd..01b4706dc5 100644 --- a/common/dialog_about/dialog_about.cpp +++ b/common/dialog_about/dialog_about.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2010 Rafael Sokolowski - * Copyright (C) 2017 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 2017-2019 KiCad Developers, see CHANGELOG.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -68,6 +68,8 @@ extern std::string GetCurlLibVersion(); DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo ) : DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo ) { + wxASSERT( aParent != nullptr ); + m_picInformation = KiBitmap( info_xpm ); m_picDevelopers = KiBitmap( preference_xpm ); m_picDocWriters = KiBitmap( editor_xpm ); @@ -89,11 +91,13 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo ) m_bitmapApp->SetBitmap( icon ); } - m_staticTextAppTitle->SetLabel( m_info.GetAppName() ); + m_titleName = aParent->GetAboutTitle(); + m_staticTextAppTitle->SetLabel( m_titleName ); m_staticTextCopyright->SetLabel( m_info.GetCopyright() ); m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() ); m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() ); + SetTitle( wxString::Format( _( "About %s" ), m_titleName ) ); createNotebooks(); GetSizer()->SetSizeHints( this ); @@ -124,10 +128,13 @@ void DIALOG_ABOUT::createNotebooks() createNotebookHtmlPage( m_auiNotebook, _( "Information" ), m_picInformation, m_info.GetDescription() ); - createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers, m_info.GetDevelopers() ); - createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters, m_info.GetDocWriters() ); + createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers, + m_info.GetDevelopers() ); + createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters, + m_info.GetDocWriters() ); - createNotebookPageByCategory( m_auiNotebook, _( "Artists" ), m_picArtists, m_info.GetArtists() ); + createNotebookPageByCategory( m_auiNotebook, _( "Artists" ), m_picArtists, + m_info.GetArtists() ); createNotebookPageByCategory( m_auiNotebook, _( "Translators" ), m_picTranslators, m_info.GetTranslators() ); createNotebookPageByCategory( m_auiNotebook, _( "Packagers" ), m_picPackagers, @@ -237,7 +244,8 @@ void DIALOG_ABOUT::createNotebookPageByCategory(wxAuiNotebook* aParent, const wx wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY, contributor->GetCategory() + wxT( ":" ), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, + m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, + wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); // bold font m_staticText1->Wrap( -1 ); fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 ); @@ -444,7 +452,7 @@ void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml ) #define OFF "OFF" << eol wxPlatformInfo platform; - aMsg << "Application: " << m_info.GetAppName() << eol; + aMsg << "Application: " << m_titleName << eol; aMsg << "Version: " << m_info.GetBuildVersion() << eol; aMsg << "Libraries:" << eol; aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol; diff --git a/common/dialog_about/dialog_about.h b/common/dialog_about/dialog_about.h index 62a51b00a9..d44ed31915 100644 --- a/common/dialog_about/dialog_about.h +++ b/common/dialog_about/dialog_about.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2010 Rafael Sokolowski - * Copyright (C) 2010-2017 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 2010-2019 KiCad Developers, see CHANGELOG.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -49,6 +49,7 @@ private: wxBitmap m_picTranslators; wxBitmap m_picPackagers; wxBitmap m_picLicense; + wxString m_titleName; ABOUT_APP_INFO& m_info; diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 5ce030ee92..d54c6583c9 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -215,6 +215,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_tempCopyComponent = NULL; m_treePane = nullptr; m_libMgr = nullptr; + m_AboutTitle = "LibEdit"; // Delayed initialization if( m_textSize == -1 ) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index fd89b304ef..497fe2185d 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -387,6 +387,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_undoItem = NULL; m_hasAutoSave = true; m_FrameSize = ConvertDialogToPixels( wxSize( 500, 350 ) ); // default in case of no prefs + m_AboutTitle = "Eeschema"; m_toolManager = new TOOL_MANAGER; diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 8f6cee4042..cf11984ca9 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -89,9 +89,11 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_SelNetnameBox = nullptr; m_SelAperAttributesBox = nullptr; m_displayMode = 0; + m_AboutTitle = "GerbView"; int fileHistorySize; - Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &fileHistorySize, DEFAULT_FILE_HISTORY_SIZE ); + Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &fileHistorySize, + DEFAULT_FILE_HISTORY_SIZE ); m_drillFileHistory.SetMaxFiles( fileHistorySize ); m_zipFileHistory.SetMaxFiles( fileHistorySize ); m_jobFileHistory.SetMaxFiles( fileHistorySize ); @@ -889,6 +891,7 @@ void GERBVIEW_FRAME::SetVisibleElementColor( int aLayerID, COLOR4D aColor ) } } + COLOR4D GERBVIEW_FRAME::GetNegativeItemsColor() { if( IsElementVisible( LAYER_NEGATIVE_OBJECTS ) ) diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index cf0bb6164b..e8d58d5397 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -3,7 +3,7 @@ * * Copyright (C) 2009-2015 Jean-Pierre Charras, jp.charras wanadoo.fr * Copyright (C) 2011 Wayne Stambaugh - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -87,20 +87,20 @@ enum id_librarytype { /** - * Class EDA_BASE_FRAME - * is the base frame for deriving all KiCad main window classes. This class is not - * intended to be used directly. It provides support for automatic calls to - * a SaveSettings() function. SaveSettings() for a derived class can choose - * to do nothing, or rely on basic SaveSettings() support in this base class to do - * most of the work by calling it from the derived class's SaveSettings(). + * The base frame for deriving all KiCad main window classes. + * + * This class is not intended to be used directly. It provides support for automatic calls + * to SaveSettings() function. SaveSettings() for a derived class can choose to do nothing, + * or rely on basic SaveSettings() support in this base class to do most of the work by + * calling it from the derived class's SaveSettings(). *

* This class is not a KIWAY_PLAYER because KICAD_MANAGER_FRAME is derived from it * and that class is not a player. + *

*/ class EDA_BASE_FRAME : public wxFrame { /** - * Function windowClosing * (with its unexpected name so it does not collide with the real OnWindowClose() * function provided in derived classes) is called just before a window * closing, and is used to call a derivation specific @@ -148,7 +148,6 @@ protected: static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND; /** - * Function GetBackupSuffix * @return the suffix to be appended to the file extension on backup */ static wxString GetBackupSuffix() @@ -157,7 +156,6 @@ protected: } /** - * Function GetAutoSaveFilePrefix * @return the string to prepend to a file name for automatic save. */ static wxString GetAutoSaveFilePrefix() @@ -166,37 +164,35 @@ protected: } /** - * Function onAutoSaveTimer - * handles the auto save timer event. + * Handle the auto save timer event. */ void onAutoSaveTimer( wxTimerEvent& aEvent ); /** - * Function autoSaveRequired - * returns the auto save status of the application. Override this function if - * your derived frame supports automatic file saving. + * Return the auto save status of the application. + * + * Override this function if your derived frame supports automatic file saving. */ virtual bool isAutoSaveRequired() const { return false; } /** - * Function doAutoSave - * should be overridden by the derived class to handle the auto save feature. + * This should be overridden by the derived class to handle the auto save feature. * * @return true if the auto save was successful otherwise false. */ virtual bool doAutoSave(); /** - * Function config - * returns the wxConfigBase used in SaveSettings(), and is overloaded in - * KICAD_MANAGER_FRAME + * Return the wxConfigBase used in SaveSettings(). + * + * This is overloaded in #KICAD_MANAGER_FRAME */ virtual wxConfigBase* config(); /** - * Function sys_search - * returns a SEARCH_STACK pertaining to entire program, and is overloaded in - * KICAD_MANAGER_FRAME + * Return a SEARCH_STACK pertaining to entire program. + * + * This is overloaded in #KICAD_MANAGER_FRAME */ virtual const SEARCH_STACK& sys_search(); @@ -210,8 +206,7 @@ public: ~EDA_BASE_FRAME(); /** - * Function ProcessEvent - * overrides the default process event handler to implement the auto save feature. + * Override the default process event handler to implement the auto save feature. * * @warning If you override this function in a derived class, make sure you call * down to this or the auto save feature will be disabled. @@ -236,16 +231,14 @@ public: void PrintMsg( const wxString& text ); /** - * Function InstallPreferences - * allows a Frame to load its preference panels (if any) into the preferences - * dialog. + * Allow a frame to load its preference panels (if any) into the preferences dialog. + * * @param aParent a paged dialog into which the preference panels should be installed */ virtual void InstallPreferences( PAGED_DIALOG* aParent ) { } /** - * Function LoadSettings - * loads common frame parameters from a configuration file. + * Load common frame parameters from a configuration file. * * Don't forget to call the base method or your frames won't * remember their positions and sizes. @@ -253,8 +246,7 @@ public: virtual void LoadSettings( wxConfigBase* aCfg ); /** - * Function SaveSettings - * saves common frame parameters to a configuration data file. + * Saves common frame parameters to a configuration data file. * * Don't forget to call the base class's SaveSettings() from * your derived SaveSettings() otherwise the frames won't remember their @@ -263,7 +255,6 @@ public: virtual void SaveSettings( wxConfigBase* aCfg ); /** - * Function ConfigBaseName * @return a base name prefix used in Load/Save settings to build * the full name of keys used in config. * This is usually the name of the frame set by CTOR, unless m_configFrameName @@ -280,8 +271,8 @@ public: /** - * Function SaveProjectSettings - * saves changes to the project settings to the project (.pro) file. + * Save changes to the project settings to the project (.pro) file. + * * The method is virtual so you can override it to call the suitable save method. * The base method do nothing * @param aAskForSave = true to open a dialog before saving the settings @@ -291,9 +282,9 @@ public: // Read/Save and Import/export hotkeys config /** - * Function WriteHotkeyConfig * Store the current hotkey list - * It is stored using the standard wxConfig mechanism or a file. + * + * The hotkey list is stored using the standard wxConfig mechanism or a file. * * @param aDescList = pointer to the current hotkey list. * @param aFullFileName = a wxString pointer to a full file name. @@ -301,34 +292,35 @@ public: * the output format is: shortcut "key" "function" * lines starting with # are comments */ - virtual int WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList, wxString* aFullFileName = NULL ); + virtual int WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList, + wxString* aFullFileName = NULL ); /** - * Function ImportHotkeyConfigFromFile * Prompt the user for an old hotkey file to read, and read it. + * * @param aDescList = current hotkey list descr. to initialize. - * @param aDefaultShortname = a default short name (extention not needed) + * @param aDefaultShortname = a default short name (extension not needed) * like eechema, kicad... */ void ImportHotkeyConfigFromFile( EDA_HOTKEY_CONFIG* aDescList, const wxString& aDefaultShortname ); /** - * Function ExportHotkeyConfigToFile * Prompt the user for an old hotkey file to read, and read it. + * * @param aDescList = current hotkey list descr. to initialize. - * @param aDefaultShortname = a default short name (extention not needed) + * @param aDefaultShortname = a default short name (extension not needed) * like eechema, kicad... */ void ExportHotkeyConfigToFile( EDA_HOTKEY_CONFIG* aDescList, const wxString& aDefaultShortname ); /** - * Function GetFileFromHistory - * fetches the file name from the file history list. - * and removes the selected file, if this file does not exists - * Note also the menu is updated, if wxFileHistory::UseMenu - * was called at init time + * Fetches the file name from the file history list. + * + * This removes the selected file, if this file does not exist. The menu is also updated, + * if wxFileHistory::UseMenu was called at init time + * * @param cmdId The command ID associated with the \a aFileHistory object. * @param type Please document me! * @param aFileHistory The wxFileHistory in use. If null, the main application file @@ -339,10 +331,10 @@ public: wxFileHistory* aFileHistory = NULL ); /** - * Function UpdateFileHistory - * Updates the list of recently opened files. - * Note also the menu is updated, if wxFileHistory::UseMenu - * was called at init time + * Update the list of recently opened files. + * + * The menu is also updated, if wxFileHistory::UseMenu was called at init time. + * * @param FullFileName The full file name including the path. * @param aFileHistory The wxFileHistory in use. * If NULL, the main application file history is used. @@ -354,15 +346,14 @@ public: wxString GetMruPath() const { return m_mruPath; } /** - * Function ReCreateMenuBar - * Creates recreates the menu bar. + * Recreates the menu bar. + * * Needed when the language is changed */ virtual void ReCreateMenuBar(); /** - * Function IsWritable - * checks if \a aFileName can be written. + * Checks if \a aFileName can be written. *

* The function performs a number of tests on \a aFileName to verify that it * can be saved. If \a aFileName defines a path with no file name, them the @@ -380,8 +371,7 @@ public: bool IsWritable( const wxFileName& aFileName ); /** - * Function CheckForAutoSaveFile - * checks if an auto save file exists for \a aFileName and takes the appropriate + * Check if an auto save file exists for \a aFileName and takes the appropriate * action depending on the user input. *

* If an auto save file exists for \a aFileName, the user is prompted if they wish @@ -396,25 +386,23 @@ public: void CheckForAutoSaveFile( const wxFileName& aFileName ); /** - * Function ShowChangedLanguage - * redraws the menus and what not in current language. + * Redraw the menus and what not in current language. */ virtual void ShowChangedLanguage(); /** - * Function CommonSettingsChanged * Notification event that some of the common (suite-wide) settings have changed. * Update menus, toolbars, local variables, etc. */ virtual void CommonSettingsChanged(); /** - * Function PostCommandMenuEvent - * * Post a menu event to the frame, which can be used to trigger actions * bound to menu items. */ bool PostCommandMenuEvent( int evt_type ); + + const wxString& GetAboutTitle() const { return m_AboutTitle; } }; @@ -450,7 +438,6 @@ public: } /** - * Function HToolbar * Turn *this to a horizontal toolbar for KiCad. */ EDA_PANE& HToolbar() @@ -465,7 +452,6 @@ public: } /** - * Function VToolbar * Turn *this into a vertical toolbar for KiCad. */ EDA_PANE& VToolbar() @@ -480,7 +466,6 @@ public: } /** - * Function Palette * Turn *this into a captioned palette suitable for a symbol tree, layers manager, etc. */ EDA_PANE& Palette() @@ -491,7 +476,6 @@ public: } /** - * Function Canvas * Turn *this into an undecorated pane suitable for a drawing canvas. */ EDA_PANE& Canvas() @@ -504,7 +488,6 @@ public: } /** - * Function Messages * Turn *this into a messages pane for KiCad. */ EDA_PANE& Messages() diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index 2fa62d3a10..65868028ad 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 CERN (www.cern.ch) - * Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2004-2019 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -62,6 +62,7 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, m_active_project = false; m_leftWinWidth = 60; m_manager_Hotkeys_Descr = NULL; + m_AboutTitle = "KiCad"; // Create the status line (bottom of the frame) static const int dims[3] = { -1, -1, 100 }; diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index f5ee7de751..a98316469f 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013 CERN - * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr * * This program is free software; you can redistribute it and/or @@ -49,9 +49,6 @@ #include #include -/*************************/ -/* class PL_EDITOR_FRAME */ -/*************************/ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : EDA_DRAW_FRAME( aKiway, aParent, FRAME_PL_EDITOR, wxT( "PlEditorFrame" ), @@ -70,6 +67,7 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_originSelectChoice = 0; SetDrawBgColor( WHITE ); // default value, user option (WHITE/BLACK) SetShowPageLimits( true ); + m_AboutTitle = "PlEditor"; m_designTreeWidth = 150; m_propertiesFrameWidth = 200; @@ -185,7 +183,8 @@ void PL_EDITOR_FRAME::OnCloseWindow( wxCloseEvent& Event ) { if( GetScreen()->IsModify() ) { - if( !HandleUnsavedChanges( this, _( "The current page layout has been modified. Save changes?" ), + if( !HandleUnsavedChanges( this, + _( "The current page layout has been modified. Save changes?" ), [&]()->bool { return saveCurrentPageLayout(); } ) ) { Event.Veto(); @@ -325,7 +324,7 @@ void PL_EDITOR_FRAME::UpdateStatusBar() // Display Zoom level: EDA_DRAW_FRAME::UpdateStatusBar(); - // coodinate origin can be the paper Top Left corner, + // coordinate origin can be the paper Top Left corner, // or each of 4 page corners // We know the origin, and the orientation of axis wxPoint originCoord; diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 3b9de95589..27e3ff1c68 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -223,6 +223,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, m_hotkeysDescrList = g_Module_Editor_Hotkeys_Descr; m_FrameSize = ConvertDialogToPixels( wxSize( 500, 350 ) ); // default in case of no prefs m_canvasType = aBackend; + m_AboutTitle = "ModEdit"; // Give an icon wxIcon icon; diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index b4db36fb53..a49a9e6910 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -312,6 +312,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_ZoneFillsDirty = true; m_rotationAngle = 900; + m_AboutTitle = "Pcbnew"; // Create GAL canvas EDA_DRAW_PANEL_GAL* galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),