← Back to team overview

kicad-developers team mailing list archive

Re: pcbnew hotkeys.cpp improvment

 

As I drive down the road and someone honks at me, I am fond of saying,

"I don't speak beep." It's true, ask my wife. Meaning: "Beep" is not a language that I understand.


I would think a better investment in time would be to embellish the help system:

A) to allow for context sensitive invocation
B) searching by keyword
C) indexes

I think all of these are capabilities in the wxWidgets help viewer that we are not using.

To get there I think we need to stick with OpenOffice all the way, but go to a newer OpenOffice file format from which we can automatically parse the embedded XML which is hidden inside the zip file wrapper which constitutes the OpenOffice file formats. I was thinking we would write a CMake or python script (soon everyone will have python on their systems) to tear apart the OO source file, then do any XSLT transformations on it to get to a format that wxWidget's help file viewer likes. At that point we can then go hog wild on using OpenOffice to embellish the help files up to the point where a new user would be able to find out the mysteries of toolbar selection in a way easier than what you experienced.


Dick




mkajdas wrote:
In my opinion 'hot keys' should always work as expected or give some
kind of error if they do not.
I 'fixed' pcbnew/hotkeys.cpp to my liking but I would like to hear
other opinions. Maybe I went a little overboard?

The only problems that I can see is that wxBell does not sound on many
Linux distributions (including mine, Fedora 8) which is a common
problem mentioned on the web. It is suppose to work OK on Windows.
Do we have any other way of producing simple sounds?
The other problem is that the messages are displayed on status line
until another message overwrites them. It may take a while.
Any suggestions on how to clear them after a few seconds?

If acceptable, I can fix other hotkeys files in other programs.
Martin

--- tmp/hotkeys-HEAD.4.cpp	2008-05-19 21:52:26.000000000 -0700
+++ svn/kicad/pcbnew/hotkeys.cpp 2008-05-19 21:36:49.000000000 -0700
@@ -17 +17 @@
- * add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION.
+ * add a new id in the enum hotkey_id_command like MY_NEW_ID_FUNCTION.
@@ -25 +25 @@
- * when the variable PopupOn is true, an item is currently edited.
+ * When the variable ItemFree is false, an item is currently edited.
@@ -175,3 +175 @@
- bool PopupOn = (GetCurItem() && GetCurItem()->m_Flags);
-
- bool ItemFree = (GetCurItem()==0 || GetCurItem()->m_Flags==0);
+ bool ItemFree = (GetCurItem() == NULL || GetCurItem()->m_Flags == 0);
@@ -206 +203,0 @@
- return;
@@ -211,0 +209,3 @@
+ {
+ Affiche_Message( _( "Requested layer is out of range" ) );
+ wxBell();
@@ -212,0 +213 @@
+ }
@@ -224,0 +226,3 @@
+ {
+ Affiche_Message( _( "Requested layer is out of range" ) );
+ wxBell();
@@ -225,0 +230 @@
+ }
@@ -322,0 +328,6 @@
+ GetScreen()->SetModify();
+ }
+ else
+ {
+ Affiche_Message( _( "Cannot delete modules" ) );
+ wxBell();
@@ -324 +334,0 @@
- GetScreen()->SetModify();
@@ -334,0 +345,10 @@
+ else
+ {
+ Affiche_Message( _( "Nothing to delete" ) );
+ wxBell();
+ }
+ }
+ else
+ {
+ Affiche_Message( _( "Backspace key is only active during
track edit mode" ) );
+ wxBell();
@@ -344,0 +365,5 @@
+ else
+ {
+ Affiche_Message( _( "No new track in progress" ) );
+ wxBell();
+ }
@@ -353,0 +379,5 @@
+ else
+ {
+ Affiche_Message( _( "Not allowed now" ) );
+ wxBell();
+ }
@@ -362,0 +393,5 @@
+ else
+ {
+ Affiche_Message( _( "Not allowed now" ) );
+ wxBell();
+ }
@@ -372,0 +408,5 @@
+ else
+ {
+ Affiche_Message( _( "Not allowed now" ) );
+ wxBell();
+ }
@@ -382,0 +423,5 @@
+ else
+ {
+ Affiche_Message( _( "Not allowed now" ) );
+ wxBell();
+ }
@@ -385,10 +430,9 @@
- case HK_ADD_MICROVIA: // Place a micro via if a track is in
progress
- if( m_ID_current_state != ID_TRACK_BUTT )
- return;
- if( ItemFree )	// no track in progress: nothing to do
- break;
- if( GetCurItem()->Type() != TYPETRACK )	// Should not occur
- return;
- if( (GetCurItem()->m_Flags & IS_NEW) == 0 )
- return;
-
+ case HK_ADD_MICROVIA: // Place a micro via if a track is in
progress
+ if( m_ID_current_state != ID_TRACK_BUTT
+ || ItemFree // no track in
progress: nothing to do
+ || GetCurItem()->Type() != TYPETRACK // Should not occur
+ || (GetCurItem()->m_Flags & IS_NEW) == 0 )
+ {
+ Affiche_Message( _( "No new track in progress" ) );
+ wxBell();
+ }
@@ -396 +440 @@
- if ( GetScreen()->IsMicroViaAcceptable() )
+ else if ( GetScreen()->IsMicroViaAcceptable() )
@@ -404,0 +449,5 @@
+ else
+ {
+ Affiche_Message( _( "Microvia is not allowed" ) );
+ wxBell();
+ }
@@ -409 +458,5 @@
- return;
+ {
+ Affiche_Message( _( "No new track in progress" ) );
+ wxBell();
+ break;
+ }
@@ -416 +469,5 @@
- return;
+ {
+ Affiche_Message( _( "No new track in progress" ) );
+ wxBell();
+ break;
+ }
@@ -418 +475,5 @@
- return;
+ {
+ Affiche_Message( _( "No new track in progress" ) );
+ wxBell();
+ break;
+ }
@@ -436,0 +498,5 @@
+ else
+ {
+ Affiche_Message( _( "Not a module" ) );
+ wxBell();
+ }
@@ -441 +507 @@
- if( PopupOn )
+ if( ! ItemFree )
@@ -483,0 +550,3 @@
+ {
+ Affiche_Message( _( "Not a module" ) );
+ wxBell();
@@ -484,0 +554 @@
+ }
@@ -550 +619,0 @@
- return;
@@ -598,2 +667 @@
- bool ItemFree = (GetCurItem() == NULL )
- || (GetCurItem()->m_Flags == 0);
+ bool ItemFree = (GetCurItem() == NULL || GetCurItem()->m_Flags == 0);
@@ -604,0 +673,3 @@
+ {
+ Affiche_Message( _( "Active layer is out of range" ) );
+ wxBell();
@@ -605,0 +677 @@
+ }
@@ -609,0 +682,3 @@
+ {
+ Affiche_Message( _( "Cannot delete modules" ) );
+ wxBell();
@@ -610,0 +686 @@
+ }
@@ -628,0 +705,3 @@
+ {
+ Affiche_Message( _( "No module found" ) );
+ wxBell();
@@ -629,0 +709 @@
+ }
@@ -632,0 +713 @@
+ break;
@@ -634,3 +715 @@
- else
- return FALSE;
- break;
+ // else fall into default case
@@ -638,0 +718,2 @@
+ Affiche_Message( _( "Not allowed now" ) );
+ wxBell();



------------------------------------

Yahoo! Groups Links







--
Best Regards,

Dick


I pray we can elect a U.S. President that has the common sense to enforce our
existing immigration laws and stop the invasion from Mexico.







References