• Keine Ergebnisse gefunden

Teolor class

Im Dokument Reference Guide (Seite 85-97)

Black

Gray

LtBlue

LtCyan

ltG ray

72

Protected data members

HWND HWndNext;

Specifies the next window in the Clipboard-viewer chain.

Response table entries

Response table entry EV _WM_CHANGECBCHAIN EV _ WM_DESTROY EV _WM_DRAWCLIPBOARD

Member function EvChangeCbChain EvDestroy EvDrawClipBoard

color.h

TColor is a support class used in conjunction with the classes TPalette, TPaletteEntry, TRgbQuad, and TRgbTriple to simplify all Windows color operations. TColor has ten static data members representing the standard RGB COLORREF values, from Black to White. Constructors are provided to create TColor objects from COLORREF and RGB values, palette indexes, palette entries, and RGBQUAD and RGBTRIPLE values. See the entries for NBits and NColors for a description of TColor-related functions.

Public data members

static const TColor Black;

The static TColor object with fixed Value set by RGB(O, 0, 0). See the RGB Windows macro for more information.

static const TColor Gray;

Contains the static TColor object with fixed Value set by RGB(128, 128, 128).

static const TColor LtBlue;

Contains the static TColor object with the fixed Value set by RGB(O, 0, 255).

static const TColor LtCyan;

Contains the static TColor object with the fixed Value set by RGB(O, 255, 255).

static const TColor LtGray;

ObjectWindows 2.0 Reference Guide

LtGreen

LtMagenta

LtRed

LtYe II ow

White

Constructor

Constructor

Constructor

Constructor

Teolor class

Contains the static TColor object with the fixed Value set by RGB(192, 192, 192).

static const TColor LtGreen;

Contains the static TColor object with the fixed Value set by RGB(O, 255, 0).

static const TColor LtMagenta;

Contains the static TColor object with the fixed Value set by RGB(255, 0, 255).

static const TColor LtRed;

Contains the static TColor object with the fixed Value set by RGB(255, 0, 0).

static const TColor LtYellow;

Contains the static TColor object with the fixed Value set by RGB(255, 255,0).

static const TColor White;

Contains the static TColor object with the fixed Value set by RGB(255, 255, 255).

See also: Windows macro RGB

Public constructors

TColor() ;

The default constructor sets Value to 0.

See also: TColor::Value TColor(COLORREF value);

Creates a TColor object with Value set to the given value.

See also: TColor:: Value TColor(long value);

TColor(long value) : Value«COLORREF)value) {}

Creates a TColor object with Value set to (COLORREF)value.

See also: TColor::Value, COLORREF TColor(int r, int g, int b);

Creates a TColor object with Value set to RGB(r,g,b).

Te%r class

Constructor

Constructor

Constructor

Constructor

Constructor

Blue

Flags

Green

74

See also: TColor::Value, RGB macro TColor(int r, int g, int b, int f);

Creates a TColor object with Value set to RGB(r,g,b) with the flag byte formed from

f.

See also: TColor::Value, PALETEENTRY struct TColor(int index);

Creates a TColor object with Value set to PALETTEINDEX(index).

See also: TColor::Value, PALETTEINDEX macro TColor(const PALETTEENTRY far& pel;

Creates a TColor object with Value set to:

RGB(pe.peRed, pe.peGreen, pe.peBlue)

See also: TColor::Value, RGB macro, PALETEENTRY struct TColor(const RGBQUAD far& q);

Creates a TColor object with Value set to:

RGB(q.rgbRed, q.rgbGreen, q.rgbBlue)

See also: TColor::Value, RGB macro, RGBQUAD struct TColor(const RGBTRIPLE far& t);

Creates a TColor object with Value set to:

RGB(t.rgbtRed, t.rgbtGreen, t.rgbtBlue)

See also: T(;olor::Value, RGB macro, RGBTRIPLE struct

Public member functions

inline BYTE Blue() const;

Returns the blue component of this color's Value . . See also: TColor::Red, TColor::Green, RGB

inline BYTE Flags() const;

Returns the peFlags value of this object's Value.

See also: TPaletteEntry inline BYTE Green() const;

ObjecfWindows 2.0 Reference Guide

, operator==

operator

COLORREF()

Index

Pallndex

Pal Relative

Red

Rgb

Value

Returns the green component of this color's Value.

See also: TColor::Red, TColor::Blue, RGB inline BOOL operator==(const TColor& clrVal);

reolor class

Returns TRUE if this color's Value equals clrValue; otherwise returns FALS~.

See also: TColor::Value

inline operator COLORREF() const;

Type-conversion operator that returns Value.

See also: TColor::Value inline int Index() const;

Returns the index value corresponding to this color's Value by masking out the two upper bytes. Used when color is a palette index value.

See also: TColor::Value, COLORREF . inline TColor PalIndex() const;

Returns the palette index corresponding to this color's Value. The returned color has the high-order byte set to l.

See also: TColor:: Value, TColor::lndex, COLORREF inline TColor PalRelative() const;

Returns the palette-relative RGB corresponding to this color's Value. The returned color has the high-order byte set to 2.

See also: TColor:: Value, TColor::Rgb, COLORREF inline BYTE Red() const;

Returns the red component of this color's Value.

See also: TColor::Blue, TColor::Green, RGB inline TColor Rgb() const;

Returns the explicit RGB color corresponding to this color's Value by masking out the high-order byte.

See also: TColor::Value, COLORREF

Protected data members

COLORREF Value;

TColor class

The color value of this TColor object. Value can have three different forms, depending on the application:

• Explicit values for RGB (red, green, blue)

• An index into a logical color palette

• A palette-relative RGB value

TComboBox class combobox.h

TextLen

Constructor

76

You can use TComboBox to create a combo box or a combo box control in a parent TWindow, or to facilitate communication between your application and the combo-box controls of TDialog. TComboBox objects inherit most of their behavior from TListBox. This class is streamable.

There are three types of combo boxes: simple, drop down, and drop down list. These types are governed by the style constants CBS_SIMPLE,

CBS_DROPDOWN, and CBS_DROPDOWNLIST. These constants, supplied to the constructor of a TComboBox, tell Windows the type of combo box element to create.

Public data members

WORD TextLeni

Contains the length of the text in the combo box's associated edit control.

Public constructors

TComboBox(TWindow *parent, int Id, int x, int y, int w, int h, DWORD style, WORD textLen, TModule* module = O)i

Constructs a combo box object with the specified parent window (parent), controlID (Id), position (x, y) relative to the origin of the parent window's client area, width (w), height (h), style (style), and text length (textLen).

Invokes the TListBox constructor with similar parameters. Then sets Attr.Style as follows:

Attr.Style = WS_CHILD I WS_VISIBLE I WS_GROUP I WS_TABSTOP I CBS_SORT I CBS_AUTOHSCROLL I WS_VSCROLL I style;

One of the following combo box style constants must be among the styles set in style: CBS_SIMPLE, CBS_DROPDOWN, CBS_DROPDOWNLIST, CBS_OWNERDRA WFIXED, or CBS_OWNERDRA WV ARIABLE.

ObjectWindows 2.0 Reference Guide

Constructor

AddString

Clear

ClearList

DeleteString

DirectoryList

FindString

GetCount

TComboBox class

See also: TComboBox::TextLen, TListBox::TListBox

TComboBox(TWindow* parent, int Id, WORD textLen, TModule* module

=

0);

Constructs a default combo box with the given parent window, control ID, and text length.

Public member functions

inline virtual int AddString(const char far* string);

Adds a string to an associated list part of a combo box. Returns the index of the string in the list. The first entry is at index zero. Returns a negative value if an error occurs.

inline void Clear();

Clears the text of the associated edit control.

inline virtual void ClearList();

Clears out all associated entries in the associated list.

inline virtual int DeleteString(int index);

Deletes the string at the passed index in the associated list part of a combo box. Returns a count of the entries remaining in the list or a negative value if an error occurs.

inline virtual int DirectoryList(UINT attrs, const char far* fileSpec);

Fills the combo box with file names from a specified directory.

inline virtual int FindString(const char far* find, int indexStart) const;

Searches for a match beginning at the passed Index. If a match is not found after the last string has been compared, the search continues from the beginning of the list until a match is found or until the list has been completely traversed. Returns the index of the first string in the associated list part of a combo box or a negative value if an error occurs.

inline virtual int GetCount() const;

Returns the number of entries in the associated list part of the combo box or a negative value if an error occurs.

GetDroppedControlRect inline void GetDroppedControlRect (TRect& Rect) const;

GetDroppedState

For combo boxes, gets the screen coordinates of the dropped down list box.

inline BOOL GetDroppedState() const;

TComboBox class

GetEditSel

GetExtendedUI

GetltemData

GetltemHeight

GetSellndex

GetString

GetStringLen

78

For drop down combo boxes, determines if a list box is visible.

int GetEditSel(int &startPas, int &endPas);

Returns the starting and ending positions of the text selected in the associated edit control. Returns CB_ERR if the combo box has no edit control.

inline BOOL GetExtendedUI() canst;

Determines if the combo box has the extended user interface, which differs from the default user interface in the following ways:

• Displays the list box if the user clicks the static text field.

• Displays the list box if the user presses the -L. key.

• Disables scrolling in the static text field if the item list is not visible.

Returns TRUE if the combo box has the extended user interface; otherwise returns FALSE.

See also: TComboBox::SetExtendedUI

inline virtual DWORD GetltemData(int index) canst;

Returns the 32-bit value associated with the combo box's item.

See also: TListBox::GetItemData

inline int GetltemHeight(int index) canst;

Returns the height in pixels of the Combo box's list items or CB_ERR if an error occurs.

See also: TComboBox::GetItemData, TListBox::GetItemData inline virtual int GetSellndex() canst;

Returns the index of the list selection or a negative value if none exists.

inline virtual int GetString(char far* str, int index) canst;

Retrieves the contents of the string at the position supplied in index and returns it in string. GetString returns the string length or a negative value if an error occurs. The buffer must be large enough for the string and the terminating zero.

See also: TListBox::GetString

inline virtual int GetStringLen(int index) canst;

Returns the string length (excluding the terminating zero) of the item at the position index supplied in index. Returns a negative value if an error occurs.

ObjecfWindows 2.0 Reference Guide

GetText

GetTextLen

HideList

InsertString

SetEditSel

SetExtendedUI

SetltemData

SetltemHeight

SetSellndex

TComboBox class

See also: TListBox::GetStringLen

inline int GetText(char far* str, int maxChars) const;

Retrieves the number of characters in the edit or static portion of the combo box.

inline int GetTextLen() const;

Returns the text length (excluding the terminating zero) of the edit control or static portion of the combo box.

inline void HideList();

Hides the drop down list of a drop down or drop down list combo box.

inline virtual int InsertString(const char far* str, int index);

Inserts a string in the associated list part of a combo box at the position supplied in Index. Returns the index of the string in the list or a negative value if an error occurs.

See also: TListBox::InsertString

inline int SetEditSel(int startPos, int endPos);

Selects characters that are between startPos and endPos in the edit control of the combo box. Returns CB _ERR if the combo box does not have an edit control.

inline int SetExtendedUI(BOOL extended);

If the combo box has the extended user interface, sets the extended user interface.

See also: TComboBox::GetExtendedUI

inline virtual int SetltemData{int index, DWORD data);

Sets the 32-bit value associated with the TComboBox's item. Returns CB_ERR if an error occurs.

inline int SetltemHeight(int index, int height);

Sets the height of the list items or the edit control portion in a combo box. If the index or height is invalid, returns CB_ERR.

See also: TComboBox::GetItemHeight inline virtual int SetSellndex(int index);

Sets the index of the list selection.

See also: TComboBox::GetSeIIndex

TComboBox class

SetSelString

SetText

ShowList

ShowList

Transfer

inline virtual int SetSelString(const char far* findStr, int indexStart);

Selects a string of characters in the associated list box and sets the contents of the associated edit control to the supplied string.

void SetText(const char far* string);

Selects the first string in the associated list box that begins with the supplied string. If there is no match, SetText sets the contents of the associated edit control to the supplied string and selects it.

inline void ShowList();

Shows the list of a drop down or drop down list combo box.

See also: TComboBox::HideList void ShowList(BOOL show);

Returns TRUE if the list is displayed.

WORD Transfer(void* buffer, TTransferDirection direction);

Transfers the items and selection of the combo box to or from a transfer buffer if tdSetData or tdGetData, respectively, is passed as the direction.

buffer is expected to point to a TComboBoxData structure.

Transfer returns the size of a pointer to a TComboBoxData. To retrieve the size without transferring data, your application must pass tdSizeData as the direction.

. . You must use a pointer in your transfer buffer to these structures. You cannot embed copies of the structures in your transfer buffer, and you cannot use these structures as transfer buffers.

GetClassName

SetupWindow

80

See also: TComboBoxData, TWindow::Transfer Protected member functions

virtual char far* GetClassNarne();

Returns the name of TComboBox's Windows registration class,

"ComboBox."

void Setupwindow();

Sets up the window and limits the amount of text the user can enter in the combo box's edit control to the value of TextLen minus l.

See also: TWindow::SetupWindow

ObjectWindows 2.0 Reference' Guide

TComboBoxData class

TComboBoxData class combobox.h

ItemDatas

Selection

Sellndex

Strings

Constructor

Destructor

AddltemData

AddString

A TComboBoxData is an interface object that represents a transfer buffer for a TComboBox.

Public data members

TDwordArray* ItemDatas;

Array of DWORDs to transfer into and out of the combo box's associated list box.

See also: TComboBoxData::SetItemData, TComboBoxData::GetItemData char* Selection;

Points to the currently selected string to transfer to or from a combo box.

int SelIndexi

Index of the selected item in the strings array. If zero, the index is used to transfer to. If negative, no item is selected.

TStringArray* Strings;

Array of class string to transfer in or out of the combo box's associated list box.

Public constructors and destructor

TComboBoxData()i

Constructs a TComboBox object, initializes Strings and ItemDatas to empty arrays, and initializes Selection and SelIndex to

o.

~TComboBoxData() i

Deletes Strings, ItemDatas, and Selection.

Public member functions

inline void AddItemData(DWORD itemData) i

Adds the user-defined item data to the ItemDatas array.

void AddString(const char *str, BOOL isSelected

=

FALSE);

TComboBoxData class

AddStringltem

Adds the specified string to the array of Strings. If IsSelected is TRUE, AddString deletes Selection and copies string into Selection.

inline void AddStringltem(const chart str, DWORD itemData, BOOL isSelected

=

FALSE);

Calls AddItemData to add the item data to the ItemDatas array, and calls AddString to add a string to the array of Strings.

TCommonDialog class commdial.h

Constructor

DoCreate

Do Execute

CDTitie

82

Derived from TDialog, TCommonDialog is the abstract base class for TCommonDialog objects. It provides the basic functionality for creating dialog boxes using the common dialog DLL.

Public constructors

TCornrnonDialog(TWindow* parent, const char far* title = 0, TModule*

module = 0);

Invokes a TWindow constructor, passing parent and library ID. Constructs a common dialog box.

Public member functions

HWND DoCreate();

Called by Create, DoCreate creates a modeless dialog box. It returns 0 if unsuccessful.

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

Called by Execute, DoExecute creates a modal dialog box. It returns IDCANCEL if canceled or unsuccessful.

See also: TDialog::Execute

Protected data members

const char far* CDTitle;

CDTitle stores the optional caption displayed in the common dialog box.

ObjecfWindows 2.0 Reference Guide

CmHelp

CmOkCancel

EvClose

SetupWindow

TCommonLJlalog class

See also: TDialog::SetCaption

Protected member functions

inline void CmHelp();

Default handler for the pshHelp push button (the Help button in the dialog box).

inline void CmOkCancel();

Responds to a click on the dialog box's OK or Cancel button by calling DefaultProcessing to let the common dialog DLL process the command.

See also: TDialog::Cancel, TDialog::Ok inline void EvClose();

Responds to a WM_ CLOSE message by calling DefaultProcessing to let the common dialog DLL process the command.

See also: TDialog::EvClose void SetupWindow();

Assigns the caption of the dialog box to CDTitle if CD Title is nonzero.

See also: TDialog::SetupWindow

Response table entries

Response table entry

EV _COMMAND(IDCANCEL, CmOkCancel) EV _COMMAND(IDOK, CmOkCancel) EV _WM_CLOSE

EV_WM_CTLCOLOR

Member function CmOkCancel CmOkCancel EvClose EvCtlColor

TCondFunctype window.h

Defines a member function type used by TWindow's function FirstThat.

typedef BOOL (*TCondFunc) (TWindow *win, void *param);

See also: TWindow::FirstThat

TCondMemFunc typedef

TCondMemFunc typedef window.h

Im Dokument Reference Guide (Seite 85-97)