15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Dialog Boxes and Statusbar controls

Daniel Curry -- dcurry@webzone.net
Friday, July 19, 1996

Environment: WinNT 3.51 and 4.0 beta 2, VC++ 4.1

question:  where can I find/get information about how to put a status bar on
a dialogue?  My project requires adding and progress bar and flashing lights
to show connection to a data source over the network.  these things I have
done on other status bars and will not be a problem, however, I am not
certain how to put a statusbar on the dialog itself.  Any ideas would be
greatly appreciated.



        
Daniel Curry
Programmer for Boston Communications Group


dcurry@webzone.net
zilog@webzone.net







Greg D. Tighe -- gdt@eng.aisinc.com
Monday, July 22, 1996

[Mini-digest: 5 responses]

> Environment: WinNT 3.51 and 4.0 beta 2, VC++ 4.1
> 
> question:  where can I find/get information about how to put a status bar on
> a dialogue?
>
The following Tech Note (look under On-Line Help) may be of help:

	TN060: The New Windows Common Controls

Look at the section titled "Using CStatusBarCtrl"

	-Greg Tighe
	Applied Intelligent Systems, Inc.
	Ann Arbor, MI
	gdt@aisinc.com
-----From: CraigTT@ccmail01.PE-Nelson.COM

     The following link is an example that might be useful 
     ftp://ftp.microsoft.com/softlib/mslfiles/dlgcbr32.exe

     Tim
-----From: stanleyh (Stanley Man-Kit Ho)

	I just have done the same thing two weeks ago. What you need to do
is create the status bar window in WM_INITDIALOG. Look at Charles's Programming
Windows 95 or Jeff's Programming Windows 95 with MFC for more details.

	Stanley   8^)

-----From: "Cunningham Graham, IK 23" 

I eneded up using CStatusBarCtrl which is just a wrapper for the windows
control. I personally found CStatusBar unusable for a dialog, but this
could be just me. 
heres a bit of sample stuff to get you going.
in the dialog .h
CExtStatusBarCtrl m_Status;	//CExtStatusBarCtrl is derived from
CStatusBarCtrl and handles DrawItem()

in the dialog OnCreate() I do the following to create 4 panes with the
last one being owner drawn and handled in CExtStatusBarCtrl::DrawItem()

	m_Status.Create(WS_CHILD | WS_BORDER | WS_VISIBLE,
CRect(0,0,0,0),this,ID_STATUSBAR);

	for (int i =0;i<4;i++)
		m_aWidths[i] = 0;

	m_Status.SetParts(4,m_aWidths);
	m_Status.SetText((LPCTSTR)" ",0,SBT_NOBORDERS);
	m_Status.SetText((LPCTSTR)" ",1,SBT_NOBORDERS);
	m_Status.SetText((LPCTSTR)"  ",2,SBT_NOBORDERS);
	m_Status.SetText((LPCTSTR)&m_dlgStatus,3,SBT_OWNERDRAW);

HTH

-----From: Kostya Sebov 

If you can access to the MS Visual C++ 2.2 CD look in the
\mfcconf/pss_10/pss_qa/dlgcbr directory. It contains the very sample you need.
Hopefully it also available somewhere on the WWW.

I believe it can be easily adapted for the MFC 4.x.

Sincerely,

--- 
Kostya Sebov. 
----------------------------------------------------------------------------
Tel: (38 044) 266-6387 | Fax: (38 044) 266-6195 | E-mail: sebov@is.kiev.ua




| Вернуться в корень Архива |