Commit f7d85eca authored by CHARRAS's avatar CHARRAS

better hotkey.cpp (code cleaning and info messages)

parent 2ac1fe57
...@@ -13,10 +13,11 @@ email address. ...@@ -13,10 +13,11 @@ email address.
though I'm not perfectly happy with the implementation -- wxwidgets puts though I'm not perfectly happy with the implementation -- wxwidgets puts
the control-characters in alphabetical order! the control-characters in alphabetical order!
2007-June-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2007-June-25 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+ pcbnew + pcbnew
minor enhancement in Edit footprint dialog (some help tool tips). minor enhancement in Edit footprint dialog (more help tool tips).
better hotkey.cpp (code cleaning and info messages)
......
This diff is collapsed.
...@@ -27,7 +27,7 @@ int ii; ...@@ -27,7 +27,7 @@ int ii;
wxMenuBar * menuBar = GetMenuBar(); wxMenuBar * menuBar = GetMenuBar();
if( menuBar == NULL ) if( menuBar == NULL )
{ {
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
m_FilesMenu = new wxMenu; m_FilesMenu = new wxMenu;
...@@ -48,7 +48,7 @@ wxMenuBar * menuBar = GetMenuBar(); ...@@ -48,7 +48,7 @@ wxMenuBar * menuBar = GetMenuBar();
m_FilesMenu->Append(ID_GERBVIEW_LOAD_DCODE_FILE, m_FilesMenu->Append(ID_GERBVIEW_LOAD_DCODE_FILE,
_("Load DCodes"), _("Load DCodes"),
_("Load DCodes File"), _("Load D-Codes File"),
FALSE); FALSE);
#if 0 #if 0
m_FilesMenu->Append(ID_GERBVIEW_LOAD_DRILL_FILE, m_FilesMenu->Append(ID_GERBVIEW_LOAD_DRILL_FILE,
...@@ -100,15 +100,15 @@ wxMenuBar * menuBar = GetMenuBar(); ...@@ -100,15 +100,15 @@ wxMenuBar * menuBar = GetMenuBar();
// Configuration: // Configuration:
wxMenu * configmenu = new wxMenu; wxMenu * configmenu = new wxMenu;
configmenu->Append(ID_CONFIG_REQ, _("&Files and Dir"), ADD_MENUITEM_WITH_HELP(configmenu, ID_CONFIG_REQ, _("&File ext"),
_("Setting Files extension, Directories and others...")); _("Setting Files extension"), config_xpm );
configmenu->Append(ID_COLORS_SETUP, _("&Colors"), ADD_MENUITEM_WITH_HELP(configmenu, ID_COLORS_SETUP, _("&Colors"),
_("Select Colors and Display for layers")); _("Select Colors and Display for layers"), palette_xpm);
configmenu->Append(ID_OPTIONS_SETUP, _("&Options"), ADD_MENUITEM_WITH_HELP(configmenu, ID_OPTIONS_SETUP, _("&Options"),
_(" Select general options")); _(" Select general options"), preference_xpm);
configmenu->Append(ID_PCB_LOOK_SETUP, _("Display"), ADD_MENUITEM_WITH_HELP(configmenu, ID_PCB_LOOK_SETUP, _("Display"),
_(" Select how items are displayed")); _(" Select how items are displayed"), display_options_xpm);
// Font selection and setup // Font selection and setup
AddFontSelectionMenu(configmenu); AddFontSelectionMenu(configmenu);
...@@ -116,8 +116,8 @@ wxMenuBar * menuBar = GetMenuBar(); ...@@ -116,8 +116,8 @@ wxMenuBar * menuBar = GetMenuBar();
m_Parent->SetLanguageList(configmenu); m_Parent->SetLanguageList(configmenu);
configmenu->AppendSeparator(); configmenu->AppendSeparator();
configmenu->Append(ID_CONFIG_SAVE, _("&Save Setup"), ADD_MENUITEM_WITH_HELP(configmenu, ID_CONFIG_SAVE, _("&Save Gerbview Setup"),
_("Save application preferences")); _("Save application preferences"), save_setup_xpm);
// Menu drill ( generation fichiers percage) // Menu drill ( generation fichiers percage)
/* wxMenu *drill_menu = new wxMenu; /* wxMenu *drill_menu = new wxMenu;
...@@ -126,18 +126,20 @@ wxMenuBar * menuBar = GetMenuBar(); ...@@ -126,18 +126,20 @@ wxMenuBar * menuBar = GetMenuBar();
*/ */
// Menu d'outils divers // Menu d'outils divers
wxMenu *miscellaneous_menu = new wxMenu; wxMenu *miscellaneous_menu = new wxMenu;
miscellaneous_menu->Append(ID_GERBVIEW_SHOW_LIST_DCODES, _("&List DCodes"), ADD_MENUITEM_WITH_HELP(miscellaneous_menu, ID_GERBVIEW_SHOW_LIST_DCODES, _("&List DCodes"),
_("List and Edit DCodes") ); _("List and Edit DCodes"), show_dcodenumber_xpm );
miscellaneous_menu->Append(ID_GERBVIEW_SHOW_SOURCE,_("&Show source"), ADD_MENUITEM_WITH_HELP(miscellaneous_menu, ID_GERBVIEW_SHOW_SOURCE,_("&Show source"),
_("Show source file for the current layer") ); _("Show source file for the current layer"), tools_xpm );
miscellaneous_menu->AppendSeparator(); miscellaneous_menu->AppendSeparator();
miscellaneous_menu->Append(ID_PCB_GLOBAL_DELETE, _("&Delete Layer"), ADD_MENUITEM_WITH_HELP(miscellaneous_menu, ID_PCB_GLOBAL_DELETE, _("&Delete Layer"),
_("Delete current layer") ); _("Delete current layer"), general_deletions_xpm );
// Menu Help: // Menu Help:
wxMenu *helpMenu = new wxMenu; wxMenu *helpMenu = new wxMenu;
helpMenu->Append(ID_GENERAL_HELP, _("&Contents"), _("Open the gerbview manual") ); ADD_MENUITEM_WITH_HELP(helpMenu, ID_GENERAL_HELP, _("&Contents"),
helpMenu->Append(ID_KICAD_ABOUT, _("&About"), _("About this application") ); _("Open the gerbview manual"), help_xpm );
ADD_MENUITEM_WITH_HELP(helpMenu, ID_KICAD_ABOUT, _("&About"),
_("About this application"), info_xpm );
menuBar->Append(m_FilesMenu, _("&File")); menuBar->Append(m_FilesMenu, _("&File"));
menuBar->Append(configmenu, _("&Preferences")); menuBar->Append(configmenu, _("&Preferences"));
...@@ -147,7 +149,7 @@ wxMenuBar * menuBar = GetMenuBar(); ...@@ -147,7 +149,7 @@ wxMenuBar * menuBar = GetMenuBar();
// 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 // simple mise a jour de la liste des fichiers anciens
{ {
...@@ -255,32 +257,32 @@ int ii; ...@@ -255,32 +257,32 @@ int ii;
wxNullBitmap, wxNullBitmap,
FALSE, FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Zoom + (F1)")); _("zoom + (F1)"));
m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, BITMAP(zoom_out_xpm), m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, BITMAP(zoom_out_xpm),
wxNullBitmap, wxNullBitmap,
FALSE, FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Zoom - (F2)")); _("zoom - (F2)"));
m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, BITMAP(repaint_xpm), m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, BITMAP(repaint_xpm),
wxNullBitmap, wxNullBitmap,
FALSE, FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Redraw (F3)")); _("redraw (F3)"));
m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, BITMAP(zoom_optimal_xpm), m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, BITMAP(zoom_optimal_xpm),
wxNullBitmap, wxNullBitmap,
FALSE, FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Auto zoom")); _("auto zoom"));
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool(ID_FIND_ITEMS, BITMAP(find_xpm), m_HToolBar->AddTool(ID_FIND_ITEMS, BITMAP(find_xpm),
wxNullBitmap, wxNullBitmap,
FALSE, FALSE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Find DCodes")); _("Find D Codes"));
wxArrayString choices; wxArrayString choices;
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
...@@ -426,7 +428,7 @@ void WinEDA_GerberFrame::ReCreateOptToolbar(void) ...@@ -426,7 +428,7 @@ void WinEDA_GerberFrame::ReCreateOptToolbar(void)
wxNullBitmap, wxNullBitmap,
TRUE, TRUE,
-1, -1, (wxObject *) NULL, -1, -1, (wxObject *) NULL,
_("Show DCode number")); _("Show dcode number"));
m_OptionsToolBar->Realize(); m_OptionsToolBar->Realize();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE #ifdef EDA_BASE
(wxT("(2007-06-21)")) (wxT("(2007-06-25)"))
#endif #endif
; ;
......
...@@ -51,6 +51,11 @@ ...@@ -51,6 +51,11 @@
l_item = new wxMenuItem(menu, id, text);\ l_item = new wxMenuItem(menu, id, text);\
l_item->SetBitmap(icon); menu->Append(l_item);} l_item->SetBitmap(icon); menu->Append(l_item);}
#define ADD_MENUITEM_WITH_HELP(menu, id, text, help, icon) {\
wxMenuItem * l_item;\
l_item = new wxMenuItem(menu, id, text, help);\
l_item->SetBitmap(icon); menu->Append(l_item);}
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#define ADD_MENUITEM_WITH_SUBMENU(menu, submenu, id, text, icon) {\ #define ADD_MENUITEM_WITH_SUBMENU(menu, submenu, id, text, icon) {\
wxMenuItem * l_item;\ wxMenuItem * l_item;\
......
No preview for this file type
This diff is collapsed.
...@@ -85,24 +85,6 @@ WinEDA_PrjFrame::WinEDA_PrjFrame(WinEDA_MainFrame * parent, ...@@ -85,24 +85,6 @@ WinEDA_PrjFrame::WinEDA_PrjFrame(WinEDA_MainFrame * parent,
item->SetBitmap( directory_xpm ); item->SetBitmap( directory_xpm );
menu->Append( item ); menu->Append( item );
#if 0
item = new wxMenuItem(menu, ID_PROJECT_NEWSCH, _("New &Schematic"), _("Create a New Schematic File") );
item->SetBitmap( new_sch_xpm );
menu->Append( item );
item = new wxMenuItem(menu, ID_PROJECT_NEWBRD, _("New &PCB"), _("Create a New PCB File") );
item->SetBitmap( new_pcb_xpm );
menu->Append( item );
item = new wxMenuItem(menu, ID_PROJECT_NEWGERBER, _("New &Gerber File"), _("Create a New Gerber File") );
item->SetBitmap( new_gerb_xpm );
menu->Append( item );
item = new wxMenuItem(menu, ID_PROJECT_NEWNET, _("New &Netlist"), _("Create a New Netlist") );
item->SetBitmap( new_cvpcb_xpm );
menu->Append( item );
#endif
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
item = new wxMenuItem(menu, ID_PROJECT_NEWPY, _("New P&ython Script"), _("Create a New Python Script") ); item = new wxMenuItem(menu, ID_PROJECT_NEWPY, _("New P&ython Script"), _("Create a New Python Script") );
item->SetBitmap( new_python_xpm ); item->SetBitmap( new_python_xpm );
......
************************************************************** **************************************************************
Update 25 may 2007 Update 25 jun 2007
pcbnew: pcbnew:
bug fix (problem in postscript generation due to the internationalization bug fix (problem in postscript generation due to the internationalization
of floating point number notation ) of floating point number notation )
......
...@@ -133,7 +133,7 @@ void WinEDA_CleaningOptionsFrame::Init() ...@@ -133,7 +133,7 @@ void WinEDA_CleaningOptionsFrame::Init()
void WinEDA_CleaningOptionsFrame::CreateControls() void WinEDA_CleaningOptionsFrame::CreateControls()
{ {
////@begin WinEDA_CleaningOptionsFrame content construction ////@begin WinEDA_CleaningOptionsFrame content construction
// Generated by DialogBlocks, 28/05/2007 19:08:46 (unregistered) // Generated by DialogBlocks, 21/06/2007 19:58:26 (unregistered)
WinEDA_CleaningOptionsFrame* itemDialog1 = this; WinEDA_CleaningOptionsFrame* itemDialog1 = this;
...@@ -159,16 +159,18 @@ void WinEDA_CleaningOptionsFrame::CreateControls() ...@@ -159,16 +159,18 @@ void WinEDA_CleaningOptionsFrame::CreateControls()
m_DeleteunconnectedOpt->SetValue(false); m_DeleteunconnectedOpt->SetValue(false);
itemStaticBoxSizer4->Add(m_DeleteunconnectedOpt, 0, wxALIGN_LEFT|wxALL, 5); itemStaticBoxSizer4->Add(m_DeleteunconnectedOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_ConnectToPadsOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Connect stubs to Pads"), wxDefaultPosition, wxDefaultSize, 0 ); m_ConnectToPadsOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Connect to Pads"), wxDefaultPosition, wxDefaultSize, 0 );
m_ConnectToPadsOpt->SetValue(false); m_ConnectToPadsOpt->SetValue(false);
itemStaticBoxSizer4->Add(m_ConnectToPadsOpt, 0, wxALIGN_LEFT|wxALL, 5); itemStaticBoxSizer4->Add(m_ConnectToPadsOpt, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); itemStaticBoxSizer4->Add(5, 5, 0, wxGROW|wxALL, 5);
itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton10 = new wxButton( itemDialog1, ID_BUTTON_EXECUTE, _("Clean pcb"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL);
itemButton10->SetDefault(); itemBoxSizer3->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer9->Add(itemButton10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxButton* itemButton11 = new wxButton( itemDialog1, ID_BUTTON_EXECUTE, _("Clean pcb"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton11->SetDefault();
itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
// Set validators // Set validators
m_CleanViasOpt->SetValidator( wxGenericValidator(& s_CleanVias) ); m_CleanViasOpt->SetValidator( wxGenericValidator(& s_CleanVias) );
......
...@@ -34,14 +34,11 @@ BEGIN_EVENT_TABLE(Panel3D_Ctrl, wxPanel) ...@@ -34,14 +34,11 @@ BEGIN_EVENT_TABLE(Panel3D_Ctrl, wxPanel)
END_EVENT_TABLE() END_EVENT_TABLE()
#define H_SIZE 430
#define V_SIZE 530
/**************************************************************************************/ /**************************************************************************************/
WinEDA_ModulePropertiesFrame::WinEDA_ModulePropertiesFrame(WinEDA_BasePcbFrame *parent, WinEDA_ModulePropertiesFrame::WinEDA_ModulePropertiesFrame(WinEDA_BasePcbFrame *parent,
MODULE * Module,wxDC * DC, MODULE * Module,wxDC * DC,
const wxPoint & framepos): const wxPoint & framepos):
wxDialog(parent, -1, _("Module properties"), framepos, wxDialog(parent, -1, _("Module properties"), framepos, wxDefaultSize, DIALOG_STYLE)
wxSize(H_SIZE, V_SIZE), DIALOG_STYLE)
/**************************************************************************************/ /**************************************************************************************/
{ {
wxString number; wxString number;
...@@ -77,20 +74,15 @@ void WinEDA_ModulePropertiesFrame::CreateControls(void) ...@@ -77,20 +74,15 @@ void WinEDA_ModulePropertiesFrame::CreateControls(void)
{ {
wxPoint pos; wxPoint pos;
wxButton * Button; wxButton * Button;
wxSize usize;
bool FullOptions = FALSE; bool FullOptions = FALSE;
if ( m_Parent->m_Ident == PCB_FRAME ) FullOptions = TRUE; if ( m_Parent->m_Ident == PCB_FRAME ) FullOptions = TRUE;
usize = GetClientSize();
m_GeneralBoxSizer = new wxBoxSizer(wxVERTICAL); m_GeneralBoxSizer = new wxBoxSizer(wxVERTICAL);
SetSizer(m_GeneralBoxSizer); SetSizer(m_GeneralBoxSizer);
m_NoteBook = new wxNotebook(this, ID_NOTEBOOK, m_NoteBook = new wxNotebook(this, ID_NOTEBOOK);
wxDefaultPosition,wxSize(usize.x,usize.y - 34) );
m_NoteBook->SetFont(*g_DialogFont); m_NoteBook->SetFont(*g_DialogFont);
m_GeneralBoxSizer->Add(m_NoteBook, 0, wxGROW|wxALL, 5); m_GeneralBoxSizer->Add(m_NoteBook, 0, wxGROW|wxALL, 5);
// Add panels // Add panels
......
/////////////////////////////////////////////////////////////////////////////
// Name: essai.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 28/02/2006 07:46:42
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 28/02/2006 07:46:42
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "essai.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "essai.h"
////@begin XPM images
////@end XPM images
/*!
* essai type definition
*/
IMPLEMENT_DYNAMIC_CLASS( essai, wxDialog )
/*!
* essai event table definition
*/
BEGIN_EVENT_TABLE( essai, wxDialog )
////@begin essai event table entries
////@end essai event table entries
END_EVENT_TABLE()
/*!
* essai constructors
*/
essai::essai( )
{
}
essai::essai( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* essai creator
*/
bool essai::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin essai member initialisation
GridSizer = NULL;
////@end essai member initialisation
////@begin essai creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
////@end essai creation
return true;
}
/*!
* Control creation for essai
*/
void essai::CreateControls()
{
////@begin essai content construction
// Generated by DialogBlocks, 28/02/2006 07:48:35 (unregistered)
essai* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1, wxID_STATIC, _("Static text"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText3, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 5);
GridSizer = new wxFlexGridSizer(3, 2, 0, 0);
itemBoxSizer2->Add(GridSizer, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
GridSizer->Add(itemStaticText5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
wxTextCtrl* itemTextCtrl6 = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
GridSizer->Add(itemTextCtrl6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
////@end essai content construction
}
/*!
* Should we show tooltips?
*/
bool essai::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap essai::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin essai bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end essai bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon essai::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin essai icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end essai icon retrieval
}
/////////////////////////////////////////////////////////////////////////////
// Name: essai.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 28/02/2006 07:46:42
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 28/02/2006 07:46:42
#ifndef _ESSAI_H_
#define _ESSAI_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "essai.h"
#endif
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxFlexGridSizer;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define SYMBOL_ESSAI_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_ESSAI_TITLE _("essai")
#define SYMBOL_ESSAI_IDNAME ID_DIALOG
#define SYMBOL_ESSAI_SIZE wxSize(400, 300)
#define SYMBOL_ESSAI_POSITION wxDefaultPosition
#define ID_TEXTCTRL 10001
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* essai class declaration
*/
class essai: public wxDialog
{
DECLARE_DYNAMIC_CLASS( essai )
DECLARE_EVENT_TABLE()
public:
/// Constructors
essai( );
essai( wxWindow* parent, wxWindowID id = SYMBOL_ESSAI_IDNAME, const wxString& caption = SYMBOL_ESSAI_TITLE, const wxPoint& pos = SYMBOL_ESSAI_POSITION, const wxSize& size = SYMBOL_ESSAI_SIZE, long style = SYMBOL_ESSAI_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_ESSAI_IDNAME, const wxString& caption = SYMBOL_ESSAI_TITLE, const wxPoint& pos = SYMBOL_ESSAI_POSITION, const wxSize& size = SYMBOL_ESSAI_SIZE, long style = SYMBOL_ESSAI_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin essai event handler declarations
////@end essai event handler declarations
////@begin essai member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end essai member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin essai member variables
wxFlexGridSizer* GridSizer;
////@end essai member variables
};
#endif
// _ESSAI_H_
#include "wx/msw/wx.rc"
...@@ -40,163 +40,129 @@ sous le courseur souris ...@@ -40,163 +40,129 @@ sous le courseur souris
MODULE* module = NULL; MODULE* module = NULL;
hotkey = toupper(hotkey);
switch (hotkey) switch (hotkey)
{ {
case WXK_DELETE: case WXK_DELETE:
case WXK_NUMPAD_DELETE: case WXK_NUMPAD_DELETE:
OnHotkeyDeleteItem(DC, DrawStruct); OnHotkeyDeleteItem(DC, DrawStruct);
break; break;
case WXK_BACK: case WXK_BACK:
{ {
if( m_ID_current_state == ID_TRACK_BUTT && if( m_ID_current_state == ID_TRACK_BUTT &&
GetScreen()->m_Active_Layer <= CMP_N ) GetScreen()->m_Active_Layer <= CMP_N )
{ {
bool ItemFree = (GetScreen()->m_CurrentItem == NULL ) || bool ItemFree = (GetScreen()->m_CurrentItem == NULL ) ||
(GetScreen()->m_CurrentItem->m_Flags == 0); (GetScreen()->m_CurrentItem->m_Flags == 0);
if ( ItemFree ) if ( ItemFree )
{ {
//no track is currently being edited - select a segment and remove it. //no track is currently being edited - select a segment and remove it.
DrawStruct = PcbGeneralLocateAndDisplay(); DrawStruct = PcbGeneralLocateAndDisplay();
//don't let backspace delete modules!! //don't let backspace delete modules!!
if ( DrawStruct && (DrawStruct->m_StructType == TYPETRACK if ( DrawStruct && (DrawStruct->m_StructType == TYPETRACK
|| DrawStruct->m_StructType == TYPEVIA)) || DrawStruct->m_StructType == TYPEVIA))
Delete_Segment(DC, (TRACK*)DrawStruct); Delete_Segment(DC, (TRACK*)DrawStruct);
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
else if ( GetScreen()->m_CurrentItem->m_StructType == TYPETRACK ) else if ( GetScreen()->m_CurrentItem->m_StructType == TYPETRACK )
{ {
//then an element is being edited - remove the last segment. //then an element is being edited - remove the last segment.
GetScreen()->m_CurrentItem = GetScreen()->m_CurrentItem =
Delete_Segment(DC, (TRACK*)GetScreen()->m_CurrentItem); Delete_Segment(DC, (TRACK*)GetScreen()->m_CurrentItem);
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
} }
break; break;
}
case WXK_END:
DrawPanel->MouseToCursorSchema();
End_Route( (TRACK *) (GetScreen()->m_CurrentItem), DC);
break;
case (int('f') + GR_KB_CTRL) :
case (int('F') + GR_KB_CTRL) :
case 1030:{ // f = letter 6 in the alphabet + 1024 = 1030
wxCommandEvent evt;
evt.SetId(ID_FIND_ITEMS);
Process_Special_Functions(evt);
} }
break;
case WXK_END:
case 'v': // Switch to alternate layer and Place a via if a track is in progress DrawPanel->MouseToCursorSchema();
case 'V': End_Route( (TRACK *) (GetScreen()->m_CurrentItem), DC);
if ( m_ID_current_state != ID_TRACK_BUTT ) return; break;
if ( ItemFree )
{
Other_Layer_Route( NULL, DC);
break;
}
if ( GetScreen()->m_CurrentItem->m_StructType != TYPETRACK )
return;
if ( (GetScreen()->m_CurrentItem->m_Flags & IS_NEW) == 0 )
return;
Other_Layer_Route( (TRACK *) GetScreen()->m_CurrentItem, DC);
if ( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq();
break;
case 'o': case 'V': // Switch to alternate layer and Place a via if a track is in progress
case 'O': if ( m_ID_current_state != ID_TRACK_BUTT ) return;
case (int('o') + GR_KB_CTRL) : if ( ItemFree )
case (int('O') + GR_KB_CTRL) : {
case 1039: //o is the 15th letter in the alphabet + 1024 = 1039 Other_Layer_Route( NULL, DC);
if( hotkey & GR_KB_CTRL ){ break;
//try not to duplicate save, load code etc. }
wxCommandEvent evt; if ( GetScreen()->m_CurrentItem->m_StructType != TYPETRACK )
evt.SetId(ID_LOAD_FILE); return;
Files_io(evt); if ( (GetScreen()->m_CurrentItem->m_Flags & IS_NEW) == 0 )
} return;
break; Other_Layer_Route( (TRACK *) GetScreen()->m_CurrentItem, DC);
case 'r': // Rotation if ( DisplayOpt.ContrastModeDisplay )
case 'R': GetScreen()->SetRefreshReq();
if ( ItemFree ) break;
module = Locate_Prefered_Module(m_Pcb,
CURSEUR_ON_GRILLE | IGNORE_LOCKED | MATCH_LAYER );
else if (GetScreen()->m_CurrentItem->m_StructType == TYPEMODULE)
{
module = (MODULE*)GetScreen()->m_CurrentItem;
// @todo: might need to add a layer check in if() below
if( module->IsLocked() )
module = 0; // do not move it.
}
if ( module )
{
GetScreen()->m_CurrentItem = module;
module->Display_Infos(this);
Rotate_Module(DC, module, 900, TRUE);
}
break;
case 's': // move to other side // Footprint edition:
case 'S': case 'L': // toggle module "MODULE_is_LOCKED" status:
case (int('s') + GR_KB_CTRL) : // get any module, locked or not locked and toggle its locked status
case (int('S') + GR_KB_CTRL) :
case 1043: //as before, 19th letter..
if( hotkey & GR_KB_CTRL ){
//try not to duplicate save, load code etc.
wxCommandEvent evt;
evt.SetId(ID_SAVE_BOARD);
Files_io(evt);
}else{
if ( ItemFree ) if ( ItemFree )
module = Locate_Prefered_Module( m_Pcb, CURSEUR_ON_GRILLE | MATCH_LAYER );
else if (GetScreen()->m_CurrentItem->m_StructType == TYPEMODULE)
module = (MODULE*)GetScreen()->m_CurrentItem;
if( module )
{
GetScreen()->m_CurrentItem = module;
module->SetLocked( !module->IsLocked() );
module->Display_Infos(this);
}
break;
case 'G': // Start move (and drag) module
case 'M': // Start move module
if ( PopupOn ) break;
case 'R': // Rotation
case 'S': // move to other side
if ( ItemFree )
{
module = Locate_Prefered_Module(m_Pcb, module = Locate_Prefered_Module(m_Pcb,
CURSEUR_ON_GRILLE | IGNORE_LOCKED | MATCH_LAYER ); CURSEUR_ON_GRILLE | IGNORE_LOCKED | MATCH_LAYER );
if ( module == NULL ) // no footprint found
{
module = Locate_Prefered_Module(m_Pcb, CURSEUR_ON_GRILLE );
if ( module ) // a footprint is found, but locked or on an other layer
{
if ( module->IsLocked() ) DisplayInfo(this, _("Footprint found, but locked") );
else DisplayInfo(this, _("Footprint found, but not on this layer") );
module = NULL;
}
}
}
else if (GetScreen()->m_CurrentItem->m_StructType == TYPEMODULE) else if (GetScreen()->m_CurrentItem->m_StructType == TYPEMODULE)
{ {
module = (MODULE*)GetScreen()->m_CurrentItem; module = (MODULE*)GetScreen()->m_CurrentItem;
// @todo: might need to add a layer check in if() below // @todo: might need to add a layer check in if() below
if( module->IsLocked() ) if ( (GetScreen()->m_CurrentItem->m_Flags == 0) &&
module = 0; // do not move it. module->IsLocked() )
module = NULL; // do not move, rotate ... it.
} }
if ( module ) if ( module == NULL) break;
GetScreen()->m_CurrentItem = module;
switch (hotkey)
{ {
GetScreen()->m_CurrentItem = module; case 'R': // Rotation
module->Display_Infos(this); Rotate_Module(DC, module, 900, TRUE);
Change_Side_Module(module, DC); break;
}
}
break;
case 'L': // toggle module "MODULE_is_LOCKED" status:
case 'l':
// get any module, locked or not locked and toggle its locked status
module = Locate_Prefered_Module( m_Pcb, CURSEUR_ON_GRILLE | MATCH_LAYER );
if( module )
{
GetScreen()->m_CurrentItem = module;
module->SetLocked( !module->IsLocked() );
module->Display_Infos(this);
}
break;
case 'g':
case 'G': // Start move (and drag) module
g_Drag_Pistes_On = TRUE;
// fall through
case 'm': case 'S': // move to other side
case 'M': // Start move module Change_Side_Module(module, DC);
if ( PopupOn ) break; break;
module = Locate_Prefered_Module( m_Pcb,
CURSEUR_ON_GRILLE | IGNORE_LOCKED | MATCH_LAYER ); case 'G': // Start move (and drag) module
if( module ) g_Drag_Pistes_On = TRUE;
{ // fall through
GetScreen()->m_CurrentItem = module; case 'M': // Start move module
module->Display_Infos(this); StartMove_Module( module, DC);
StartMove_Module( module, DC); break;
} }
break; module->Display_Infos(this);
break;
} }
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
est le curseur sur grille ou le curseur a deplacement fin hors grille */ est le curseur sur grille ou le curseur a deplacement fin hors grille */
#define CURSEUR_ON_GRILLE (0<<0) #define CURSEUR_ON_GRILLE (0<<0)
#define CURSEUR_OFF_GRILLE (1<<0) #define CURSEUR_OFF_GRILLE (1<<0)
#define IGNORE_LOCKED (1<<1) ///< if module is locked, do not select for single module operation #define IGNORE_LOCKED (1<<1) ///< if module is locked, do not select for single module operation
#define MATCH_LAYER (1<<2) ///< if module not on current layer, do not select #define MATCH_LAYER (1<<2) ///< if module not on current layer, do not select
#define VISIBLE_ONLY (1<<3) ///< if module not on a visible layer, do not select #define VISIBLE_ONLY (1<<3) ///< if module not on a visible layer, do not select
......
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
/* Data to build the layer pair indicator button */ /* Data to build the layer pair indicator button */
static wxBitmap * LayerPairBitmap = NULL; static wxBitmap * LayerPairBitmap = NULL;
static char s_BitmapLayerIcon[16][16] = { static char s_BitmapLayerIcon[16][16] = {
// 0 = draw pixel with active layer color
// 1 = draw pixel with top layer color (top/bottom layer used in autoroute and place via)
// 2 = draw pixel with bottom layer color
// 3 = draw pixel with via color
{0,0,0,0,0,0,0,3,3,3,1,1,1,1,0,0}, {0,0,0,0,0,0,0,3,3,3,1,1,1,1,0,0},
{0,0,0,0,0,0,3,3,3,3,3,1,1,0,0,0}, {0,0,0,0,0,0,3,3,3,3,3,1,1,0,0,0},
{0,0,0,0,0,3,3,0,1,1,3,3,0,0,0,0}, {0,0,0,0,0,3,3,0,1,1,3,3,0,0,0,0},
...@@ -116,7 +120,7 @@ bool change = false; ...@@ -116,7 +120,7 @@ bool change = false;
LayerPairBitmap = new wxBitmap(16, 16); LayerPairBitmap = new wxBitmap(16, 16);
} }
/* Draw the icon, witj colors according to the active layer and layer pairs for /* Draw the icon, with colors according to the active layer and layer pairs for
via command (change layer) */ via command (change layer) */
wxMemoryDC iconDC; wxMemoryDC iconDC;
iconDC.SelectObject( *LayerPairBitmap ); iconDC.SelectObject( *LayerPairBitmap );
......
Since the 2007-05-25 version, Kicad (which used unicode strings) can run under W98, Since the 2007-05-25 version, Kicad (which uses unicode strings) can run under W98,
if the library unicows.dll is found by kicad. if the library unicows.dll is found by kicad.
If you want to use kicad you must download unicows.dll, If you want to use kicad you must download unicows.dll,
......
release version:
25 jun 2007
files (.zip,.tgz):
kicad-2007-06-25
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