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

C++ GetPeer函数代码示例

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

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



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

示例1: GetPeer

void wxRadioButton::SetValue(bool val)
{
    wxRadioButton *cycle;
    if (GetPeer()->GetValue() == val)
        return;

    GetPeer()->SetValue( val );
    if (val)
    {
        cycle = this->NextInCycle();
        if (cycle != NULL)
        {
            while (cycle != this)
            {
                cycle->SetValue( false );
                cycle = cycle->NextInCycle();
            }
        }
    }
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:20,代码来源:radiobut_osx.cpp


示例2: GetMenuItems

wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
{
    if ( item->IsRadio() )
    {
        // Check if we're removing the item starting the radio group
        if ( item->IsRadioGroupStart() )
        {
            // Yes, we do, update the next radio group item, if any, to be the
            // start one now.
            const int endGroup = item->GetRadioGroupEnd();

            wxMenuItemList::compatibility_iterator
                node = GetMenuItems().Item(endGroup);
            wxASSERT_MSG( node, wxS("Should have valid radio group end") );

            while ( node->GetData() != item )
            {
                const wxMenuItemList::compatibility_iterator
                    prevNode = node->GetPrevious();
                wxMenuItem* const prevItem = prevNode->GetData();
                if ( prevItem == item )
                {
                    prevItem->SetAsRadioGroupStart();
                    prevItem->SetRadioGroupEnd(endGroup);
                    break;
                }

                node = prevNode;
            }
        }
    }

/*
    // we need to find the items position in the child list
    size_t pos;
    wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();

    for ( pos = 0; node; pos++ )
    {
        if ( node->GetData() == item )
            break;

        node = node->GetNext();
    }

    // DoRemove() (unlike Remove) can only be called for existing item!
    wxCHECK_MSG( node, NULL, wxT("bug in wxMenu::Remove logic") );

    wxOSXMenuRemoveItem(m_hMenu , pos );
    */
    GetPeer()->Remove( item );
    // and from internal data structures
    return wxMenuBase::DoRemove(item);
}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:54,代码来源:menu_osx.cpp


示例3: GetPeer

void AwtLabel::DoPaint(HDC hDC, RECT& r)
{
    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);

    if ((r.right-r.left) > 0 && (r.bottom-r.top) > 0 &&
        m_peerObject != NULL && m_callbacksEnabled) {

        if (env->EnsureLocalCapacity(3) < 0)
            return;
        long x,y;
        SIZE size;

        /* self is sun.awt.windows.WLabelPeer  */

        jobject self = GetPeer(env);
        DASSERT(self);

        /* target is java.awt.Label */
        jobject target = env->GetObjectField(self, AwtObject::targetID);
        jobject font = GET_FONT(target, self);
        jstring text = (jstring)env->GetObjectField(target, AwtLabel::textID);

        size = AwtFont::getMFStringSize(hDC, font, text);
        ::SetTextColor(hDC, GetColor());
        /* Redraw whole label to eliminate display noise during resizing. */
        VERIFY(::GetClientRect(GetHWnd(), &r));
        VERIFY(::FillRect (hDC, &r, GetBackgroundBrush()));
        y = (r.top + r.bottom - size.cy) / 2;

        jint alignment = env->GetIntField(target, AwtLabel::alignmentID);
        switch (alignment) {
           case java_awt_Label_LEFT:
              x = r.left + 2;
              break;
          case java_awt_Label_CENTER:
              x = (r.left + r.right - size.cx) / 2;
              break;
          case java_awt_Label_RIGHT:
              x = r.right - 2 - size.cx;
              break;
        }
        /* draw string */
        if (isEnabled()) {
            AwtComponent::DrawWindowText(hDC, font, text, x, y);
        } else {
            AwtComponent::DrawGrayText(hDC, font, text, x, y);
        }
        DoCallback("handlePaint", "(IIII)V",
                   r.left, r.top, r.right-r.left, r.bottom-r.top);
        env->DeleteLocalRef(target);
        env->DeleteLocalRef(font);
        env->DeleteLocalRef(text);
    }
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:54,代码来源:awt_Label.cpp


示例4: GetPeer

STDMETHODIMP
CPosPassThru::get_StopTime(REFTIME * pllTime)
{
    IMediaPosition* pMP;
    HRESULT hr = GetPeer(&pMP);
    if (FAILED(hr)) {
	return hr;
    }
    hr = pMP->get_StopTime(pllTime);
    pMP->Release();
    return hr;
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:12,代码来源:ctlutil.cpp


示例5: GetPeer

void wxChoice::DoClear()
{
    for ( unsigned int i = 0 ; i < GetCount() ; i++ )
    {
        m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( 0 ) );
    }

    m_strings.Empty() ;
    m_datas.Empty() ;

    GetPeer()->SetMaximum( 0 ) ;
}
开发者ID:NullNoname,项目名称:dolphin,代码行数:12,代码来源:choice_osx.cpp


示例6:

MsgRouting
AwtTextComponent::WmNotify(UINT notifyCode)
{
    if (notifyCode == EN_CHANGE) {
        JNIEnv *env;
        if (JVM->AttachCurrentThread((void **) &env, 0) == 0) {
            env->CallVoidMethod(GetPeer(), 
                                WCachedIDs.PPCTextComponentPeer_valueChangedMID);
        }
    }
    return mrDoDefault;
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:12,代码来源:PPCTextComponentPeer.cpp


示例7: SetCloseAndDelete

void pSocket::cmdPiece(size_t piece, size_t offset, unsigned char *data)
{
	Session *sess = m_sess; 
	if (!sess)
	{
		SetCloseAndDelete();
		return;
	}
	
	Peer *peer = GetPeer();
	
	size_t length = peer ? peer -> GotSlice(piece, offset) : 0;
	
	if (length)
	{
		// Trafic Log
		std::string sMl;
		sMl.append("R ");
		// Local ip @
		sMl.append(m_sess->GetLocalIpAdr());
		sMl.append(" ");
		// Remote ip @
		sMl.append(this->GetRemoteAddress());
		sMl.append(" ");
		// Number of hops to the remote ip @
		std::ostringstream oss;
		oss<<this->m_peer->GetNumberOfHops();
		sMl.append(oss.str());
		sMl.append(" ");
		 // Number of bytes received from the remote peer
		std::ostringstream oss2;
		oss2<<length;
		sMl.append(oss2.str());
		sMl.append("\n");
		if(ACTIVATE_LOG)
		{	
			sess->AddDBytesToTrafficMatrix(this->GetRemoteAddress(), length);
			sess ->matrix_log->add_line(sMl,false);
		}
		sess -> SaveSlice(piece, offset, length, data);
		sess -> SetCheckComplete();
		//TOVERIFY
		sess -> GenerateRequest(peer);
	}
	else
	{
		char sMessage[100];
		sprintf(sMessage,  "(%d)cmdPiece: no length for slice write", m_id);
		if(ACTIVATE_LOG)
			this->pSocket_log->add_line(sMessage,true);
		
	}
}
开发者ID:amirkrifa,项目名称:BitHoc,代码行数:53,代码来源:pSocket.cpp


示例8: wxT

void wxSlider::SetValue(int value)
{
    if ( m_macValueStatic )
    {
        wxString valuestring;
        valuestring.Printf( wxT("%d"), value );
        m_macValueStatic->SetLabel( valuestring );
    }

    // We only invert for the setting of the actual native widget
    GetPeer()->SetValue( ValueInvertOrNot( value ) );
}
开发者ID:chromylei,项目名称:third_party,代码行数:12,代码来源:slider_osx.cpp


示例9: GetPeer

	bool DarkNetwork::TryDispatchPackets(Packet &pck)
	{
		bool packet_dispatched = false;
		Peer *peer = GetPeer(pck.address);
		if (peer)
		{
			peer->SetInputBuffer(pck.buff);
			packet_dispatched = true;
		}

		return packet_dispatched;
	}
开发者ID:codinpsycho,项目名称:DarkNet,代码行数:12,代码来源:DarkNetwork.cpp


示例10: GetPeer

wxWindow *wxButton::SetDefault()
{
    wxWindow *btnOldDefault = wxButtonBase::SetDefault();

    if ( btnOldDefault )
    {
        btnOldDefault->GetPeer()->SetDefaultButton( false );
    }

    GetPeer()->SetDefaultButton( true );

    return btnOldDefault;
}
开发者ID:madnessw,项目名称:thesnow,代码行数:13,代码来源:button_osx.cpp


示例11: GetAccount

CClient::~CClient()
{
	bool bWasChar;

	// update ip history
#ifndef _MTNETWORK
	HistoryIP& history = g_NetworkIn.getIPHistoryManager().getHistoryForIP(GetPeer());
#else
	HistoryIP& history = g_NetworkManager.getIPHistoryManager().getHistoryForIP(GetPeer());
#endif
	if ( GetConnectType() != CONNECT_GAME )
		history.m_connecting--;
	history.m_connected--;

	bWasChar = ( m_pChar != NULL );
	CharDisconnect();	// am i a char in game ?
	Cmd_GM_PageClear();

	// Clear containers (CTAG and TOOLTIP)
	m_TagDefs.Empty();
	m_TooltipData.Clean(true);

	CAccount * pAccount = GetAccount();
	if ( pAccount )
	{
		pAccount->OnLogout(this, bWasChar);
		m_pAccount = NULL;
	}

	if (m_pPopupPacket != NULL)
	{
		delete m_pPopupPacket;
		m_pPopupPacket = NULL;
	}

	if (m_net->isClosed() == false)
		g_Log.EventError("Client being deleted without being safely removed from the network system\n");
}
开发者ID:MortalROs,项目名称:Source,代码行数:38,代码来源:CClient.cpp


示例12: GetPeer

void pSocket::cmdUnchoke()
{
	Peer *peer = GetPeer();
	char sMessage[100];
	sprintf(sMessage, ">(%d)Unchoke", m_id);
	if(ACTIVATE_LOG)
		this->pSocket_log->add_line(sMessage,true);
	
	if (peer)
	{
		peer -> SetChoked(false);
		peer -> RequestAvailable();
	}
}
开发者ID:amirkrifa,项目名称:BitHoc,代码行数:14,代码来源:pSocket.cpp


示例13: GetPeer

// This function returns a local reference
jobject
AwtMenuItem::GetFont(JNIEnv *env)
{
    jobject self = GetPeer(env);
    jobject target = env->GetObjectField(self, AwtObject::targetID);
    jobject font = JNU_CallMethodByName(env, 0, target, "getFont_NoClientCode", "()Ljava/awt/Font;").l;

    if (font == NULL) {
        font = env->NewLocalRef(GetDefaultFont(env));
    }

    env->DeleteLocalRef(target);
    return font;
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:15,代码来源:awt_MenuItem.cpp


示例14: sprintf

void pSocket::cmdNotinterested()
{
	char sMessage[100];
	sprintf(sMessage, ">(%d)Notinterested", m_id);
	if(ACTIVATE_LOG)
		this->pSocket_log->add_line(sMessage,true);

	Peer *peer = GetPeer();
	if (peer)
		peer -> SetInterested(false);
	// We have modified the choking algorithm 
	//if (!m_choke)
	//	SendChoke(true);
}
开发者ID:amirkrifa,项目名称:BitHoc,代码行数:14,代码来源:pSocket.cpp


示例15: wxCHECK_RET

void wxChoice::DoDeleteOneItem(unsigned int n)
{
    wxCHECK_RET( IsValid(n) , wxT("wxChoice::Delete: invalid index") );

    if ( HasClientObjectData() )
        delete GetClientObject( n );

    m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( n ) );

    m_strings.RemoveAt( n ) ;
    m_datas.RemoveAt( n ) ;
    GetPeer()->SetMaximum( GetCount() ) ;

}
开发者ID:NullNoname,项目名称:dolphin,代码行数:14,代码来源:choice_osx.cpp


示例16: if

void AwtScrollPane::PostScrollEvent(int orient, int scrollCode, int pos) {
    if (scrollCode == SB_ENDSCROLL) {
	return;
    }

    // convert Windows scroll bar ident to peer ident
    jint jorient;
    if (orient == SB_VERT) {
	jorient = java_awt_Adjustable_VERTICAL;
    } else if (orient == SB_HORZ) {
	jorient = java_awt_Adjustable_HORIZONTAL;
    } else {
	DASSERT(FALSE);
	return;
    }

    // convert Windows scroll code to adjustment type and isAdjusting status
    jint jscrollcode;
    jboolean jadjusting = JNI_FALSE;
    switch (scrollCode) {
      case SB_LINEUP:
	  jscrollcode = java_awt_event_AdjustmentEvent_UNIT_DECREMENT;
	  break;
      case SB_LINEDOWN:
	  jscrollcode = java_awt_event_AdjustmentEvent_UNIT_INCREMENT;
	  break;
      case SB_PAGEUP:
	  jscrollcode = java_awt_event_AdjustmentEvent_BLOCK_DECREMENT;
	  break;
      case SB_PAGEDOWN:
	  jscrollcode = java_awt_event_AdjustmentEvent_BLOCK_INCREMENT;
	  break;
      case SB_THUMBTRACK:
	  jscrollcode = java_awt_event_AdjustmentEvent_TRACK;
	  jadjusting = JNI_TRUE;
	  break;
      case SB_THUMBPOSITION:
	  jscrollcode = java_awt_event_AdjustmentEvent_TRACK;
	  break;
      default:
	  DASSERT(FALSE);
	  return;
    }

    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
    env->CallVoidMethod(GetPeer(env), AwtScrollPane::postScrollEventID,
			jorient, jscrollcode, (jint)pos, jadjusting);
    DASSERT(!safe_ExceptionOccurred(env));
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:49,代码来源:awt_ScrollPane.cpp


示例17: GetPeer

MsgRouting
AwtChoice::WmNotify( UINT notifyCode )
{
    if ( notifyCode == CBN_SELCHANGE ) {
        JNIEnv *env;
        if ( JVM->AttachCurrentThread( (void **)&env, 0 ) != 0 ) {
            return mrDoDefault; // ?
        }
        env->CallVoidMethod( GetPeer(),
                             WCachedIDs.PPCChoicePeer_handleActionMID,
                             SendMessage( CB_GETCURSEL ) );
        ASSERT( !env->ExceptionCheck() );
    }
    return mrDoDefault;
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:15,代码来源:PPCChoicePeer.cpp


示例18: JNU_CallMethodByName

jobject AwtChoice::PreferredItemSize(JNIEnv *env)
{
    jobject dimension = JNU_CallMethodByName(env, NULL, GetPeer(env),
					     "preferredSize",
					     "()Ljava/awt/Dimension;").l;
    DASSERT(!safe_ExceptionOccurred(env));
    if (dimension == NULL) {
	return NULL;
    }
    /* This size is window size of choice and it's too big for each
     * drop down item height.
     */
    env->SetIntField(dimension, AwtDimension::heightID,
		       GetFontHeight(env));
    return dimension;
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:16,代码来源:awt_Choice.cpp


示例19: wxStripMenuCodes

void wxMenuItem::UpdateItemText()
{
    if ( !m_parentMenu )
        return ;

    wxString text = wxStripMenuCodes(m_text, m_parentMenu != NULL && m_parentMenu->GetNoEventsMode() ? wxStrip_Accel : wxStrip_All);
    if (text.IsEmpty() && !IsSeparator())
    {
        wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));
        text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC);
    }

    wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ;
    GetPeer()->SetLabel( text, entry );
    delete entry ;
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:16,代码来源:menuitem_osx.cpp


示例20: GetPeer

/*
 * There currently is no good place to cache java.awt.Dimension field
 * ids. If this method gets called a lot, one such place should be found.
 * -- br 07/18/97.
 */
jobject AwtList::PreferredItemSize(JNIEnv *env)
{
    jobject peer = GetPeer(env);
    jobject dimension = JNU_CallMethodByName(env, NULL, peer, "preferredSize",
                                             "(I)Ljava/awt/Dimension;",
                                             1).l;

    DASSERT(!safe_ExceptionOccurred(env));
    if (dimension == NULL) {
        return NULL;
    }
    /* This size is too big for each item height. */
    (env)->SetIntField(dimension, AwtDimension::heightID, GetFontHeight(env));

    return dimension;
}
开发者ID:Gustfh,项目名称:jdk8u-dev-jdk,代码行数:21,代码来源:awt_List.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetPeiServicesTablePointer函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPciAddress函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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