zWindow Class Reference

BASE CLASS FOR ANY WINDOWS CONTROLS. More...

#include <Zclass.h>

Inheritance diagram for zWindow:
zAnimate zAviCapture zButton zComboBox zDateTime zDBButton zEdit zForm zGrid zHSplitter zIPAddress zListBox zListView zMonthCal zPager zPicture zProgressBar zRebar zRichEdit zStatic zStatusBar zTabSheet zToolBar zTrackBar zTreeView zUpDown zVSplitter

List of all members.

Public Member Functions

COLORREF BackColor (void)
void BackColor (COLORREF color)
void Brush (COLORREF color)
COLORREF BrushColor (void)
void CaptureMouse (void)
void ClientRectangle (void)
void WindowRectangle (void)
void Clear (void)
void DrawMenu (void)
void Disable (void)
void Enable (void)
void EnableFlag (bool flag)
void Align (void)
void Focus (void)
void onForeground (void)
COLORREF ForeColor (void)
void ForeColor (COLORREF color)
bool isEnabled (void)
bool isNotEnabled (void)
bool isNotNull (void)
bool isNotValidDate (void)
bool isNull (void)
bool isValidDate (void)
bool isVisible (void)
bool isNotVisible (void)
bool hasFocus (void)
bool hasNoFocus (void)
int Height (void)
void MoveAndResize (int x, int y, int cx, int cy)
void Freeze (void)
void Unfreeze (void)
void Invalidate (LPCRECT rect=0, bool erase=__yes)
void ReleaseMouse (void)
void MoveY2Center (void)
void MoveX2Center (void)
void Move2Center (void)
void Move2ParentCenter (void)
void Restyle (bool refresh=__no)
void SendChar (TCHAR chCharCode)
void SendKey (WPARAM KeyCode)
void Show (int nCmdShow=SW_RESTORE)
void Style (void)
void Text (zDBColumn &)
void Text (LPCTSTR)
xstring Text (void)
int TextLength (void)
int Width (void)
HWND Handle (void)
void ZOrder (HWND hWndInsertAfter)
virtual void Load (void)
virtual void Define (void)

Public Attributes

bind_info bind
init_info init
style_info style
scroll_info scroll
label_info label
align_info align
xicon icon
zWindowparent
short win_show_state
int win_type
xrectangle win_rect
xrectangle client_rect
void * userdata
xstring cargo
xstring tag
xstring name
xstring hint
xstring null_msg
xfont font
xstring image
int image_rop
short effects

Detailed Description

BASE CLASS FOR ANY WINDOWS CONTROLS.

% Provides methods for manipulating a generic window. In a graphical Win32-based application,a window is a rectangular area of the screen where the application displays output and receives input from the user. Therefore, one of the first tasks of a graphical Win32-based application is to create a window. A window shares the screen with other windows,including those from other applications. Only one window at a time can receive input from the user. The user can use the mouse, keyboard, or other input device to interact with this window and the application that owns it.


Member Function Documentation

void zWindow::Align ( void   ) 

Resizes and aligns the window using the align-to-parent informations.

void zWindow::BackColor ( COLORREF  color  )  [inline]

Sets the background color used to display text.

Parameters:
color - A COLORREF value representing the color. When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

Reimplemented in zMonthCal, and zGrid.

COLORREF zWindow::BackColor ( void   )  [inline]

Retrieves the background color used to display text. When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

void zWindow::Brush ( COLORREF  color  ) 

Sets the brush color used to erase the window's background.

Parameters:
color - A COLORREF value representing the color. When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.
COLORREF zWindow::BrushColor ( void   )  [inline]

Retrieves the brush color used to erase the window's background. When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

void zWindow::CaptureMouse ( void   )  [inline]

Sets the mouse capture to the specified window belonging to the current thread. Once a window has captured the mouse, all mouse input is directed to that window, regardless of whether the cursor is within the borders of that window. Only one window at a time can capture the mouse.

void zWindow::Clear ( void   )  [inline]

Clears the window's text.

Reimplemented in zDateTime.

void zWindow::ClientRectangle ( void   )  [inline]

Retrieves the xrectangle object that represents the client area of the control. Because client coordinates are relative to the upper-left corner of the client area of the control, the coordinates of the upper-left corner of the returned rectangle are (0,0). Refer to zWindow::client_rect.

Reimplemented in zForm.

virtual void zWindow::Define ( void   )  [inline, virtual]

Loads the default properties. A property is an attribute of a control, field, or database object that you set to define one of the object's characteristics or an aspect of its behavior. For example, the Visible property affects whether a control can be seen at run time. You can change an object's property settings at design-time.

void zWindow::Disable ( void   )  [inline]

Disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses.

void zWindow::DrawMenu ( void   )  [inline]

Redraws the menu bar of the specified window. If the menu bar changes after the system has created the window, this function must be called to draw the changed menu bar.

void zWindow::Enable ( void   )  [inline]

Enables mouse and keyboard input to the specified window or control. When input is enabled, the window receives all input.

void zWindow::EnableFlag ( bool  flag  ) 

Enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.

void zWindow::Focus ( void   )  [inline]

Sets the keyboard focus to the specified window. The window must be associated with the calling thread's message queue.

void zWindow::ForeColor ( COLORREF  color  )  [inline]

Sets the foreground color used to display text.

Parameters:
color - A COLORREF value representing the color. When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

Reimplemented in zMonthCal.

COLORREF zWindow::ForeColor ( void   )  [inline]

Retrieves the foreground color used to display text. When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

void zWindow::Freeze ( void   )  [inline]

Clears the redraw flag. If the redraw flag is cleared, the content of the given window is not updated after each change, and the window is not repainted until the redraw flag is set. For example, an application that must add several items to a list box can clear the redraw flag, add the items, and then set the redraw flag. Finally, the application can call the InvalidateRect function to cause the list box to be repainted.

Reimplemented in zGrid.

HWND zWindow::Handle ( void   )  [inline]
Returns:
the handle to the window associated with the object. It will be zero if the window does not exists.
bool zWindow::hasFocus ( void   )  [inline]
Returns:
true if the window has the keyboard focus.
bool zWindow::hasNoFocus ( void   )  [inline]
Returns:
true if the window does not have the keyboard focus.
int zWindow::Height ( void   )  [inline]

Retrieves the height of a window in pixels.

void zWindow::Invalidate ( LPCRECT  rect = 0,
bool  erase = __yes 
)

Adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn.

Parameters:
rect - Pointer to a RECT structure that contains the client coordinates of the rectangle to be added to the update region. If this parameter is NULL, the entire client area is added to the update region.
erase - Specifies whether the background within the update region is to be erased when the update region is processed. If this parameter is TRUE, the background is erased. If this parameter is FALSE, the background remains unchanged.
bool zWindow::isEnabled ( void   )  [inline]
Returns:
___yes if the window is enabled, otherwise __no.
bool zWindow::isNotEnabled ( void   )  [inline]
Returns:
___yes if the window is not enabled, otherwise __no.
bool zWindow::isNotNull ( void   )  [inline]
Returns:
___yes if the text window is not null, otherwise __no.

Reimplemented in zComboBox, and zPicture.

bool zWindow::isNotValidDate ( void   )  [inline]
Returns:
___yes if the text window does not represent a valid date, otherwise __no.
bool zWindow::isNotVisible ( void   )  [inline]
Returns:
true if the window is not visible. The visibility state of a window is indicated by the VISIBLE style bit. When VISIBLE is set, the window is displayed and subsequent drawing into it is displayed as long as the window has the VISIBLE style. Any drawing to a window with the VISIBLE style will not be displayed if the window is obscured by other windows or is clipped by its parent window.
bool zWindow::isNull ( void   ) 
Returns:
___yes if the text window is null, otherwise __no.

Reimplemented in zComboBox, and zPicture.

bool zWindow::isValidDate ( void   ) 
Returns:
___yes if the text window does represent a valid date, otherwise __no.
bool zWindow::isVisible ( void   )  [inline]
Returns:
true if the window is visible. The visibility state of a window is indicated by the VISIBLE style bit. When VISIBLE is set, the window is displayed and subsequent drawing into it is displayed as long as the window has the VISIBLE style. Any drawing to a window with the VISIBLE style will not be displayed if the window is obscured by other windows or is clipped by its parent window.
virtual void zWindow::Load ( void   )  [inline, virtual]

Creates the window, show it and sets the basic properties. The WMCreate events will occurs before and after the creation of the window.

void zWindow::Move2Center ( void   )  [inline]

Centers the window on the central axes of the screen.

void zWindow::Move2ParentCenter ( void   )  [inline]

Centers the window on the central axes of its own parent window.

void zWindow::MoveAndResize ( int  x,
int  y,
int  cx,
int  cy 
)

Changes the size and position of the window.

Parameters:
x - Specifies the new position of the left side of the window, in client coordinates.
y - Specifies the new position of the top of the window, in client coordinates.
cx - Specifies the new width of the window, in pixels.
cy - Specifies the new height of the window, in pixels.
void zWindow::MoveX2Center ( void   )  [inline]

Centers the window on the X central axe of the screen.

void zWindow::MoveY2Center ( void   )  [inline]

Centers the window on the X central axe of the screen.

void zWindow::onForeground ( void   )  [inline]

Puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user. The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads. The foreground window is the window at the top of the Z order. It is the window that the user is working with. In a preemptive multitasking environment, you should generally let the user control which window is the foreground window.

void zWindow::ReleaseMouse ( void   )  [inline]

Releases the mouse capture from a window in the current thread and restores normal mouse input processing. A window that has captured the mouse receives all mouse input, regardless of the position of the cursor, except when a mouse button is clicked while the cursor hot spot is in the window of another thread.

void zWindow::Restyle ( bool  refresh = __no  ) 

Modifies the window styles and the extended window styles. Refreshs the window using stored values into public attributes style.base and style.extended.

void zWindow::SendChar ( TCHAR  chCharCode  )  [inline]

Posts a character code to the window with the keyboard focus.

Parameters:
chCharCode - Specifies the character code of the key.
void zWindow::SendKey ( WPARAM  KeyCode  )  [inline]

Posts a character code to the window with the keyboard focus.

Parameters:
chCharCode - Specifies the character code of the key.
void zWindow::Show ( int  nCmdShow = SW_RESTORE  ) 

Sets the specified window's show state. zWindow::win_show_state will be set to store the current show state.

Parameters:
nCmdShow - Specifies how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. In subsequent calls, this parameter can be one of the following values:

  • SW_FORCEMINIMIZE - Windows 2000: Minimizes a window, even if the thread that owns the window is hung.This flag should only be used when minimizing windows from a different thread.
  • SW_HIDE - Hides the window and activates another window.
  • SW_MAXIMIZE - Maximizes the specified window.
  • SW_MINIMIZE - Minimizes the specified window and activates the next top-level window in the Z order.
  • SW_RESTORE - Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
  • SW_SHOW - Activates the window and displays it in its current size and position.
  • SW_SHOWDEFAULT - Sets the show state based on the SW_ value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
  • SW_SHOWMAXIMIZED - Activates the window and displays it as a maximized window.
  • SW_SHOWMINIMIZED - Activates the window and displays it as a minimized window.
  • SW_SHOWMINNOACTIVE - Displays the window as a minimized window. This value is similar to SW_SHOWMINIMIZED, except the window is not activated.
  • SW_SHOWNA Displays - the window in its current size and position. This value is similar to SW_SHOW, except the window is not activated.
  • SW_SHOWNOACTIVATE - Displays a window in its most recent size and position. This value is similar to SW_SHOWNORMAL, except the window is not actived.
  • SW_SHOWNORMAL - Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

Reimplemented in zGrid.

void zWindow::Style ( void   ) 

Refreshes public values of style.base and style.extended.

xstring zWindow::Text ( void   )  [inline]

Retrieves the window’s title to the specified text. If the window is a control, the text within the control is retrieived.

Reimplemented in zDateTime.

void zWindow::Text ( LPCTSTR   ) 

Sets the window’s title to the specified text. If the window is a control, the text within the control is set.

Reimplemented in zDateTime, and zTabSheet.

void zWindow::Text ( zDBColumn  ) 

Sets the window’s text by interpreting a value retrieved from a zDBColumn object.

int zWindow::TextLength ( void   )  [inline]

Retrieves the length, in characters, of the text associated with a window. The length does not include the terminating null character.

void zWindow::Unfreeze ( void   )  [inline]

Sets the redraw flag. If the redraw flag is cleared, the content of the given window is not updated after each change, and the window is not repainted until the redraw flag is set. For example, an application that must add several items to a list box can clear the redraw flag, add the items, and then set the redraw flag. Finally, the application can call the InvalidateRect function to cause the list box to be repainted.

Reimplemented in zGrid.

int zWindow::Width ( void   )  [inline]

Retrieves the width of a window in pixels.

void zWindow::WindowRectangle ( void   )  [inline]

Retrieves the xrectangle object that represents the bounding area of the control. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. Refer to zWindow::win_rect.

void zWindow::ZOrder ( HWND  hWndInsertAfter  ) 

Changes the Z order and position of the window. The Z order is the stack of overlapping windows. Each window has a unique position in the Z order.

Parameters:
hWndInsertAfter - Handle to the window to precede the positioned window in the Z order. This parameter must be a window handle or one of the following values: HWND_BOTTOM - Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows. HWND_NOTOPMOST - Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window. HWND_TOP - Places the window at the top of the Z order. HWND_TOPMOST - Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.

Member Data Documentation

Values that determines whether an object is displayed in any size anywhere on a form or whether it's displayed at the top, bottom, left, or right of the form and is automatically sized to fit the form's width

Binding informations. A bound object is a control on a form or report whose contents are associated with a particular field in the underlying table or query. For example, a text box that displays an employee's last name might be bound to the LastName field in the Employees table.

Is the string value associated with the window. Each window has a corresponding string value intended for use by the application that created the window.

It is used by the zWindow::ClientRectangle method to receives the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).

Sets the specials. If contains __transparentback the device context background remains untouched when drawing text.

The font's object.

Specifies the text that appears as a tooltip control or into mainform's status bar.

The icon associated with the object.

Specifies the graphics file to be displayed on the control or an instance resource name.

Specifies how the source pixels, the destination device context's current brush, and the destination pixels are to be combined to form the image to be displayed on the control.

  • BLACKNESS Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)
  • CAPTUREBLT Windows 98/Me, Windows 2000/XP: Includes any windows that are layered on top of your window in the resulting image. By default, the image only contains your window.
  • DSTINVERT Inverts the destination rectangle.
  • MERGECOPY Merges the colors of the source rectangle with the brush currently selected in hdcDest, by using the Boolean AND operator.
  • MERGEPAINT Merges the colors of the inverted source rectangle with the colors of the destination rectangle by using the Boolean OR operator.
  • NOMIRRORBITMAP Windows 98/Me, Windows 2000/XP: Prevents the bitmap from being mirrored.
  • NOTSRCCOPY Copies the inverted source rectangle to the destination.
  • NOTSRCERASE Combines the colors of the source and destination rectangles by using the Boolean OR operator and then inverts the resultant color.
  • PATCOPY Copies the brush currently selected in hdcDest, into the destination bitmap.
  • PATINVERT Combines the colors of the brush currently selected in hdcDest, with the colors of the destination rectangle by using the Boolean XOR operator.
  • PATPAINT Combines the colors of the brush currently selected in hdcDest, with the colors of the inverted source rectangle by using the Boolean OR operator. The result of this operation is combined with the colors of the destination rectangle by using the Boolean OR operator.
  • SRCAND Combines the colors of the source and destination rectangles by using the Boolean AND operator.
  • SRCCOPY Copies the source rectangle directly to the destination rectangle.
  • SRCERASE Combines the inverted colors of the destination rectangle with the colors of the source rectangle by using the Boolean AND operator.
  • SRCINVERT Combines the colors of the source and destination rectangles by using the Boolean XOR operator.
  • SRCPAINT Combines the colors of the source and destination rectangles by using the Boolean OR operator.
  • WHITENESS Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)

Binding initialization informations. A bound object is a control on a form or report whose contents are associated with a particular field in the underlying table or query. For example, a text box that displays an employee's last name might be bound to the LastName field in the Employees table.

Label informations. Nedeed to displays a string of text next to the window object.

The name's object.

Specifies the text that is displayed to indicate null window text.

The pointer to the parent window object.

Vertical and horizontal scroll informations. Nedeed to control the process of shifting a data object in a window's client area in order to see parts of the object that extend beyond the border of the client area.

Styles informations. Represents the display type and behavior of the object.

Specifies the value assigned to a radio/check button to toggle against the binded database column value.

Is the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.

It is used by the zWindow::WindowRectangle method to receives the screen coordinates of the upper-left and lower-right corners of the window.

Specifies the current window's show state. Refer to zWindow::Show method for values.

Specifies the internal window type; it can be one of the following values:

  • SDI - Single Document Interface child window
  • SDIFRAME - Single Document Interface frame window
  • MDIFRAME - Multiple Document Interface frame window
  • MDICHILD - Multiple Document Interface child window

The documentation for this class was generated from the following file:

Generated on Sun Nov 29 07:22:17 2009 for Rad.on++ by  doxygen 1.6.1