Commit f5eae506 authored by CHARRAS's avatar CHARRAS

more work on hotkeys. many features are ok.

parent 90e28dd1
......@@ -4,6 +4,15 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-aug-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ eeschema & pcbnew
more about programmable hotkeys.
Most existing hotkeys are programmable and displayed in popup menus or tools
Work still in progress but most features are ok.
some features are not fixed (mainly the configuration files path, which is
currently the home directory under unix systems and kicad/template under windows))
2007-Aug-29 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
......
This diff is collapsed.
......@@ -294,6 +294,9 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
switch( g_KeyPressed )
{
case 0:
break;
case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP );
curpos = m_CurrentScreen->m_Curseur;
......@@ -315,23 +318,16 @@ void WinEDA_DrawFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels
break;
case EDA_ZOOM_IN_FROM_MOUSE:
case WXK_F1:
OnZoom( ID_ZOOM_PLUS_KEY );
curpos = m_CurrentScreen->m_Curseur;
break;
case EDA_ZOOM_OUT_FROM_MOUSE:
case WXK_F2:
OnZoom( ID_ZOOM_MOINS_KEY );
curpos = m_CurrentScreen->m_Curseur;
break;
case WXK_F3:
OnZoom( ID_ZOOM_REDRAW_KEY );
break;
case EDA_ZOOM_CENTER_FROM_MOUSE:
case WXK_F4:
OnZoom( ID_ZOOM_CENTER_KEY );
curpos = m_CurrentScreen->m_Curseur;
break;
......
/***********************************/
/* eeschema.cpp - module principal */
/***********************************/
/***********************************/
/* eeschema.cpp - module principal */
/***********************************/
#ifdef __GNUG__
#pragma implementation
......@@ -26,51 +26,57 @@
/* Routines locales */
static void CreateScreens(void);
static void CreateScreens( void );
// Global variables
wxString g_Main_Title( wxT("EESchema") );
wxString g_Main_Title( wxT( "EESchema" ) );
/************************************/
/* Called to initialize the program */
/************************************/
/************************************/
/* Called to initialize the program */
/************************************/
// Create a new application object: this macro will allow wxWindows to create
// the application object during program execution (it's better than using a
// static object for many reasons) and also declares the accessor function
// wxGetApp() which will return the reference of the right type (i.e. MyApp and
// not wxApp)
IMPLEMENT_APP(WinEDA_App)
IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit(void)
bool WinEDA_App::OnInit( void )
{
wxString FFileName;
wxString FFileName;
EDA_Appl = this;
g_DebugLevel = 0; // Debug level */
InitEDA_Appl( wxT("eeschema") );
InitEDA_Appl( wxT( "eeschema" ) );
if ( m_Checker && m_Checker->IsAnotherRunning() )
if( m_Checker && m_Checker->IsAnotherRunning() )
{
if ( ! IsOK(NULL, _("Eeschema is already running, Continue?") ) )
if( !IsOK( NULL, _( "Eeschema is already running, Continue?" ) ) )
return false;
}
if(argc > 1 ) FFileName = argv[1];
if( argc > 1 )
FFileName = argv[1];
CreateScreens();
/* init EESCHEMA */
GetSettings(); // read current setup
SeedLayers();
Read_Hotkey_Config( SchematicFrame, false ); /* Must be called before creating the main frame
* in order to display the real hotkeys in menus
* or tool tips */
// Create main frame (schematic frame) :
SchematicFrame = new WinEDA_SchematicFrame(NULL, this,
wxT("EESchema"), wxPoint(0,0), wxSize(600,400) );
SchematicFrame = new WinEDA_SchematicFrame( NULL, this,
wxT( "EESchema" ),
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
SetTopWindow(SchematicFrame);
SchematicFrame->Show(TRUE);
SetTopWindow( SchematicFrame );
SchematicFrame->Show( TRUE );
if( CreateServer( SchematicFrame, KICAD_SCH_PORT_SERVICE_NUMBER ) )
{
......@@ -79,24 +85,22 @@ wxString FFileName;
SetupServerFunction( RemoteCommand );
}
SchematicFrame->Zoom_Automatique(TRUE);
Read_Hotkey_Config(SchematicFrame, false);
SchematicFrame->Zoom_Automatique( TRUE );
/* Load file specified in the command line. */
if( ! FFileName.IsEmpty() )
if( !FFileName.IsEmpty() )
{
ChangeFileNameExt(FFileName, g_SchExtBuffer);
wxSetWorkingDirectory( wxPathOnly(FFileName) );
if ( SchematicFrame->DrawPanel )
if ( SchematicFrame->LoadOneEEProject(FFileName, FALSE) <= 0 )
SchematicFrame->DrawPanel->Refresh(TRUE); // File not found or error
ChangeFileNameExt( FFileName, g_SchExtBuffer );
wxSetWorkingDirectory( wxPathOnly( FFileName ) );
if( SchematicFrame->DrawPanel )
if( SchematicFrame->LoadOneEEProject( FFileName, FALSE ) <= 0 )
SchematicFrame->DrawPanel->Refresh( TRUE ); // File not found or error
}
else
{
Read_Config(wxEmptyString, TRUE); // Read config file ici si pas de fichier a charger
if ( SchematicFrame->DrawPanel )
SchematicFrame->DrawPanel->Refresh(TRUE);
Read_Config( wxEmptyString, TRUE ); // Read config file ici si pas de fichier a charger
if( SchematicFrame->DrawPanel )
SchematicFrame->DrawPanel->Refresh( TRUE );
}
return TRUE;
......@@ -104,23 +108,23 @@ wxString FFileName;
/******************************/
static void CreateScreens(void)
static void CreateScreens( void )
/******************************/
/*
Fonction d'init des crans utiliss dans EESchema:
*/
* Fonction d'init des crans utiliss dans EESchema:
*/
{
/* creation des ecrans Sch , Lib */
if(ScreenSch == NULL )
ScreenSch = new SCH_SCREEN(SCHEMATIC_FRAME);
if( ScreenSch == NULL )
ScreenSch = new SCH_SCREEN( SCHEMATIC_FRAME );
ScreenSch->m_FileName = g_DefaultSchematicFileName;
ScreenSch->m_Date = GenDate();
ActiveScreen = ScreenSch;
if(ScreenLib == NULL )
ScreenLib = new SCH_SCREEN(LIBEDITOR_FRAME);
ScreenLib->SetZoom(4);
if( ScreenLib == NULL )
ScreenLib = new SCH_SCREEN( LIBEDITOR_FRAME );
ScreenLib->SetZoom( 4 );
ScreenLib->m_UndoRedoCountMax = 10;
}
This diff is collapsed.
/***************/
/* hotkeys.h */
/***************/
#ifndef KOTKEYS_H
#define KOTKEYS_H
#include "hotkeys_basic.h"
enum hotkey_id_commnand {
HK_NOT_FOUND = 0,
HK_RESET_LOCAL_COORD,
HK_HELP,
HK_ZOOM_IN,
HK_ZOOM_OUT,
HK_ZOOM_REDRAW,
HK_ZOOM_CENTER,
HK_NEXT_SEARCH,
HK_DELETE,
HK_REPEAT_LAST,
HK_MOVEBLOCK_TO_DRAGBLOCK,
HK_ROTATE_COMPONENT,
HK_MIRROR_X_COMPONENT,
HK_MIRROR_Y_COMPONENT,
HK_ORIENT_NORMAL_COMPONENT,
HK_MOVE_COMPONENT,
HK_ADD_NEW_COMPONENT,
HK_BEGIN_WIRE
};
// List of hotkey descriptors for schematic
extern Ki_HotkeyInfo* s_Schematic_Hotkey_List[];
// List of hotkey descriptors for libray editor
extern Ki_HotkeyInfo* s_LibEdit_Hotkey_List[];
#endif // KOTKEYS_H
......@@ -16,6 +16,7 @@
#include "protos.h"
#include "id.h"
#include "hotkeys.h"
#include "bitmaps.h"
......@@ -272,24 +273,31 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
/* Add menu commands for a component
*/
{
wxString msg;
EDA_LibComponentStruct* LibEntry;
LibEntry = FindLibPart( Component->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( !Component->m_Flags )
{
msg = AddHotkeyName( _( "Move Component" ), s_Schematic_Hotkey_List, HK_MOVE_COMPONENT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_CMP_REQUEST,
_( "Move Component (M)" ), move_xpm );
msg, move_xpm );
}
// add menu orient et sous menu:
wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate +" ), s_Schematic_Hotkey_List, HK_ROTATE_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE,
_( "Rotate + (R)" ), rotate_pos_xpm );
msg, rotate_pos_xpm );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE, _( "Rotate -" ), rotate_neg_xpm );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_MIROR_X_CMP, _( "Mirror -- (X)" ), mirror_V_xpm );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_MIROR_Y_CMP, _( "Mirror || (Y)" ), mirror_H_xpm );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ORIENT_NORMAL_CMP, _( "Normal (N)" ), normal_xpm );
msg = AddHotkeyName( _( "Mirror --" ), s_Schematic_Hotkey_List, HK_MIRROR_X_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_MIROR_X_CMP, msg, mirror_V_xpm );
msg = AddHotkeyName( _( "Mirror ||" ), s_Schematic_Hotkey_List, HK_MIRROR_Y_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_MIROR_Y_CMP, msg, mirror_H_xpm );
msg = AddHotkeyName( _( "Normal" ), s_Schematic_Hotkey_List, HK_ORIENT_NORMAL_COMPONENT );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ORIENT_NORMAL_CMP, msg, normal_xpm );
ADD_MENUITEM_WITH_SUBMENU( PopMenu, orientmenu,
ID_POPUP_SCH_GENERIC_ORIENT_CMP, _(
"Orient Component" ), orient_xpm );
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
(wxT("(2007-08-21)"))
(wxT("(2007-08-30)"))
#endif
;
......
/*******************/
/* hotkeys_basic.h */
/*******************/
/*******************/
/* hotkeys_basic.h */
/*******************/
/* Some functions to handle hotkeys in kicad
*/
*/
#ifndef HOTKEYS_BASIC_H
#define HOTKEYS_BASIC_H
#define DEFAULT_HOTKEY_FILENAME_EXT wxT(".key")
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( ".key" )
/* define default path for config key file */
#ifdef __WINDOWS__
#define DEFAULT_HOTKEY_FILENAME_PATH EDA_Appl->m_BinDir + wxT("../template/")
#define DEFAULT_HOTKEY_FILENAME_PATH EDA_Appl->m_BinDir + wxT( "../template/" )
#else
#define DEFAULT_HOTKEY_FILENAME_PATH wxGetHomeDir() + wxT("/")
#define DEFAULT_HOTKEY_FILENAME_PATH wxGetHomeDir() + wxT( "/" )
#endif
/* Class to handle hotkey commnands. hotkeys have a default value
This class allows (for the future..) the real key code changed by user(from a key code list file, TODO)
*/
* This class allows (for the future..) the real key code changed by user(from a key code list file, TODO)
*/
class Ki_HotkeyInfo
{
public:
......@@ -29,15 +29,16 @@ public:
int m_Idcommand; // internal id for the corresponding command (see hotkey_id_commnand list)
public:
Ki_HotkeyInfo(const wxChar * infomsg, int idcommand, int keycode);
Ki_HotkeyInfo( const wxChar* infomsg, int idcommand, int keycode );
};
/* Functions:
*/
wxString ReturnKeyNameFromKeyCode(int keycode);
void DisplayHotkeyList(WinEDA_DrawFrame * frame, Ki_HotkeyInfo ** List);
int GetCommandCodeFromHotkey(int key, Ki_HotkeyInfo ** List);
*/
wxString ReturnKeyNameFromKeyCode( int keycode );
wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** List, int CommandId );
wxString AddHotkeyName( const wxString& text, Ki_HotkeyInfo** List, int CommandId );
void DisplayHotkeyList( WinEDA_DrawFrame* frame, Ki_HotkeyInfo** List );
int GetCommandCodeFromHotkey( int key, Ki_HotkeyInfo** List );
#endif // HOTKEYS_BASIC_H
No preview for this file type
This diff is collapsed.
......@@ -73,7 +73,6 @@ void D_PAD::ComputeRayon( void )
break;
case RECT:
case SPECIAL_PAD:
case TRAPEZE:
m_Rayon = (int) (sqrt( (float) m_Size.y * m_Size.y
+ (float) m_Size.x * m_Size.x ) / 2);
......@@ -410,7 +409,6 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
break;
case RECT:
case SPECIAL_PAD:
case TRAPEZE:
{
int ddx, ddy;
......@@ -910,11 +908,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
pos += 6;
Affiche_1_Parametre( frame, pos, Msg_Pad_Shape[m_PadShape], wxEmptyString, DARKGREEN );
/* Affichage en couleur diff si pad stack ou non */
if( m_Attribut & PAD_STACK )
Affiche_1_Parametre( frame, -1, wxEmptyString, Msg_Pad_Attribut[m_Attribut & 15], RED );
else
Affiche_1_Parametre( frame,
-1,
wxEmptyString,
......@@ -1011,7 +1005,8 @@ bool D_PAD::HitTest( const wxPoint& ref_pos )
}
#if defined(DEBUG)
#if defined (DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
......@@ -1024,6 +1019,7 @@ void D_PAD::Show( int nestLevel, std::ostream& os )
char padname[5] = { m_Padname[0], m_Padname[1], m_Padname[2], m_Padname[3], 0 };
char layerMask[16];
sprintf( layerMask, "0x%08X", m_Masque_Layer );
// for now, make it look like XML:
......@@ -1037,4 +1033,5 @@ void D_PAD::Show( int nestLevel, std::ostream& os )
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}
#endif
......@@ -4,20 +4,19 @@
class Pcb3D_GLCanvas;
/* forme des pastilles : (parametre .forme) */
/* Pad shape id : ( .m_PadShape member) */
#define CIRCLE 1
#define RECT 2
#define OVALE 3
#define TRAPEZE 4 // trapeze: traversante ou surfacique
#define SPECIAL_PAD 5 // description libre
#define TRAPEZE 4 // trapezoid
/* Attributs des PADS */
#define STANDARD 0 // pad classique
#define SMD 1 // surfacique, generation d'un masque d'empatement
#define CONN 2 // surfacique, peut etre dore
/* PADS attributes */
#define STANDARD 0 // Usual pad
#define SMD 1 // Smd pad, appears on the layer paste (default)
#define CONN 2 // Like smd, does not appear on the layer paste (default)
// reserved, but not yet really used:
#define P_HOLE 3 // trou simple, utile sur pad stack
#define MECA 4 // PAD "mecanique" (fixation, zone cuivre...)
#define PAD_STACK 0x80 // bit 7 de .attrib (flag)
/* Definition type Structure d'un pad */
class D_PAD : public BOARD_ITEM
......@@ -26,41 +25,41 @@ public:
union
{
unsigned long m_NumPadName;
char m_Padname[4]; /* nom (numero) de la pastille (assimilable a un long)*/
char m_Padname[4]; /* Pad name (4 char) or a long identifier
* (used in pad name comparisons because this is faster than string comparison)
*/
};
wxString m_Netname; /* Net Name */
int m_Masque_Layer; // (Bit a Bit :1= cuivre, 15= cmp,
// 2..14 = interne
// 16 .. 31 = couches non cuivre
int m_PadShape; // forme CERCLE, RECT, OVALE, TRAPEZE ou libre
int m_DrillShape; // forme CERCLE, OVAL
int m_Masque_Layer; // Bitwise layer :1= copper layer, 15= cmp,
// 2..14 = internal layers
// 16 .. 31 = technical layers
wxPoint m_Pos; // Position de reference du pad
int m_PadShape; // Shape: CIRCLE, RECT, OVAL, TRAPEZOID
int m_DrillShape; // Shape CIRCLE, OVAL
wxPoint m_Pos; // pad Position on board
wxSize m_Drill; // Drill diam (drill shape = CIRCLE) or drill size(shape = OVAL)
// for drill shape = CIRCLE, drill diam = m_Drill.x
wxSize m_Offset; // Offset de la forme (pastilles excentrees)
wxSize m_Size; // Dimensions X et Y ( si orient 0 x = axe X
// y = axe Y
wxSize m_Size; // X and Y size ( relative to orient 0)
wxSize m_DeltaSize; // delta sur formes rectangle -> trapezes
wxPoint m_Pos0; // Coord relatives a l'ancre du pad en orientation 0
wxPoint m_Pos0; // Initial Pad position (i.e. pas position relative to the module anchor, orientation 0
int m_Rayon; // rayon du cercle exinscrit du pad
int m_Attribut; // NORMAL, SMD, CONN, Bit 7 = STACK
int m_Orient; // en 1/10 degres
int m_Attribut; // NORMAL, SMD, CONN
int m_Orient; // in 1/10 degrees
int m_NetCode; /* Numero de net pour comparaisons rapides */
int m_logical_connexion; // variable utilisee lors du calcul du chevelu:
// contient de numero de block pour une connexion type ratsnet
int m_NetCode; // Net number for fast comparisons
int m_logical_connexion; // variable used in rastnest computations
// handle block number in ratsnet connection
int m_physical_connexion; // variable utilisee lors du calcul de la connexit�
// contient de numero de block pour une connexion type piste
int m_physical_connexion; // variable used in rastnest computations
// handle block number in track connection
public:
D_PAD( MODULE* parent );
......@@ -71,7 +70,7 @@ public:
D_PAD* Next( void ) { return (D_PAD*) Pnext; }
/* supprime du chainage la structure Struct */
/* remove from linked list */
void UnLink( void );
/* Reading and writing data on files */
......@@ -82,11 +81,11 @@ public:
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
// autres
// others
void SetPadName( const wxString& name ); // Change pad name
wxString ReturnStringPadName( void ); // Return pad name as string in a wxString
void ReturnStringPadName( wxString& text ); // Return pad name as string in a buffer
void ComputeRayon( void ); // met a jour m_Rayon, rayon du cercle exinscrit
void ComputeRayon( void ); // compute m_Rayon, rayon du cercle exinscrit
const wxPoint ReturnShapePos( void ); // retourne la position
/**
......@@ -106,7 +105,8 @@ public:
*/
bool HitTest( const wxPoint& refPos );
#if defined(DEBUG)
#if defined (DEBUG)
/**
* Function GetClass
* returns the class name.
......@@ -117,6 +117,7 @@ public:
return wxT( "PAD" );
}
/**
* Function Show
* is used to output the object tree, currently for debugging only.
......@@ -125,8 +126,8 @@ public:
* @param os The ostream& to output to.
*/
virtual void Show( int nestLevel, std::ostream& os );
#endif
#endif
};
typedef class D_PAD * LISTE_PAD;
......@@ -215,51 +215,6 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
switch( g_KeyPressed )
{
case WXK_NUMPAD_SUBTRACT:
case WXK_SUBTRACT:
case '-':
ll = GetScreen()->m_Active_Layer;
if( ll > CMP_N )
break;
if( ll <= CUIVRE_N )
break;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer
ll = CUIVRE_N;
if( ll == CMP_N )
ll = MAX( CUIVRE_N, m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 );
else if( ll > CUIVRE_N )
ll--;
GetScreen()->m_Active_Layer = ll;
if( DisplayOpt.ContrastModeDisplay )
DrawPanel->Refresh( TRUE );
break;
case WXK_NUMPAD_ADD:
case WXK_ADD:
case '+':
ll = GetScreen()->m_Active_Layer;
if( ll >= CMP_N )
break;
ll++;
if( ll >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
ll = CMP_N;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer
ll = CUIVRE_N;
GetScreen()->m_Active_Layer = ll;
if( DisplayOpt.ContrastModeDisplay )
DrawPanel->Refresh( TRUE );
break;
case WXK_NUMPAD0:
case WXK_PAGEUP:
SwitchLayer( DC, CMP_N );
break;
case WXK_NUMPAD9:
case WXK_PAGEDOWN:
SwitchLayer( DC, CUIVRE_N );
break;
case EDA_PANNING_UP_KEY:
OnZoom( ID_ZOOM_PANNING_UP );
curpos = m_CurrentScreen->m_Curseur;
......@@ -281,51 +236,20 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
break;
case EDA_ZOOM_IN_FROM_MOUSE:
case WXK_F1:
OnZoom( ID_ZOOM_PLUS_KEY );
oldpos = curpos = GetScreen()->m_Curseur;
break;
case EDA_ZOOM_OUT_FROM_MOUSE:
case WXK_F2:
OnZoom( ID_ZOOM_MOINS_KEY );
oldpos = curpos = GetScreen()->m_Curseur;
break;
case WXK_F3:
OnZoom( ID_ZOOM_REDRAW_KEY );
break;
case EDA_ZOOM_CENTER_FROM_MOUSE:
case WXK_F4:
OnZoom( ID_ZOOM_CENTER_KEY );
oldpos = curpos = GetScreen()->m_Curseur;
break;
case WXK_F5:
SwitchLayer( DC, LAYER_N_2 );
break;
case WXK_F6:
SwitchLayer( DC, LAYER_N_3 );
break;
case WXK_F7:
SwitchLayer( DC, LAYER_N_4 );
break;
case WXK_F8:
SwitchLayer( DC, LAYER_N_5 );
break;
case WXK_F9:
SwitchLayer( DC, LAYER_N_6 );
break;
case WXK_F10:
SwitchLayer( DC, LAYER_N_7 );
break;
case WXK_NUMPAD8: /* Deplacement curseur vers le haut */
case WXK_UP:
Mouse.y -= delta.y;
......
......@@ -123,7 +123,7 @@ bool WinEDA_PadPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const w
////@end WinEDA_PadPropertiesFrame member initialisation
////@begin WinEDA_PadPropertiesFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
......@@ -144,7 +144,7 @@ void WinEDA_PadPropertiesFrame::CreateControls()
{
SetFont(*g_DialogFont);
////@begin WinEDA_PadPropertiesFrame content construction
// Generated by DialogBlocks, 03/08/2006 10:35:29 (unregistered)
// Generated by DialogBlocks, 27/08/2007 21:03:59 (unregistered)
WinEDA_PadPropertiesFrame* itemDialog1 = this;
......@@ -172,46 +172,42 @@ void WinEDA_PadPropertiesFrame::CreateControls()
m_DrillShapeBoxSizer = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(m_DrillShapeBoxSizer, 0, wxGROW|wxTOP, 5);
wxString m_DrillShapeCtrlStrings[] = {
_("Circle"),
_("Oval")
};
m_DrillShapeCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX_DRILL_SHAPE, _("Drill Shape:"), wxDefaultPosition, wxDefaultSize, 2, m_DrillShapeCtrlStrings, 1, wxRA_SPECIFY_COLS );
wxArrayString m_DrillShapeCtrlStrings;
m_DrillShapeCtrlStrings.Add(_("Circle"));
m_DrillShapeCtrlStrings.Add(_("Oval"));
m_DrillShapeCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX_DRILL_SHAPE, _("Drill Shape:"), wxDefaultPosition, wxDefaultSize, m_DrillShapeCtrlStrings, 1, wxRA_SPECIFY_COLS );
m_DrillShapeCtrl->SetSelection(0);
m_DrillShapeBoxSizer->Add(m_DrillShapeCtrl, 0, wxGROW|wxALL, 5);
m_PadOptSizer = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(m_PadOptSizer, 0, wxGROW|wxALL, 5);
wxString m_PadOrientStrings[] = {
_("0"),
_("90"),
_("-90"),
_("180"),
_("User")
};
m_PadOrient = new wxRadioBox( itemDialog1, ID_LISTBOX_ORIENT_PAD, _("Pad Orient:"), wxDefaultPosition, wxDefaultSize, 5, m_PadOrientStrings, 1, wxRA_SPECIFY_COLS );
wxArrayString m_PadOrientStrings;
m_PadOrientStrings.Add(_("0"));
m_PadOrientStrings.Add(_("90"));
m_PadOrientStrings.Add(_("-90"));
m_PadOrientStrings.Add(_("180"));
m_PadOrientStrings.Add(_("User"));
m_PadOrient = new wxRadioBox( itemDialog1, ID_LISTBOX_ORIENT_PAD, _("Pad Orient:"), wxDefaultPosition, wxDefaultSize, m_PadOrientStrings, 1, wxRA_SPECIFY_COLS );
m_PadOrient->SetSelection(0);
m_PadOptSizer->Add(m_PadOrient, 0, wxGROW|wxALL, 5);
wxString m_PadShapeStrings[] = {
_("Circle"),
_("Oval"),
_("Rect"),
_("Trapezoidal")
};
m_PadShape = new wxRadioBox( itemDialog1, ID_LISTBOX_SHAPE_PAD, _("Pad Shape:"), wxDefaultPosition, wxDefaultSize, 4, m_PadShapeStrings, 1, wxRA_SPECIFY_COLS );
wxArrayString m_PadShapeStrings;
m_PadShapeStrings.Add(_("Circle"));
m_PadShapeStrings.Add(_("Oval"));
m_PadShapeStrings.Add(_("Rect"));
m_PadShapeStrings.Add(_("Trapezoidal"));
m_PadShape = new wxRadioBox( itemDialog1, ID_LISTBOX_SHAPE_PAD, _("Pad Shape:"), wxDefaultPosition, wxDefaultSize, m_PadShapeStrings, 1, wxRA_SPECIFY_COLS );
m_PadShape->SetSelection(0);
m_PadOptSizer->Add(m_PadShape, 0, wxGROW|wxALL, 5);
wxString m_PadTypeStrings[] = {
_("Standard"),
_("SMD"),
_("Conn"),
_("Hole"),
_("Mechanical")
};
m_PadType = new wxRadioBox( itemDialog1, ID_LISTBOX_TYPE_PAD, _("Pad Type:"), wxDefaultPosition, wxDefaultSize, 5, m_PadTypeStrings, 1, wxRA_SPECIFY_COLS );
wxArrayString m_PadTypeStrings;
m_PadTypeStrings.Add(_("Standard"));
m_PadTypeStrings.Add(_("SMD"));
m_PadTypeStrings.Add(_("Conn"));
m_PadTypeStrings.Add(_("Hole"));
m_PadTypeStrings.Add(_("Mechanical"));
m_PadType = new wxRadioBox( itemDialog1, ID_LISTBOX_TYPE_PAD, _("Pad Type:"), wxDefaultPosition, wxDefaultSize, m_PadTypeStrings, 1, wxRA_SPECIFY_COLS );
m_PadType->SetSelection(0);
m_PadOptSizer->Add(m_PadType, 0, wxGROW|wxALL, 5);
......@@ -228,61 +224,61 @@ void WinEDA_PadPropertiesFrame::CreateControls()
wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Layers:"));
wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxVERTICAL);
itemBoxSizer15->Add(itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer15->Add(itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);
m_PadLayerCu = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Copper layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerCu->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerCu, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerCu, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
m_PadLayerCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Comp layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerCmp->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerCmp, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerCmp, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
itemStaticBoxSizer18->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_PadLayerAdhCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX2, _("Adhesive Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerAdhCmp->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerAdhCmp, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerAdhCmp, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
m_PadLayerAdhCu = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("Adhesive Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerAdhCu->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerAdhCu, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerAdhCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerPateCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX4, _("Solder paste Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerPateCmp->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerPateCmp, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerPateCmp, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerPateCu = new wxCheckBox( itemDialog1, ID_CHECKBOX5, _("Solder paste Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerPateCu->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerPateCu, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerPateCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerSilkCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX6, _("Silkscreen Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerSilkCmp->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerSilkCmp, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerSilkCmp, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerSilkCu = new wxCheckBox( itemDialog1, ID_CHECKBOX7, _("Silkscreen Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerSilkCu->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerSilkCu, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerSilkCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerMaskCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX8, _("Solder mask Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerMaskCmp->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerMaskCmp, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerMaskCmp, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerMaskCu = new wxCheckBox( itemDialog1, ID_CHECKBOX9, _("Solder mask Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerMaskCu->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerMaskCu, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerMaskCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerECO1 = new wxCheckBox( itemDialog1, ID_CHECKBOX10, _("E.C.O.1 layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerECO1->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerECO1, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerECO1, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerECO2 = new wxCheckBox( itemDialog1, ID_CHECKBOX11, _("E.C.O.2 layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerECO2->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerECO2, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerECO2, 0, wxGROW|wxLEFT|wxRIGHT, 5);
m_PadLayerDraft = new wxCheckBox( itemDialog1, ID_CHECKBOX12, _("Draft layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_PadLayerDraft->SetValue(false);
itemStaticBoxSizer18->Add(m_PadLayerDraft, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_PadLayerDraft, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
////@end WinEDA_PadPropertiesFrame content construction
......@@ -381,11 +377,6 @@ void WinEDA_PadPropertiesFrame::OnListboxShapePadSelected( wxCommandEvent& event
m_PadDeltaSizeCtrl->Enable(TRUE, TRUE);
m_PadSizeCtrl->Enable(TRUE, TRUE);
break;
case 4: //SPECIAL_PAD:
m_PadDeltaSizeCtrl->Enable(FALSE, FALSE);
m_PadSizeCtrl->Enable(TRUE, TRUE);
break;
}
}
......
......@@ -39,12 +39,6 @@ class wxBoxSizer;
////@begin control identifiers
#define ID_DIALOG 10000
// #define SYMBOL_WINEDA_PADPROPERTIESFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_TITLE _("Pad properties")
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_POSITION wxDefaultPosition
#define ID_TEXTCTRL_PADNUM 10001
#define ID_TEXTCTRL_NETNAME 10002
#define ID_RADIOBOX_DRILL_SHAPE 10019
......@@ -64,6 +58,11 @@ class wxBoxSizer;
#define ID_CHECKBOX10 10016
#define ID_CHECKBOX11 10017
#define ID_CHECKBOX12 10018
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_TITLE _("Pad properties")
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
......
This diff is collapsed.
......@@ -160,12 +160,6 @@ int tmp;
m_PadSizeCtrl->Enable(TRUE, TRUE);
m_PadShape->SetSelection(3);
break;
case SPECIAL_PAD:
m_PadDeltaSizeCtrl->Enable(FALSE, FALSE);
m_PadSizeCtrl->Enable(TRUE, TRUE);
m_PadShape->SetSelection(4);
break;
}
// Selection du type
......@@ -416,9 +410,6 @@ bool error = FALSE;
case TRAPEZE:
break;
case SPECIAL_PAD:
break;
}
switch ( CurrentPad->m_Attribut )
......
......@@ -174,9 +174,8 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
else
GetScreen()->m_FileName = FullFileName;
/////////////////////////
/* Lecture Fichier PCB */
/////////////////////////
/* Start read PCB file
*/
source = wxFopen( GetScreen()->m_FileName, wxT( "rt" ) );
if( source == NULL )
......@@ -187,7 +186,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
}
/* Lecture de l'entete et TEST si PCB format ASCII */
/* Read header and TEST if it is a PCB file format */
GetLine( source, cbuf, &ii );
if( strncmp( cbuf, "PCBNEW-BOARD", 12 ) != 0 )
{
......@@ -199,7 +198,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
SetTitle( GetScreen()->m_FileName );
SetLastProject( GetScreen()->m_FileName );
// Rechargement de la configuration:
// Reload the corresponding configuration file:
wxSetWorkingDirectory( wxPathOnly( GetScreen()->m_FileName ) );
if( Append )
ReadPcbFile( DC, source, TRUE );
......@@ -207,7 +206,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
{
Read_Config( GetScreen()->m_FileName );
// Mise a jour du toolbar d'options
// Update the option toolbar
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
m_DisplayModText = DisplayOpt.DisplayModText;
m_DisplayModEdge = DisplayOpt.DisplayModEdge;
......@@ -227,11 +226,12 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
wxGetCwd().GetData(), DIR_SEP, PcbExtBuffer.GetData() );
}
/* liste des pads recalculee avec Affichage des messages d'erreur */
/* Rebuild the new pad list (for drc and ratsnet control ...) */
build_liste_pads();
m_Pcb->Display_Infos( this );
/* reset the auto save timer */
g_SaveTime = time( NULL );
......
This diff is collapsed.
/***************/
/* hotkeys.h */
/***************/
#ifndef KOTKEYS_H
#define KOTKEYS_H
#include "hotkeys_basic.h"
enum hotkey_id_commnand {
HK_NOT_FOUND = 0,
HK_RESET_LOCAL_COORD,
HK_HELP,
HK_ZOOM_IN,
HK_ZOOM_OUT,
HK_ZOOM_REDRAW,
HK_ZOOM_CENTER,
HK_DELETE,
HK_BACK_SPACE,
HK_ROTATE_FOOTPRINT,
HK_MOVE_FOOTPRINT,
HK_DRAG_FOOTPRINT,
HK_FLIP_FOOTPRINT,
HK_LOCK_UNLOCK_FOOTPRINT,
HK_ADD_VIA, HK_END_TRACK,
HK_SAVE_BOARD, HK_LOAD_BOARD,
HK_SWITCH_UNITS, HK_SWITCH_TRACK_DISPLAY_MODE,
HK_FIND_ITEM,
HK_SWITCH_LAYER_TO_COPPER,
HK_SWITCH_LAYER_TO_COMPONENT,
HK_SWITCH_LAYER_TO_NEXT,
HK_SWITCH_LAYER_TO_PREVIOUS,
HK_SWITCH_LAYER_TO_INNER1,
HK_SWITCH_LAYER_TO_INNER2,
HK_SWITCH_LAYER_TO_INNER3,
HK_SWITCH_LAYER_TO_INNER4,
HK_SWITCH_LAYER_TO_INNER5,
HK_SWITCH_LAYER_TO_INNER6
};
// List of hotkey descriptors for pcbnew
extern Ki_HotkeyInfo* s_board_edit_Hotkey_List[];
// List of hotkey descriptors for the module editor
extern Ki_HotkeyInfo* s_module_edit_Hotkey_List[];
#endif // KOTKEYS_H
......@@ -183,11 +183,11 @@ wxMenuBar * menuBar = GetMenuBar();
configmenu->Append(item);
configmenu->AppendSeparator();
item = new wxMenuItem(configmenu, ID_PREFERENCES_CREATE_CONFIG_HOTKEYS, _("Create Eeschema &Hotkey config file"),
item = new wxMenuItem(configmenu, ID_PREFERENCES_CREATE_CONFIG_HOTKEYS, _("Create Pcbnew &Hotkey config file"),
_("Create or Recreate the hotkey config file from current hotkey list") );
item->SetBitmap(save_setup_xpm);
configmenu->Append(item);
item = new wxMenuItem(configmenu, ID_PREFERENCES_READ_CONFIG_HOTKEYS, _("Reread &Eeschema Hotkey config file"),
item = new wxMenuItem(configmenu, ID_PREFERENCES_READ_CONFIG_HOTKEYS, _("Reread &Pcbnew Hotkey config file"),
_("Reread the hotkey config file") );
item->SetBitmap( reload_xpm);
configmenu->Append(item);
......
......@@ -58,6 +58,10 @@ bool WinEDA_App::OnInit( void )
Read_Config( FFileName );
g_DrawBgColor = BLACK;
Read_Hotkey_Config( m_PcbFrame, false ); /* Must be called before creating the main frame
* in order to display the real hotkeys
* in menus or tool tips */
/* allocation de la memoire pour le fichier et autres buffers: */
/* On reserve BUFMEMSIZE octets de ram pour calcul */
......@@ -79,7 +83,6 @@ bool WinEDA_App::OnInit( void )
SetTopWindow( m_PcbFrame );
m_PcbFrame->Show( TRUE );
Read_Hotkey_Config(m_PcbFrame, false);
if( CreateServer( m_PcbFrame, KICAD_PCB_PORT_SERVICE_NUMBER ) )
{
......
This diff is collapsed.
......@@ -25,6 +25,8 @@
#include "wx/ownerdrw.h"
#include "wx/menuitem.h"
#include "hotkeys.h"
#define MUWAVE_ENBL
#include "mw_Add_Stub.xpm"
......@@ -199,9 +201,10 @@ void WinEDA_PcbFrame::PrepareLayerIndicator( void )
void WinEDA_PcbFrame::ReCreateHToolbar( void )
/******************************************/
// Create the main horizontal toolbar
/* Create the main horizontal toolbar for the board editor */
{
int ii;
wxString msg;
if( m_HToolBar != NULL )
{ // simple mise a jour de la liste des fichiers anciens
......@@ -264,19 +267,25 @@ void WinEDA_PcbFrame::ReCreateHToolbar( void )
_( "Plot (HPGL, PostScript, or GERBER format)" ) );
m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "zoom +" ), s_board_edit_Hotkey_List, HK_ZOOM_IN );
m_HToolBar->AddTool( ID_ZOOM_PLUS_BUTT, wxEmptyString, BITMAP( zoom_in_xpm ),
_( "zoom + (F1)" ) );
msg );
msg = AddHotkeyName( _( "zoom -" ), s_board_edit_Hotkey_List, HK_ZOOM_OUT );
m_HToolBar->AddTool( ID_ZOOM_MOINS_BUTT, wxEmptyString, BITMAP( zoom_out_xpm ),
_( "zoom - (F2)" ) );
msg );
msg = AddHotkeyName( _( "redraw" ), s_board_edit_Hotkey_List, HK_ZOOM_REDRAW );
m_HToolBar->AddTool( ID_ZOOM_REDRAW_BUTT, wxEmptyString, BITMAP( repaint_xpm ),
_( "redraw (F3)" ) );
msg );
m_HToolBar->AddTool( ID_ZOOM_PAGE_BUTT, wxEmptyString, BITMAP( zoom_optimal_xpm ),
_( "auto zoom" ) );
m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Find components and texts" ), s_board_edit_Hotkey_List, HK_FIND_ITEM );
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, BITMAP( find_xpm ),
_( "Find components and texts (Ctrl-F)" ) );
msg );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_GET_NETLIST, wxEmptyString, BITMAP( netlist_xpm ),
......
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