void CPropertiesWnd::OnSize(UINT nType, int cx, int cy)
{
	CDockablePane::OnSize(nType, cx, cy);

	AdjustLayout();
}
示例#2
0
void xTerrainPane::OnSize(UINT nType, int cx, int cy)
{
	CDockablePane::OnSize(nType, cx, cy);
	AdjustLayout();
}
示例#3
0
void CFileView::OnSize(UINT nType, int cx, int cy)
{
	CDockablePane::OnSize(nType, cx, cy);
	AdjustLayout();
}
示例#4
0
void CComputerListView::OnSize(UINT nType, int cx, int cy) 
{
	CView::OnSize(nType, cx, cy);
	AdjustLayout();
}
示例#5
0
void SceneResource::OnSize(UINT nType, int cx, int cy)
{
	CBCGPDockingControlBar::OnSize(nType, cx, cy);
	AdjustLayout();
}
示例#6
0
void CDxMonthPicker::OnSize(UINT nType, CSize)
{
    CRect rcClient;
    GetRect(rcClient);
    AdjustLayout(rcClient);
}
//***************************************************************************
BOOL CBCGPDAOGridCtrl::OpenSQL (LPCTSTR lpszSQL)
{
	try
	{
		ASSERT (lpszSQL != NULL);
		m_strSQL.Empty ();

		RemoveAll ();

		if (!m_bIsSorting)
		{
			DeleteAllColumns ();
		}
		
		if (m_pDataBase == NULL)
		{
			ASSERT (FALSE);
			return FALSE;
		}

		ASSERT_VALID (m_pDataBase);

		if (!m_pDataBase->IsOpen ())
		{
			ASSERT (FALSE);
			return FALSE;
		}

		if (m_pRecordSet != NULL)
		{
			ASSERT_VALID (m_pRecordSet);

			if (m_pRecordSet->IsOpen ())
			{
				m_pRecordSet->Close ();
			}

			delete m_pRecordSet;
			m_pRecordSet = NULL;
		}

		//---------------------------------------------------------
		// Create a new record set and open it using SQL statement:
		//---------------------------------------------------------
		m_pRecordSet = new CDaoRecordset (m_pDataBase);
		m_pRecordSet->Open (dbOpenDynaset, lpszSQL);

		if (!m_pRecordSet->IsOpen ())
		{
			return FALSE;
		}

		int nColumns = 0;

		if (!m_bIsSorting)
		{
			//-------------
			// Add columns:
			//-------------
			CStringList lstField;
			if (!GetFieldList (lstField))
			{
				return FALSE;
			}

			int nColumn = 0;
			for (POSITION pos = lstField.GetHeadPosition (); pos != NULL; nColumn++)
			{
				InsertColumn (nColumn, lstField.GetNext (pos), 50);
			}

			nColumns = (int) lstField.GetCount ();
		}
		else
		{
			nColumns = GetColumnCount (); 
		}

		if (nColumns == 0)
		{
			// No columns
			AdjustLayout ();
			return TRUE;
		}

		//-------------
		// Add records:
		//-------------
		if (m_pRecordSet->IsEOF () && m_pRecordSet->IsBOF ())
		{
			// The table is empty
			AdjustLayout ();
			return TRUE;
		}

		if (m_bVirtualMode)
		{
			while (!m_pRecordSet->IsEOF ())
			{
				m_pRecordSet->MoveNext ();
			}

			SetVirtualRows (max (0, m_pRecordSet->GetRecordCount ()));
		}		
		else
		{
			for (int nRow = 0; !m_pRecordSet->IsEOF (); 
				m_pRecordSet->MoveNext (), nRow++)
			{
				CBCGPGridRow* pRow = CreateRow (nColumns);
				ASSERT_VALID (pRow);

				for (int nColumn = 0; nColumn < nColumns; nColumn++)
				{
					OnAddData (pRow, nColumn, nRow);
				}

				if (OnBeforeAddRow (pRow, nRow))
				{
					AddRow (pRow, FALSE);
				}
				else
				{
					delete pRow;
				}
			}
		}

		if (!m_pRecordSet->CanUpdate ())
		{
			SetReadOnly ();
		}
	}
	catch (CDaoException* pEx)
	{
		OnDaoException (pEx);
		pEx->Delete ();

		return FALSE;
	}

	m_strSQL = lpszSQL;
	AdjustLayout ();
	return TRUE;
}
示例#8
0
void CFileView::OnSize(UINT nType, int cx, int cy)
{
	_MyBase::OnSize(nType, cx, cy);
	AdjustLayout();
}
//*****************************************************************************
void CBCGPCaptionBar::RemoveText ()
{
	m_strText.Empty ();
	AdjustLayout ();
}
//*****************************************************************************
void CBCGPCaptionBar::RemoveBitmap ()
{
	m_Bitmap.Clear ();

	AdjustLayout ();
}
//*****************************************************************************
void CBCGPCaptionBar::RemoveIcon ()
{
	m_hIcon = NULL;
	AdjustLayout ();
}
//*****************************************************************************
void CBCGPCaptionBar::RemoveButton ()
{
	m_strBtnText.Empty ();
	AdjustLayout ();
}