Ejemplo n.º 1
0
ProgressBar::ProgressBar()
{
    SetClassName(_T("ProgressBar"));
    SetAutoDelete(false);

    SetHeight(24);
    SetWidth(60);

    SmallChange(0);
    SetValue(10);

    SetAutoDelete(true);
}
CCommanderStatusPanel::CCommanderStatusPanel(const char *pElementName) :
	CHudElement(pElementName), BaseClass( NULL, "CCommanderStatusPanel" )
{
	m_hFont = m_hFontText = 0;
	m_nLeftEdge = 0;
	m_nBottomEdge = 0;
	
	SetBgColor( Color( 0, 0, 0, 100 ) );

	// hogsy start
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent(pParent);

	SetHiddenBits(HIDEHUD_MISCSTATUS);
	// hogsy end

	// we need updating
	//vgui::ivgui()->AddTickSignal( GetVPanel() );

	InternalClear();

	// hogsy start
	SetAutoDelete(false);
	SetLeftBottom(0, 1 - 10);
	// hogsy end
}
BOOL CxResLibImgList::OnInit( void )
{
	//
	SetAutoDelete(TRUE);
	//图片模式
	if ( !SetImageMode() ) return FALSE;
	//背景色
//	m_crCanvasBk = Color::LightGreen;
	//图片尺寸、间距、透明色
	InitImageLayout(90, 100, 1, 1, 42, 42);
	SetFont(NULL);

	//
	COLORREF clr = RGB(m_crCanvasBk.GetR(), m_crCanvasBk.GetG(), m_crCanvasBk.GetB());
	SetBkColor(clr);

	OnLoadStateImage();
	OnLoadTextFont();

	ModifyStyle(DS_3DLOOK, WS_CLIPCHILDREN|WS_CLIPSIBLINGS);
	ModifyStyleEx(WS_EX_CLIENTEDGE, 0);

	m_ToolTip.Create (this);

	m_RMenu.LoadMenu(IDR_RESLIB_LIST_POP);
	CMenu * pPopup = m_RMenu.GetSubMenu(0);
	m_wndDummy.Create(WS_CHILD, CRect(0,0,0,0),this, IDC_RESLIBIMGLIST_DUMMY);
	return TRUE;
}
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : id - 
//			priority - 
//			player - 
//			entity - 
//-----------------------------------------------------------------------------
C_TFBaseHint::C_TFBaseHint( int id, int priority, int entity, HINTCOMPLETIONFUNCTION pfn /*=NULL*/ )
	: vgui::Panel( NULL, "TFBaseHint" ), m_CursorNone( vgui::dc_none )
{
	m_pObject = NULL;
	m_pClearLabel = NULL;
	m_pCaption = NULL;
	m_pfnCompletion = pfn;

	// Child of main panel
	SetParent( VGui_GetClientDLLRootPanel() );
	
	// Put at top of z-order (happens in Think, too)
//	MoveToFront();

	// No cursor
	SetCursor( m_CursorNone );
	// Set to default size
	SetSize( TFBASEHINT_DEFAULT_WIDTH, TFBASEHINT_DEFAULT_HEIGHT );
	// We'll expressly delete it
	SetAutoDelete( false );

	// Set up default values
	SetID( id );
	SetPriority( priority );
	SetEntity( entity );
	SetCompleted( false );
	// Target panel
	m_hTarget		= NULL; 
	
	m_bMoving		= false;
	m_flMoveRemaining	= 0.0f;
	m_flMoveTotal		= 0.0f;

	for ( int pt = 0; pt < 2; pt++ )
	{
		m_nMoveStart[ pt ] = 0;
		m_nMoveEnd[ pt ] = 0;
	}

	vgui::ivgui()->AddTickSignal( GetVPanel() );

	// Create clear label
	m_pClearLabel = new vgui::Label( this, "CLEAR", "[Enter] to remove, [Enter] twice quickly to remove all..." );
	m_pClearLabel->SetContentAlignment( vgui::Label::a_west );
	m_pClearLabel->SetTextInset( 3, 2 );

	// Create window caption
	m_pCaption = new vgui::Label( this, "CAPTION", "" );
	m_pCaption->SetContentAlignment( vgui::Label::a_west );
	m_pCaption->SetTextInset( 3, 0 );

	// See if the hint started out complete!
	CheckForCompletion();

	// Always start out hidden
	SetVisible( false );
}
Ejemplo n.º 5
0
void ScrollBar::DoScroll(bool bUpdate)
{
    bool bAutoDel = SetAutoDelete(false);
    suic::ElementPtr ePtr(this);

    if (Scroll)
    {
        ui::ScrollEventArg scrollEvt(_scroInfo.iVisualPos);

        Scroll(ePtr, scrollEvt);
    }

    if (bUpdate)
    {
        UpdateScrollBar();
    }
    
    InvalidateVisual();
    SetAutoDelete(bAutoDel);
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CHudMortar::CHudMortar( const char *pElementName ) :
	CHudElement( pElementName ), vgui::Panel( NULL, pElementName )
{
	m_flPower = 0;
	m_flFiringPower = 0;
	m_flFiringAccuracy = 0;
	m_flReset = 0;
	SetPaintBackgroundEnabled( false );
	SetAutoDelete( false );
	SetName( "mortar" );
}
Ejemplo n.º 7
0
//-----------------------------------------------------------------------------
// Purpose:
// Output :
//-----------------------------------------------------------------------------
CHudPlayerOverlay::CHudPlayerOverlay( vgui::Panel *parent, const char *panelName )
    : BaseClass( parent, "CHudPlayerOverlay" )
{
    m_pHealth	= 0;
    m_pName		= 0;
    m_pClass	= 0;
    m_pSquad	= 0;
    m_pSelected = 0;

    SetAutoDelete( false );

    m_hPlayer = NULL;
}
Ejemplo n.º 8
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CHudEMP::CHudEMP( const char *pElementName ) :
	CHudElement( pElementName ), vgui::Panel( NULL, pElementName )
{
	m_pEMPIcon = NULL;
	m_pFrameVar = NULL;
	m_flNextFrameChange = 0.0f;
	m_nNumFrames = 1;
	//SetPaintBackgroundEnabled( false );
	SetAutoDelete( false );
	SetName( "emp" );
	
	SetHiddenBits( HIDEHUD_HEALTH );
}
Ejemplo n.º 9
0
CUIListItemServer::CUIListItemServer()
{
	AttachChild					(&m_icon);
	m_icon.AttachChild			(&m_iconPass);
	m_icon.AttachChild			(&m_iconDedicated);
	m_icon.AttachChild			(&m_iconPunkBuster);
	AttachChild					(&m_server);
	AttachChild					(&m_map);
	AttachChild					(&m_game);
	AttachChild					(&m_players);
	AttachChild					(&m_ping);
	AttachChild					(&m_version);
	SetAutoDelete				(false);
}
Ejemplo n.º 10
0
Looper::Looper( const char *name, int port )
: Thread( name ), m_port(port)
{
   SetAutoDelete( true );

   int ok = smk_create_port( m_port, tid() );

   if ( ok != 0 ) 
   {
   	ok = smk_new_port( tid() );
	m_port = ok;
   }
   
}
Ejemplo n.º 11
0
/** When constructing a Looper using this constructor, you can specify
 * which IPC port the Looper should listen to. If it is unable to 
 * acquire the specified port, then the first available port is used
 * instead.
 *
 * During construction, the auto-delete feature of the derived Thread
 * class is set to true.
 *
 * The default name for a Looper Thread is "_looper".
 */
Looper::Looper( int port )
: Thread( "_looper" ), m_port(port)
{
   SetAutoDelete( true );
  
   int ok = smk_create_port( m_port, tid() );

   if ( ok != 0 ) 
   {
   	ok = smk_new_port( tid() );
	m_port = ok;
   }

}
Ejemplo n.º 12
0
    void OnStart()
    {
        mpStream = DoStream();

        if (mCancel)
        {
            SetAutoDelete(true);
            NGL_LOG(_T("nuiAsyncIStream::Handler"), NGL_LOG_DEBUG, _T("Cancel (auto delete thread)"));
            return;
        }

        nuiNotification* pNotif = new nuiNotification(_T("nuiAsyncIStream_Handler"));
        pNotif->SetToken(new nuiToken<nuiCommand*>(this, true));
        App->Post(pNotif);
        NGL_LOG(_T("nuiAsyncIStream::Handler"), NGL_LOG_DEBUG, _T("Posted notification"));
    }
Ejemplo n.º 13
0
CUIListItem::CUIListItem(void)
{
	m_eButtonState = BUTTON_NORMAL;
	m_ePressMode = NORMAL_PRESS;

	m_bButtonClicked = false;

	m_pData = NULL;

	m_iIndex = -1;
	m_iValue = 0;
	m_bHighlightText = false;
	m_iGroupID = -1;
	SetAutoDelete(true);
	SetTextAlignment(CGameFont::alLeft);
}
Ejemplo n.º 14
0
VideoPanel::VideoPanel( unsigned int nXPos, unsigned int nYPos, unsigned int nHeight, unsigned int nWidth, vgui::VPANEL pParent ) : 
	BaseClass( NULL, "VideoPanel" ),
	m_BIKHandle( BIKHANDLE_INVALID ),
	m_nPlaybackWidth( 0 ),
	m_nPlaybackHeight( 0 )
{
	
	if (pParent == NULL)
	{
		SetParent( enginevgui->GetPanel( PANEL_GAMEUIDLL ) );
	}
	else
	{
		SetParent( pParent );
	}
	
	SetVisible( false );

	m_czLastFile[0] = '\0';
	m_bPlaying = false;
	m_bRepeat = false;

	m_bBlackBackground = true;

	SetKeyBoardInputEnabled( true );
	SetMouseInputEnabled( false );

	SetProportional( false );
	SetVisible( true );
	SetPaintBackgroundEnabled( false );
	SetPaintBorderEnabled( false );
	SetAutoDelete( true );
	
	// Set us up
	SetTall( nHeight );
	SetWide( nWidth );
	SetPos( nXPos, nYPos );

	SetScheme(vgui::scheme()->LoadSchemeFromFile( "resource/VideoPanelScheme.res", "VideoPanelScheme"));
	LoadControlSettings("resource/UI/VideoPanel.res");
}
Ejemplo n.º 15
0
CUIAnswerItem::CUIAnswerItem			(CUIXml* xml_doc, LPCSTR path)
{
	m_text							= xr_new<CUITextWnd>();m_text->SetAutoDelete(true);
	m_name							= xr_new<CUITextWnd>();m_name->SetAutoDelete(true);
	AttachChild						(m_text);
	AttachChild						(m_name);

	string512						str;
	CUIXmlInit						xml_init;

	xr_strcpy							(str,path);
	xml_init.InitWindow				(*xml_doc, str, 0, this);

	m_min_height					= xml_doc->ReadAttribFlt(path,0,"min_height",15.0f);
	m_bottom_footer					= xml_doc->ReadAttribFlt(path,0,"bottom_footer",0.0f);
	strconcat						(sizeof(str),str,path,":content_text");
	xml_init.InitTextWnd			(*xml_doc, str, 0, m_text);

	strconcat						(sizeof(str),str,path,":name_caption");
	xml_init.InitTextWnd				(*xml_doc, str, 0, m_name);
	SetAutoDelete					(true);
}
CShaderPrecache::CShaderPrecache( vgui::Panel *parent, CNodeView *nodeview ) : BaseClass( parent, nodeview, "shaderpreview" )
{
	m_pPanelList_Shader = new PanelListPanel( this, "shaderlist" );
	m_pPanelList_Shader->SetFirstColumnWidth( 300 );

	m_pCheck_ReloadCache = new CheckButton( this, "check_reloadcache", "Reload cache on close" );

	LoadControlSettings("shadereditorui/vgui/shadereditor_shaderprecache.res");

	SetTitle("Shader precache",true);

	SetAutoDelete( true );
	SetSizeable(false);

	int sx, sy;
	surface()->GetScreenSize( sx, sy );
	SetSize( 480, sy * 0.8f );

	DoModal();

	LoadList();
}
Ejemplo n.º 17
0
RingDockSite::RingDockSite(RingBaseWnd* parent,DWORD state/*=TBS_FLAG_DOCKTOP*/)
{
	m_windowType = ITIS_DOCKSITE;
	SetParentObj(parent);
	SetAutoDelete();

	m_SplitterSize = RING_SPLITERSIZE;

   RtlZeroMemory(&m_Background,sizeof(BARBMPINFO));
	m_First = m_Curr = NULL;
	m_nChild = 0;
	m_CaptureBar = NULL;

	if(state > TBS_FLAG_DOCKRIGHT || state < TBS_FLAG_DOCKTOP)
		state = TBS_FLAG_DOCKTOP;

	m_State = state;

	RingWnd* temp = (RingWnd*)m_parent;
	temp->GetClientRect(&m_rcPos);
	RECT rc;
	::GetClientRect(m_parent->Handle(),&rc);

	m_windowInfo.hCursor = LoadCursor(NULL,IDC_ARROW);

   switch(m_State)
	{
		case TBS_FLAG_DOCKTOP:
			m_rcPos.left = 0;
			m_rcPos.right = rc.right;
			m_rcPos.bottom = 0;			
			m_cursor = LoadCursor(NULL,IDC_SIZENS);
			m_cursorLine = LoadCursor(NULL,IDC_SIZEWE);
			break;
		case TBS_FLAG_DOCKBOTTOM:
			m_rcPos.left = 0;
			m_rcPos.right = rc.right;
			m_rcPos.top = m_rcPos.bottom;
			m_cursor = LoadCursor(NULL,IDC_SIZENS);
			m_cursorLine = LoadCursor(NULL,IDC_SIZEWE);
			break;
		case TBS_FLAG_DOCKLEFT:
			m_rcPos.right = 0;
			m_cursor = LoadCursor(NULL,IDC_SIZEWE);
			m_cursorLine = LoadCursor(NULL,IDC_SIZENS);
			break;
		case TBS_FLAG_DOCKRIGHT:
			m_rcPos.left = m_rcPos.right;
			m_cursor = LoadCursor(NULL,IDC_SIZEWE);
			m_cursorLine = LoadCursor(NULL,IDC_SIZENS);
			break;
	}

	if(temp->m_dockSite)
		for(int i=0;i<4;i++)
			if(temp->m_dockSite[i] && temp->m_dockSite[i]->m_Background.hBrush)
			{
				//SetBgBmp(temp->m_dockSite[i]->m_Background.hbmp);
				m_Background = temp->m_dockSite[i]->m_Background;
				m_Background.bNeedDelete = FALSE;
				break;
			}
}
Ejemplo n.º 18
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CHudOrder::CHudOrder( int x,int y,int wide,int tall ) : vgui::Panel( NULL, "CHudOrder")
{
	SetBounds( x, y, wide, tall );
	SetAutoDelete( false );
	m_pOrder = NULL;
}
Ejemplo n.º 19
0
CDialog_GeneralConfig::CDialog_GeneralConfig( CNodeView *n, Panel *parent ) : Frame( parent, "_config" )
{
	pNodeView = n;
	GenericShaderData *setup = &n->GetDataForModify();

	SetSizeable( false );
	SetVisible( true );

	SetMouseInputEnabled( true );
	SetKeyBoardInputEnabled( true );
	SetAutoDelete( true );
	Activate();

	m_pRadBut_Sm2 = new RadioButton( this, "rad_1", "SM 2.0b" );
	m_pRadBut_Sm3 = new RadioButton( this, "rad_2", "SM 3.0" );
	m_pRadBut_Sm2->SetSubTabPosition( 1 );
	m_pRadBut_Sm3->SetSubTabPosition( 1 );

	m_pCBut_DepthTest = new CheckButton( this, "depthtest", "Depth testing" );
	m_pCBut_DepthWrite = new CheckButton( this, "depthwrite", "Depth writing" );
	m_pCBut_sRGBWrite = new CheckButton( this, "srgbwrite", "write sRGB" );

	m_pCBox_AlphaBlend = new ComboBox( this, "alphablend", numAblendModes, false );
	
	for ( int i = 0; i < numAblendModes; i++ )
		m_pCBox_AlphaBlend->AddItem( blendNames[i], NULL );

	Assert( numAblendModes == m_pCBox_AlphaBlend->GetItemCount() );

	m_pCBox_Cullmode = new ComboBox( this, "cullmode", 5, false );
	m_pCBox_Cullmode->AddItem( "CW", NULL );
	m_pCBox_Cullmode->AddItem( "CCW", NULL );
	//m_pCBox_Cullmode->AddItem( "Double", NULL );
	m_pCBox_Cullmode->AddItem( "Off", NULL );

	LoadControlSettings("shadereditorui/vgui/dialog_config.res");

	if ( setup->shader->iShaderModel == SM_30 )
		m_pRadBut_Sm3->SetSelected( true );
	else
		m_pRadBut_Sm2->SetSelected( true );

	m_pCBut_DepthTest->SetSelected( setup->shader->iDepthtestmode == DEPTHTEST_NORMAL );
	m_pCBut_DepthWrite->SetSelected( setup->shader->iDepthwritemode == DEPTHWRITE_NORMAL );
	m_pCBox_Cullmode->ActivateItem( setup->shader->iCullmode );
	m_pCBut_sRGBWrite->SetSelected( setup->shader->bsRGBWrite );

	for ( int i = 0; i < numAblendModes; i++ )
	{
		if ( blendIDx[i] == setup->shader->iAlphablendmode )
		{
			m_pCBox_AlphaBlend->ActivateItem( i );
			break;
		}
	}

	SetTitle( "Shader settings", true );


	DoModal();

	SetDeleteSelfOnClose( true );
}