[Classes] [Prev] [Next] [Methods]


Methods Index

Protected Data Members
Private Data Members
Public Methods
Destructor and Initializer Methods
Inherited Utilities
Inherited Sizing and Dragging Methods
Other Methods
Surrogate Clipping Methods
Protected Methods
Constructor and Operator Methods
Other Methods



Superclass: CView

Subclasses: CNativeList, NButton, NCheckBox, NEditControl, NGroupBox, NIcon, NRadioButton, NScrollBar, NText


CNativeView is an abstract class from which several view classes are derived. Native views are the means of communication between the application and the user who is operating the mouse. Inheriting from CNativeView are objects such as buttons, scrollbars, check boxes, and radio buttons, which have the look-and-feel of the native window manager.


This is a base class that must be overridden by classes specific to each native view.


There are no environment settings for classes that inherit from CNativeView. The drawing properties of native views are system-defined.

Protected Data Members

long itsIconId; The resource ID of the icon needed by NIcon
long itsXVTAttributes; Union of XVT Portability Toolkit CTL_* flags
WIN_TYPE itsType; The native view's type
WINDOW itsNativeView; The window handler for the native control

Private Data Members

static CNativeView* selectedControl; Implement dragging in WSMTF (Motif only)
static RWOrdered movableControls; Implement dragging in WSMTF (Motif only)


friend class CControlWireFrame; Used for implementation
friend class CResourceWindow;

Public Methods

Destructor and Initializer Methods

virtual ~CNativeView(void);
BOOLEAN INativeView(const CStringRW theTitle		= NULLString,
BOOLEAN isEnabled = TRUE,
BOOLEAN isVisible = TRUE,


virtual void DoHit(CONTROL_INFO theControlInfo) = NULL;
	typedef struct s_ctlinfo {			
WIN_TYPE type; /* WC_* */
WINDOW win; /* WINDOW of control */
union {
struct s_pushbutton {
int reserved; /* Reserved (unused). */
} pushbutton;

struct s_radiobutton {
int reserved; /* Reserved (unused). */
} radiobutton;

struct s_checkbox {
int reserved; /* Reserved (unused). */
} checkbox;

struct s_scroll {
SCROLL_INFO what; /* activity site */
short_pos; /* thumb position */
} scroll;

struct s_edit {
BOOLEAN focus_change;
/*is event a focus change?*/
BOOLEAN active; /* if so: gaining focus? */
} edit;

struct s_statictext {
int reserved; /* Reserved (unused). */
} statictext;

struct s_lbox {
BOOLEAN dbl_click; /* double click? */
} lbox;

struct s_listbutton {
int reserved; /* Reserved (unused) */
} listbutton;

struct s_listedit {
BOOLEAN focus_change; /* Did the edit field part
change focus? */
BOOLEAN active; /* if so: gaining focus? */
} listedit;

struct s_groupbox {
int reserved; /* Reserved (unused). */
} groupbox;

struct s_icon {
int reserved; /* Reserved (unused). */
} icon;
} v;

Inherited Utilities

virtual void Size(const CRect& theNewSize);
virtual void SetOrigin(const CPoint& diff);
virtual void Hide(void);	
virtual void Show(void);	
virtual void SetId(int theId);
virtual void SetEnclosure(CSubview *theEnclosure);
virtual void SetTitle(const CStringRW& theNewTitle);
virtual const CStringRW GetTitle(void);
virtual void SetGlue(GLUETYPE theGlue);
virtual void Enable(void); 
virtual void Disable(void);
virtual void Activate(void);
virtual void Deactivate(void);
virtual void SetFont(const CFont& theFont, 
BOOLEAN isUpdate = FALSE);
virtual void SetEnvironment(
const CEnvironment& theEnv,
BOOLEAN isUpdate = FALSE);

Inherited Sizing and Dragging Methods

In the case of native views (controls), setting the moving and sizing to TRUE in effect disables a view because that view no longer acts as it usually does-as a button, for example. Instead, it simply acts as an object that is being moved and sized interactively by the user.

virtual void SetSizing(BOOLEAN isSizable);
virtual void SetDragging(BOOLEAN isDraggable);

Other Methods

WINDOW GetXVTWindow(void) const;
WIN_TYPE GetXVTType(void) const;
long GetAttributes(void) const;
void SetAttributes(long theXVTAttributes);

Surrogate Clipping Methods

These methods allow you to enable and disable surrogate clipping. By default, surrogate clipping is enabled, and native views are created in a manner that ensures they are clipped naturally by their enclosure. However, surrogate clipping can slow the creation of native views, so you can choose to disable it when creating native views that do not need clipping.

static void EnableSurrogateClipping(void);
static void DisableSurrogateClipping(void);

Protected Methods

Constructor and Operator Methods

CNativeView(CSubview* theEnclosure,
const CRect& theRegion,
WIN_TYPE theControlType,
long theControlAttributes = NULL;
const CStringRW& theTitle = NULLString);

WC_PUSHBUTTON Button control
WC_EDIT Edit field
WC_LBOX List box
WC_VSCROLL Vertical scrollbar
WC_HSCROLL Horizontal scrollbar
WC_TEXT Static text
WC_LISTEDIT List-edit combo control
WC_LISTBUTTON List-button combo control
WC_TEXTEDIT XVT Portability Toolkit text edit object

CTL_FLAG_DISABLED Initially disabled control
CTL_FLAG_CHECKED The "checked" state for check boxes and radio buttons only
CTL_FLAG_DEFAULT Default border style for push buttons in a dialog
CTL_FLAG_INVISIBLE Initially invisible
CTL_FLAG_GROUP The first or last element in a radio button grouping, for keyboard navigation purposes
CTL_FLAG_READONLY A readable but not selectable list box
CTL_FLAG_MULTIPLE Multiple selections in a list box
CTL_FLAG_NATIVE_JUST Native justification
CTL_FLAG_LEFT_JUST Left text justification
CTL_FLAG_CENTER_JUST Center text justification
CTL_FLAG_RIGHT_JUST Right text justification

CNativeView(WINDOW theCreatedControl,
CSubview* theEnclosure, const CRect& theRegion,
WIN_TYPE theControlType);
CNativeView(const CNativeView& theControl);
CNativeView& operator=(const CNativeView& theControl);

Other Methods

void CreateControl(void);
virtual void InitControl(void);
virtual void UpdateUnits(CUnits* theUnits);
void Close(void);

[Classes] [Prev] [Next] [Methods]


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.