BOOL CStudentDemoListDlg::OnInitDialog()
{
	CElcSkinDialog::OnInitDialog();

	AdjustImagePanePos(IDC_IMAGE_PANE);
	BindButton(IDC_BTN_HELP);
	BindButton(ID_BTN_OK);
	BindButton(ID_BTN_CANCEL);
	BindPictureCtrl(IDC_STUDENT_DEMO_ICON, IDR_RT_STUDENT_DEMO);

	if (!GetParent()) {
		SetParent(m_pWndParent);
		SetOwner(m_pWndParent);
	}

	CString strText;
	strText.LoadString(IDS_DEMO_TO_ALL);
	m_wndListType.InsertString(0, strText);
	strText.LoadString(IDS_DEMO_TO_STUDENT);
	m_wndListType.InsertString(1, strText);
	strText.LoadString(IDS_DEMO_TO_GROUP);
	m_wndListType.InsertString(2, strText);
	m_wndListType.SetCurSel(0);

	m_wndAvailableList.EnableCheck(IDB_STATE_IMAGE_LIST16);
	m_wndAvailableList.EnableSelect(TRUE);

	m_nSelectType = DEMO_TO_ALL;
	GetDlgItem(IDC_CHK_SELECT_ALL)->EnableWindow(m_nSelectType != DEMO_TO_ALL);
	InitAvailableList(m_nSelectType);
	UpdateButtonState();

	if (m_pTeacherFrame) {
		DWORD dwCallbackMask;
		dwCallbackMask =  ITeacherFrame::ELC_MEMBER_CONNECTED
						| ITeacherFrame::ELC_MEMBER_DISCONNECTED
						| ITeacherFrame::ELC_MEMBER_NAMECHANGED
						| ITeacherFrame::ELC_EXIT;
		m_pTeacherFrame->RegisterCallback(dwCallbackMask, this, NULL);
	}

	if (m_pDemoMemberInfo) {
		GetWindowText(strText);
		strText += (CString)_T(" [") + m_pDemoMemberInfo->szDefaultName + (CString)_T("] ");
		SetWindowText(strText);
	}

	return TRUE;
}
bool ProxyPasswordDialog::Create( wxWindow* parent, wxWindowID WXUNUSED(id), const wxString& WXUNUSED(caption), const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), long WXUNUSED(style) )
{
////@begin ProxyPasswordDialog creation
    SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);
    SetParent(parent);
    CreateControls();
    SetIcon(GetIconResource(wxT("res/nx.png")));
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
////@end ProxyPasswordDialog creation
    return true;
}
Beispiel #3
0
Edge::Edge(const string& aName, Elem* aMan, MEnv* aEnv): Elem(aName, aMan, aEnv), iPoint1(NULL), iPoint2(NULL)
{
    if (!iInit) 
	Init();
    SetEType(Type(), Elem::PEType());
    SetParent(Type());
    // Adding properties "Points"
    Elem* p1 = Provider()->CreateNode("Prop", "P1", this, iEnv);
    Elem* p2 = Provider()->CreateNode("Prop", "P2", this, iEnv);
    __ASSERT(p1 != NULL && p2 != NULL);
    TBool res = AppendComp(p1);
    __ASSERT(res);
    res = AppendComp(p2);
    __ASSERT(res);
}
Beispiel #4
0
Control::Control(Control *newParent)
{
    wantedInputBits = 0;
    stateBits = 0;
    zOrder = 0;
    parent = NULL;
    hwndParent = NULL;
    layout = NULL;
    hCursor = NULL;
    cachedStyle = NULL;
    SetStyle(NULL);
    pos = Rect();
    if (newParent)
        SetParent(newParent);
}
Beispiel #5
0
//--------------------------------------------------------------------
void CForm::Create( IGUIControl* p_pParent, int p_nLeft, int p_nTop,
                    CBitmap& p_Bitmap )
{
    IGUIControl::Create();
    SetParent( p_pParent );
    SetLeft( p_nLeft );
    SetTop( p_nTop );
    SetBG( p_Bitmap );
    SetWidth( p_Bitmap.Width() );
    SetHeight( p_Bitmap.Height() );
    if( m_pColor == NULL )
    {
        SetFontColor( *(new CColor( CColor::WHITE )) );
    }
}
bool SupressibleMessageDialog::Create( wxWindow* parent, wxWindowID, const wxString&, const wxPoint&, const wxSize&, long)
{
    ////@begin SupressibleMessageDialog creation
    SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
    SetParent(parent);
    CreateControls();
    SetIcon(GetIconResource(wxT("res/nx.png")));
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
    ////@end SupressibleMessageDialog creation
    return true;
}
	CGameObject::~CGameObject()
	{
		//	Note, that here we adding children to parent in reverse order, i think it's not that important for now.
		//	That order is not important at all. Overall comment should be removed.
		while (!Children.empty())
			Children.back()->SetParent(Parent);

		SetParent(NULL);

		if (Created)
		{
			Scene->Remove(this);
			DestroyLuaObject();
		}
	}
Beispiel #8
0
bool StringEditorWindow::CreateThis(HWND hParent, u32 windowId)
{
	if ( getHandle() != NULL )
		return SetParent(hParent);

	if ( ClassWindow::RegisterWindowClass(0, NULL, NULL, NULL, NULL, "StringEditor", NULL, false) &&
		 ClassWindow::CreateClassWindow(0, "", WS_VISIBLE|WS_CHILD, 4, 22, 592, 524, hParent, (HMENU)windowId) )
	{
		CreateSubWindows(getHandle());
		RefreshWindow();
		return true;
	}
	else
		return false;
}
Beispiel #9
0
void Window::setParent(Window* parent)
{
	if (!mHWND) {
		mParent = parent; // parent will be used in realize() later on
		mParent->mChildren.push_back(this);
		onParentChanged();
		return;
	}
	// Otherwise, reparent
	LONG currStyle = GetWindowLong(handle(), GWL_STYLE);
	if (parent) {
		SetParent(handle(), parent->handle());
		SETWINDOWLONGPTR(handle(), GWL_STYLE, currStyle | WS_CHILD);
	} else {
		SetParent(handle(), 0);
		SETWINDOWLONGPTR(handle(), GWL_STYLE, currStyle & ~WS_CHILD);
	}
	if (mParent)
		mParent->rebuildChildrenList();
	mParent = parent;
	if (mParent)
		mParent->rebuildChildrenList();
	onParentChanged();
}
Beispiel #10
0
CEntity::~CEntity()
{
#if 0 && defined(NIV_DEBUG)
	CLogFile::Printf("CEntity[%d]::~CEntity()",m_ID);
#endif

	// Remove all children elements
	DeleteAllChildren();

	// remove the parent
	SetParent(NULL);

	// push the entity ID back into the pool
	CEntityIDs::Push(this);
}
Beispiel #11
0
DWORD KGSFXModelPane::UpdateWndState()
{
    KSceneSFXEditorView* pEditView = dynamic_cast<KSceneSFXEditorView*>(m_pDependWnd);
    KG_PROCESS_ERROR(pEditView);

    if (m_dwWndState == SFX_WND_STATE_FREE)
    {
        ModifyStyle(NULL, WS_CAPTION | WS_BORDER | WS_SIZEBOX, SWP_DRAWFRAME);
        RECT rectWnd;
        GetWindowRect(&rectWnd);
        SetParent(NULL);
        MoveWindow(&rectWnd);
    }
    else
    {
        ModifyStyle(WS_CAPTION | WS_BORDER | WS_SIZEBOX, NULL, SWP_DRAWFRAME);
        SetParent(m_pDependWnd);
        MoveWindow(&(pEditView->GetPaneRect(WND_LEFT_PANE)));
    }
    pEditView->m_paneSFXKeyFrame.UpdateWndState();
    pEditView->m_paneSFXMainWnd.UpdateWndState();
Exit0:
    return m_dwWndState;
}
//
//	Name: CGUICommunity
//	Author: Hekar Khani
//	Description: Community portal to news, etc
//	Notes: 
//
CGUICommunity::CGUICommunity( vgui::VPANEL parent ) :
	BaseClass( NULL, "GUICommunity" )
{	
	SetParent( parent );
	vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile( "resource/sourcescheme.res", "sourcescheme" );
	SetScheme( scheme );
	LoadControlSettings( "resource/ui/Community.res" );

	SetVisible( false );
	SetTitle( "#lf_community_title", true );
	SetSizeable( false );

	SetMaximizeButtonVisible( false );
	SetMinimizeButtonVisible( false );
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CDoDHudPlayerStatusPanel::CDoDHudPlayerStatusPanel( const char *pElementName ) : CHudElement( pElementName ), BaseClass( NULL, "HudPlayerStatusPanel" )
{
    SetParent( g_pClientMode->GetViewport() );

    m_pMainBar = new CDoDCutEditablePanel( this, "PlayerStatusMainBackground" );
    m_pAlliesIcon = new ImagePanel( this, "PlayerStatusAlliesIcon" );
    m_pAxisIcon = new ImagePanel( this, "PlayerStatusAxisIcon" );
    m_pAmmoStatus = new CDoDHudAmmo( this, "PlayerStatusAmmo" );
    m_pCurrentWeapon = new CDoDHudCurrentWeapon( this, "PlayerStatusCurrentWeapon" );
    m_pHealthStatus = new CDoDHudHealth( this, "PlayerStatusHealth" );
    m_pStamina = new CDoDHudStamina( this, "PlayerStatusStamina" );
    m_pMGHeat = new CDoDHudMGHeat( this, "PlayerStatusMGHeat" );
    m_pFireSelect = new CDoDHudFireSelect( this, "PlayerStatusFireSelect" );
    m_pTNT = new CDoDHudTNT( this, "PlayerStatusTNT" );
}
Beispiel #14
0
GUIVidget::GUIVidget()
{
	Init();
	SetX(0);
	SetY(0);
	SetWidth(0);
	SetHeight(0);
	SetColor(DEFAULT_CONTROL_COLOR);
	SetVisible(false);
	SetDead(false);
	SetTexture(NULL);
	SetParent((GUIBaseControl*)NULL);
	SetBorder(false);
	SetBorderType(btNone);
}
bool PermutationCounterDlg::Create( wxWindow* parent,
									wxWindowID id,
									const wxString& caption,
									const wxPoint& pos,
									const wxSize& size,
									long style )
{
    m_number = NULL;
    SetParent(parent);
    CreateControls();
    GetSizer()->Fit(this);
    GetSizer()->SetSizeHints(this);
    Centre();
    return true;
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CTFWinPanel::CTFWinPanel( const char *pElementName ) : EditablePanel( NULL, "WinPanel" ), CHudElement( pElementName )
{
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent( pParent );
	m_bShouldBeVisible = false;
	SetAlpha( 0 );
	SetScheme( "ClientScheme" );

	m_pTeamScorePanel = new EditablePanel( this, "TeamScoresPanel" );
	m_flTimeUpdateTeamScore = 0;
	m_iBlueTeamScore = 0;
	m_iRedTeamScore = 0;

	RegisterForRenderGroup( "mid" );
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CDODDeathStatsPanel::CDODDeathStatsPanel( const char *pElementName )
: EditablePanel( NULL, "DeathStats" ), CHudElement( pElementName )
{
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent( pParent );
	SetVisible( false );
	SetAlpha( 0 );
	SetScheme( "ClientScheme" );

	m_pAttackerHistoryLabel = new vgui::Label( this, "AttackerDmgLabel", "..." );
	m_pSummaryLabel = new vgui::Label( this, "LifeSummaryLabel", "..." );

	memset( &m_DeathRecord, 0, sizeof(m_DeathRecord) );

	LoadControlSettings("Resource/UI/DeathStats.res");	
}
Beispiel #18
0
	Node::Node(const Node& node) :
	m_initialRotation(node.m_initialRotation),
	m_rotation(node.m_rotation),
	m_initialPosition(node.m_initialPosition),
	m_initialScale(node.m_initialScale),
	m_position(node.m_position),
	m_scale(node.m_scale),
	m_parent(nullptr),
	m_derivedUpdated(false),
	m_inheritPosition(node.m_inheritPosition),
	m_inheritRotation(node.m_inheritRotation),
	m_inheritScale(node.m_inheritScale),
	m_transformMatrixUpdated(false)
	{
		SetParent(node.m_parent, false);
	}
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CTFFreezePanel::CTFFreezePanel( const char *pElementName )
	: EditablePanel( NULL, "FreezePanel" ), CHudElement( pElementName )
{
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent( pParent );
	SetVisible( false );
	SetScheme( "ClientScheme" );

	m_iKillerIndex = 0;
	m_iShowNemesisPanel = SHOW_NO_NEMESIS;
	m_iYBase = -1;
	m_flShowCalloutsAt = 0;

	m_iBasePanelOriginalX = -1;
	m_iBasePanelOriginalY = -1;
}
Beispiel #20
0
	//--------------------------------------------------------------------
	void CScrollBar::Create(  IGUIControl* p_pParent, int p_nLeft, int p_nTop,
		ENUM_ScrollBarType p_eType, CBitmap& p_Bitmap, int p_nLength )
	{
		IGUIControl::Create();

		SetParent( p_pParent );
		SetLeft( p_nLeft );
		SetTop( p_nTop );
		SetType( p_eType );
		SetLength( p_nLength );
		SetSlider( p_Bitmap );
		if( m_pColor == NULL )
		{
			SetFontColor( *(new CColor( CColor::WHITE )) );
		}
	}
Beispiel #21
0
//---------------------------------------------------------------------------//
// Constructor
//
//---------------------------------------------------------------------------//
CMGControl::CMGControl(CMGControl *pParent, int iX, int iY, int iW, int iH)
{
  m_Parent  = NULL;
  m_Align   = MGALIGN_NONE;
  m_Enabled = true;
  m_Visible = true;
  m_Focused = false;
  m_AddRectAlign = true;
  m_Transparent  = true;
  m_Color = g_pMGDD->Skin()->Color(COL_BASE_BG);
  SetRect   (m_Border, 0,0,0,0);
  SetPos    (iX, iY);
  SetSize   (iW, iH);
  SetParent (pParent);
  m_FreeRect = m_Rect;
}
static PyObject *
FreeCADGui_embedToWindow(PyObject * /*self*/, PyObject *args)
{
    char* pointer;
    if (!PyArg_ParseTuple(args, "s", &pointer))
        return NULL;

    QWidget* widget = Gui::getMainWindow();
    if (!widget) {
        PyErr_SetString(PyExc_Exception, "No main window");
        return 0;
    }

    std::string pointer_str = pointer;
    std::stringstream str(pointer_str);

#if defined(Q_OS_WIN)
    void* window = 0;
    str >> window;
    WId winid = (WId)window;

    LONG oldLong = GetWindowLong(winid, GWL_STYLE);
    SetWindowLong(winid, GWL_STYLE,
    oldLong | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
    //SetWindowLong(widget->winId(), GWL_STYLE,
    //    WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
    SetParent(widget->winId(), winid);

    QEvent embeddingEvent(QEvent::EmbeddingControl);
    QApplication::sendEvent(widget, &embeddingEvent);
#elif defined(Q_WS_X11)
    WId winid;
    str >> winid;

    QX11EmbedWidget* x11 = new QX11EmbedWidget();
    widget->setParent(x11);
    x11->embedInto(winid);
    x11->show();
#else
    PyErr_SetString(PyExc_NotImplementedError, "Not implemented for this platform");
    return 0;
#endif

    Py_INCREF(Py_None);
    return Py_None;
}
SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxString& text ) :
    SCH_HIERLABEL( pos, text, SCH_SHEET_PIN_T )
{
    SetParent( parent );
    wxASSERT( parent );
    m_Layer = LAYER_SHEETLABEL;
    m_Pos   = pos;

    if( parent->IsVerticalOrientation() )
        SetEdge( 2 );
    else
        SetEdge( 0 );

    m_shape = NET_INPUT;
    m_isDangling = true;
    m_number     = 2;
}
//-----------------------------------------------------------------------------
// C_SDKRootPanel implementation.
//-----------------------------------------------------------------------------
C_SDKRootPanel::C_SDKRootPanel( vgui::VPANEL parent )
	: BaseClass( NULL, "SDK Root Panel" )
{
	SetParent( parent );
	SetPaintEnabled( false );
	SetPaintBorderEnabled( false );
	SetPaintBackgroundEnabled( false );

	// This panel does post child painting
	SetPostChildPaintEnabled( true );

	// Make it screen sized
	SetBounds( 0, 0, ScreenWidth(), ScreenHeight() );

	// Ask for OnTick messages
	vgui::ivgui()->AddTickSignal( GetVPanel() );
}
Beispiel #25
0
EHS::EHS ( EHS * ipoParent, ///< parent EHS object for routing purposes
		   std::string isRegisteredAs ///< path string for routing purposes
	) :
	poParent ( NULL ),
	poEHSServer ( NULL ),
	m_poSourceEHS ( NULL )
{

	if ( ipoParent != NULL ) {
		SetParent ( ipoParent, isRegisteredAs );
	}

#ifdef EHS_MEMORY
	fprintf ( stderr, "[EHS_MEMORY] Allocated: EHS\n" );
#endif		

}
bool CActivityAreaCtrl::Create()
{
	for(size_t i = 0; i < ActivityBoxesMaxCount;i++)
	{
		if ( wxGetApp().Prefs.nActBoxType[i] >= 0 && m_ActivityBox[i] == NULL )
		{
			m_ActivityBox[i] = new CActivityBox( m_pPanel, MUSIK_ACTIVITYBOX1 + i, wxGetApp().Prefs.nActBoxType[i] );
			pTopSizer->Add( m_ActivityBox[i], 1, wxEXPAND | wxRIGHT, 1 );
		}
	}

	m_pPanel->Layout();
	//	SetSize( pTopSizer->GetMinSize() );

	SetParent( NULL, false );
	return true;
}
BOOL CSystemTray::RemoveTaskbarIcon(HWND hWnd)
{
    // Create static invisible window
    if (!::IsWindow(m_hWndInvisible))
    {
		m_hWndInvisible = CreateWindowEx(0, "Static", _T(""), WS_POPUP,
				CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
				NULL, 0, NULL, 0);

		if (!m_hWndInvisible)
			return FALSE;
    }

    SetParent(hWnd, m_hWndInvisible);

    return TRUE;
}
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *parent - 
//-----------------------------------------------------------------------------
CDownloadSliderPanel::CDownloadSliderPanel( vgui::VPANEL parent ) :
	BaseClass( NULL , "CDownloadSliderPanel" )
{
	SetParent( parent );
	SetSize( ScreenWidth(), ScreenHeight() );
	SetPos( 0, 0 );
	SetVisible( false );
	SetCursor( null );

	SetFgColor( Color( 0, 0, 0, 255 ) );
	SetPaintBackgroundEnabled( false );

	scr_downloading = (ConVar *)cvar->FindVar( "scr_downloading" );
	assert( scr_downloading );

	vgui::ivgui()->AddTickSignal( GetVPanel(), 250 );
}
ACheatCheatInfoDlg::ACheatCheatInfoDlg(AWindowBase* parent,ACheatEntry* pEntry)
{
	m_editName   = new AEditBox;
	m_editEdit   = new AEditBox;

	m_pEntry = pEntry;
	m_bCurrentDesc = true;

	SetParent(parent);

	m_ModalDialogResultCode = DialogBox(
		GetModuleHandle(0),
		MAKEINTRESOURCE(IDD_EDITCHEATITEM),
		parent->GetHwnd(),
		(DLGPROC)GetWindowThunk()
	);
}
Beispiel #30
0
int main(int argc, char** argv[])
{
    HWND cmd = GetConsoleWindow();
    LONG lStyle = ::GetWindowLong(cmd, GWL_STYLE);
    ::SetWindowLong(cmd, GWL_STYLE, lStyle & ~WS_SYSMENU);
    ::ShowWindow(cmd, SW_SHOW);
    HWND parent = findDesktopIconWnd();

    if (NULL == SetParent(cmd, parent))
    {
        char buf[1024] = {0};
        sprintf(buf, "%d\n", GetLastError());
        OutputDebugString(buf);
    }
    system("pause");
    return 0;
}