home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
LANCELOT
/
LPAGECTL.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-01
|
7KB
|
243 lines
/*******************************************************************************
* FILE NAME: lpagectl.hpp *
* *
* DESCRIPTION: *
* *
* Classes *
* PageButtons *
* PageCnrButtons *
* PageScrollButtons *
* QueryRange *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1995 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#ifndef _LPAGECTL_
#define _LPAGECTL_
#include <isetcv.hpp>
#include <igraphbt.hpp>
#include <icheckbx.hpp>
#include <icombobx.hpp>
#include <istring.hpp>
#include <istattxt.hpp>
#include <imsgbox.hpp>
#include <imcelcv.hpp>
#include <iselhdr.hpp>
#ifdef IC_MOTIF
#include <ipicvhdr.hpp>
#include <istring.hpp>
#endif
class AccountPage;
class SkillPage;
class ProjectPage;
class TasksPage;
class AGraphicPushButton : public IGraphicPushButton
{
public:
AGraphicPushButton( unsigned long windowId,
IWindow* parent,
IWindow* owner,
unsigned long iconid);
~AGraphicPushButton();
protected:
inline virtual
ISize calcMinimumSize() const {
return (ISize(40, 40)); }
};
#ifndef IC_MOTIF
class PageButtonsSelectHandler : public ISelectHandler
{
public:
PageButtonsSelectHandler( IMultiCellCanvas* parent );
~PageButtonsSelectHandler();
Boolean
selected( IControlEvent& event );
private:
IMultiCellCanvas
*theParentMulticell;
};
#endif
class PageCnrButtons : public ISetCanvas
{
public:
PageCnrButtons( unsigned long windowId
,IWindow* parent
,IWindow* owner
,Boolean noChangeButton= false );
~PageCnrButtons();
private:
IGraphicPushButton
*addButton,
*removeButton,
*changeButton;
};
class PageButtons : public ISetCanvas
{
public:
PageButtons( unsigned long windowId
,IMultiCellCanvas* parent
,IMultiCellCanvas* owner
,Boolean noQueryButton = false );
~PageButtons();
private:
AGraphicPushButton
*queryButton,
*saveButton,
*undoButton,
*helpButton;
#ifndef IC_MOTIF
ICheckBox
*gridCheckBox;
PageButtonsSelectHandler
selectHandler;
#endif
};
class PageScrollButtons : public ISetCanvas
{
public:
PageScrollButtons( unsigned long windowId
,IWindow* parent
,IWindow* owner );
~PageScrollButtons();
PageScrollButtons&
setDisplayText( const char* theStr );
private:
IStaticText
weekEndingText;
IString
dateText;
AGraphicPushButton
prevButton,
nextButton;
IString
displayText;
};
/******************************************************************************
* Class PageCnrSelHandler - Page container select handler. *
******************************************************************************/
class PageCnrSelHandler : public ISelectHandler
{
public:
/*------------------------ Constructors/Destructor ----------------------------
| Construct the object given a page. |
-----------------------------------------------------------------------------*/
PageCnrSelHandler( AccountPage* page );
PageCnrSelHandler( SkillPage* page );
PageCnrSelHandler( ProjectPage* page );
PageCnrSelHandler( TasksPage* page );
~PageCnrSelHandler();
protected:
/*----------------------------- Event Processing ------------------------------
| Handle and process events: |
| selected - Process select events. |
-----------------------------------------------------------------------------*/
Boolean
selected( IControlEvent& event );
private:
enum
PageType { accountPage, skillPage, projectPage, taskPage };
IMultiCellCanvas
*pPage;
PageType
pageType;
};
class QueryRange : public ISetCanvas
{
public:
QueryRange( unsigned long windowId
,IWindow* parent
,IWindow* owner
,unsigned long id);
~QueryRange();
inline IString
getRange() { return range.text();} ;
inline QueryRange&
setRange(const IString& r ) { range.setText(r); return *this;} ;
private:
IComboBox
range;
};
#ifdef IC_MOTIF
class LPictureVerifyHandler : public IPictureVerifyHandler
{
public:
// ---------------------- PUBLIC -------------------------------------
LPictureVerifyHandler( IWindow* owner,
IString pictureString);
IWindow* owner();
protected:
Boolean invalidChange ( IEditVerifyEvent& event );
private:
//--------------------------- PRIVATE ----------------------------------------
IWindow* pOwner;
};
const IString TEST_ALPHA = IString("*a");
const IString TEST_LETTER = IString("1a");
const IString TEST_ALPHANUMERIC = IString("*&");
const IString TEST_DATE = IString("1-2n '/' 1-2n '/' 2n");
const IString TEST_PHONE = IString( "3n '-' 3n '-' 4n");
const IString TEST_FULL_NAME = IString("*a 1w *a" );
const IString TEST_CURRENCY = IString("*n 0-1p 0-2n");
#endif
#endif