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

C++ wxObjectDataPtr类代码示例

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

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



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

示例1: OnStyleChange

void MyFrame::OnStyleChange( wxCommandEvent& WXUNUSED(event) )
{
    unsigned int nPanel = m_notebook->GetSelection();

    // build the style
    unsigned long style = 0;
    /*if (GetMenuBar()->FindItem(ID_SINGLE)->IsChecked())
        style |= wxDV_SINGLE;*/
    if (GetMenuBar()->FindItem(ID_MULTIPLE)->IsChecked())
        style |= wxDV_MULTIPLE;
    if (GetMenuBar()->FindItem(ID_ROW_LINES)->IsChecked())
        style |= wxDV_ROW_LINES;
    if (GetMenuBar()->FindItem(ID_HORIZ_RULES)->IsChecked())
        style |= wxDV_HORIZ_RULES;
    if (GetMenuBar()->FindItem(ID_VERT_RULES)->IsChecked())
        style |= wxDV_VERT_RULES;

    wxSizer* sz = m_ctrl[nPanel]->GetContainingSizer();
    wxASSERT(sz);

    sz->Detach(m_ctrl[nPanel]);
    wxDELETE(m_ctrl[nPanel]);
    m_ctrl[nPanel] = NULL;

    if (nPanel == 0)
        m_music_model.reset(NULL);
    else if (nPanel == 1)
        m_list_model.reset(NULL);

    // rebuild the DVC for the selected panel:
    BuildDataViewCtrl((wxPanel*)m_notebook->GetPage(nPanel), nPanel, style);

    sz->Prepend(m_ctrl[nPanel], 1, wxGROW|wxALL, 5);
    sz->Layout();
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:35,代码来源:dataview.cpp


示例2: OnShowCurrent

void MyFrame::OnShowCurrent(wxCommandEvent& WXUNUSED(event))
{
    wxDataViewItem item = m_ctrl[0]->GetCurrentItem();
    if ( item.IsOk() )
    {
        wxLogMessage("Current item: \"%s\" by %s",
                     m_music_model->GetTitle(item),
                     m_music_model->GetArtist(item));
    }
    else
    {
        wxLogMessage("There is no current item.");
    }

    wxDataViewColumn *col = m_ctrl[0]->GetCurrentColumn();
    if ( col )
    {
        wxLogMessage("Current column: %d",
                     m_ctrl[0]->GetColumnPosition(col));
    }
    else
    {
        wxLogMessage("There is no current column.");
    }
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:25,代码来源:dataview.cpp


示例3: OnSelectNinth

void MyFrame::OnSelectNinth( wxCommandEvent& WXUNUSED(event) )
{
    if (!m_music_model->GetNinthItem().IsOk())
    {
        wxLogError( "Cannot select the ninth symphony: it was removed!" );
        return;
    }

    m_ctrl[0]->Select( m_music_model->GetNinthItem() );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:10,代码来源:dataview.cpp


示例4: OnDeleteList

void MyFrame::OnDeleteList( wxCommandEvent& WXUNUSED(event) )
{
    wxDataViewItemArray items;
    int len = m_ctrl[1]->GetSelections( items );
    if (len > 0)
        m_list_model->DeleteItems( items );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:7,代码来源:dataview.cpp


示例5: EvtCommandMessageAdded

	EvtCommandWindowMessage():EvtCommandWindow(_kT("Message")),wm(WndManager::current())
	{
		memset(m_aLogLevelEnabled,-1,sizeof(m_aLogLevelEnabled));
		memset(m_nLogLevelCount,0,sizeof(m_nLogLevelCount));

		m_nMaxSize=4000;
		m_nCapacity=5000;
		m_nRdPos=0;
		m_nWrPos=0;

		m_aRecords.resize(m_nCapacity);

		EvtManager::current().append(new EvtCommandMessageAdded(*this));

        m_pListModel = new IMessageModel(*this);
		m_pListView = new IMessageView(*this,WndModel::current().GetWindow());

		//m_pListView->Connect(wxID_ANY,wxEVT_CHILD_FOCUS,wxChildFocusEventHandler(MyWindow::OnFocus));


		m_pListView->SetName(str2wx(m_sId));
        m_pListView->AssociateModel( m_pListModel.get() );

		m_pListView->SetSize(wxSize(480,240));
		m_pListView->SetMinSize(wxSize(120,120));

		SetWindow(m_pListView);

		LogTarget* ptarget=new LogTargetMessage(*this);
		WndManager::current().logptr.SetData(ptarget);
		Logger::def(ptarget);

		wm.evtmgr["CloseFrame"].AttachListener(this);

	}
开发者ID:xuanya4202,项目名称:ew_base,代码行数:35,代码来源:plugin_message.cpp


示例6: DeleteSelectedItems

void MyFrame::DeleteSelectedItems()
{
    wxDataViewItemArray items;
    int len = m_ctrl[0]->GetSelections( items );
    for( int i = 0; i < len; i ++ )
        if (items[i].IsOk())
            m_music_model->Delete( items[i] );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:8,代码来源:dataview.cpp


示例7: OnSelectionChanged

void MyFrame::OnSelectionChanged( wxDataViewEvent &event )
{
    wxString title = m_music_model->GetTitle( event.GetItem() );
    if (title.empty())
        title = "None";

    wxLogMessage( "wxEVT_DATAVIEW_SELECTION_CHANGED, First selected Item: %s", title );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:8,代码来源:dataview.cpp


示例8: OnActivated

void MyFrame::OnActivated( wxDataViewEvent &event )
{
    wxString title = m_music_model->GetTitle( event.GetItem() );
    wxLogMessage( "wxEVT_DATAVIEW_ITEM_ACTIVATED, Item: %s", title );

    if (m_ctrl[0]->IsExpanded( event.GetItem() ))
    {
        wxLogMessage( "Item: %s is expanded", title );
    }
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:10,代码来源:dataview.cpp


示例9: OnSetNinthCurrent

void MyFrame::OnSetNinthCurrent(wxCommandEvent& WXUNUSED(event))
{
    wxDataViewItem item(m_music_model->GetNinthItem());
    if ( !item.IsOk() )
    {
        wxLogError( "Cannot make the ninth symphony current: it was removed!" );
        return;
    }

    m_ctrl[0]->SetCurrentItem(item);
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:11,代码来源:dataview.cpp


示例10: OnDropPossible

void MyFrame::OnDropPossible( wxDataViewEvent &event )
{
    wxDataViewItem item( event.GetItem() );

    // only allow drags for item, not containers
    if (m_music_model->IsContainer( item ) )
        event.Veto();

    if (event.GetDataFormat() != wxDF_UNICODETEXT)
        event.Veto();
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:11,代码来源:dataview.cpp


示例11: OnContextMenu

void MyFrame::OnContextMenu( wxDataViewEvent &event )
{
    wxString title = m_music_model->GetTitle( event.GetItem() );
    wxLogMessage( "wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, Item: %s", title );

    wxMenu menu;
    menu.Append( 1, "menuitem 1" );
    menu.Append( 2, "menuitem 2" );
    menu.Append( 3, "menuitem 3" );

    m_ctrl[0]->PopupMenu(&menu);
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:12,代码来源:dataview.cpp


示例12: OnStartEditing

void MyFrame::OnStartEditing( wxDataViewEvent &event )
{
    wxString artist = m_music_model->GetArtist( event.GetItem() );
    if (artist == "Ludwig van Beethoven")
    {
        event.Veto();

        wxLogMessage( "wxEVT_DATAVIEW_ITEM_START_EDITING vetoed. Artist: %s", artist );
    }
    else
        wxLogMessage( "wxEVT_DATAVIEW_ITEM_START_EDITING not vetoed. Artist: %s", artist );

}
开发者ID:ruifig,项目名称:nutcracker,代码行数:13,代码来源:dataview.cpp


示例13: OnBeginDrag

void MyFrame::OnBeginDrag( wxDataViewEvent &event )
{
    wxDataViewItem item( event.GetItem() );

    // only allow drags for item, not containers
    if (m_music_model->IsContainer( item ) )
    {
        event.Veto();
        return;
    }

    MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) item.GetID();
    wxTextDataObject *obj = new wxTextDataObject;
    obj->SetText( node->m_title );
    event.SetDataObject( obj );
    event.SetDragFlags(wxDrag_AllowMove); // allows both copy and move
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:17,代码来源:dataview.cpp


示例14: OnDrop

void MyFrame::OnDrop( wxDataViewEvent &event )
{
    wxDataViewItem item( event.GetItem() );

    // only allow drops for item, not containers
    if (m_music_model->IsContainer( item ) )
    {
        event.Veto();
        return;
    }

    if (event.GetDataFormat() != wxDF_UNICODETEXT)
    {
        event.Veto();
        return;
    }

    wxTextDataObject obj;
    obj.SetData( wxDF_UNICODETEXT, event.GetDataSize(), event.GetDataBuffer() );

    wxLogMessage( "Text dropped: %s", obj.GetText() );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:22,代码来源:dataview.cpp


示例15: UpdateModel

void EvtCommandWindowMessage::UpdateModel()
{
	m_aSrcCount.clear();
	m_aRecordsReal.clear();
	memset(m_nLogLevelCount,0,sizeof(m_nLogLevelCount));

	for(int i=m_nRdPos;i!=m_nWrPos;i=(i+1)%m_nCapacity)
	{
		int lv=m_aRecords[i].m_nLevel;
		if(uint32_t(lv)>LOGLEVEL_MAX) continue;

		m_nLogLevelCount[lv]++;
		if(!m_aLogLevelEnabled[lv])
		{
			continue;
		}

		if(!m_sSearchText.empty())
		{
			const char* c=::strstr(m_aRecords[i].m_sMessage.c_str(),m_sSearchText.c_str());
			if(c==NULL) continue;
		}

		m_aSrcCount[m_aRecords[i].m_nSrc]++;
		m_aRecordsReal.append(i);
	}

	unsigned _nRowCount=m_aRecordsReal.size();
	m_pListModel->Reset(_nRowCount);

	EvtManager::current()["TB_MSG"].UpdateCtrl();

	//延时事件,通知消息窗口滚动动最新的消息
	if(_nRowCount>0) EvtManager::current().pending("MessageAdded",_nRowCount-1);

}
开发者ID:xuanya4202,项目名称:ew_base,代码行数:36,代码来源:plugin_message.cpp


示例16: OnExpanding

void MyFrame::OnExpanding( wxDataViewEvent &event )
{
    wxString title = m_music_model->GetTitle( event.GetItem() );
    wxLogMessage( "wxEVT_DATAVIEW_ITEM_EXPANDING, Item: %s", title );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:5,代码来源:dataview.cpp


示例17: OnEditingDone

void MyFrame::OnEditingDone( wxDataViewEvent &event )
{
    wxString title = m_music_model->GetTitle( event.GetItem() );
    wxLogMessage( "wxEVT_DATAVIEW_ITEM_EDITING_DONE, Item: %s", title );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:5,代码来源:dataview.cpp


示例18: OnCollapsed

void MyFrame::OnCollapsed( wxDataViewEvent &event )
{
    wxString title = m_music_model->GetTitle( event.GetItem() );
    wxLogMessage( "wxEVT_DATAVIEW_ITEM_COLLAPSED, Item: %s", title );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:5,代码来源:dataview.cpp


示例19: OnValueChanged

void MyFrame::OnValueChanged( wxDataViewEvent &event )
{
    wxString title = m_music_model->GetTitle( event.GetItem() );
    wxLogMessage( "wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, Item Id: %s;  Column: %d",
                  title, event.GetColumn() );
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:6,代码来源:dataview.cpp


示例20: OnPrependList

void MyFrame::OnPrependList( wxCommandEvent& WXUNUSED(event) )
{
    m_list_model->Prepend("Test");
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:4,代码来源:dataview.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ wxOutputStream类代码示例发布时间:2022-05-31
下一篇:
C++ wxNotebookEvent类代码示例发布时间: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