home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WOPTIMA.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-25
|
5KB
|
162 lines
//
// woptima.hpp -- Private functions.
//
#ifndef _WOPTIMA_HPP_INCLUDED
#define _WOPTIMA_HPP_INCLUDED
#ifndef _WDEF_HPP_INCLUDED
#include "wdef.hpp"
#endif
#ifndef _WTOOLBAR_HPP_INCLUDED
#include "wtoolbar.hpp"
#endif
#ifndef _WDIALOG_HPP_INCLUDED
#include "wdialog.hpp"
#endif
#ifndef _WPROPSHT_HPP_INCLUDED
#include "wpropsht.hpp"
#endif
struct __OptimaRTControl {
WUInt size;
WLong controlID;
WRect r;
WStyle style;
WStyle ex_style;
char text[];
};
class WWindow;
class WModule;
class WFont;
class WTransaction;
class WQuery;
class WDataSource;
#ifndef _WIN16
#undef GetObject
#if defined( _UNICODE )
#define GetObject GetObjectW
#else
#define GetObject GetObjectA
#endif
#endif
class WCMCLASS WOptima {
public:
static WBool CreateControl( WWindow * parent,
const WResourceID & parentID,
WWindow * control, long controlID,
WFont * font = NULL,
WModuleHandle module=_ApplicationModule );
static void ConnectTransaction( WForm * parent,
WTransaction * trans,
const WChar * name, WBool connect );
static void CreateQuery( WForm * parent, WQuery * query,
const WChar * trans_name,
const WChar * query_name );
static void AutoOpenQuery( WForm * parent, WQuery * query );
static WDataSource *GetDataSource( WForm * parent, const WChar * dsource_name );
static WObject *GetObject( WForm *parent, const WChar * object_name );
static void SetFormIcon( WForm * form, WBool mainForm,
const WResourceID & id,
WModuleHandle module=_ApplicationModule );
};
struct WOptimaToolbarEventList {
WEventID event;
WEventHandler handler;
WToolbarItemHandle item;
};
class WCMCLASS WOptimaToolbarData : public WObject {
private:
struct WResourceToolbarItem {
WToolbarItemStyle style;
WInt bitmapIndex;
WInt stringIndex;
WBool enabled;
WBool checked;
WBool pressed;
WBool indeterminate;
WBool hidden;
WBool lineBreak;
WBool inToolbar;
WInt textLength;
WInt toolTipTextLength;
};
struct WResourceCustomImage {
WInt resourceID;
WInt numBitmaps;
WInt isIcon;
};
struct WResourceToolbar {
WBool usesStandardBitmaps;
WBool usesViewBitmaps;
WBool usesLargeBitmaps;
WInt bitmapSizeWidth;
WInt bitmapSizeHeight;
WInt buttonSizeWidth;
WInt buttonSizeHeight;
WInt numItems;
WToolbarItemInfoArray * items;
WInt numCustomImages;
const WResourceCustomImage * images;
};
public:
WOptimaToolbarData( WOptimaToolbarEventList events[], WObject * object, WToolbar * tb );
~WOptimaToolbarData();
WBool BuildToolbar( const WResourceID & id,
WModuleHandle module=_ApplicationModule );
WToolbarItemHandle GetHandle( WUInt index );
protected:
WBool BuildToolbar( WResourceToolbar & toolbarResource,
WModuleHandle moduleHandle );
WBool ToolbarEventHandler( WObject *, WToolbarEventData * event );
private:
WObject * _object;
WOptimaToolbarEventList * _events;
WToolbar * _toolbar;
WBitmap ** _images;
WInt _imagesSize;
WToolbarItemInfoArray _items;
};
extern class WOptimaCreateGlobal * TheFirstWOptimaCreateGlobal;
class WCMCLASS WOptimaCreateGlobal {
public:
WOptimaCreateGlobal( WObject * (*create)( WBool ),
void (*destroy)( WObject * ),
WOptimaCreateGlobal ** first );
static void CreateGlobals( WOptimaCreateGlobal ** first );
static void DestroyGlobals( WOptimaCreateGlobal ** first );
private:
WObject * (*_createFN)( WBool doCreate );
void (*_destroyFN)( WObject * item );
WOptimaCreateGlobal * _next;
};
#endif