Commit d6072d8a authored by CHARRAS's avatar CHARRAS
Browse files

Programmable hotkeys added in gerbview. Fixed a compilation probleme in ansi...

Programmable hotkeys added in gerbview. Fixed a compilation probleme in ansi mode (non unicode mode).
parent 67f15fe0
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -5,6 +5,12 @@ Please add newer entries at the top, list the date and your name with
email address.
email address.




2007-sept-10 UPDATE   Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ gerbview
    Programmable hotkeys added. Fixed a compilation probleme in ansi mode (non unicode mode).


2007-Sep-8 UPDATE   Dick Hollenbeck <dick@softplc.com>
2007-Sep-8 UPDATE   Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+ pcbnew
+ pcbnew
@@ -13,7 +19,6 @@ email address.
    used like simple expressions.
    used like simple expressions.
    All changes not yet committed.
    All changes not yet committed.
    
    

2007-sept-6 UPDATE   Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2007-sept-6 UPDATE   Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+ eeschema & pcbnew
+ eeschema & pcbnew
+2 −1
Original line number Original line Diff line number Diff line
@@ -427,7 +427,8 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
            fprintf( cfgfile, DescList->m_Comment );
            fprintf( cfgfile, DescList->m_Comment );
            fprintf( cfgfile, "\n" );
            fprintf( cfgfile, "\n" );
        }
        }
        fprintf( cfgfile, CONV_TO_UTF8( *DescList->m_SectionTag ) );
		msg = *DescList->m_SectionTag;
        fprintf( cfgfile, CONV_TO_UTF8( msg ) );
        fprintf( cfgfile, "\n" );
        fprintf( cfgfile, "\n" );
        List = DescList->m_HK_InfoList;
        List = DescList->m_HK_InfoList;
        for( ; *List != NULL; List++ )
        for( ; *List != NULL; List++ )
+4 −2
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@
/* Variables locales */
/* Variables locales */




#define HOTKEY_FILENAME wxT("eeschema")

/*********************************************************************/
/*********************************************************************/
void WinEDA_SchematicFrame::Process_Config(wxCommandEvent& event)
void WinEDA_SchematicFrame::Process_Config(wxCommandEvent& event)
/*********************************************************************/
/*********************************************************************/
@@ -76,7 +78,7 @@ wxString FullFileName;


		case ID_PREFERENCES_CREATE_CONFIG_HOTKEYS:
		case ID_PREFERENCES_CREATE_CONFIG_HOTKEYS:
			FullFileName = DEFAULT_HOTKEY_FILENAME_PATH;
			FullFileName = DEFAULT_HOTKEY_FILENAME_PATH;
			FullFileName += wxT("eeschema");
			FullFileName += HOTKEY_FILENAME;
			FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
			FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
			WriteHotkeyConfigFile(FullFileName, s_Eeschema_Hokeys_Descr, true);
			WriteHotkeyConfigFile(FullFileName, s_Eeschema_Hokeys_Descr, true);
			break;
			break;
@@ -99,7 +101,7 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose )
*/
*/
{
{
	wxString FullFileName = DEFAULT_HOTKEY_FILENAME_PATH;
	wxString FullFileName = DEFAULT_HOTKEY_FILENAME_PATH;
	FullFileName += wxT("eeschema");
	FullFileName += HOTKEY_FILENAME;
	FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
	FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
	frame->ReadHotkeyConfigFile(FullFileName, s_Eeschema_Hokeys_Descr, verbose);
	frame->ReadHotkeyConfigFile(FullFileName, s_Eeschema_Hokeys_Descr, verbose);


+22 −18
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@


/* local variables */
/* local variables */
/* Hotkey list: */
/* Hotkey list: */

// Common commands
// Common commands
static Ki_HotkeyInfo    HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 );
static Ki_HotkeyInfo    HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 );
static Ki_HotkeyInfo    HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 );
static Ki_HotkeyInfo    HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 );
@@ -97,25 +98,28 @@ Ki_HotkeyInfo* s_LibEdit_Hotkey_List[] =
};
};


// list of sections and corresponding hotkey list for eeschema (used to create an hotkey config file)
// list of sections and corresponding hotkey list for eeschema (used to create an hotkey config file)
struct Ki_HotkeyInfoSectionDescriptor s_Eeschema_Hokeys_Descr[] = {
struct Ki_HotkeyInfoSectionDescriptor s_Eeschema_Hokeys_Descr[] =
{
    { &g_CommonSectionTag,    s_Common_Hotkey_List,    "Common keys"           },
    { &g_CommonSectionTag,    s_Common_Hotkey_List,    "Common keys"           },
    { &g_SchematicSectionTag, s_Schematic_Hotkey_List, "Schematic editor keys" },
    { &g_SchematicSectionTag, s_Schematic_Hotkey_List, "Schematic editor keys" },
    { &g_LibEditSectionTag,   s_LibEdit_Hotkey_List,   "library editor keys"   },
    { &g_LibEditSectionTag,   s_LibEdit_Hotkey_List,   "library editor keys"   },
	NULL, NULL
    { NULL,                   NULL }
};
};


// list of sections and corresponding hotkey list for the schematic editor (used to list current hotkeys)
// list of sections and corresponding hotkey list for the schematic editor (used to list current hotkeys)
struct Ki_HotkeyInfoSectionDescriptor s_Schematic_Hokeys_Descr[] = {
struct Ki_HotkeyInfoSectionDescriptor s_Schematic_Hokeys_Descr[] =
{
    { &g_CommonSectionTag,    s_Common_Hotkey_List,    NULL },
    { &g_CommonSectionTag,    s_Common_Hotkey_List,    NULL },
    { &g_SchematicSectionTag, s_Schematic_Hotkey_List, NULL },
    { &g_SchematicSectionTag, s_Schematic_Hotkey_List, NULL },
	NULL, NULL
    { NULL,                   NULL,                    NULL }
};
};


// list of sections and corresponding hotkey list for the component editor (used to list current hotkeys)
// list of sections and corresponding hotkey list for the component editor (used to list current hotkeys)
struct Ki_HotkeyInfoSectionDescriptor s_Libedit_Hokeys_Descr[] = {
struct Ki_HotkeyInfoSectionDescriptor s_Libedit_Hokeys_Descr[] =
{
    { &g_CommonSectionTag,  s_Common_Hotkey_List,  NULL },
    { &g_CommonSectionTag,  s_Common_Hotkey_List,  NULL },
    { &g_LibEditSectionTag, s_LibEdit_Hotkey_List, NULL },
    { &g_LibEditSectionTag, s_LibEdit_Hotkey_List, NULL },
	NULL, NULL
    { NULL,                 NULL,                  NULL }
};
};


/***********************************************************/
/***********************************************************/
+12 −41
Original line number Original line Diff line number Diff line
@@ -67,37 +67,6 @@ int hotkey = 0;


	switch(g_KeyPressed)
	switch(g_KeyPressed)
		{
		{
		case WXK_NUMPAD_SUBTRACT :
		case WXK_SUBTRACT :
		case '-' :
			if(GetScreen()->m_Active_Layer > 0)
				GetScreen()->m_Active_Layer--;
			break ;

		case WXK_NUMPAD_ADD :
		case WXK_ADD :
		case '+' :
			if(GetScreen()->m_Active_Layer < 31)
				GetScreen()->m_Active_Layer ++;
			break ;

		case 'F' | GR_KB_CTRL :
		case 'f' | GR_KB_CTRL :
			DisplayOpt.DisplayPcbTrackFill ^= 1; DisplayOpt.DisplayPcbTrackFill &= 1 ;
			GetScreen()->SetRefreshReq();
			break ;

		case ' ' : /* Mise a jour de l'origine des coord relatives */
			GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
			break ;


		case 'U' | GR_KB_CTRL :
		case 'u' | GR_KB_CTRL :
			if (g_UnitMetric == INCHES ) g_UnitMetric = MILLIMETRE ;
			else 	g_UnitMetric = INCHES ;
			break ;

		case EDA_PANNING_UP_KEY :
		case EDA_PANNING_UP_KEY :
			OnZoom(ID_ZOOM_PANNING_UP);
			OnZoom(ID_ZOOM_PANNING_UP);
			curpos = m_CurrentScreen->m_Curseur;
			curpos = m_CurrentScreen->m_Curseur;
@@ -118,21 +87,17 @@ int hotkey = 0;
			curpos = m_CurrentScreen->m_Curseur;
			curpos = m_CurrentScreen->m_Curseur;
			break;
			break;


		case WXK_F1 :
		case EDA_ZOOM_IN_FROM_MOUSE :
			OnZoom(ID_ZOOM_PLUS_KEY);
			OnZoom(ID_ZOOM_PLUS_KEY);
			curpos = GetScreen()->m_Curseur;
			curpos = GetScreen()->m_Curseur;
			break;
			break;


		case WXK_F2 :
		case EDA_ZOOM_OUT_FROM_MOUSE :
			OnZoom(ID_ZOOM_MOINS_KEY);
			OnZoom(ID_ZOOM_MOINS_KEY);
			curpos = GetScreen()->m_Curseur;
			curpos = GetScreen()->m_Curseur;
			break;
			break;


		case WXK_F3 :
		case EDA_ZOOM_CENTER_FROM_MOUSE :
			OnZoom(ID_ZOOM_REDRAW_KEY);
			break;

		case WXK_F4 :
			OnZoom(ID_ZOOM_CENTER_KEY);
			OnZoom(ID_ZOOM_CENTER_KEY);
			curpos = GetScreen()->m_Curseur;
			curpos = GetScreen()->m_Curseur;
			break;
			break;
@@ -186,13 +151,19 @@ int hotkey = 0;
		}
		}
	}
	}


	SetToolbars();
	Affiche_Status_Box();	 /* Affichage des coord curseur */

	if ( hotkey )
	if ( hotkey )
	{
	{
		OnHotKey(DC, hotkey, NULL);
		OnHotKey(DC, hotkey, NULL);
	}
	}

    if( GetScreen()->IsRefreshReq() )
    {
        RedrawActiveWindow( DC, TRUE );
    }

	SetToolbars();
	Affiche_Status_Box();	 /* Affichage des coord curseur */

}
}


Loading