home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ICLUI.ZIP
/
SPLITCV
/
ASPLITCV.CPP
< prev
next >
Wrap
Text File
|
1993-03-09
|
4KB
|
74 lines
/******************************************************************************/
/* Canvas Classes Example 1 - Split Canvas */
/* */
/* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1993. */
/* */
/* DISCLAIMER OF WARRANTIES: */
/* The following [enclosed] code is sample code created by IBM */
/* Corporation. This sample code is not part of any standard IBM product */
/* and is provided to you solely for the purpose of assisting you in the */
/* development of your applications. The code is provided "AS IS", */
/* without warranty of any kind. IBM shall not be liable for any damages */
/* arising out of your use of the sample code, even if they have been */
/* advised of the possibility of such damages. */
/******************************************************************************/
/* NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE */
/******************************************************************************/
/* Canvas Classes Example 1 - Split Canvas */
/* key functions: */
/* - create a main window */
/* - run the current application */
/* - create horizontal and vertical split canvases */
/* - create static text controls */
/* - load strings from resource bound to the exe */
/******************************************************************************/
//Include IBM UI class headers:
#include <iapp.hpp> //IApplication Class
#include "asplitcv.hpp" //Include ASplitCanvas Class headers
#include "asplitcv.h" //Include our symbolic definitions
/******************************************************************************/
/* main - Application entry point */
/******************************************************************************/
void main()
{
ASplitCanvas mainWindow(WND_MAIN); // create main window for application
IApplication::current().run(); // start message processing
} /* end main */
/******************************************************************************/
/* ASplitCanvas :: ASplitCanvas - Constructor for our main window */
/******************************************************************************/
ASplitCanvas :: ASplitCanvas( unsigned long windowId )
: IFrameWindow( windowId )
, horzCanvas( WND_CANVAS, this, this )
, vertCanvas( WND_CANVAS2, &horzCanvas, &horzCanvas )
, lText( WND_TXTL, &vertCanvas, &vertCanvas )
, rText( WND_TXTR, &vertCanvas, &vertCanvas )
, bText( WND_TXTB, &horzCanvas, &horzCanvas )
{
// give the canvas a horizontal split bar
// and make it the client area
horzCanvas.setOrientation( ISplitCanvas::horizontalSplit );
setClient( &horzCanvas );
// give the canvas a vertical split bar
vertCanvas.setOrientation( ISplitCanvas::verticalSplit );
// set top left static text
lText.setText(STR_TOPLEFT);
lText.setAlignment( IStaticText::centerCenter );
// set top right static text
rText.setText(STR_TOPRIGHT);
rText.setAlignment( IStaticText::centerCenter );
// set bottom static text
bText.setText(STR_BOTTOM);
bText.setAlignment( IStaticText::centerCenter );
setFocus().show(); // set focus and show window
} /* end ASplitCanvas :: ASplitCanvas(...) */