当前位置: 首页>>代码示例>>C++>>正文


C++ SetAcceleratorTable函数代码示例

本文整理汇总了C++中SetAcceleratorTable函数的典型用法代码示例。如果您正苦于以下问题:C++ SetAcceleratorTable函数的具体用法?C++ SetAcceleratorTable怎么用?C++ SetAcceleratorTable使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetAcceleratorTable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetMenuCount

void wxMenuBar::RebuildAccelTable()
{
    // merge the accelerators of all menus into one accel table
    size_t nAccelCount = 0;
    size_t i, count = GetMenuCount();
    wxMenuList::iterator it;
    for ( i = 0, it = m_menus.begin(); i < count; i++, it++ )
    {
        nAccelCount += (*it)->GetAccelCount();
    }

    if ( nAccelCount )
    {
        wxAcceleratorEntry *accelEntries = new wxAcceleratorEntry[nAccelCount];

        nAccelCount = 0;
        for ( i = 0, it = m_menus.begin(); i < count; i++, it++ )
        {
            nAccelCount += (*it)->CopyAccels(&accelEntries[nAccelCount]);
        }

        SetAcceleratorTable(wxAcceleratorTable(nAccelCount, accelEntries));

        delete [] accelEntries;
    }
    else // No (more) accelerators.
    {
        SetAcceleratorTable(wxAcceleratorTable());
    }
}
开发者ID:djbarry004,项目名称:Ishiiruka,代码行数:30,代码来源:menu.cpp

示例2: wxFrame

FileViewer::FileViewer(wxWindow *parent,
                       const wxString& basePath,
                       const wxArrayString& references,
                       int startAt)
        : wxFrame(parent, -1, _("Source file")),
          m_references(references)
{
    m_basePath = basePath;

    SetName("fileviewer");

    wxPanel *panel = new wxPanel(this, -1);
    wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
    panel->SetSizer(sizer);

    wxSizer *barsizer = new wxBoxSizer(wxHORIZONTAL);
    sizer->Add(barsizer, wxSizerFlags().Expand().Border());

    barsizer->Add(new wxStaticText(panel, wxID_ANY,
                                   _("Source file occurrence:")),
                  wxSizerFlags().Center().Border(wxRIGHT));

    wxChoice *choice = new wxChoice(panel, wxID_ANY);
    barsizer->Add(choice, wxSizerFlags(1).Center());

    for (size_t i = 0; i < references.Count(); i++)
        choice->Append(references[i]);
    choice->SetSelection(startAt);

    wxButton *edit = new wxButton(panel, wxID_ANY, _("Open In Editor"));
    barsizer->Add(edit, wxSizerFlags().Center().Border(wxLEFT, 10));

    m_text = new wxStyledTextCtrl(panel, wxID_ANY,
                                  wxDefaultPosition, wxDefaultSize,
                                  wxBORDER_THEME);
    SetupTextCtrl();
    sizer->Add(m_text, 1, wxEXPAND);

    RestoreWindowState(this, wxSize(600, 400));

    wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
    topsizer->Add(panel, wxSizerFlags(1).Expand());
    SetSizer(topsizer);
    Layout();

    choice->Bind(wxEVT_CHOICE, &FileViewer::OnChoice, this);
    edit->Bind(wxEVT_BUTTON, &FileViewer::OnEditFile, this);

    ShowReference(m_references[startAt]);

#ifdef __WXOSX__
    wxAcceleratorEntry entries[] = {
        { wxACCEL_CMD,  'W', wxID_CLOSE }
    };
    wxAcceleratorTable accel(WXSIZEOF(entries), entries);
    SetAcceleratorTable(accel);

    Bind(wxEVT_MENU, [=](wxCommandEvent&){ Destroy(); }, wxID_CLOSE);
#endif
}
开发者ID:mfloryan,项目名称:poedit,代码行数:60,代码来源:fileviewer.cpp

示例3: wxFrame

SjVisFrame::SjVisFrame( wxWindow* parent, wxWindowID id, const wxString& title,
                        const wxPoint& pos, const wxSize& size,
                        long style)
	: wxFrame(parent, id, title, pos, size, style)
{
	SetAcceleratorTable(g_accelModule->GetAccelTable(SJA_MAIN));
}
开发者ID:conradstorz,项目名称:silverjuke,代码行数:7,代码来源:vis_window.cpp

示例4: wxMDIParentFrame

// Define my frame constructor
MyFrame::MyFrame(wxWindow *parent,
                 const wxWindowID id,
                 const wxString& title,
                 const wxPoint& pos,
                 const wxSize& size,
                 const long style)
       : wxMDIParentFrame(parent, id, title, pos, size,
                          style | wxNO_FULL_REPAINT_ON_RESIZE)
{
    textWindow = new wxTextCtrl(this, wxID_ANY, _T("A help window"),
                                wxDefaultPosition, wxDefaultSize,
                                wxTE_MULTILINE | wxSUNKEN_BORDER);

#if wxUSE_TOOLBAR
    CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL);
    InitToolBar(GetToolBar());
#endif // wxUSE_TOOLBAR

    // Accelerators
    wxAcceleratorEntry entries[3];
    entries[0].Set(wxACCEL_CTRL, (int) 'N', MDI_NEW_WINDOW);
    entries[1].Set(wxACCEL_CTRL, (int) 'X', MDI_QUIT);
    entries[2].Set(wxACCEL_CTRL, (int) 'A', MDI_ABOUT);
    wxAcceleratorTable accel(3, entries);
    SetAcceleratorTable(accel);
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:27,代码来源:mdi.cpp

示例5: accel

void FeedPanel::CreateAccelerators()
{
	wxAcceleratorEntry entries[1];
	entries[0].Set(wxACCEL_CTRL, (int)'C', ID_COPYTEXT);
	wxAcceleratorTable accel(1, entries);
	SetAcceleratorTable(accel);
}
开发者ID:lsegal,项目名称:Twittle,代码行数:7,代码来源:feed_panel.cpp

示例6: SetOwnBackgroundColour

bool wxFrame::Create(wxWindow *parent,
                     wxWindowID id,
                     const wxString& title,
                     const wxPoint& pos,
                     const wxSize& size,
                     long style,
                     const wxString& name)
{
    if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
        return false;

    SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));

#if defined(__SMARTPHONE__)
    SetLeftMenu(wxID_EXIT, _("Done"));
#endif

#if wxUSE_ACCEL && defined(__POCKETPC__)
    // The guidelines state that Ctrl+Q should quit the app.
    // Let's define an accelerator table to send wxID_EXIT.
    wxAcceleratorEntry entries[1];
    entries[0].Set(wxACCEL_CTRL,   'Q',         wxID_EXIT);
    wxAcceleratorTable accel(1, entries);
    SetAcceleratorTable(accel);
#endif // wxUSE_ACCEL && __POCKETPC__

    return true;
}
开发者ID:mark711,项目名称:Cafu,代码行数:28,代码来源:frame.cpp

示例7: SetAcceleratorTable

// -------------------------------------------------------------------------------- //
void guAlListBox::CreateAcceleratorTable( void )
{
    wxAcceleratorTable AccelTable;
    wxArrayInt AliasAccelCmds;
    wxArrayInt RealAccelCmds;

    AliasAccelCmds.Add( ID_PLAYER_PLAYLIST_SAVE );
    AliasAccelCmds.Add( ID_PLAYER_PLAYLIST_EDITLABELS );
    AliasAccelCmds.Add( ID_PLAYER_PLAYLIST_EDITTRACKS );
    AliasAccelCmds.Add( ID_TRACKS_PLAY );
    AliasAccelCmds.Add( ID_TRACKS_ENQUEUE_AFTER_ALL );
    AliasAccelCmds.Add( ID_TRACKS_ENQUEUE_AFTER_TRACK );
    AliasAccelCmds.Add( ID_TRACKS_ENQUEUE_AFTER_ALBUM );
    AliasAccelCmds.Add( ID_TRACKS_ENQUEUE_AFTER_ARTIST );
    AliasAccelCmds.Add( ID_PLAYER_PLAYLIST_SEARCH );

    RealAccelCmds.Add( ID_ALBUM_SAVETOPLAYLIST );
    RealAccelCmds.Add( ID_ALBUM_EDITLABELS );
    RealAccelCmds.Add( ID_ALBUM_EDITTRACKS );
    RealAccelCmds.Add( ID_ALBUM_PLAY );
    RealAccelCmds.Add( ID_ALBUM_ENQUEUE_AFTER_ALL );
    RealAccelCmds.Add( ID_ALBUM_ENQUEUE_AFTER_TRACK );
    RealAccelCmds.Add( ID_ALBUM_ENQUEUE_AFTER_ALBUM );
    RealAccelCmds.Add( ID_ALBUM_ENQUEUE_AFTER_ARTIST );
    RealAccelCmds.Add( ID_LIBRARY_SEARCH );

    if( guAccelDoAcceleratorTable( AliasAccelCmds, RealAccelCmds, AccelTable ) )
    {
        SetAcceleratorTable( AccelTable );
    }
}
开发者ID:anonbeat,项目名称:guayadeque,代码行数:32,代码来源:AlListBox.cpp

示例8: table

bool wxFrame::ShowFullScreen(bool show, long style)
{
    if (!wxFrameBase::ShowFullScreen(show, style))
        return false;

#if wxUSE_MENUS && wxUSE_ACCEL
    if (show && GetMenuBar())
    {
        wxAcceleratorTable table(wxCreateAcceleratorTableForMenuBar(GetMenuBar()));
        if (table.IsOk())
            SetAcceleratorTable(table);
    }
#endif // wxUSE_MENUS && wxUSE_ACCEL

    wxWindow* const bar[] = {
#if wxUSE_MENUS
        m_frameMenuBar,
#else
        NULL,
#endif
#if wxUSE_TOOLBAR
        m_frameToolBar,
#else
        NULL,
#endif
#if wxUSE_STATUSBAR
        m_frameStatusBar,
#else
        NULL,
#endif
    };
    const long fsNoBar[] = {
        wxFULLSCREEN_NOMENUBAR, wxFULLSCREEN_NOTOOLBAR, wxFULLSCREEN_NOSTATUSBAR
    };
    for (int i = 0; i < 3; i++)
    {
        if (show)
        {
            if (bar[i] && (style & fsNoBar[i]))
            {
                if (bar[i]->IsShown())
                    bar[i]->Show(false);
                else
                    style &= ~fsNoBar[i];
            }
        }
        else
        {
            if (bar[i] && (m_fsSaveFlag & fsNoBar[i]))
                bar[i]->Show(true);
        }
    }
    if (show)
        m_fsSaveFlag = style;

    return true;
}
开发者ID:Richard-Ni,项目名称:wxWidgets,代码行数:57,代码来源:frame.cpp

示例9: wxFrame

SjVisFrame::SjVisFrame( wxWindow* parent, const wxPoint& pos, const wxSize& size, bool fullscreen)
	: wxFrame(parent, wxID_ANY, _("Video screen"), pos, size,
				fullscreen? (wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxFULL_REPAINT_ON_RESIZE|wxFRAME_NO_TASKBAR) : (wxCLIP_CHILDREN|wxFULL_REPAINT_ON_RESIZE|wxFRAME_NO_TASKBAR))
{
	SetAcceleratorTable(g_accelModule->GetAccelTable(SJA_MAIN));
	if( fullscreen ) {
        ShowFullScreen(true);
	}
}
开发者ID:boh1996,项目名称:silverjuke,代码行数:9,代码来源:vis_frame.cpp

示例10: accel

void SearchPanel::InitAcceleratorTable() {
	const unsigned int accelcount = 3;
	wxAcceleratorEntry entries[accelcount];
	entries[0].Set(wxACCEL_ALT, (int)'R', REPLACE_REPLACE);
	entries[1].Set(wxACCEL_ALT, (int)'A', REPLACE_ALL);
	entries[2].Set(wxACCEL_NORMAL, WXK_ESCAPE, SEARCH_CLOSE);
	wxAcceleratorTable accel(accelcount, entries);
	SetAcceleratorTable(accel);
}
开发者ID:dxtravi,项目名称:e,代码行数:9,代码来源:SearchPanel.cpp

示例11: m_listCtrl

FindFrame::FindFrame(wxWindow *parent,
                     PoeditListCtrl *list,
                     Catalog *c,
                     wxTextCtrl *textCtrlOrig,
                     wxTextCtrl *textCtrlTrans,
                     wxTextCtrl *textCtrlComments,
                     wxTextCtrl *textCtrlAutoComments)
        : m_listCtrl(list),
          m_catalog(c),
          m_position(-1),
          m_textCtrlOrig(textCtrlOrig),
          m_textCtrlTrans(textCtrlTrans),
          m_textCtrlComments(textCtrlComments),
          m_textCtrlAutoComments(textCtrlAutoComments)
{
    wxXmlResource::Get()->LoadDialog(this, parent, "find_frame");

    m_textField = XRCCTRL(*this, "string_to_find", wxTextCtrl);

    SetEscapeId(wxID_CLOSE);

    RestoreWindowState(this, wxDefaultSize, WinState_Pos);

    m_btnNext = XRCCTRL(*this, "find_next", wxButton);
    m_btnPrev = XRCCTRL(*this, "find_prev", wxButton);

    if ( !ms_text.empty() )
    {
        m_textField->SetValue(ms_text);
        m_textField->SelectAll();
    }

    Reset(c);

    XRCCTRL(*this, "in_orig", wxCheckBox)->SetValue(
        wxConfig::Get()->ReadBool("find_in_orig", true));
    XRCCTRL(*this, "in_trans", wxCheckBox)->SetValue(
        wxConfig::Get()->ReadBool("find_in_trans", true));
    XRCCTRL(*this, "in_comments", wxCheckBox)->SetValue(
        wxConfig::Get()->ReadBool("find_in_comments", true));
    XRCCTRL(*this, "in_auto_comments", wxCheckBox)->SetValue(
        wxConfig::Get()->ReadBool("find_in_auto_comments", true));
    XRCCTRL(*this, "case_sensitive", wxCheckBox)->SetValue(
        wxConfig::Get()->ReadBool("find_case_sensitive", false));
    XRCCTRL(*this, "from_first", wxCheckBox)->SetValue(
        wxConfig::Get()->ReadBool("find_from_first", true));
    XRCCTRL(*this, "whole_words", wxCheckBox)->SetValue(
        wxConfig::Get()->ReadBool("whole_words", false));

#ifdef __WXOSX__
    wxAcceleratorEntry entries[] = {
        { wxACCEL_CMD,  'W', wxID_CLOSE }
    };
    wxAcceleratorTable accel(WXSIZEOF(entries), entries);
    SetAcceleratorTable(accel);
#endif
}
开发者ID:mfloryan,项目名称:poedit,代码行数:57,代码来源:findframe.cpp

示例12: wxListView

wxExListView::wxExListView(wxWindow* parent,
  wxWindowID id,
  const wxPoint& pos,
  const wxSize& size,
  long style,
  wxExImageType image_type,
  const wxValidator& validator,
  const wxString &name)
  : wxListView(parent, id, pos, size, style, validator, name)
  , m_FieldSeparator('\t')
  , m_ImageType(image_type)
  , m_ImageHeight(16)
  , m_ImageWidth(16)
  , m_SortedColumnNo(-1)
{
#if wxUSE_DRAG_AND_DROP
  SetDropTarget(new ListViewDropTarget(this));
#endif

  if (image_type != IMAGE_NONE)
  {
    if (image_type == IMAGE_ART || image_type == IMAGE_OWN)
    {
      AssignImageList(
        new wxImageList(
          m_ImageWidth, 
          m_ImageHeight, true, 0), 
        wxIMAGE_LIST_SMALL);
    }
    else if (image_type == IMAGE_FILE_ICON)
    {
      SetImageList(
        wxTheFileIconsTable->GetSmallImageList(), 
        wxIMAGE_LIST_SMALL);
    }
    else
    {
      wxFAIL;
    }
  }

  SetFont(wxConfigBase::Get()->ReadObject(
    _("List Font"), wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT)));

  wxAcceleratorEntry entries[4];

  entries[0].Set(wxACCEL_NORMAL, WXK_DELETE, wxID_DELETE);
  entries[1].Set(wxACCEL_CTRL, WXK_INSERT, wxID_COPY);
  entries[2].Set(wxACCEL_SHIFT, WXK_INSERT, wxID_PASTE);
  entries[3].Set(wxACCEL_SHIFT, WXK_DELETE, wxID_CUT);

  wxAcceleratorTable accel(WXSIZEOF(entries), entries);
  SetAcceleratorTable(accel);
}
开发者ID:hugofvw,项目名称:wxExtension,代码行数:54,代码来源:listview.cpp

示例13: dialog

void wxGISApplicationEx::Customize(void)
{
	wxGISCustomizeDlg dialog(this);
	if(dialog.ShowModal() == wxID_OK )
	{
		if(m_pGISAcceleratorTable->HasChanges())
			SetAcceleratorTable(m_pGISAcceleratorTable->GetAcceleratorTable());
		wxGISToolBarMenu* pToolBarMenu =  static_cast<wxGISToolBarMenu*>(GetCommandBar(TOOLBARMENUNAME));
		if(pToolBarMenu)
			pToolBarMenu->Update();
	}
}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:12,代码来源:applicationex.cpp

示例14: MainFrame

    MainFrame() {
        SetBackgroundColour(GetChildren()[0]->GetBackgroundColour());
        createProgramsPage();
        populateActivationKeyList();
        sendOptionsToControls(options);
        KeyList->SetFont(wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT));

        wxAcceleratorEntry entries[2];
        entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, CancelButton->GetId());
        entries[1].Set(wxACCEL_NORMAL, WXK_F1, HelpButton->GetId());
        wxAcceleratorTable accel(2, entries);
        SetAcceleratorTable(accel);
    };
开发者ID:nohwnd,项目名称:touchcursor,代码行数:13,代码来源:main.cpp

示例15: pgDialog

DialogWithHelp::DialogWithHelp(frmMain *frame) : pgDialog()
{
	mainForm = frame;

	wxAcceleratorEntry entries[2];
	entries[0].Set(wxACCEL_NORMAL, WXK_F1, MNU_HELP);
// this is for GTK because Meta (usually Numlock) is interpreted like Alt
// there are too many controls to reset m_Meta in all of them
	entries[1].Set(wxACCEL_ALT, WXK_F1, MNU_HELP);
	wxAcceleratorTable accel(2, entries);

	SetAcceleratorTable(accel);
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:13,代码来源:dlgClasses.cpp


注:本文中的SetAcceleratorTable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。