CListCtrl/CHeaderCtrl/CFrameWind
Ruben Bartelink SCP24001 -- SCP24001@novell1.rtc-carlow.ie
Thursday, January 18, 1996
[VC22, MFC] [NO V4 yet....]
[Apologies for the repost, but there wasn't even ONE reply last time!]
Regarding the following Classes
1. CMiniFrameWnd
This may be a FAQ, but I can't seem to find any information:
"How does one make/do/use a "CMiniMDIChild" class"
In other words, I need an MDI client with a small title bar ?
I tried using a CMiniFrameWnd as a part of the tripartite
DocTemplate thingy, but (obviously) this has the result of excluding
all MDI child Behaviour from it.
Am I missing something ?? Any assistance would be appreciated!!!
2. CHeaderCtrl/CListCtrl
Does anybody have any ideas whatsoever on where I might get sample
code which uses these controls to produce a Win95 Explorer type
listbox interface. Specifically, having done the CHeaderCtrl - how
does one interlink it into a CListCtrl or CListBox ??
I have grepped the samples - and the DAOVIEW OLE sample uses a
CListCtrl - but not in very much depth. It is more CHeaderCtrl in
which I am interested. If an applicable sample IS in VC4, could
somebody mail it to me privately ??? [Given that I will be
purchasing it within the next month anyway].
3. Totally unrelated [Dave - chop this portion if you like!!!]
Using NT3.51, does anybody know of a patch (or even a problem)
using new PCI EIDE controllers. This causes the machine to crash
periodically at random times. The Service update doesn't seem to
address this problem. On a similar track, does anybody know of the
electronic address of OAK technologies ??
Thanking you in advance for any responses, no matter how short..
Ruben Bartelink email: scp24001@rtc-carlow.ie
BSc Software Engineering
RTC Carlow "The advantage of being Mottoless
Carlow is to be able to make it up as
Ireland one goes along" -- R.B. (1995)
Jeff Wishnie -- jwishnie@swellsoft.com
Saturday, January 20, 1996
>2. CHeaderCtrl/CListCtrl
> Does anybody have any ideas whatsoever on where I might get sample
> code which uses these controls to produce a Win95 Explorer type
> listbox interface. Specifically, having done the CHeaderCtrl - how
> does one interlink it into a CListCtrl or CListBox ??
>
Under MFC 4.0, the CHeaderCtrl is a component part of the CListCtrl, that
is, a standard CListCtrl has a CHeaderCtrl internally. When you get MFC 4.0
look at the Common Controls (cmnctrls I think) sample, it shows how the use
all the new controls (Tree, slider, status bar) including the CListCtrl.
- Jeff
jwishnie@swellsoft.com
415 437-0922 (w)
Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Sunday, January 21, 1996
[Snip->Start()]
2. CHeaderCtrl/CListCtrl
Does anybody have any ideas whatsoever on where I might get sample
code which uses these controls to produce a Win95 Explorer type
listbox interface. Specifically, having done the CHeaderCtrl - how
does one interlink it into a CListCtrl or CListBox ??
[Snip->Stop()]
I browsed David J. Kruglinski's new book this week end and remember seeing an
example
of exatly that. I refrained from purchasing it due mainly to its lack of common
controls coverage.
I'm sure Mike B's book will be a better buy.
In any case look into CListView and CTreeView. That is the way explorer does
it.
It is rather easy once you get the hang of it. Use a splitter window between
the two views,
and upon the tree control selection display something accordingly in the list
view.
mcontest@universal.com
www.universal.com
Matt Gradwohl -- Matt_Gradwohl@msn.com
Tuesday, January 23, 1996
To do an explorer type application, you don't need to use a CHeaderCtrl, just
a CListCtrl (or CListView).
Initialize the Columns, and AddItems to the ListCtrl. I have written a lot of
little tool apps for me like this, where the Doc is a CObList of CMyObject
types, and the CMyListView::OnGetDispInfo just asks the object to format
themselves. Use of UpdateAllViews with User defined hints for adding,
deleting, and changing items is also something I recommend.
-Matt
BOOL CMyListView::InitColumns()
{
TRACE(">>> CMyListView::InitColumns()\r\n");
int iCol;
int i=0;
CString csText;
LV_COLUMN lvc;
memset( (void*) &lvc, 0, sizeof(lvc));
CListCtrl& theListCtrl=GetListCtrl();
CDC* pDC=GetDC();
TEXTMETRIC tm;
pDC->GetTextMetrics( &tm );
int iStretch=tm.tmMaxCharWidth;
char szText[MLC_MAXHEADLENGTH];
lvc.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt=LVCFMT_LEFT;
lvc.pszText=szText;
for (iCol=0; iCol < MLC_NUMCOLUMNS; iCol++)
{
if (iCol>1) lvc.fmt=LVCFMT_RIGHT;
lvc.iSubItem=iCol;
csText.LoadString(STR_COLUMN0 + i++);
strcpy(szText, csText.GetBuffer(MLC_MAXHEADLENGTH));
csText.ReleaseBuffer(-1);
lvc.cx=lstrlen(lvc.pszText) * iStretch;
if (theListCtrl.InsertColumn( i, &lvc) == -1 ) return FALSE;
}
return TRUE;
}
----------
From: owner-mfc-l@netcom.com on behalf of Mario Contestabile
Sent: Sunday, January 21, 1996 8:00 AM
To: Ruben Bartelink
Cc: mfc-l
Subject: Re: CListCtrl/CHeaderCtrl/CFrameWind
[Snip->Start()]
2. CHeaderCtrl/CListCtrl
Does anybody have any ideas whatsoever on where I might get sample
code which uses these controls to produce a Win95 Explorer type
listbox interface. Specifically, having done the CHeaderCtrl - how
does one interlink it into a CListCtrl or CListBox ??
[Snip->Stop()]
I browsed David J. Kruglinski's new book this week end and remember seeing an
example
of exatly that. I refrained from purchasing it due mainly to its lack of
common
controls coverage.
I'm sure Mike B's book will be a better buy.
In any case look into CListView and CTreeView. That is the way explorer does
it.
It is rather easy once you get the hang of it. Use a splitter window between
the two views,
and upon the tree control selection display something accordingly in the list
view.
mcontest@universal.com
www.universal.com
Mike Blaszczak -- mikeblas@msn.com
Friday, January 26, 1996
Jeff Wishnie wrote:
> Under MFC 4.0, the CHeaderCtrl is a component part of the
> CListCtrl, that is, a standard CListCtrl has a CHeaderCtrl internally.
MFC, in this case, is irrelevant.
The common controls are implemented by Windows. A list view control,
implemented by Windows itself, which is in report view mode, can have a header
control inside of it. Windows creates the controls in this hierarchy--MFC has
nothing to do with it.
.B ekiM
TCHAR szMoose[] = _T("This moose is my own; I do not keep him on behalf of
Microsoft.");
| Вернуться в корень Архива
|