本文整理汇总了C++中gtk::SelectionData::get_target方法的典型用法代码示例。如果您正苦于以下问题:C++ SelectionData::get_target方法的具体用法?C++ SelectionData::get_target怎么用?C++ SelectionData::get_target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk::SelectionData
的用法示例。
在下文中一共展示了SelectionData::get_target方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onDragDataGet
void ApplicationList::onDragDataGet(const Glib::RefPtr<Gdk::DragContext>& context,
Gtk::SelectionData& data, guint info, guint time)
{
Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
Gtk::TreeModel::iterator iter = refTreeSelection->get_selected();
if(iter && ((*iter)[m_appColumns.m_col_type] == MODULE))
{
Glib::ustring name = (*iter)[m_appColumns.m_col_name];
data.set(data.get_target(), MODULE,
(const guchar*)name.c_str(), name.size()+1);
}
else if(iter && ((*iter)[m_appColumns.m_col_type] == RESOURCE))
{
Glib::ustring name = (*iter)[m_appColumns.m_col_name];
data.set(data.get_target(), RESOURCE,
(const guchar*)name.c_str(), name.size()+1);
}
else if(iter && ((*iter)[m_appColumns.m_col_type] == APPLICATION))
{
Glib::ustring name = (*iter)[m_appColumns.m_col_name];
data.set(data.get_target(), APPLICATION,
(const guchar*)name.c_str(), name.size()+1);
}
}
示例2: on_routine_drop
//------------------------------------------------------------------------------
void DbMySQLRoutineGroupEditor::on_routine_drop(const Glib::RefPtr<Gdk::DragContext>& context
,int x, int y
, const Gtk::SelectionData& selection_data
, guint info, guint time)
{
bool dnd_status = false;
if ( selection_data.get_target() == WB_DBOBJECT_DRAG_TYPE)
{
std::list<db_DatabaseObjectRef> objects;
const std::string selection = selection_data.get_data_as_string();
objects= bec::CatalogHelper::dragdata_to_dbobject_list(_be->get_catalog(), selection);
for (std::list<db_DatabaseObjectRef>::const_iterator obj= objects.begin();
obj != objects.end(); ++obj)
{
if (obj->is_instance<db_mysql_Routine>())
{
db_mysql_RoutineRef routine = db_mysql_RoutineRef::cast_from(*obj);
if ( routine.is_valid() )
_be->append_routine_with_id(routine.id());
}
}
recreate_model_from_string_list(_routines_model, _be->get_routines_names());
dnd_status = true;
}
context->drag_finish(dnd_status, false, time);
}
示例3: on_button_drag_data_get
void DnDWindow::on_button_drag_data_get(
const Glib::RefPtr<Gdk::DragContext>&,
Gtk::SelectionData& selection_data, guint, guint)
{
selection_data.set(selection_data.get_target(), 8 /* 8 bits format */,
(const guchar*)"I'm Data!",
9 /* the length of I'm Data! in bytes */);
}
示例4: on_drag_data_get
//
// D&Dで受信側がデータ送信を要求してきた
//
void TabLabel::on_drag_data_get( const Glib::RefPtr<Gdk::DragContext>& context,
Gtk::SelectionData& selection_data, guint info, guint time )
{
#ifdef _DEBUG
std::cout << "TabLabel::on_drag_data_get target = " << selection_data.get_target()
<< " " << m_fulltext << std::endl;;
#endif
Gtk::EventBox::on_drag_data_get( context, selection_data, info, time );
m_sig_tab_drag_data_get( selection_data );
}
示例5: srcSelect
void ImportClassesBox::ClassesTreeView::on_drag_data_get(
const Glib::RefPtr<Gdk::DragContext>& ,
Gtk::SelectionData& selection_data, guint, guint)
{
Glib::RefPtr<Gtk::TreeSelection> srcSelect(get_selection());
if (srcSelect) {
Gtk::TreeModel::iterator iter = srcSelect->get_selected();
if (iter) {
Gtk::TreeModel::Row row = *iter;
std::string className = row.get_value(mColumns.m_col_name);
selection_data.set(selection_data.get_target(), className);
}
}
}
示例6: dragFunction
void ClipSelector::dragFunction( const Glib::RefPtr<Gdk::DragContext>& context,
Gtk::SelectionData& selection_data, guint info, guint time)
{
cout << "ClipSelector::dragFunction() called!" << endl;
// drag target is of string type, send
cout << "DRAG from block " << block << endl;
// get state of clip selector
ClipSelectorState* state = &stateStore->clipSelectorState.at(ID);
// get block info, to retrieve its bufferID
std::list<ClipInfo>::iterator iter = state->clipInfo.begin();
std::advance(iter, block);
stringstream s;
s << (*iter).bufferID;
// send data to drop
selection_data.set( selection_data.get_target(), 8, (guchar*) s.str().c_str(), s.str().size() );
}
示例7: SetData
void SetData(Gtk::SelectionData& selection_data, void* dat, int dat_sz)
{
selection_data.set(selection_data.get_target(), 8 /* 8 bits format */,
(const guchar*)dat, dat_sz /* the length of data in bytes */);
}
示例8: PrintSelectionData
void PrintSelectionData(const Gtk::SelectionData& selection_data, const std::string& location_str)
{
io::cout << "\nFrom " << location_str << ":" << io::endl;
io::cout << "Target: " << selection_data.get_target() << io::endl;
io::cout << "Selection: " << gdk_atom_name(selection_data.get_selection()) << io::endl;
}