Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
8dd82dfb
Commit
8dd82dfb
authored
Feb 16, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup and enhancements about hotkeys
parent
1ee86d4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
hotkeys_basic.cpp
common/hotkeys_basic.cpp
+13
-13
hotkeys_basic.h
include/hotkeys_basic.h
+18
-3
No files found.
common/hotkeys_basic.cpp
View file @
8dd82dfb
...
@@ -353,22 +353,22 @@ static int ReturnKeyCodeFromKeyName( const wxString& keyname )
...
@@ -353,22 +353,22 @@ static int ReturnKeyCodeFromKeyName( const wxString& keyname )
/** function DisplayHotkeyList
/** function DisplayHotkeyList
* Displays the current hotkey list
* Displays the current hotkey list
* @param
f
rame = current active frame
* @param
aF
rame = current active frame
* @param List = pointer to a Ki_HotkeyInfoSectionDescriptor list
* @param
a
List = pointer to a Ki_HotkeyInfoSectionDescriptor list
*(Null terminated)
*(Null terminated)
* @return none
* @return none
*/
*/
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
f
rame
,
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
aF
rame
,
struct
Ki_HotkeyInfoSectionDescriptor
*
DescList
)
struct
Ki_HotkeyInfoSectionDescriptor
*
a
DescList
)
{
{
wxString
keyname
;
wxString
keyname
;
Ki_HotkeyInfo
**
List
;
Ki_HotkeyInfo
**
List
;
wxString
msg
=
_
(
"Current hotkey list:
\n\n
"
);
wxString
msg
=
_
(
"Current hotkey list:
\n\n
"
);
for
(
;
DescList
->
m_HK_InfoList
!=
NULL
;
DescList
++
)
for
(
;
aDescList
->
m_HK_InfoList
!=
NULL
;
a
DescList
++
)
{
{
List
=
DescList
->
m_HK_InfoList
;
List
=
a
DescList
->
m_HK_InfoList
;
for
(
;
*
List
!=
NULL
;
List
++
)
for
(
;
*
List
!=
NULL
;
List
++
)
{
{
Ki_HotkeyInfo
*
hk_decr
=
*
List
;
Ki_HotkeyInfo
*
hk_decr
=
*
List
;
...
@@ -378,22 +378,22 @@ void DisplayHotkeyList( WinEDA_DrawFrame* frame,
...
@@ -378,22 +378,22 @@ void DisplayHotkeyList( WinEDA_DrawFrame* frame,
}
}
}
}
DisplayInfoMessage
(
f
rame
,
msg
);
DisplayInfoMessage
(
aF
rame
,
msg
);
}
}
/** function GetDescriptorFromHotkey
/** function GetDescriptorFromHotkey
* Return a Ki_HotkeyInfo * pointer fron a key code for OnHotKey() function
* Return a Ki_HotkeyInfo * pointer fron a key code for OnHotKey() function
* @param
k
ey = key code (ascii value, or wxWidgets value for function keys
* @param
aK
ey = key code (ascii value, or wxWidgets value for function keys
* @param List = pointer to a Ki_HotkeyInfo list of commands
* @param
a
List = pointer to a Ki_HotkeyInfo list of commands
* @return the corresponding Ki_HotkeyInfo pointer from the Ki_HotkeyInfo List
* @return the corresponding Ki_HotkeyInfo pointer from the Ki_HotkeyInfo List
*/
*/
Ki_HotkeyInfo
*
GetDescriptorFromHotkey
(
int
key
,
Ki_HotkeyInfo
**
List
)
Ki_HotkeyInfo
*
GetDescriptorFromHotkey
(
int
aKey
,
Ki_HotkeyInfo
**
a
List
)
{
{
for
(
;
*
List
!=
NULL
;
List
++
)
for
(
;
*
aList
!=
NULL
;
a
List
++
)
{
{
Ki_HotkeyInfo
*
hk_decr
=
*
List
;
Ki_HotkeyInfo
*
hk_decr
=
*
a
List
;
if
(
hk_decr
->
m_KeyCode
==
k
ey
)
if
(
hk_decr
->
m_KeyCode
==
aK
ey
)
return
hk_decr
;
return
hk_decr
;
}
}
...
...
include/hotkeys_basic.h
View file @
8dd82dfb
...
@@ -109,12 +109,27 @@ wxString AddHotkeyName( const wxString& aText,
...
@@ -109,12 +109,27 @@ wxString AddHotkeyName( const wxString& aText,
int
aCommandId
,
int
aCommandId
,
bool
aIsShortCut
=
true
);
bool
aIsShortCut
=
true
);
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
frame
,
/** function DisplayHotkeyList
struct
Ki_HotkeyInfoSectionDescriptor
*
List
);
* Displays the current hotkey list
Ki_HotkeyInfo
*
GetDescriptorFromHotkey
(
int
key
,
Ki_HotkeyInfo
**
List
);
* @param aFrame = current active frame
* @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor list
*(Null terminated)
* @return none
*/
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
aFrame
,
struct
Ki_HotkeyInfoSectionDescriptor
*
aList
);
/** function GetDescriptorFromHotkey
* Return a Ki_HotkeyInfo * pointer fron a key code for OnHotKey() function
* @param aKey = key code (ascii value, or wxWidgets value for function keys
* @param aList = pointer to a Ki_HotkeyInfo list of commands
* @return the corresponding Ki_HotkeyInfo pointer from the Ki_HotkeyInfo List
*/
Ki_HotkeyInfo
*
GetDescriptorFromHotkey
(
int
aKey
,
Ki_HotkeyInfo
**
aList
);
// common hotkeys event id
// common hotkeys event id
// these hotkey ID are used in many files, so they are define here only once.
enum
common_hotkey_id_commnand
{
enum
common_hotkey_id_commnand
{
HK_NOT_FOUND
=
0
,
HK_NOT_FOUND
=
0
,
HK_RESET_LOCAL_COORD
,
HK_RESET_LOCAL_COORD
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment