• Keine Ergebnisse gefunden

TCharSet class

Im Dokument Reference Guide (Seite 70-83)

Constructor

Constructor

Constructor

Protected data members

TBitmap* Bitmap;

Points to the bitmap.

TSize CSize;

The size of a cell in the array.

TPoint Offs;

TCelArray class

Holds the offset of the upper left corner of the eel array from the upper left corner of the bitmap.

int NCels;

The number of cells in the eel array.

BOOL ShouldDelete;

~s TRUE if the destructor needs to delete the bitmap associated with the eel array.

bitset.h

Derived from TBitSet, TCharSet sets and clears bytes for a group of

characters. You can use this class to set or clear bits in a group of characters, such as the capital letters from" A" through "Z" or the lowercase letters from "a" through "z." The class TBitSet performs similar operations for a group of bits.

Public constructors

TCharSet()i

Constructs a TCharSet object.

TCharSet(const TCharSet&);

Copy constructor for a TCharSet object.

TCharSet(const char far* str);

Constructs a string of characters.

TCharSet class

operator !=

Public member functions

inline int operator !=(const TBitSet& bsl, const TBitSet& bs2);

ORs all of the bits in the copied string and returns a reference to the copied TCharSet object.

TCheckBox class checkbox.h

See Chapter 4 in the ObjecfWindows Programmer's Guide for a description of interface objects. See Chapter 10 in the ObjecfWindows Programmer's Guide for specific instructions about creating check box controls.

Group

Constructor

Constructor

58

TCheckBox is a streamable interface class that represents a check box control. Use TCheckBox to create a check box control in a parent window ..

You can also use TCheckBox objects to more easily manipulate check boxes you created in a dialog box resource.

Two-state check boxes can be checked or unchecked; three-state check boxes have an additional grayed state. TCheckBox member functions let you easily control the check box's state. A check box can be in a group box (a

TGroupBox object) that groups related controls.

Public data members

TGroupBox *Group;

If the check box belongs to a group box (a TGroupBox object), Group points to that object. If the check box is not part of a group, Group is zero.

See also: TGroupBox::TGroupBox

Public constructors

TCheckBox(TWindow *parent, int Id, const char far *title, int x, int y, int w, int h, TGroupBox *group, TModule* module = 0);

Constructs a check box object with the specified parent window (parent), controlID (Id), associated text (title), position relative to the origin of the parent window's client area (x, y), width (w), height (h), associated group box (group), and owning module (module). Invokes the TButton constructor with similar parameters. Sets the check box's Attr.Style to WS_CHILD I WS_VISIBLE I WS_TABSTOP I BS_AUTOCHECKBOX.

See also: TButton::TButton

TCheckBox(TWindow *parent, int resourceId, TGroupBox *group, TModule*

module = 0);

ObjecfWindows 2.0 Reference Guide

Check

GetCheck

Table 1.26 TCheckSox check states

GetState

SetCheck

SetState

SetStyle

TCheckBox class

Constructs an associated TCheckBox object for the check box control with a resource ID of resourceld in the parent dialog box. Sets Group to group and then enables the data transfer mechanism by calling EnableTransfer.

See also: TButton::TButton, TWindow::EnableTransfer

Public member functions

void Check();

Forces the check box to be checked by calling SetCheck with the value of BF _CHECKED. Notifies the associated group box, if there is one, that the state was changed.

See also: TCheckBox: :GetCheck, TCheckBox: :Toggle, TCheckBox:: Un check, TGroupBox:: Selection Changed

inline DINT GetCheck() canst;

Returns the state of the check box.

Check box state Checked Unchecked Grayed

Return value SF_CHECKED SF_UNCHECKED SF_GRAYED See also: TCheckBox::SetCheck inline DINT GetState() canst;

Returns the check, focus, and highlight state of the check box. See the BM_ GETSTATE message in the Windows API online Help for more details.

See also: TCheckBox::SetState void SetCheck(WORD check);

Forces the check box into the state specified by Check. See Table 1.26 for possible values of Check.

See also: TCheckBox: :GetCheck inline void SetState(DINT state);

Sets the check, focus, and highlight state of the check box. See the

BM_SETSTATE message in the Windows API online Help for more details.

See also: TCheckBox::GetState

inline void SetStyle(DINT style, BOOL redraw);

TCheckBox class

Toggle

Transfer

Uncheck

BNClicked

EvGetDlgCode

GetClassName

60

Changes the style of the check box. See the BM_SETSTYLE message in the Windows API online Help for more details.

void Toggle();

Toggles the check box between checked and unchecked if it's a two-state check box; toggles it between checked, unchecked, and gray if it's a three-state check box.

See also: TCheckBox::SetCheck

virtual WORD Transfer(void *buffer, TTransferDirection direction);

Overrides TWindow::Transfer. Transfers the check state of the check box to or from buffer, using the values specified in Table 1.26. If direction is tdGetDate, the check box state is transferred into the buffer. If direction is tdSetData, the check box state is changed to the settings in the transfer buffer.

Transfer returns the size of the transfer data in bytes. To get the size without actually transferring the check box, use tdSizeData as the direction argument.

inline void Dncheck();

Forces the check box to be unchecked by calling SetCheck with a value of BF _UNCHECKED. Notifies the associated group box, if there is one, that the state has changed.

See also: TCheckBox::Check, TCheckBox::SetCheck, TCheckBox::Toggle

Protected member functions

void BNClicked();

Responds to notification message BN_CLICKED, indicating that the user clicked the check box. If Group isn't 0, BNClicked calls the group box's SelectionChanged member function to notify the group box that the state has changed.

See also: TGroupBox::SelectionChanged DINT EvGetDlgCode();

Overrides TButton's response to the WM_ GETDLGCODE message, an input procedure associated with a control that is not a check box, by calling DefaultProcessing.

See also: TButton::EvGetDlgCode, TWindow::DefaultProcessing char far* GetClassNarne();

ObjectWindows 2.0 Reference Guide

TCheckBox class

If BWCC is enabled, TCheckBox returns CHECK_CLASS. If BWCC is not enabled, returns "BUTTON."

Response table entries

Response table entry

EV _NOTIFY _AT_CHILD (BN_CLlCKED, BNClicked) EV _ WM_GETDLGCODE

Member function BNClicked EVGetDlgCode

TChooseColorDialog class chooseco.h

Constructor

SetRGBCoior

cc

TChooseColorDialog objects represent modal dialog box interface elements that allow color selection and custom color adjustment. TChooseColorDialog can be made to appear modeless to the user by creating the dialog's parent as an invisible pop-up window and making the pop-up window a child of the main application window.

Public constructors

TChooseColorDialog(TWindow* parent, TData& data, TResld templateID

=

0, const char far* title

=

0, TModule* module

=

0);

Constructs a dialog box with specified parent window, data, resource identifier, window caption, and library ID.

See also: TChooseColorDialog::TData

Public member functions

inline void SetRGBColor(TColor color);

Sets the current RGB color for the open dialog box by sending a

SetRGBMsgld. You can use SetRGBCoior to send a message to change the current color selection.

Protected data members

CHOOSECOLOR CCi

TChooseColorDialog class

Data

SetRGBMsgid

DialogFunction

DoExecute

EvSetRGBCoior

Stores the length of the TChooseColorDialog structure, the window that owns the dialog box, and the data block that contains the dialog template. It also points to an array of 16 RGB values for the custom color boxes in the dialog box, and specifies the dialog-box initialization flags. This information is passed to the Windows API ChooseColor function.

See also: TChooseColorDialog::TData TData& Data;

Data is a reference to the TData object passed in the constructor.

See also: TChooseColorDialog::TData static UINT SetRGBMsgId;

Contains the ID of the registered message sent by SetRGBColor.

Protected member functions

BOOL DialogFunction(UINT message, WPARAM, LPARAM);

Returns TRUE if a message is handled.

See also: TDialog::DialogFunction int DoExecute();

If no error occurs, DoExecute copies flags and colors into Data and returns zero. If an error occurs, DoExecute returns the IDCANCEL with Data.Error set to the value returned from CommDlgExtendedError.

inline LPARAM EvSetRGBColor(WPARAM, LPARAM);

Responds to the message sent by SetRGBColor by forwarding it to the original class via DefaultProcessing. This event handler is not in the response table.

Response table entries

The TChooseColorDialog response table has no entries.

TChooseColorDialog::TData struct chooseco.h

62

The TChooseColorDialog::TData struct defines information necessary to initialize the dialog box with the user's color selection.

ObjeclWindows 2.0 Reference Guide

Color

CustColors

Error

Flags

TChooseColorDialog::TData struct

Public data members

TColor Color;

Color specifies the color that is initially selected when the dialog box is created and contains the user's color selection when the dialog box is closed.

TColor* CustColors;

CustColors points to an array of 16 colors.

DWORD Error;

Error contains one of the following CommDlgExtendedError codes:

Constant Meaning

CDERR_DIALOGFAILURE CDERR_FINDRESFAILURE CDERR_LOADRESFAILURE CDERR_LOCKRESOURCEFAILURE CDERR_LOADSTRFAILURE

Failed to create a dialog box.

Failed to find a specified resource.

Failed to load a specified resource.

Failed to lock a specified resource ..

Failed to load a specified string.

DWORD Flags;

Flags can be a combination of the following Windows API constants:

Constant

CC_FULLOPEN

CC_PREVENTFULLOPEN CC_RGBINIT

Meaning

Causes the entire dialog box to appear when the dialog box is created.

Disables the "Define Custom Colors" push button.

Causes the dialog box to use the color specified in rgbResult as the initial color selection.

Causes the dialog box to show the Help push button.

See also: TChooseColorDialog::Data, ::ChooseColor

TChooseFontDialog class choosefo.h

A TChooseFontDialog represents modal dialog-box interface elements that create a system-defined dialog box from which the user can select a font, a font style (such as bold or italic), a point size, an effect (such as strikeout or underline), and a color. TChooseFontDialog can be made to appear modeless by creating the dialog's parent as an invisible pop-up window and making the pop-up window a child of the main application window.

TChooseFontDialog class

Constructor

cf

Data

CmFontApply

DialogFunction

DoExecute

64

See Chapter 4 in the Object Windows Programmer's Guide for a general description of interface objects and Chapter 8 in the Object Windows Programmer's Guide for specific instructions about creating dialog boxes.

Public constructors

TChooseFontDialog(TWindow* parent, TData& data, TResID templateID

=

0, const char far* title

=

0, TModule* module

=

0);

Constructs a dialog box with specified data, parent window, resource identifier, window caption, and library ID.

See also: TChooseFontDialog::TData

Protected data members

CHOOSEFONT cf;

Contains font attributes that ObjectWindows passes to the Windows API Choosefont function. cf is initialized using fields in the

TChooseFontDialog::TData class. It stores the length of the structure, the window that owns the dialog box and the data block that contains the dialog template. It also specifies the dialog-box initialization flags.

See also: TChooseFontDialog::TData TData& Data;

Data is a reference to the TData object passed in the constructor.

See also: TChooseFontDialog::TData

Protected member functions

inline void CmFontApply();

Default handler for the third push button (the apply button) in the dialog box.

BOOL DialogFunction(UINT message, WPARAM, LPARAM);

Returns TRUE if a message is handled.

See also: TDialog::DialogFunction int DoExecute();

ObjectWindows 2.0 Reference Guide

TChooseFontDialog class

If no error occurs, DoExecute copies the flag values and font information into Ddata, and returns

o.

If an error occurs, DoExecute returns the CommDlg ExtendedError.

See also: TChooseFontDialog::TData

Response table entries

The TChooseFontDialog response table contains no entries.

TChooseFontDialog: :TData struct choosefo.h

Color

DC

Error

Flags

The ChooseFontDialog structure defines information necessary to initialize the dialog box with the user's font selection.

Public data members

TColor Color;

Indicates the font color that is initially selected when the dialog box is created; contains the user's font color selection when the dialog box is closed.

HDC DC;

Handle to the device context from which fonts are obtained.

DWORD Error;

Error contains one of the following CommDlgExtendedError codes:

Constant

CDERR-,-DIALOGFAILURE CDERR_FINDRESFAILURE CDERR_LOCKRESOURCEFAILURE CDERR_LOADRESFAILURE CDERR_LOADSTRFAILURE CFERR_MAXLESSTHANMIN CFERR_NOFONTS

DWORD Flags;

Meaning

Failed to create a dialog box.

Failed to find a specified resource.

Failed to lock a specified resource.

Failed to load a specified resource.

Failed to load a specified string.

The size specified in SizeMax is less than the size in SizeMin.

No fonts exist.

Flags can be a combination of the following Windows API constants:

TChooseFontDialog::TData struct

Attributes of the font.

int PointSize;

Point size of the font.

char far* Style;

Meaning

Enables the display and use of the Apply button.

Specifies that the ChooseFontDialog structure allows only the selection of fonts that use the ANSI character set.

Causes the dialog box to list both the available printer and screen fonts.

Enables strikeout, underline, and color effects.

Enables fixed-pitch fonts only. I

Indicates an error if the user selects a nonexistent font or style.

Uses the LOG FONT structure at which LogFont points to initialize the dialog controls.

Limits font selection to those between SizeMin and SizeMax.

Does not allow GOI font simulations.

Causes the dialog box to list only the fonts supported by the printer that is associated with the device context.

Allows only the selection of scalable fonts.

Causes the dialog box to list only the system-supported screen fonts.

Causes the dialog box to show the Help button.

Enumerates and allows the selection of TrueType fonts only.

Specifies that Style points to a buffer containing the style attributes used to initialize the selection of font styles.

Allows only the selection of fonts available on both the printer and the screen.

Style of the font such as bold, italic, underline, or strikeout.

WORD FontType;

Font type or name.

int SizeMaxi

Maximum size of the font.

int SizeMin;

Minimum size of the font.

ObjectWindows 2.0 Reference Guide

TClientDC class

See also: TChooseFontDialog::Data

TClientDC class dc.h

Constructor

A DC class derived from TWindowDC, TClientDC provides access to the client area owned by a window.

Public constructors

TClientDC(HWND wnd);

Creates a TClientDC object with the given owned window. The data member Wnd is set to wnd.

See also: TWindowDC::Wnd, TDC::TDC

TClipboard class clipboar.h

DefaultProtocol

CloseClipboard

TClipboard encapsulates several Windows API Clipboard functions that manipulate Clipboard data. You can open, close, empty, and paste data in a variety of data formats between the Clipboard and the open window.

Public data members

static const char* DefaultProtocol;

Points to a string that specifies the name of the protocol the client needs.

The default protocol is "StdFileEditing," which is the name of the object linking and embedding protocol. The macros _OLE_H or _INC_OLE must be defined before this function can be used.

See also: TClipboard::QueryCreate

Public member functions

inline void CloseClipboard()

Closes the Clipboard and returns TRUE if the Clipboard is closed or FALSE if it is not closed. Closing the Clipboard allows other applications to access the Clipboard.

See also: TClipboard: :CloseClipboard, : :CloseClipboard

TClipboard class

CountClipboardFormats inline int CountClipboardFormats () constj

EmptyClipboard

Returns a count of the number of types of data formats the Clipboard can use.

See also: TClipboard::RegisterClipboardFormats inline BOOL EmptyClipboard() j

Clears the Clipboard and frees any handles to the Clipboard's data. Returns TRUE if the Clipboard is empty, or FALSE if an error occurs.

See also: ::EmptyClipboard

GetClipboardData inline HANDLE GetClipboardData (DINT format) const j

Retrieves data from the Clipboard in the format specified by format. For a description of Windows CF _xxxx data formats, see the Windows API online Help.

See also: TClipboard::SetClipboardData, ::GetClipboardData

GetClipboardFormatName inline int GetClipboardFormatName (DINT format I char far* formatName I int maxCount) constj

Retrieves the name of the registered format specified by format and copies the format to the buffer pointed to by formatName. maxCount specifies the maximum length of the name of the format. If the name is longer than maxCount, it is truncated.

See also: TClipboard::CountClipboardFormats GetClipboardOwner inline HWND GetClipboardOwner () const j

Retrieves the handle of the window that currently owns the Clipboard.

See also: ::GetClipboardOwner

GetClipboardViewer inline HWND GetClipboardViewer () const j

Retrieves the handle of the first window in the Clipboard-view chain.

See also: TClipboard:: SetClipboardViewer GetOpenClipboardWindow HWND GetOpenClipboardWindow () const j

Retrieves the handle of the window that currently has the Clipboard open.

If the Clipboard is not open, the return value is FALSE.

GetPriorityClipboardFormat inline int GetpriorityClipboardFormat (DINT FAR * priorityList I int count) constj

68 ObjecfWindows 2.0 Reference Guide

TClipboard class

Returns the first Clipboard format in a list. priorityList points to an array that contains a list of the Clipboard formats arranged in order of priority.

See the Windows API online Help for a description of these formats.

IsClipboardFormatAvaiiable inline BOOL IsClipboardFormatAvailable (DINT format) const i

OpenClipboard

operator BOOl

QueryCreate

QueryLink

Indicates if the format specified in format exists for use in the Clipboard. See the Windows API online Help for a description of Clipboard data formats.

See also: ::IsClipboardFormatAvailable inline BOOL OpenClipboard(HWND Wnd) i

Opens the Clipboard and associates it with the window specified in Wnd.

See also: TClipboard::CloseClipboard, ::OpenClipboard operator BOOL() consti

Checks handle. Should use IsOk instead.

inline BOOL QueryCreate(const char far* protocol = DefaultProtocol, OLEOPT_RENDER renderopt = 01 erender_draw , OLECLIPFORMAT format

=

0);

QueryCreate determines if the object on the Clipboard supports the specified protocol and rendering options. DefaultProtocol points to a string specifying the name of the protocol the client needs to use. renderopt specifies the client application's display and printing preference for the Clipboard object.

renderopt is set to olerender _draw, which specifies that the client application calls the Windows API function OleDraw, which tells the client library to obtain and manage the data presentation. format specifies the Clipboard format the client application requests. The macros _OLE_H or _INC_OLE mustbe defined before this function can be used.

See the Windows API online Help for more information and a description of Clipboard formats.

See also: TClipboard::QueryLink

inline BOOL QueryLink(const char far*protocol = DefaultProtocol, OLEOPT_RENDER renderopt

=

olerender_draw, OLECLIPFORMAT format

=

O)i

QueryLink determines if a client application can use the Clipboard data to produce a linked object that uses the specified protocol and rendering options. See TClipboard::QueryCreate for a description of the parameters.

The macros _OLE_H or _INC_OLE must be defined before this function can be used.

TClipboard class

See the Windows API online Help for more information about this function.

See also: TClipboard::QueryCreate

RegisterClipboardFormat inline UINT RegisterClipboardFormat (const char far* formatName) const;

SetClipboardData

Registers a new Clipboard format. formatName points to a character string that identifies the new format. If the format can't be registered, the return value is O. See the Windows API onlin.e Help for more information.

See also: . TClipboard::CountClipboardFormats

inline HANDLE SetClipboardData(UINT format, HANDLE handle);

Sets a handle to the block of data at the location indicated by handle. format specifies the format of the data block. If successful, the return value is a handle to the data; if an error occurs, the return value is O. See the Windows API online Help for more information.

See also: TClipboard::GetClipboardData, ::SetClipboardData SetClipboardViewer inline HWND SetClipboardViewer (HWND Wnd) const;

IsOpen

TheClipboard

Constructor

Destructor

70

Adds the window specified by Wnd to the chain of windows that

WM_DRA WCLIPBOARD notifies whenever the contents of the Clipboard change.

See also: TClipboard::GetClipboardViewer

Protected data members

BOOL IsOpen;

Returns TRUE if the Clipboard is open.

static TClipboard TheClipboard;

Im Dokument Reference Guide (Seite 70-83)