[comp.windows.ms.programmer] toolbar

pottera@infonode.ingr.com (Andrew Potter) (05/07/91)

I am interested in what approach should be taken to implementing a tool
bar, such as the one used in Excel.  I haven't seen anything in the way of
direct support for it in the SDK.  Is there anything?  Or does anyone have 
any suggestions as to how it should be approached?

Thanks,

Andrew


-- 
Andrew Potter                           |  "t-crosser
Intergraph Corp         205-730-8673    |       i-dotter"
uunet!ingr!b23b!entropy!andrew          |               Dr. Seuss

dave@wucs1.wustl.edu (David T Mitchell III) (05/07/91)

>I am interested in what approach should be taken to implementing a tool
>bar, such as the one used in Excel.  I haven't seen anything in the way of
>direct support for it in the SDK.  Is there anything?  Or does anyone have 
>any suggestions as to how it should be approached?

there's a reasonably new book out called _Windows 3: A Developer's Guide_fN!
by Jeffrey Richter (ISBN 1-851-164-4, $39.95, 670 pages) that has a chapter
on MDI stuff, including how to implement a "ribbon" (toolbar) and a status 
line.  The book comes with three floppies of source.

In a nutshell, Richter suggests setting up the ribbon as a modeless dialog
box.  The book goes into the details about resizing the client window (to
make room for the ribbon), and passing the messages correctly.

dave	dave@wucs1.wustl.edu
	the mira corporation
	314/434-434

demillo@porter.geo.brown.edu (Rob DeMillo) (05/07/91)

In article <1991May6.202626.10316@infonode.ingr.com> pottera@infonode.ingr.com (Andrew Potter) writes:
>
>I am interested in what approach should be taken to implementing a tool
>bar, such as the one used in Excel.  I haven't seen anything in the way of
>direct support for it in the SDK.  Is there anything?  Or does anyone have 
>any suggestions as to how it should be approached?

The MS Toolbar concept is a big hack, and its pretty easy to
implement. The 'bar' itself is a modeless dialog box without
borders, etc. The 'tools' are simple push buttons. (The dialog
box is scaled to exactly fit the width of the push buttons, and the
buttons are shoved next to each other.) Simple icons are then placed
on the buttons. (Button positions can be obtained in screen
coordinates (rather than the device independent dialog coordinate
system, which is the default coordinate system for all dialog boxes)
by a quicky little mapping function. I came up with a mapping
function that does the trick, which I'll post if anyone is
interested....

Anyway, that's all there is to it...then just treat the 'tools' 
like you would any other dialog box button....


 - Rob DeMillo			     | Internet: demillo@juliet.ll.mit.edu
   Mass Inst of Tech/Lincoln Lab     | Also:     demillo@porter.geo.brown.edu
   Weather Sensing Project-Group 43  | Reality:  401-273-0804 (home)
"I say you *are* the Messiah, Lord! And I ought to know, I've followed a few!"