🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2103

Re: MDI devloper Pen Pal

#2103
From: sampson david 58163
Date: Mon, 15 Apr 1991 18:04
58 lines
3286 bytes
In article <25920007@hpkslx.mayfield.HP.COM>
ssl@hpkslx.mayfield.HP.COM (SSL Guest User) writes:


   In the mean time, I am wondering how Microsoft Excel (tm) creates
   the row of push buttons directly below the Menu bar.  These buttons
   are most certainly part of the Client area, but i'm wondering how
   to prevent the MDICREATE from taking over the entire client area,
   thereby slamming the buttons.

About a year ago I started fooling with trying to create a toolkit of
sorts to handle some common things like a spreadsheet type of
interface (the grid look, not necessarily the full functional
capability).  I ran into a problem that drove me nuts when it came to
laying out the grid.

If you look in the Petzold book to see how he does vertical line
spacing, you'll see that he determines the height of a line by adding
tmHeight + tmInternalLeading + tmExternalLeading => yLineHeight

The thing that drove me nuts was trying to set up a loop to draw the
horizontal lines of the grid so that they would be equi-distant
between the top and bottom of rows of text, i.e. draw a perfectly
semetrical line between two rows of text.  

To establish the line position (that can be multiplied by a for
statement loop counter variable) I tried variations of tmHeight +
tmInternalLeading or tmHeight + tmExternalLeading, etc.  I could never
get the thing right. 

It was further compounded by the particular mapping mode that was
selected.  MM_ANISOTROPIC was a particular pain.  When world
coordinates were scales, boy did that throw off the vertical line spacing.

Everything would look OK on the first few lines, but as you drew more
and more lines (about 100 should do it) the verticle "distortion" grew worse.

If you look at Excel, you'll notice that the row buttons and the
horizontal lines for the spreadsheet grid line up exactly, independent
of the video mode (i.e. EGA, VGA, etc) and they are perfectly symetrical.

Am I dumb or what???  Anybody know how they did this?

--

                                          A new world record
                                          in the javalin throw
                                                
    /                                          /
   /                                          I
-------------------------------------------------


David Sampson                                         Harris Corporation
dsampson@x102a.ess.harris.com                   Gov't Aerospace Systems Divison
uunet!x102a!dsampson                                  Melbourne, Florida

-------------------------------------------------------------------------------
Technical Details
Message-ID: <DSAMPSON.91Apr15130446@x102a.harris-atd.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!rex!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!trantor!dsampson
References: <25920007@hpkslx.mayfield.HP.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!rex!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!trantor!dsampson
From: dsampson@x102a.harris-atd.com (sampson david 58163)
Newsgroups: comp.windows.ms.programmer
Subject: Re: MDI devloper Pen Pal
Message-ID: <DSAMPSON.91Apr15130446@x102a.harris-atd.com>
Date: 15 Apr 91 18:04:46 GMT
References: <25920007@hpkslx.mayfield.HP.COM>
Sender: news@trantor.harris-atd.com
Organization: Harris Gov't Aerospace Systems Division
Lines: 58
In-reply-to: ssl@hpkslx.mayfield.HP.COM's message of 8 Apr 91 18:04:17 GMT