To get a flat blank area ... steps please!

To get a flat blank area ... steps please!

Post by drod.. » Mon, 01 Apr 1996 04:00:00

>Can anyone give me a little help with OS2 programming, I am an
>experienced programmer but only on the DOS/Windows platforms.

>I need to know know the basic steps to get a blank flat area visible
>and on the screen.

>For example in windows it is

>(i) Register a class, the class must provide a default message handler
>(ii) Use create window call with that class to make a window
>(iii) Call show window call to make window visible
>(iv) Call upon the window to update itself.

Its basically the same thing in OS/2. Keep this issues in mind:

1) OS/2 is different in that you seldom have just a single window. In OS/2 there is
a frame window and you almost always provide a client area window. The client
is the one you register and provide a window procedure for. Use the API
WinCreateStdWindow() to create both the frame and client at once.

2) Since there are always (except for dialogs generally) client windows, there are
no such things as NC_XXX messages. The frame gets its message and the client
gets its message and never the twain shall meet.

3) One of the frame flags passed to WinCreateStdWindow() will allow the system
to auto size the frame (FCF_SHELLPOSITION), or you can create it and then size
it yourself.

4) All windows have a visibility style, so you can make it visible immediately upon
creation if you know the size up front. If not, create it without the visible style and
then show it later.

5) If you just want a default colored background, when you get the WM_PAINT
message in your client, just call GpiErase() and it will set the invalid area to the
system defined background color.

6) You can use the Windoze scheme of having only a frame window but you will
have to subclass it in order to get control of some functionality. In OS/2 usually
only dialogs use the 'frame only' scheme because all they have is just child
control windows which manage their own affairs anyway (i.e. there is no need to
have any special control over the painting of the frame or interaction etc...) The
frame handles all of that in a dialog.

7) Scroll bars and menus are real windows in OS/2, not just drawn onto the frame
window as in Win. This gives you more control over how you use them.

Can't help you with the Pascal issues, so that might be all that it is and every thing
you are doing is really correct. I've seen some other people here who use it so they
will hopefully kick in.

Dean Roddey
CIDCorp, The CIDLib Class Libraries