2007-09-09 02:21:43 +00:00
|
|
|
/*******************************************************************/
|
|
|
|
/* 3d_toolbar.cpp: construction des tool bars de la frame visu 3d */
|
|
|
|
/*******************************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "macros.h"
|
|
|
|
|
|
|
|
#include "bitmaps.h"
|
|
|
|
|
|
|
|
#include "id.h"
|
|
|
|
|
|
|
|
#define BITMAP wxBitmap
|
|
|
|
#include "3d_viewer.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************/
|
2007-09-09 02:21:43 +00:00
|
|
|
void WinEDA3D_DrawFrame::ReCreateHToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
/*********************************************/
|
|
|
|
{
|
2007-09-09 02:21:43 +00:00
|
|
|
if( m_HToolBar != NULL )
|
|
|
|
{ // simple mise a jour de la liste des fichiers anciens
|
|
|
|
SetToolbars();
|
|
|
|
return;
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
SetToolBar( m_HToolBar );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
// Set up toolbar
|
|
|
|
m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString, BITMAP( import3d_xpm ),
|
|
|
|
_( "Reload board" ) );
|
|
|
|
#ifdef __WINDOWS__ // do not work properly under linux
|
|
|
|
m_HToolBar-> AddSeparator();
|
|
|
|
|
|
|
|
m_HToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString, BITMAP( copy_button ),
|
|
|
|
_( "Copy 3D Image to Clipboard" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2008-02-17 21:19:13 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_IN_BUTT, wxEmptyString, BITMAP( zoom_in_xpm ),
|
2008-10-03 13:13:21 +00:00
|
|
|
_( "Zoom in" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-02-17 21:19:13 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_OUT_BUTT, wxEmptyString, BITMAP( zoom_out_xpm ),
|
2008-10-03 13:13:21 +00:00
|
|
|
_( "Zoom out" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-08-26 06:00:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_REDRAW_BUTT, wxEmptyString, BITMAP( zoom_redraw_xpm ),
|
2008-10-03 13:13:21 +00:00
|
|
|
_( "Redraw view" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-08-26 06:00:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_PAGE_BUTT, wxEmptyString, BITMAP( zoom_auto_xpm ),
|
2008-10-03 13:13:21 +00:00
|
|
|
_( "Zoom auto" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
|
|
|
m_HToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString, BITMAP( rotate_neg_X_xpm ),
|
|
|
|
_( "Rotate X <-" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString, BITMAP( rotate_pos_X_xpm ),
|
|
|
|
_( "Rotate X ->" ) );
|
2007-06-14 18:39:36 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
|
|
|
m_HToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString, BITMAP( rotate_neg_Y_xpm ),
|
|
|
|
_( "Rotate Y <-" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString, BITMAP( rotate_pos_Y_xpm ),
|
|
|
|
_( "Rotate Y ->" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
|
|
|
m_HToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString, BITMAP( rotate_neg_Z_xpm ),
|
|
|
|
_( "Rotate Z <-" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString, BITMAP( rotate_pos_Z_xpm ),
|
|
|
|
_( "Rotate Z ->" ) );
|
2007-06-14 18:39:36 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
|
|
|
m_HToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, BITMAP( left_xpm ),
|
|
|
|
_( "Move left <-" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, BITMAP( right_xpm ),
|
|
|
|
_( "Move right ->" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, BITMAP( up_xpm ),
|
|
|
|
_( "Move Up ^" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, BITMAP( down_xpm ),
|
|
|
|
_( "Move Down" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
m_HToolBar->Realize();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
// SetToolbars();
|
|
|
|
}
|
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/*********************************************/
|
2007-09-09 02:21:43 +00:00
|
|
|
void WinEDA3D_DrawFrame::ReCreateVToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
/*********************************************/
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/**********************************************/
|
2007-09-09 02:21:43 +00:00
|
|
|
void WinEDA3D_DrawFrame::ReCreateMenuBar()
|
2007-05-06 16:03:28 +00:00
|
|
|
/**********************************************/
|
|
|
|
{
|
2008-08-17 18:37:03 +00:00
|
|
|
bool full_options = true;
|
|
|
|
|
|
|
|
// If called from the display frame of cvpcb, only some options are relevant
|
|
|
|
if ( m_Parent->m_FrameName == wxT( "CmpFrame" ) ) // Called from cvpcb !
|
|
|
|
full_options = false; // Do not display all options
|
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
wxMenuBar* menuBar = new wxMenuBar;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
wxMenu* fileMenu = new wxMenu;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
fileMenu->Append( ID_MENU_SCREENCOPY_PNG, _( "Create Image (png format)" ) );
|
|
|
|
fileMenu->Append( ID_MENU_SCREENCOPY_JPEG, _( "Create Image (jpeg format)" ) );
|
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
fileMenu->Append( wxID_EXIT, _( "&Exit" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
wxMenu* referencesMenu = new wxMenu;
|
|
|
|
menuBar->Append( referencesMenu, _( "&Preferences" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
|
|
|
|
_( "Choose background color" ), palette_xpm );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-08-16 17:42:40 +00:00
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_AXIS_ONOFF,
|
2008-08-17 18:37:03 +00:00
|
|
|
_( "3D Axis On/Off" ), axis3d_front_xpm );
|
2008-08-16 17:42:40 +00:00
|
|
|
|
2008-08-17 18:37:03 +00:00
|
|
|
if ( full_options )
|
|
|
|
{
|
2008-08-16 17:42:40 +00:00
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_MODULE_ONOFF,
|
2008-08-18 15:18:35 +00:00
|
|
|
_( "3D Footprints Shapes On/Off" ), shape_3d_xpm );
|
2008-08-16 17:42:40 +00:00
|
|
|
|
2008-08-17 18:37:03 +00:00
|
|
|
#if 0
|
2008-08-16 17:42:40 +00:00
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_PLACE_ONOFF,
|
|
|
|
_( "PCB place 3D On/off" ), select_w_layer_xpm );
|
2008-08-17 18:37:03 +00:00
|
|
|
#endif
|
2008-08-16 17:42:40 +00:00
|
|
|
|
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_ZONE_ONOFF,
|
2008-08-17 18:37:03 +00:00
|
|
|
_( "Zone Filling On/Off" ), add_zone_xpm );
|
|
|
|
|
2008-08-16 17:42:40 +00:00
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_COMMENTS_ONOFF,
|
2008-08-17 18:37:03 +00:00
|
|
|
_( "Comments Layer On/Off" ), edit_sheet_xpm );
|
2008-08-16 17:42:40 +00:00
|
|
|
|
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_DRAWINGS_ONOFF,
|
2008-08-17 18:37:03 +00:00
|
|
|
_( "Drawings Layer On/Off" ), add_polygon_xpm );
|
2008-08-16 17:42:40 +00:00
|
|
|
|
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO1_ONOFF,
|
2008-08-17 18:37:03 +00:00
|
|
|
_( "Eco1 Layer On/Off" ), tools_xpm );
|
2008-08-16 17:42:40 +00:00
|
|
|
|
|
|
|
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO2_ONOFF,
|
2008-08-17 18:37:03 +00:00
|
|
|
_( "Eco2 Layer On/Off" ), tools_xpm );
|
|
|
|
}
|
2007-09-09 02:21:43 +00:00
|
|
|
|
|
|
|
SetMenuBar( menuBar );
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2007-09-09 02:21:43 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/*****************************************/
|
2007-09-09 02:21:43 +00:00
|
|
|
void WinEDA3D_DrawFrame::SetToolbars()
|
2007-05-06 16:03:28 +00:00
|
|
|
/*****************************************/
|
|
|
|
{
|
|
|
|
}
|