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

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


Non-scrolling area in a CScrollView?

Jean-Francois Cordier -- cordierj@chor.ucl.ac.be
Saturday, December 30, 1995

Thanks to Andreas Will I managed to reoganize my controls properly on sizing.

Now, I've got two other questions:

o 1st: is it possible to have a non-scolling area in a CScrollView?
    I would like my CScrollView to have a CComboBox and a Save and
    a Discard CButton at the top. The scrolling area can have up to
    30 CEdit boxes depending on what the user choose in the CComboBox.
    Do I have to create 2 different Views in ONE Frame? And then would
    it still be possible to tab between the controls and use short-cuts
    (Alt+letter), especially between the scrolling and the
    non-scrolling part ?

o  2nd: Very easy. I would like a CListBox that supports multiple
        column display (An improved LBS_USETABSTOPS) with column
        sizing (Like the mailboxes in Eudora for instances).
    I know I can easily do this by using a LBS_OWNERDRAWFIXED Listbox
    -and would probably do this if I find nothing- but maybe this has
    already been done and the source code might be available somewhere
    on the net (I don't want to re-invent the wheel). If not, I'll do
    it myself and give away my code.

BTW: I'm using MFC 2.5.

Thanks a lot for your help, 
                                Happy New Year!

Jean-Francois.
--------------------------------------------------------------------------
Jean-Francois Cordier (a.k.a. Dji)    Office : +32 10 47.87.58
Universite Catholique de Louvain      Home   : +32 10 45.60.18
Laboratoire ORSY                      Fax    : +32 10 47.20.48/41.68
1, pl. L. Pasteur                     WWW    : http://c227b.chor.ucl.ac.be/
1348 Louvain-la-Neuve (BELGIUM)       Email  : cordierj@chor.ucl.ac.be






Andreas Will -- a.will@T-Online.de
Sunday, December 31, 1995

>Jean-Francois.
>Now, I've got two other questions:
>
>o 1st: is it possible to have a non-scolling area in a CScrollView?
>    I would like my CScrollView to have a CComboBox and a Save and
>    a Discard CButton at the top. The scrolling area can have up to
>    30 CEdit boxes depending on what the user choose in the CComboBox.
>    Do I have to create 2 different Views in ONE Frame? And then would
>    it still be possible to tab between the controls and use short-cuts
>    (Alt+letter), especially between the scrolling and the
>    non-scrolling part ?

One solution is the use of a CDialogBar. 
1. Create a dialog template - just like a form view template
(WS_VISIBLE not set) - but do not call class wizzard to create a new
class.

2. The code below shows creation of the dialog bar (I tried
OnInitialUpdate() first but it didn't work as expected)

int CFormTestView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
  if(CFormView::OnCreate(lpCreateStruct) == -1)
    return -1;
	
  m_dlgbar.Create(GetParent(), IDD_DLGBAR1, CBRS_TOP, 0x1001);
  return 0;
}

Tabbing from the bar to the form view *doesn't* work. 
I can't investigate any further right now (I have to go sledge riding
with my kids - oh yes, we do have snow in northern germany and there is
a suitable slope in the vicinity).  You probably have to implement your
own CMDIChildWindow (or adjust CMainFrame if you use SDI), to catch the
Tabs from form view and dialog bar.

>
>o  2nd: Very easy. I would like a CListBox that supports multiple
>        column display (An improved LBS_USETABSTOPS) with column
>        sizing (Like the mailboxes in Eudora for instances).

Check out the CListCtrl - report view - it has a lot of good features
and is part of the common controls for Win95.

 Happy New Year
  Andy
/////////////////
Andreas Will
Jever, Germany
a.will@t-online.de
/////////////////



Jean-Francois Cordier -- cordierj@chor.ucl.ac.be
Monday, January 01, 1996

Andreas,

>One solution is the use of a CDialogBar. 
>1. Create a dialog template - just like a form view template
>(WS_VISIBLE not set) - but do not call class wizzard to create a new
>class.

That's a good idea! Thanks!


>Check out the CListCtrl - report view - it has a lot of good features
>and is part of the common controls for Win95.
>
Sorry but I'm using MFC 2.52. I'm still developing under Win 3.x and FOR Win
3.x though I might install NT and use VC 4.0 for development but it'll still
be for Win 3.x (with win32s then).
IMHO, CListCtrl is part of MFC 3.0 or 4.0 not 2.52.

I coudn't find any sample code for listboxes like the one you may find in
Eudora or NX (a free Win NewsReader program). I'll do it myself and will
distribute my code (there might be a few programmers that are still using VC
1.52).

BTW:
-I would also like to implement tooltips (those are part of the latest MFCs
but not 2.5), I saw somehing somewhere on the net but couldn't find it now I
need it. I'll continue to dig but if someone knows where to find it... :)

-Eudora's toolbar is using color buttons however the default CToolBar
implementation is using only 1 bitmap and using color gives terrible
results. Is there a way to override this and have different bitmaps for each
state (up, down, grayed,...) ?

Thanks a lot for your help,

        Jean-Francois
--------------------------------------------------------------------------
Jean-Francois Cordier (a.k.a. Dji)    Office : +32 10 47.87.58
Universite Catholique de Louvain      Home   : +32 10 45.60.18
Laboratoire ORSY                      Fax    : +32 10 47.20.48/41.68
1, pl. L. Pasteur                     WWW    : http://c227b.chor.ucl.ac.be/
1348 Louvain-la-Neuve (BELGIUM)       Email  : cordierj@chor.ucl.ac.be






Brad Wilson -- bradw@exptech.com
Friday, January 05, 1996

>> though I might install NT and use VC 4.0 for development but it'll still
>> be for Win 3.x (with win32s then).

The 32-bit common controls are supported with Win32s 1.30.
Brad





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