Ejemplo n.º 1
0
void DisplayHotkeyList( EDA_BASE_FRAME* aFrame, struct EDA_HOTKEY_CONFIG* aDescList )
{
    wxString     keyname;
    wxString     keymessage;
    EDA_HOTKEY** list;

    wxString     msg = wxT( "<html><body bgcolor=\"#E2E2E2\">" );

    msg += wxT( "<H3>" );
    msg += _( "Hotkeys List" );
    msg += wxT( "</H3> <table cellpadding=\"0\">" );

    for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
    {
        list = aDescList->m_HK_InfoList;

        for( ; *list != NULL; list++ )
        {
            EDA_HOTKEY* hk_decr = *list;

            if( !hk_decr->m_InfoMsg.Contains( wxT( "Macros" ) ) )
            {
                keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
                keymessage = wxGetTranslation( hk_decr->m_InfoMsg );

                // Some chars are modified, using html encoding, to be
                // displayed by DisplayHtmlInfoMessage()
                keyname.Replace( wxT( "<" ), wxT( "&lt;" ) );
                keyname.Replace( wxT( ">" ), wxT( "&gt;" ) );
                msg    += wxT( "<tr><td>" ) + keymessage + wxT( "</td>" );
                msg    += wxT( "<td><b>&nbsp;&nbsp;" ) + keyname + wxT( "</b></td></tr>" );
            }
        }
    }

    msg += wxT( "</table></html></body>" );

#if 0   // Set to 1 to create a modal dialog (blocking)
    DisplayHtmlInfoMessage( aFrame, _( "Hotkeys List" ), msg, wxSize( 340, 750 ) );
#else
    // Create a non modal dialog, which shows the list of hotkeys until dismissed
    // but does not block the parent window
    HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX( aFrame, _( "Hotkeys List" ),
                                        wxDefaultPosition, wxSize( 340, 750 ) );
    dlg->AddHTML_Text( msg );
    dlg->Show( true );
#endif
}
Ejemplo n.º 2
0
/* DisplayHotkeyList
 * Displays the current hotkey list
 * aList = a EDA_HOTKEY_CONFIG list(Null terminated)
 */
void DisplayHotkeyList( EDA_DRAW_FRAME* aFrame, struct EDA_HOTKEY_CONFIG* aDescList )
{
    wxString     keyname;
    EDA_HOTKEY** list;

    wxString     msg = wxT( "<html><body bgcolor=\"#E2E2E2\">" );

    msg += wxT( "<H3>");
    msg += _("Hotkeys List");
    msg += wxT("</H3> <table cellpadding=\"0\">");

    for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
    {
        list = aDescList->m_HK_InfoList;

        for( ; *list != NULL; list++ )
        {
            EDA_HOTKEY* hk_decr = *list;

            if( !hk_decr->m_InfoMsg.Contains( wxT( "Macros" ) ) )
            {
                keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );

                // Some chars should be modified, using html encoding, to be
                // displayed by DisplayHtmlInfoMessage()
                keyname.Replace( wxT("<"), wxT("&lt;") );
                keyname.Replace( wxT(">"), wxT("&gt;") );
                msg    += wxT( "<tr><td>" ) + hk_decr->m_InfoMsg + wxT("</td>");
                msg    += wxT("<td><b>&nbsp;&nbsp;") + keyname + wxT( "</b></td></tr>" );
            }
        }
    }

    msg += wxT("</table></html></body>");
    DisplayHtmlInfoMessage( aFrame, _("Hotkeys List"), msg, wxSize(340, 750));
}