• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: wxBoxSizer

bool MyApp::OnInit()
{
    wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
    frame = new wxFrame((wxFrame *)NULL, -1,  wxT("Hello wxDC"), wxPoint(50,50), wxSize(800,600));
	
    drawPane = new BasicDrawPane( (wxFrame*) frame );
    sizer->Add(drawPane, 1, wxEXPAND);
	
    frame->SetSizer(sizer);
    frame->SetAutoLayout(true);
	
    frame->Show();
    return true;
} 
开发者ID:chrisdonahue,项目名称:NEATMusicVisualizer,代码行数:14,代码来源:TestGui.cpp


示例2: wxBoxSizer

bool TraceScope::OnInit()
{
    wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
    m_frame = new wxFrame((wxFrame *)NULL, -1,  wxT("lttng-scope"), wxPoint(50,50), wxSize(400,200));

    m_scopeView = new ScopeView( (wxFrame*) m_frame );
    sizer->Add(m_scopeView, 1, wxEXPAND);

    m_frame->SetSizer(sizer);
    m_frame->SetAutoLayout(true);

    m_frame->Show();

    return true;
}
开发者ID:SimonKagstrom,项目名称:lttng-scope,代码行数:15,代码来源:app.cpp


示例3: wxBoxSizer

bool MyApp::OnInit()
{
    wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
    frame = new wxFrame((wxFrame *)NULL, -1,  wxT("Hello GL World"), wxPoint(50,50), wxSize(400,200));
	
    int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0};
    
    glPane = new BasicGLPane( (wxFrame*) frame, args);
    sizer->Add(glPane, 1, wxEXPAND);
	
    frame->SetSizer(sizer);
    frame->SetAutoLayout(true);
	
    frame->Show();
    return true;
} 
开发者ID:xuweirong,项目名称:wxWidgets,代码行数:16,代码来源:main.cpp


示例4: init_render_sys

	void init_render_sys()
	{
		m_root = new Ogre::Root();
		m_root->setRenderSystem(m_root->getRenderSystemByName("OpenGL Rendering Subsystem"));
		m_root->initialise(false);
		m_frm = new wxFrame(0,-1,wxT(""));
		NameValuePairList a;
		a.insert(std::pair<String,String>("externalWindowHandle",StringConverter::toString( (size_t) m_frm->GetHandle() )));
		RenderSystem *sys = m_root->getRenderSystem();
		RenderWindow *m_ren = sys->_createRenderWindow(String("OgreRenderWindow_00"),1,1,false,&a);
		MaterialManager::getSingleton().initialise();
		m_frm->Show(false);
	}
开发者ID:EnsonRedShirt,项目名称:Segs,代码行数:13,代码来源:wxOgrePanel.cpp


示例5: wxBoxSizer

bool MyApp::OnInit()
{
    wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
    frame = new wxFrame((wxFrame *)NULL, -1,  wxT("Hello GL World"), wxPoint(50,50), wxSize(400,200));
 
    int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0};
    
    glPane = new BasicGLPane( (wxFrame*) frame, args);
    sizer->Add(glPane, 1,wxEXPAND);
    //glPane->starter = false;
    frame->SetSizer(sizer);
    frame->SetAutoLayout(true);

    
    cout << "Initializing!!" << std::endl;
    if(!initialize())
        return false;
    frame->Show();

    //glPane->starter = true;
    return true;
} 
开发者ID:ChaseCarthen,项目名称:cs791a,代码行数:22,代码来源:example2.cpp


示例6: AddCoolToolBar

void AddCoolToolBar(const std::vector<ToolBarEntry>& entries, wxFrame& frame)
{
    wxToolBar* tb = frame.CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL);

    for (std::vector<ToolBarEntry>::const_iterator i = entries.begin();
         i != entries.end(); i++) {
        tb->AddTool(i->id, wxT(""), *(i->bm), i->desc, i->kind);
        if (i->space) {
            tb->AddSeparator();
        }
    }
    tb->Realize();
}
开发者ID:calband,项目名称:calchart,代码行数:13,代码来源:toolbar.cpp


示例7: wxFrame

void MenuTestCase::CreateFrame()
{
    m_frame = new wxFrame(NULL, wxID_ANY, "test frame");

    wxMenu *fileMenu = new wxMenu;
    wxMenu *helpMenu = new wxMenu;
    wxMenu *subMenu = new wxMenu;
    wxMenu *subsubMenu = new wxMenu;

    size_t itemcount = 0;

    PopulateMenu(subsubMenu, "Subsubmenu item ", itemcount);

    // Store one of its IDs for later
    m_subsubmenuItemId = MenuTestCase_First + itemcount - 2;

    PopulateMenu(subMenu, "Submenu item ", itemcount);

    // Store one of its IDs for later
    m_submenuItemId = MenuTestCase_First + itemcount - 2;

    subMenu->AppendSubMenu(subsubMenu, "Subsubmen&u", "Test a subsubmenu");

    // Check GetTitle() returns the correct string _before_ appending to the bar
    fileMenu->SetTitle("&Foo\tCtrl-F");
    CPPUNIT_ASSERT_EQUAL( "&Foo\tCtrl-F", fileMenu->GetTitle() );

    PopulateMenu(fileMenu, "Filemenu item ", itemcount);

    fileMenu->Append(MenuTestCase_Foo, "&Foo\tCtrl-F", "Test item to be found");


    PopulateMenu(helpMenu, "Helpmenu item ", itemcount);
    helpMenu->Append(MenuTestCase_Bar, "Bar\tF1");
    m_menuWithBar = helpMenu;
    helpMenu->AppendSubMenu(subMenu, "Sub&menu", "Test a submenu");

    // +2 for "Foo" and "Bar", +2 for the 2 submenus
    m_itemCount = itemcount + 4;

    // Use an arraystring here, to help with future tests
    m_menuLabels.Add("&File");
    m_menuLabels.Add("&Help");

    wxMenuBar *menuBar = new wxMenuBar();
    menuBar->Append(fileMenu, m_menuLabels[0]);
    menuBar->Append(helpMenu, m_menuLabels[1]);
    m_frame->SetMenuBar(menuBar);
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:49,代码来源:menu.cpp


示例8: OnInit


//.........这里部分代码省略.........
          {
            if (5 == sscanf(s, "%" NAME_FIELD_WIDTH "s%d%d%d%d", Name, &i1,
                &i2, &i3, &i4))
              {
                int i;
                for (i = 0; i < NumFields; i++)
                  if (!strcmp(Fields[i].Name, Name))
                    break;
                if (i < NumFields)
                  {
                    if (i2 < 0)
                      i2 += BackgroundHeight - 1;
                    if (i4 < 0)
                      i4 += BackgroundHeight - 1;
                    if (i1 > i3)
                      {
                        int i;
                        i = i1;
                        i1 = i3;
                        i3 = i1;
                      }
                    if (i2 > i4)
                      {
                        int i;
                        i = i2;
                        i2 = i4;
                        i4 = i;
                      }
                    strcpy(Fields[i].Name, Name);
                    Fields[i].Type = FT_IN;
                    Fields[i].Left = i1;
                    Fields[i].Top = i2;
                    Fields[i].Right = i3;
                    Fields[i].Bottom = i4;
                  }
              }
            else if (3 == sscanf(s, "%" NAME_FIELD_WIDTH "s%d%d", Name, &i1,
                &i2))
              {
                if (!strcmp(Name, "size"))
                  {
                    BackgroundWidth = i1;
                    BackgroundHeight = i2;
                  }
                else
                  {
                    int i;
                    for (i = 0; i < NumFields; i++)
                      if (!strcmp(Fields[i].Name, Name))
                        break;
                    if (i < NumFields)
                      {
                        if (i2 < 0)
                          i2 += BackgroundHeight - 1;
                        strcpy(Fields[i].Name, Name);
                        Fields[i].Type = FT_OUT;
                        Fields[i].x = i1;
                        Fields[i].y = i2;
                      }
                  }
              }
          }
      }
    if (BackgroundWidth == 0 || BackgroundHeight == 0)
      {
        wxMessageBox(wxT("Size-fields not found in yaPanel.coordinates"), wxT(
            "Fatal error"), wxOK | wxICON_ERROR);
        goto Done;
      }

    frame = new wxFrame(NULL, wxID_ANY, wxT("Test yaPanel"), wxPoint(50, 50),
        wxSize(BackgroundWidth, BackgroundHeight));

    // then simply create like this
    drawPane = new wxImagePanel(frame, wxT("yaPanel.png"), wxBITMAP_TYPE_PNG);
#ifndef FLEXGRID
    sizer->Add(drawPane, 100, wxEXPAND);
#else
    sizer->AddStretchSpacer();
    sizer->AddStretchSpacer();
    sizer->AddStretchSpacer();
    sizer->AddStretchSpacer();
    sizer->Add(drawPane, 100, wxSHAPED);
    sizer->AddStretchSpacer();
    sizer->AddStretchSpacer();
    sizer->AddStretchSpacer();
    sizer->AddStretchSpacer();
#endif

    frame->SetSizer(sizer);
    drawPane->CaptureMouse();

    frame->Show();
    return true;
    // Error exit here.
    Done: ;
    if (host != NULL)
      enet_host_destroy(host);
    return false;
  }
开发者ID:Bhagita,项目名称:virtualagc,代码行数:101,代码来源:yaPanel.cpp


示例9: wxFrame

bool BasicApp::OnInit()
{
   frame = new wxFrame(NULL, -1, "My First GUI Program");
   frame->Show(true);
   return true;
}
开发者ID:jervisfm,项目名称:ExampleCode,代码行数:6,代码来源:basic.cpp


示例10: OnPreferences

void DialogsProvider::OnPreferences( wxCommandEvent& WXUNUSED(event) )
{
    /* Show/hide the open dialog */
    if( !p_prefs_dialog )
        p_prefs_dialog = new PrefsDialog( p_intf, this );

    if( p_prefs_dialog )
    {
        p_prefs_dialog->Show( !p_prefs_dialog->IsShown() );
    }
}
开发者ID:,项目名称:,代码行数:11,代码来源:


示例11: OnBookmarks

void DialogsProvider::OnBookmarks( wxCommandEvent& WXUNUSED(event) )
{
    /* Show/hide the open dialog */
    if( !p_bookmarks_dialog )
        p_bookmarks_dialog = new BookmarksDialog( p_intf, this );

    if( p_bookmarks_dialog )
    {
        p_bookmarks_dialog->Show( !p_bookmarks_dialog->IsShown() );
    }
}
开发者ID:,项目名称:,代码行数:11,代码来源:


示例12: Labels

void MenuTestCase::Labels()
{
    wxMenuBar* bar = m_frame->GetMenuBar();
    CPPUNIT_ASSERT( bar );
    wxMenu* filemenu;
    wxMenuItem* itemFoo = bar->FindItem(MenuTestCase_Foo, &filemenu);
    CPPUNIT_ASSERT( itemFoo );
    CPPUNIT_ASSERT( filemenu );

    // These return labels including mnemonics/accelerators:

    // wxMenuBar
    CPPUNIT_ASSERT_EQUAL( "&File", bar->GetMenuLabel(0) );
    CPPUNIT_ASSERT_EQUAL( "&Foo\tCtrl-F", bar->GetLabel(MenuTestCase_Foo) );

    // wxMenu
    CPPUNIT_ASSERT_EQUAL( "&File", filemenu->GetTitle() );
    CPPUNIT_ASSERT_EQUAL( "&Foo\tCtrl-F", filemenu->GetLabel(MenuTestCase_Foo) );

    // wxMenuItem
    CPPUNIT_ASSERT_EQUAL( "&Foo\tCtrl-F", itemFoo->GetItemLabel() );

    // These return labels stripped of mnemonics/accelerators:

    // wxMenuBar
    CPPUNIT_ASSERT_EQUAL( "File", bar->GetMenuLabelText(0) );

    // wxMenu
    CPPUNIT_ASSERT_EQUAL( "Foo", filemenu->GetLabelText(MenuTestCase_Foo) );

    // wxMenuItem
    CPPUNIT_ASSERT_EQUAL( "Foo", itemFoo->GetItemLabelText() );
    CPPUNIT_ASSERT_EQUAL( "Foo", wxMenuItem::GetLabelText("&Foo\tCtrl-F") );
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:34,代码来源:menu.cpp


示例13: Report

    REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED )
    {
        if( !aText.IsEmpty() )
            m_hasMessage = true;

        m_frame->SetStatusText( aText, m_position );
        return *this;
    }
开发者ID:CastMi,项目名称:kicad-source-mirror,代码行数:8,代码来源:3d_draw.cpp


示例14: OnUnsplitEvent

void MySplitterWindow::OnUnsplitEvent(wxSplitterEvent& event)
{
#if wxUSE_STATUSBAR
    m_frame->SetStatusText(wxT("Splitter unsplit"), 1);
#endif // wxUSE_STATUSBAR

    event.Skip();
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:8,代码来源:splitter.cpp


示例15: OnDClick

void MySplitterWindow::OnDClick(wxSplitterEvent& event)
{
#if wxUSE_STATUSBAR
    m_frame->SetStatusText(wxT("Splitter double clicked"), 1);
#endif // wxUSE_STATUSBAR

    event.Skip();
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:8,代码来源:splitter.cpp


示例16: EnableTop

void MenuTestCase::EnableTop()
{
    wxMenuBar* const bar = m_frame->GetMenuBar();
    CPPUNIT_ASSERT( bar->IsEnabledTop(0) );
    bar->EnableTop( 0, false );
    CPPUNIT_ASSERT( !bar->IsEnabledTop(0) );
    bar->EnableTop( 0, true );
    CPPUNIT_ASSERT( bar->IsEnabledTop(0) );
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:9,代码来源:menu.cpp


示例17: OnInit

bool MyApp::OnInit()
{   
	wxSetWorkingDirectory("../."); // one directory above bin

    mainFrame = new MyFrame( _T("GCB2 DB EDITOR"), wxPoint(50,50), wxSize(1200,820) );
    mainFrame->Show(TRUE);
    SetTopWindow(mainFrame);
    return TRUE;
} 
开发者ID:WarfareCode,项目名称:gcblue,代码行数:9,代码来源:mainframe.cpp


示例18: close_render_sys

	void close_render_sys()
	{
		if(0==m_frm)
			return;
		delete m_root;
		m_root=0;
		m_instance=0;
		m_frm->Close();
		m_frm=0;
	}
开发者ID:EnsonRedShirt,项目名称:Segs,代码行数:10,代码来源:wxOgrePanel.cpp


示例19: RadioItems

void MenuTestCase::RadioItems()
{
    wxMenuBar * const bar = m_frame->GetMenuBar();
    wxMenu * const menu = new wxMenu;
    bar->Append(menu, "&Radio");

    // Adding consecutive radio items creates a radio group.
    menu->AppendRadioItem(MenuTestCase_First, "Radio 0");
    menu->AppendRadioItem(MenuTestCase_First + 1, "Radio 1");

    // First item of a radio group is checked by default.
    CPPUNIT_ASSERT( menu->IsChecked(MenuTestCase_First) );

    // Checking the second one make the first one unchecked however.
    menu->Check(MenuTestCase_First + 1, true);
    CPPUNIT_ASSERT( !menu->IsChecked(MenuTestCase_First) );
    CPPUNIT_ASSERT( menu->IsChecked(MenuTestCase_First + 1) );

    // Adding more radio items after a separator creates another radio group...
    menu->AppendSeparator();
    menu->AppendRadioItem(MenuTestCase_First + 2, "Radio 2");
    menu->AppendRadioItem(MenuTestCase_First + 3, "Radio 3");
    menu->AppendRadioItem(MenuTestCase_First + 4, "Radio 4");

    // ... which is independent from the first one.
    CPPUNIT_ASSERT( menu->IsChecked(MenuTestCase_First + 2) );

    menu->Check(MenuTestCase_First + 3, true);
    CPPUNIT_ASSERT( menu->IsChecked(MenuTestCase_First + 3) );
    CPPUNIT_ASSERT( !menu->IsChecked(MenuTestCase_First + 2) );
    CPPUNIT_ASSERT( menu->IsChecked(MenuTestCase_First + 1) );


    // Insert an item in the middle of an existing radio group.
    menu->InsertRadioItem(4, MenuTestCase_First + 5, "Radio 5");
    CPPUNIT_ASSERT( menu->IsChecked(MenuTestCase_First + 3) );

    menu->Check( MenuTestCase_First + 5, true );
    CPPUNIT_ASSERT( !menu->IsChecked(MenuTestCase_First + 3) );


    // Prepend a couple of items before the first group.
    menu->PrependRadioItem(MenuTestCase_First + 6, "Radio 6");
    menu->PrependRadioItem(MenuTestCase_First + 7, "Radio 7");
    menu->Check(MenuTestCase_First + 7, true);
    CPPUNIT_ASSERT( !menu->IsChecked(MenuTestCase_First + 1) );


    // Check that the last radio group still works as expected.
    menu->Check(MenuTestCase_First + 4, true);
    CPPUNIT_ASSERT( !menu->IsChecked(MenuTestCase_First + 5) );
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:52,代码来源:menu.cpp


示例20: Count

void MenuTestCase::Count()
{
    wxMenuBar* bar = m_frame->GetMenuBar();
    // I suppose you could call this "counting menubars" :)
    CPPUNIT_ASSERT( bar );

    CPPUNIT_ASSERT_EQUAL( bar->GetMenuCount(), 2 );

    size_t count = 0;
    for (size_t n=0; n < bar->GetMenuCount(); ++n)
    {
        RecursivelyCountMenuItems(bar->GetMenu(n), count);
    }
    CPPUNIT_ASSERT_EQUAL( count, m_itemCount );
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:15,代码来源:menu.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxGCDC类代码示例发布时间:2022-05-31
下一篇:
C++ wxFont类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap