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


C++ GetPeer函数代码示例

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


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


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