Commit 76467a7f authored by jerryjacobs's avatar jerryjacobs

Beautify code see change_log.txt

parent a0c413a6
...@@ -6,6 +6,17 @@ Please add newer entries at the top, list the date and your name with ...@@ -6,6 +6,17 @@ Please add newer entries at the top, list the date and your name with
email address. email address.
2008-nov-2 CLEANUP Jerry Jacobs <jerkejacobs@gmail.com>
================================================================================
++kicad:
Cleanup comment/codestyle to make things more clear for newbie codeviewer
and developers.
+ buildmnu.cpp
+ commandframe.cpp
+ kicad.cpp
+ treeprj_frame.cpp
2008-oct-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-oct-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
++All ++All
......
/***********************************************/ /*****************************************************************************/
/* buildmnu.h: construction du menu principal */ /**
/***********************************************/ * @file buildmnu.cpp
* @brief TODO
*/
/*****************************************************************************/
#include "wx/spinctrl.h"
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "wx/spinctrl.h"
#include "kicad.h" #include "kicad.h"
#include "macros.h" #include "macros.h"
#define BITMAP wxBitmap #define BITMAP wxBitmap
// ----------------------------------------------------------------------------
// resources
// ----------------------------------------------------------------------------
// USE_XPM_BITMAPS
#include "bitmaps.h" // Common bitmaps #include "bitmaps.h" // Common bitmaps
#include "id.h" #include "id.h"
/* Fonctions locales */
/* Variables locales */
/*****************************************************************************/
BEGIN_EVENT_TABLE(WinEDA_MainFrame, WinEDA_BasicFrame) BEGIN_EVENT_TABLE(WinEDA_MainFrame, WinEDA_BasicFrame)
/*****************************************************************************/
/* Window events */
EVT_SIZE(WinEDA_MainFrame::OnSize) EVT_SIZE(WinEDA_MainFrame::OnSize)
EVT_CLOSE(WinEDA_MainFrame::OnCloseWindow) EVT_CLOSE(WinEDA_MainFrame::OnCloseWindow)
EVT_SASH_DRAGGED(ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag)
EVT_SASH_DRAGGED(ID_BOTTOM_FRAME, WinEDA_MainFrame::OnSashDrag)
EVT_SASH_DRAGGED(ID_MAIN_COMMAND, WinEDA_MainFrame::OnSashDrag)
EVT_MENU_RANGE(ID_LOAD_PROJECT,ID_LOAD_FILE_10,
WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_SAVE_PROJECT, WinEDA_MainFrame::Process_Files)
EVT_TOOL(ID_NEW_PROJECT, WinEDA_MainFrame::Process_Files)
EVT_TOOL(ID_LOAD_PROJECT, WinEDA_MainFrame::Process_Files)
EVT_TOOL(ID_SAVE_PROJECT, WinEDA_MainFrame::Process_Files)
EVT_TOOL(ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_EXIT, WinEDA_MainFrame::Process_Special_Functions) /* Sash drag events */
EVT_SASH_DRAGGED(ID_LEFT_FRAME,
WinEDA_MainFrame::OnSashDrag)
EVT_SASH_DRAGGED(ID_BOTTOM_FRAME,
WinEDA_MainFrame::OnSashDrag)
EVT_SASH_DRAGGED(ID_MAIN_COMMAND,
WinEDA_MainFrame::OnSashDrag)
EVT_MENU(ID_TO_EDITOR, WinEDA_MainFrame::Process_Fct) /* Toolbar events */
EVT_MENU(ID_BROWSE_AN_SELECT_FILE, WinEDA_MainFrame::Process_Fct) EVT_TOOL(ID_NEW_PROJECT,
EVT_MENU(ID_SELECT_PREFERED_EDITOR, WinEDA_MainFrame::Process_Preferences) WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_SELECT_DEFAULT_PDF_BROWSER, WinEDA_MainFrame::Process_Preferences) EVT_TOOL(ID_LOAD_PROJECT,
EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER, WinEDA_MainFrame::Process_Preferences) WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER_NAME, WinEDA_MainFrame::Process_Preferences) EVT_TOOL(ID_SAVE_PROJECT,
EVT_MENU(ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::Process_Files) WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_READ_ZIP_ARCHIVE, WinEDA_MainFrame::Process_Files) EVT_TOOL(ID_SAVE_AND_ZIP_FILES,
EVT_MENU(ID_PROJECT_TREE_REFRESH, WinEDA_MainFrame::OnRefresh) WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_PREFERENCES_FONT_INFOSCREEN, WinEDA_MainFrame::Process_Preferences)
EVT_MENU_RANGE(ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, /* Menu events */
EVT_MENU(ID_SAVE_PROJECT,
WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_EXIT,
WinEDA_MainFrame::Process_Special_Functions)
EVT_MENU(ID_TO_EDITOR,
WinEDA_MainFrame::Process_Fct)
EVT_MENU(ID_BROWSE_AN_SELECT_FILE,
WinEDA_MainFrame::Process_Fct)
EVT_MENU(ID_SELECT_PREFERED_EDITOR,
WinEDA_MainFrame::Process_Preferences)
EVT_MENU(ID_SELECT_DEFAULT_PDF_BROWSER,
WinEDA_MainFrame::Process_Preferences)
EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER,
WinEDA_MainFrame::Process_Preferences)
EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER_NAME,
WinEDA_MainFrame::Process_Preferences)
EVT_MENU(ID_SAVE_AND_ZIP_FILES,
WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_READ_ZIP_ARCHIVE,
WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_PROJECT_TREE_REFRESH,
WinEDA_MainFrame::OnRefresh)
EVT_MENU(ID_PREFERENCES_FONT_INFOSCREEN,
WinEDA_MainFrame::Process_Preferences)
EVT_MENU(ID_GENERAL_HELP,
WinEDA_MainFrame::GetKicadHelp)
EVT_MENU(ID_KICAD_ABOUT,
WinEDA_MainFrame::GetKicadAbout)
/* Range menu events */
EVT_MENU_RANGE(ID_LANGUAGE_CHOICE,
ID_LANGUAGE_CHOICE_END,
WinEDA_MainFrame::SetLanguage) WinEDA_MainFrame::SetLanguage)
EVT_MENU_RANGE(ID_LOAD_PROJECT,
ID_LOAD_FILE_10,
WinEDA_MainFrame::Process_Files)
EVT_MENU(ID_GENERAL_HELP, WinEDA_MainFrame::GetKicadHelp) /* Button events */
EVT_MENU(ID_KICAD_ABOUT, WinEDA_MainFrame::GetKicadAbout) EVT_BUTTON(ID_TO_PCB,
WinEDA_MainFrame::Process_Fct)
EVT_BUTTON(ID_TO_CVPCB,
WinEDA_MainFrame::Process_Fct)
EVT_BUTTON(ID_TO_EESCHEMA,
WinEDA_MainFrame::Process_Fct)
EVT_BUTTON(ID_TO_GERBVIEW,
WinEDA_MainFrame::Process_Fct)
EVT_BUTTON(ID_TO_PCB, WinEDA_MainFrame::Process_Fct)
EVT_BUTTON(ID_TO_CVPCB, WinEDA_MainFrame::Process_Fct)
EVT_BUTTON(ID_TO_EESCHEMA, WinEDA_MainFrame::Process_Fct)
EVT_BUTTON(ID_TO_GERBVIEW, WinEDA_MainFrame::Process_Fct)
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
EVT_BUTTON(ID_RUN_PYTHON, WinEDA_MainFrame::Process_Fct) EVT_BUTTON(ID_RUN_PYTHON, WinEDA_MainFrame::Process_Fct)
#endif #endif
/*****************************************************************************/
END_EVENT_TABLE() END_EVENT_TABLE()
/*****************************************************************************/
/*******************************************/ /**
* @brief TODO
*/
/*****************************************************************************/
void WinEDA_MainFrame::ReCreateMenuBar() void WinEDA_MainFrame::ReCreateMenuBar()
/*******************************************/ /*****************************************************************************/
{ {
int ii, jj; int ii, jj;
wxMenuBar * menuBar = GetMenuBar() ; wxMenuBar *menuBar = GetMenuBar() ;
// Check if menubar is empty
if( menuBar == NULL ) if( menuBar == NULL )
{ {
m_MenuBar = menuBar = new wxMenuBar(); m_MenuBar = menuBar = new wxMenuBar();
m_FilesMenu = new wxMenu; m_FilesMenu = new wxMenu;
wxMenuItem *item = new wxMenuItem(m_FilesMenu, ID_LOAD_PROJECT,
// Open project
wxMenuItem *item = new wxMenuItem(m_FilesMenu,
ID_LOAD_PROJECT,
_("&Open Project"), _("&Open Project"),
_("Select an existing project") ); _("Select an existing project") );
item->SetBitmap(open_project_xpm); item->SetBitmap(open_project_xpm);
m_FilesMenu->Append(item); m_FilesMenu->Append(item);
item = new wxMenuItem(m_FilesMenu, ID_NEW_PROJECT,
// New project
item = new wxMenuItem(m_FilesMenu,
ID_NEW_PROJECT,
_("&New Project"), _("&New Project"),
_("Create new project") ); _("Create new project") );
item->SetBitmap(new_project_xpm); item->SetBitmap(new_project_xpm);
m_FilesMenu->Append(item); m_FilesMenu->Append(item);
item = new wxMenuItem(m_FilesMenu, ID_SAVE_PROJECT,
// Save project
item = new wxMenuItem(m_FilesMenu,
ID_SAVE_PROJECT,
_("&Save Project"), _("&Save Project"),
_("Save current project") ); _("Save current project") );
item->SetBitmap(save_project_xpm); item->SetBitmap(save_project_xpm);
m_FilesMenu->Append(item); m_FilesMenu->Append(item);
// Separator
m_FilesMenu->AppendSeparator(); m_FilesMenu->AppendSeparator();
item = new wxMenuItem(m_FilesMenu, ID_SAVE_AND_ZIP_FILES,
// Archive project
item = new wxMenuItem(m_FilesMenu,
ID_SAVE_AND_ZIP_FILES,
_("&Archive project"), _("&Archive project"),
_("Archive project files in zip file") ); _("Archive project files in zip archive") );
item->SetBitmap(zip_xpm); item->SetBitmap(zip_xpm);
m_FilesMenu->Append(item); m_FilesMenu->Append(item);
item = new wxMenuItem(m_FilesMenu, ID_READ_ZIP_ARCHIVE,
// Unarchive project
item = new wxMenuItem(m_FilesMenu,
ID_READ_ZIP_ARCHIVE,
_("&Unarchive project"), _("&Unarchive project"),
_("Unarchive project files from zip file") ); _("Unarchive project files from zip file") );
item->SetBitmap(unzip_xpm); item->SetBitmap(unzip_xpm);
m_FilesMenu->Append(item); m_FilesMenu->Append(item);
// Separator
m_FilesMenu->AppendSeparator(); m_FilesMenu->AppendSeparator();
item = new wxMenuItem(m_FilesMenu, ID_EXIT, _("E&xit"), _("Quit KiCad") );
// Exit
item = new wxMenuItem(m_FilesMenu,
ID_EXIT,
_("E&xit"),
_("Quit KiCad") );
item->SetBitmap(exit_xpm); item->SetBitmap(exit_xpm);
m_FilesMenu->Append(item); m_FilesMenu->Append(item);
// Creation des selections des anciens fichiers
// Create last 10 project entries
m_FilesMenu->AppendSeparator(); m_FilesMenu->AppendSeparator();
for ( ii = 0; ii < 10; ii++ ) for ( ii = 0; ii < 10; ii++ )
{ {
if ( GetLastProject(ii).IsEmpty() ) break; m_MenuBar = menuBar = new wxMenuBar();
if ( GetLastProject(ii).IsEmpty() )
break;
m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) ); m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) );
} }
// Menu Browse
/*************************************************************************/
wxMenu *browseMenu = new wxMenu(); wxMenu *browseMenu = new wxMenu();
item = new wxMenuItem(browseMenu, ID_TO_EDITOR, /*************************************************************************/
_("&Editor"), _("Text editor") );
item->SetBitmap(editor_xpm); // Editor
browseMenu->Append(item); item = new wxMenuItem(browseMenu, // Entry in menu
item = new wxMenuItem(browseMenu, ID_BROWSE_AN_SELECT_FILE, ID_TO_EDITOR, // Entry ID
_("&Browse Files"), _("Read or edit files") ); _("&Editor"), // Entry text
_("Text editor") ); // Status bar text
item->SetBitmap(editor_xpm); // Entry XPM Bitmap
browseMenu->Append(item); // Append wxMenuItem to menu
// Browse files
item = new wxMenuItem(browseMenu,
ID_BROWSE_AN_SELECT_FILE,
_("&Browse Files"),
_("Read or edit files") );
item->SetBitmap(browse_files_xpm); item->SetBitmap(browse_files_xpm);
browseMenu->Append(item); browseMenu->Append(item);
// Separator
browseMenu->AppendSeparator(); browseMenu->AppendSeparator();
item = new wxMenuItem(browseMenu, ID_SELECT_PREFERED_EDITOR,
_("&Select Editor"), _("Select your prefered editor for file browsing") );
// Select editor
item = new wxMenuItem(browseMenu,
ID_SELECT_PREFERED_EDITOR,
_("&Select Editor"),
_("Select your prefered editor for file browsing") );
item->SetBitmap(editor_xpm); item->SetBitmap(editor_xpm);
browseMenu->Append(item); browseMenu->Append(item);
// Preferences menu:
/*************************************************************************/
wxMenu *PreferencesMenu = new wxMenu; wxMenu *PreferencesMenu = new wxMenu;
item = new wxMenuItem(PreferencesMenu , ID_PREFERENCES_FONT_INFOSCREEN, /*************************************************************************/
_("Fonts"), _("Font preferences"));
// Fonts
item = new wxMenuItem(PreferencesMenu,
ID_PREFERENCES_FONT_INFOSCREEN,
_("Fonts"),
_("Font preferences"));
item->SetBitmap(fonts_xpm); item->SetBitmap(fonts_xpm);
PreferencesMenu->Append(item); PreferencesMenu->Append(item);
// Submenu Pdf Browser selection: system browser or user selected browser (and its name)
// Submenu Pdf Browser selection: system browser or user
// selected browser (and its name)
/*************************************************************************/
wxMenu *SubMenuPdfBrowserChoice = new wxMenu; wxMenu *SubMenuPdfBrowserChoice = new wxMenu;
item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_DEFAULT_PDF_BROWSER, /*************************************************************************/
_("Default Pdf Viewer"), _("Use the default (system) PDF viewer used to browse datasheets"),
// Default PDF viewer
item = new wxMenuItem(SubMenuPdfBrowserChoice,
ID_SELECT_DEFAULT_PDF_BROWSER,
_("Default PDF Viewer"),
_("Use the default (system) PDF viewer used to browse datasheets"),
wxITEM_CHECK); wxITEM_CHECK);
SETBITMAPS(datasheet_xpm); SETBITMAPS(datasheet_xpm);
SubMenuPdfBrowserChoice->Append(item); SubMenuPdfBrowserChoice->Append(item);
SubMenuPdfBrowserChoice->Check(ID_SELECT_DEFAULT_PDF_BROWSER, SubMenuPdfBrowserChoice->Check(ID_SELECT_DEFAULT_PDF_BROWSER,
g_EDA_Appl->m_PdfBrowserIsDefault); g_EDA_Appl->m_PdfBrowserIsDefault);
item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_PREFERED_PDF_BROWSER,
_("Favourite Pdf Viewer"), _("Use your favourite PDF viewer used to browse datasheets"),
// Favourite PDF viewer
item = new wxMenuItem(SubMenuPdfBrowserChoice,
ID_SELECT_PREFERED_PDF_BROWSER,
_("Favourite PDF Viewer"),
_("Use your favourite PDF viewer used to browse datasheets"),
wxITEM_CHECK); wxITEM_CHECK);
SETBITMAPS(preference_xpm); SETBITMAPS(preference_xpm);
SubMenuPdfBrowserChoice->Append(item); SubMenuPdfBrowserChoice->Append(item);
SubMenuPdfBrowserChoice->AppendSeparator(); SubMenuPdfBrowserChoice->AppendSeparator();
SubMenuPdfBrowserChoice->Check(ID_SELECT_PREFERED_PDF_BROWSER, SubMenuPdfBrowserChoice->Check(ID_SELECT_PREFERED_PDF_BROWSER,
!g_EDA_Appl->m_PdfBrowserIsDefault); !g_EDA_Appl->m_PdfBrowserIsDefault);
item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_PREFERED_PDF_BROWSER_NAME,
_("Select Pdf Viewer"), _("Select your favourite PDF viewer used to browse datasheets"));
item = new wxMenuItem(SubMenuPdfBrowserChoice,
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
_("Select Pdf Viewer"),
_("Select your favourite PDF viewer used to browse datasheets"));
item->SetBitmap(datasheet_xpm); item->SetBitmap(datasheet_xpm);
SubMenuPdfBrowserChoice->Append(item); SubMenuPdfBrowserChoice->Append(item);
ADD_MENUITEM_WITH_HELP_AND_SUBMENU(PreferencesMenu, SubMenuPdfBrowserChoice,
ADD_MENUITEM_WITH_HELP_AND_SUBMENU(PreferencesMenu,
SubMenuPdfBrowserChoice,
-1, _("Pdf Browser"), -1, _("Pdf Browser"),
wxT("Pdf Browser choice: default or user selection"), wxT("Pdf Browser choice: default or user selection"),
datasheet_xpm); datasheet_xpm);
...@@ -184,19 +295,29 @@ void WinEDA_MainFrame::ReCreateMenuBar() ...@@ -184,19 +295,29 @@ void WinEDA_MainFrame::ReCreateMenuBar()
m_Parent->SetLanguageList(PreferencesMenu); m_Parent->SetLanguageList(PreferencesMenu);
// Menu Help: /*************************************************************************/
wxMenu *helpMenu = new wxMenu; wxMenu *helpMenu = new wxMenu;
item = new wxMenuItem(helpMenu , ID_GENERAL_HELP, /*************************************************************************/
_("&Contents"), _("Open the kicad manual"));
// Contents
item = new wxMenuItem(helpMenu ,
ID_GENERAL_HELP,
_("&Contents"),
_("Open the kicad manual"));
item->SetBitmap(help_xpm); item->SetBitmap(help_xpm);
helpMenu->Append(item); helpMenu->Append(item);
item = new wxMenuItem(helpMenu , ID_KICAD_ABOUT,
_("&About Kicad"), _("About kicad project manager")); // About Kicad
item = new wxMenuItem(helpMenu ,
ID_KICAD_ABOUT,
_("&About Kicad"),
_("About kicad project manager"));
item->SetBitmap(info_xpm); item->SetBitmap(info_xpm);
helpMenu->Append(item); helpMenu->Append(item);
// Append menus to menuBar
menuBar->Append(m_FilesMenu, _("&Projects")); menuBar->Append(m_FilesMenu, _("&Projects"));
menuBar->Append(browseMenu, _("&Browse")); menuBar->Append(browseMenu, _("&Browse"));
menuBar->Append(PreferencesMenu, _("&Preferences")); menuBar->Append(PreferencesMenu, _("&Preferences"));
...@@ -204,69 +325,108 @@ void WinEDA_MainFrame::ReCreateMenuBar() ...@@ -204,69 +325,108 @@ void WinEDA_MainFrame::ReCreateMenuBar()
// Associate the menu bar with the frame // Associate the menu bar with the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
} }
else // simple mise a jour de la liste des fichiers anciens else // TODO (ENGLISH!) simple mise a jour de la liste des fichiers anciens
{ {
wxMenuItem * item; wxMenuItem * item;
int max_file = m_Parent->m_LastProjectMaxCount; int max_file = m_Parent->m_LastProjectMaxCount;
for ( ii = max_file-1; ii >=0 ; ii-- ) for ( ii = max_file-1; ii >=0 ; ii-- )
{ {
if( m_FilesMenu->FindItem(ID_LOAD_FILE_1 + ii) ) if( m_FilesMenu->FindItem(ID_LOAD_FILE_1 + ii) )
{ {
item = m_FilesMenu->Remove(ID_LOAD_FILE_1 + ii); item = m_FilesMenu->Remove(ID_LOAD_FILE_1 + ii);
if ( item ) delete item;
if ( item )
delete item;
} }
} }
for ( jj = 0, ii = 0; ii < max_file; ii++ ) for ( jj = 0, ii = 0; ii < max_file; ii++ )
{ {
if (GetLastProject(ii).IsEmpty() ) break; if (GetLastProject(ii).IsEmpty() )
break;
m_FilesMenu->Append(ID_LOAD_FILE_1 + jj, GetLastProject(ii) ); m_FilesMenu->Append(ID_LOAD_FILE_1 + jj, GetLastProject(ii) );
jj++; jj++;
} }
} }
} }
/***************************************************/
/**
* @brief TODO
*/
/*****************************************************************************/
void WinEDA_MainFrame::RecreateBaseHToolbar() void WinEDA_MainFrame::RecreateBaseHToolbar()
/***************************************************/ /*****************************************************************************/
{ {
if ( m_HToolBar != NULL ) return; // Check if toolbar is not already set
if ( m_HToolBar != NULL )
return;
// Allocate memory for m_HToolBar
m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE);
SetToolBar(m_HToolBar); SetToolBar(m_HToolBar);
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool(ID_NEW_PROJECT, BITMAP(new_project_xpm), m_HToolBar->AddTool(ID_NEW_PROJECT, // Entry ID
wxNullBitmap, FALSE, BITMAP(new_project_xpm), // XPM Bitmap
wxNullBitmap,
FALSE,
-1, -1,
(wxObject *) NULL,
_("Create new project")); // Tooltip
// Load project
m_HToolBar->AddTool(ID_LOAD_PROJECT, // Entry ID
BITMAP(open_project_xpm), // XPM Bitmap
wxNullBitmap,
FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Create new project descriptor")); _("Load existing project")); // Tooltip
m_HToolBar->AddTool(ID_LOAD_PROJECT, BITMAP(open_project_xpm),
wxNullBitmap, FALSE,
-1, -1, (wxObject *) NULL,
_("Select an existing project descriptor"));
m_HToolBar->AddTool(ID_SAVE_PROJECT, BITMAP(save_project_xpm), // Save project
wxNullBitmap, FALSE, m_HToolBar->AddTool(ID_SAVE_PROJECT, // Entry ID
-1, -1, (wxObject *) NULL, BITMAP(save_project_xpm), // XPM Bitmap
_("Save current project descriptor")); wxNullBitmap,
FALSE,
-1, -1,
(wxObject *) NULL,
_( "Save current project" )); // Tooltip
// Separator
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool(ID_SAVE_AND_ZIP_FILES, BITMAP(zip_xpm),
wxNullBitmap, FALSE,
// Save and archive files
m_HToolBar->AddTool(ID_SAVE_AND_ZIP_FILES, // Entry ID
BITMAP(zip_xpm), // XPM Bitmap
wxNullBitmap,
FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Archive all project files")); _("Archive all project files")); // Tooltip
// Separator
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool(ID_PROJECT_TREE_REFRESH, BITMAP(reload_xpm),
wxNullBitmap, FALSE,
// Refresh project tree
m_HToolBar->AddTool(ID_PROJECT_TREE_REFRESH, // Entry ID
BITMAP(reload_xpm), // XPM Bitmap
wxNullBitmap,
FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Refresh project tree")); _("Refresh project tree")); // Tooltip
// after adding the buttons to the toolbar, must call Realize() to reflect m_HToolBar->Realize(); // Create m_HToolBar
// the changes
m_HToolBar->Realize();
} }
...@@ -65,7 +65,6 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, ...@@ -65,7 +65,6 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
{ {
m_Parent = parent; m_Parent = parent;
m_TreeProject = NULL; m_TreeProject = NULL;
wxMenu* menu = m_ContextMenus[TREE_PY];
wxMenuItem* item; wxMenuItem* item;
m_PopupMenu = NULL; m_PopupMenu = NULL;
...@@ -101,6 +100,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, ...@@ -101,6 +100,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
for( int i = 0; i < TREE_MAX; i++ ) for( int i = 0; i < TREE_MAX; i++ )
m_ContextMenus.push_back( new wxMenu() ); m_ContextMenus.push_back( new wxMenu() );
wxMenu* menu = m_ContextMenus[TREE_PY];
// Python script context menu // Python script context menu
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
......
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