OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encapsulates many functions that control window behavior and specify window creation and registration attributes. More...
#include <owl/window.h>
Classes | |
class | TChildrenIteratorTemplate |
Utility class template used as an iterator type template for TChildrenRangeTemplate. More... | |
class | TChildrenRangeTemplate |
Utility class template used as a return type for TWindow::GetChildren. More... | |
Public Types | |
typedef HWND | THandle |
TWindow encapsulates an HWND. | |
Public Types inherited from owl::TEventHandler | |
typedef bool(* | TEqualOperator) (const TGenericTableEntry &, const TEventInfo &) |
Public Member Functions | |
void | TraceWindowPlacement () |
TWindow (TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr) | |
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be created and displayed along with parent. | |
TWindow (TWindow *parent, const tstring &title, TModule *module=nullptr) | |
String-aware overload. | |
TWindow (HWND handle, TModule *module=nullptr) | |
Constructs a TWindow that is used as an alias for a non-ObjectWindows window, and sets wfAlias. | |
virtual | ~TWindow () override |
Destroys this window (unless this is an alias) and the children. | |
TApplication * | GetApplication () const |
Gets a pointer to the TApplication object associated with this. | |
virtual bool | Register () |
Registers the Windows registration class of this window, if this window is not already registered. | |
TScroller * | GetScroller () |
Returns the associated scroller object for this window. | |
void | SetScroller (TScroller *scroller) |
Sets the scroller object for this window. | |
virtual void | CloseWindow (int retVal=0) |
Determines if it is okay to close a window before actually closing the window. | |
TWindowAttr & | GetWindowAttr () |
Returns the TWindowAttr structure, which contains the window's creation attributes. | |
const TWindowAttr & | GetWindowAttr () const |
Returns the TWindowAttr structure, which contains the window's creation attributes. | |
LPCTSTR | GetCaption () const |
Returns the Title member of TWindow. | |
virtual bool | CanClose () |
Use this function to determine if it is okay to close a window. | |
void | ChildBroadcastMessage (TMsgId, TParam1=0, TParam2=0) |
Sends the specified message to all immediate children using SendMessage. | |
TResult | HandleMessage (TMsgId, TParam1=0, TParam2=0) |
Dispatches the given message using the response table. | |
virtual TResult | EvCommand (uint id, HWND hWndCtl, uint notifyCode) |
WindowProc calls EvCommand to handle WM_COMMAND messages. | |
virtual TResult | EvNotify (uint id, TNotify ¬ifyInfo) |
Handles WM_NOTIFY and subdispatch messages from child controls. | |
TResult | DefaultProcessing () |
Handles default processing of events, which includes continued processing of menu/accelerators commands and enablers, as well as notifications. | |
virtual void | Paint (TDC &dc, bool erase, TRect &rect) |
Repaints the client area (the area you can use for drawing) of a window. | |
void | SubclassWindowFunction () |
Installs the instance thunk as the WindowProc and saves the old window function in DefaultProc. | |
Query and set the Owl window flags. | |
Accepts TWindowFlag args, possibly or'd together. | |
void | SetFlag (uint mask) |
Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member. | |
void | ClearFlag (uint mask) |
Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member. | |
bool | IsFlagSet (uint mask) |
Returns the state of the bit flag in Attr.Flags whose mask is supplied. | |
Sets/clears auto-create flag | |
It indicates that the TWindow should be created if a create is sent while in the parent's child list | |
void | EnableAutoCreate () |
Ensures that an associated child window interface element is created and displayed along with its parent window. | |
void | DisableAutoCreate () |
Disables the feature that allows an associated child window interface element to be created and displayed along with its parent window. | |
Retrieves/assigns tooltip of/to window | |
virtual TTooltip * | GetTooltip () const |
virtual void | EnableTooltip (bool enable=true) |
void | SetTooltip (TTooltip *tooltip) |
Sets/clears transfer flag | |
It indicates that the TWindow can/will transfer data via the transfer mechanism | |
void | EnableTransfer () |
Enables the transfer mechanism, which allows state data to be transferred between the window and a transfer buffer. | |
void | DisableTransfer () |
Disables (for the interface object) the transfer mechanism, which allows state data to be transferred to and from a transfer buffer. | |
Window's default module access functions | |
TModule * | GetModule () const |
Returns a pointer to the module object. | |
void | SetModule (TModule *module) |
Sets the default module for this window. | |
Convenience functions - forwards the call to the module associated with this window. | |
tstring | LoadString (uint id) const |
HBITMAP | LoadBitmap (TResId id) const |
HACCEL | LoadAccelerators (TResId id) const |
HMENU | LoadMenu (TResId id) const |
HCURSOR | LoadCursor (TResId id) const |
HICON | LoadIcon (TResId id) const |
std::string | LoadHtml (TResId id) const |
Create/destroy an native window to be associated with this window | |
virtual bool | Create () |
Creates the window interface element to be associated with this ObjectWindows interface element. | |
bool | CreateChildren () |
Creates the child windows in the child list whose auto-create flags (with wfAutoCreate mask) are set. | |
virtual void | Destroy (int retVal=0) |
Destroys an MS-Windows element associated with the TWindow. | |
Create a modal window, and perform actual modal execute call | |
virtual int | Execute () |
Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support. | |
virtual int | DoExecute () |
Do actual modal execution using the Begin/End Modal support of TApplication. | |
Attach or detach a window handle to a TWindow object. | |
Used when a child re-creates itself. | |
void | AttachHandle (HWND handle) |
void | DetachHandle () |
Message preprocessing | |
Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message | |
virtual bool | PreProcessMsg (MSG &msg) |
Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message. | |
virtual bool | IdleAction (long idleCount) |
Called when no messages are waiting to be processed, IdleAction performs idle processing as long as true is returned. | |
virtual bool | HoldFocusHWnd (HWND hLose, HWND hGain) |
Responds to a request by a child window to hold its HWND when it is losing focus. | |
Child and parenting | |
int | GetId () const |
Returns Attr.Id, the ID used to find the window in a specified parent's child list. | |
auto | ChildWithId (int id) const -> const TWindow * |
auto | ChildWithId (int id) -> TWindow * |
Returns a pointer to the window in the child window list that has the supplied id. | |
HWND | GetParentH () const |
Return the handle of the parent. | |
TWindow * | GetParentO () const |
Return the OWL's parent for this window. | |
TWindow * | GetParent () const |
Retrieves the OWL object of the parent window. If none exists, returns 0. | |
virtual void | SetParent (TWindow *newParent) |
Sets the parent for the specified window by setting Parent to the specified new Parent window object. | |
void | SetNext (TWindow *next) |
Sets the next window in the sibling list. | |
Other attributes | |
virtual bool | SetDocTitle (LPCTSTR docname, int index) |
Default behavior for updating document title is to pass it to parent frame. | |
bool | SetDocTitle (const tstring &docname, int index) |
void | SetCaption (LPCTSTR title) |
Copies title to an allocated string pointed to by title. | |
void | SetCaption (const tstring &title) |
void | SetCaption (uint resourceStringId) |
Sets the window title to the resource string identified by the given id. | |
bool | SetCursor (TModule *module, TResId resId) |
Sets the mouse cursor for the window, loading the given resId from the given module . | |
auto | GetBkgndColor () const -> TColor |
Returns the overriding background color set for the window. | |
void | SetBkgndColor (TColor color, bool shouldUpdate=true) |
Sets the background color for the window. | |
auto | GetTextColor () const -> TColor |
Returns the overriding text color set for the window. | |
void | SetTextColor (TColor color, bool shouldUpdate=true) |
Sets the text color for the window. | |
void | SetAcceleratorTable (TResId resId) |
Message forwarding | |
Forward the current event to "handle" using either PostMessage() or SendMessage(). Owl window version calls directly to window proc on send. | |
TResult | ForwardMessage (HWND handle, bool send=true) |
Forwards the window's current message. | |
TResult | ForwardMessage (bool send=true) |
Forwards the window's current message. | |
Notify a window (parent usually) of a child action. | |
void | SendNotification (int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND) |
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application. | |
void | SendNotification (HWND receiver, int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND) |
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application. | |
TResult | SendNotification (int id, NMHDR &, TMsgId=WM_NOTIFY) |
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application. | |
TResult | SendNotification (HWND receiver, uint id, NMHDR &, TMsgId=WM_NOTIFY) |
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application. | |
Windows message handlers | |
Virtual functions called to handle a message, and to deal with an unhandled message in a default way. | |
virtual TResult | WindowProc (TMsgId, TParam1, TParam2) |
First virtual function called to handling incoming messages to a TWindow. | |
virtual TResult | DefWindowProc (TMsgId, TParam1, TParam2) |
Virtual function provides final default processing for an incoming message Calls original window proc that was subclassed, using ::CallWindowProc to make sure that registers get setup correctly. | |
Called by WindowProc() to handle WM_COMMAND_ENABLE, & helper function | |
virtual void | EvCommandEnable (TCommandEnabler &ce) |
Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-handling function or calls DefaultProcessing to handle the incoming message. | |
void | RouteCommandEnable (HWND hInitCmdTarget, TCommandEnabler &ce) |
Walks the chain of windows from the initial target window to this window. | |
Transfer buffer functionality | |
void | SetTransferBuffer (void *transferBuffer, uint size) |
Sets TransferBuffer and TransferBufferSize. | |
template<class TBuffer > | |
void | SetTransferBuffer (TBuffer *transferBuffer) |
Sets TransferBuffer and TransferBufferSize. | |
template<class TElement , uint Count> | |
void | SetTransferBuffer (TElement(&transferBuffer)[Count]) |
Sets TransferBuffer and TransferBufferSize. | |
void * | GetTransferBuffer () const |
uint | GetTransferBufferSize () const |
virtual uint | Transfer (void *buffer, TTransferDirection direction) |
Transfers data to or from any window with or without children and returns the total size of the data transferred. | |
virtual void | TransferData (TTransferDirection direction) |
Transfers data between the TWindow's data buffer and the child windows in its ChildList (data is not transfered between any child windows whose wfTransfer flag is not set) | |
Allow a TWindow& to be used as an HWND in Windows API calls | |
HWND | GetHandle () const |
Returns the handle of the window. | |
operator HWND () const | |
Allows a TWindow& to be used as an HWND in Windows API calls by providing an implicit conversion from TWindow to HWND. | |
bool | IsWindow () const |
Returns true if an HWND is being used. | |
Window and class Words and Longs, window properties | |
auto | GetClassName (TCHAR *className, int maxCount) const -> int |
Returns the Windows class name for this object's window handle. | |
long | GetClassLong (int index) const |
Retrieves the 32-bit value containing information about the window class. | |
long | SetClassLong (int index, long newLong) |
Sets the long value at the specified offset (index). | |
uint16 | GetClassWord (int index) const |
Gets a 16-bit value containing information about the class or style of the window. | |
uint16 | SetClassWord (int index, uint16 newWord) |
Sets the word value at the specified offset (index). | |
LONG_PTR | GetWindowLongPtr (int index) const |
Retrieves information about the window depending on the value stored in index. | |
LONG_PTR | SetWindowLongPtr (int index, LONG_PTR newLong) |
Changes information about the window. For a list of constants, see GetWindowLongPtr() | |
long | GetWindowLong (int index) const |
Retrieves information about the window depending on the value stored in index. | |
long | SetWindowLong (int index, long newLong) |
Changes information about the window. | |
uint16 | GetWindowWord (int index) const |
Retrieves information about this window depending on the value of index. | |
uint16 | SetWindowWord (int index, uint16 newWord) |
Changes information about the window. | |
WNDPROC | GetWindowProc () const |
WNDPROC | SetWindowProc (WNDPROC wndProc) |
int | EnumProps (PROPENUMPROC proc) |
Enumerates all the items in the property list of the current window and passes them one by one to the callback function indicated in proc. | |
HANDLE | GetProp (uint16 atom) const |
Returns a handle to the property list of the specified window. | |
HANDLE | RemoveProp (uint16 atom) const |
Removes the property specified by atom from the application's property list. | |
bool | SetProp (uint16 atom, HANDLE data) const |
Adds an item to the property list of the specified window. | |
HANDLE | GetProp (LPCTSTR str) const |
Returns a handle to the property list of the specified window. | |
HANDLE | GetProp (const tstring &str) const |
HANDLE | RemoveProp (LPCTSTR str) const |
Removes the property specified by str, a null-terminated string, from the application's property list. | |
HANDLE | RemoveProp (const tstring &str) const |
bool | SetProp (LPCTSTR str, HANDLE data) const |
Adds an item to the property list of the specified window. | |
bool | SetProp (const tstring &str, HANDLE data) const |
Dual mode accessors. | |
Work with Attr and other members as well as the underlying window information | |
uint32 | GetStyle () const |
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object. | |
uint32 | SetStyle (uint32 style) |
Sets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object. | |
uint32 | GetExStyle () const |
Gets the extra style bits of the window. | |
uint32 | SetExStyle (uint32 style) |
Sets the extra style bits of the window. | |
bool | ModifyStyle (uint32 offBits, uint32 onBits, uint swpFlags=0) |
Modifies the style bits of the window. | |
bool | ModifyExStyle (uint32 offBits, uint32 onBits, uint swpFlags=0) |
Modifies the style bits of the window. | |
Window placement(X,Y) and display | |
bool | MoveWindow (int x, int y, int w, int h, bool repaint=false) |
Repositions the specified window. | |
bool | MoveWindow (const TRect &rect, bool repaint=false) |
Repositions the window. | |
virtual bool | ShowWindow (int cmdShow) |
Displays this TWindow in a given state. | |
void | ShowOwnedPopups (bool show) |
Shows or hides all owned pop-up windows according to the value of show. | |
bool | IsWindowVisible () const |
Returns true if the window is visible. | |
bool | IsZoomed () const |
Returns true if window is zoomed or maximized. | |
bool | IsIconic () const |
Returns true if window is iconic or minimized. | |
int | GetWindowTextLength () const |
Returns the length, in characters, of the specified window's title. | |
int | GetWindowText (TCHAR *str, int maxCount) const |
Copies the window's title into a buffer pointed to by string. | |
tstring | GetWindowText () const |
String-aware overload. | |
void | SetWindowText (LPCTSTR str) |
Sets the window's text to the given string (by copying). | |
void | SetWindowText (const tstring &str) |
void | SetWindowText (uint resourceStringId) |
Sets the window title to the resource string identified by the given id. | |
WINDOWPLACEMENT | GetWindowPlacement () const |
Wrapper for Windows API. | |
void | SetWindowPlacement (const WINDOWPLACEMENT &place) |
Wrapper for Windows API. | |
Window painting: invalidating, validating & updating | |
virtual void | Invalidate (bool erase=true) |
Invalidates (mark for painting) the entire client area of a window. | |
virtual void | InvalidateRect (const TRect &rect, bool erase=true) |
Invalidates a specified client area. | |
void | InvalidateRgn (HRGN hRgn, bool erase=true) |
Invalidates a client area within a region specified by the hRgn parameter when the application receives a WM_PAINT message. | |
void | Validate () |
Calls the function ValidateRect to validate (that is, remove from the area to be updated) the entire client area (the area you can use for drawing). | |
void | ValidateRect (const TRect &rect) |
Validates a portion of the client area indicated by rect. | |
void | ValidateRgn (HRGN hRgn) |
Validates the client area within a region of the current window. | |
void | UpdateWindow () |
Updates the client area of the specified window by immediately sending a WM_PAINT message. | |
bool | FlashWindow (bool invert) |
Changes the window from active to inactive or vice versa. | |
bool | GetUpdateRect (TRect &rect, bool erase=true) const |
Retrieves the screen coordinates of the rectangle that encloses the updated region of the specified window. | |
int | GetUpdateRgn (TRegion &rgn, bool erase=true) const |
Copies a window's update region into a region specified by region. | |
bool | LockWindowUpdate (bool lock=true) |
Prevents or enables window drawing for one window at a time. | |
bool | RedrawWindow (TRect *update, HRGN hUpdateRgn, uint redrawFlags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE) |
Redraws the rectangle specified by update and the region specified by hUpdateRgn. | |
auto | GetWindowRgn (TRegion &) const -> int |
Obtains a copy of the region of the window within which the system permits drawing. | |
void | ResetWindowRgn (bool repaint=false) |
Calls SetWindowRgn(nullptr, repaint) . | |
auto | SetWindowRgn (HRGN, bool repaint=false) -> bool |
Sets the area within the window where the system permits drawing. | |
auto | SetWindowRgn (const TRegion &, bool repaint=false) -> bool=delete |
auto | SetWindowRgn (TRegion &&r, bool repaint=false) -> bool |
Overload for TRegion. | |
Parent/child with Ids | |
int | GetDlgCtrlID () const |
Returns the ID of the control. | |
HWND | GetDlgItem (int childId) const |
Retrieves the handle of a control specified by childId. | |
uint | GetDlgItemInt (int childId, bool *translated=0, bool isSigned=true) const |
Translates the text of a specified control into an integer value and returns it. | |
void | SetDlgItemInt (int childId, uint value, bool isSigned=true) const |
Sets the child window with the Id (childId) in the window to the integer value specified in value. | |
int | GetDlgItemText (int childId, TCHAR *text, int maxValue) const |
Retrieves the text of a control specified by childId. | |
tstring | GetDlgItemText (int childId) const |
String-aware overload. | |
void | SetDlgItemText (int childId, LPCTSTR text) const |
Sets the title or text of a control in a dialog box. | |
void | SetDlgItemText (int childId, const tstring &text) const |
void | SetDlgItemText (int childId, uint resourceStringId) const |
uint | IsDlgButtonChecked (int buttonId) const |
Indicates if the child button specified in the integer parameter, buttonId, is checked, or if a button is grayed, checked, or neither. | |
bool | IsChild (HWND hWnd) const |
Returns true if the window is a child window or a descendant window of this window. | |
HWND | GetNextDlgGroupItem (HWND hWndCtrl, bool previous=false) const |
Returns either the next or the previous control in the dialog box. | |
HWND | GetNextDlgTabItem (HWND hWndCtrl, bool previous=false) const |
Returns the handle of the first control that lets the user press the Tab key to move to the next control (that is, the first control with the WS_TABSTOP style associated with it). | |
void | CheckDlgButton (int buttonId, uint check) |
Places a check mark in (or removes a check mark from) the button specified in buttonId. | |
void | CheckRadioButton (int firstButtonId, int lastButtonId, int checkButtonId) |
Checks the radio button specified by checkButtonId and removes the check mark from the other radio buttons in the group. | |
void | SetDlgItemFont (int childId, HFONT f, bool redraw=false) const |
HFONT | GetDlgItemFont (int childId) const |
TRect | GetDlgItemRect (int childId) const |
Returns the window rectangle of the given child, specified in this window's client coordinates. | |
Menus and menubar | |
HMENU | GetMenu () const |
Returns the handle to the menu of the indicated window. | |
HMENU | GetSystemMenu (bool revert=false) const |
Returns a handle to the system menu so that an application can access the system menu. | |
bool | SetMenu (HMENU hMenu) |
Sets the specified window's menu to the menu indicated by hMenu. | |
bool | HiliteMenuItem (HMENU hMenu, uint idItem, uint hilite) |
Either highlights or removes highlighting from a top-level item in the menu. | |
void | DrawMenuBar () |
DrawMenuBar redraws the menu bar. | |
Timer | |
bool | KillTimer (UINT_PTR timerId) |
Gets rid of the timer and removes any WM_TIMER messages from the message queue. | |
UINT_PTR | SetTimer (UINT_PTR timerId, uint timeout, TIMERPROC proc=0) |
Creates a timer object associated with this window. | |
Hot keys | |
bool | RegisterHotKey (int idHotKey, uint modifiers, uint virtKey) |
Registers a hotkey ID with the current application. | |
bool | UnregisterHotKey (int idHotKey) |
Unregisters a hotkey ID with the current application. | |
Misc | |
bool | WinHelp (LPCTSTR helpFile, uint command, ULONG_PTR data) const |
Invokes a specified help system. | |
bool | WinHelp (const tstring &helpFile, uint command, ULONG_PTR data) const |
void | AssignContextMenu (TPopupMenu *menu) |
Associates a pop-up menu with the window so that it can automatically handle a WM_CONTEXTMENU message. | |
TPopupMenu * | GetContextMenu () const |
Returns the associated popup menu used by the window. | |
int | MessageBox (LPCTSTR text, LPCTSTR caption=0, uint flags=MB_OK) const |
Creates and displays a message box that contains a message (text), a title (caption), and icons or push buttons (type). | |
int | MessageBox (const tstring &text, const tstring &caption=tstring(), uint flags=MB_OK) const |
int | MessageBox (uint resId, LPCTSTR caption=0, uint flags=MB_OK) const |
int | MessageBox (uint resId, const tstring &caption, uint flags=MB_OK) const |
auto | MessageBoxIndirect (HINSTANCE resourceModule, TResId text, TResId caption, uint flags, TResId icon, DWORD_PTR contextHelpId, MSGBOXCALLBACK, DWORD languageId) const -> int |
Displays a standard message box. | |
auto | MessageBoxIndirect (TResId icon, const tstring &text, const tstring &caption, uint flags=MB_OK) const -> int |
Displays a standard message box using the given icon. | |
auto | FormatMessageBox (const tstring &formatStr, const tstring &caption, uint flags,...) const -> int |
auto | FormatMessageBox (const tstring &, std::nullptr_t, uint,...) const -> int=delete |
HTASK | GetWindowTask () const |
Returns a handle to the task that created the specified window. | |
void | DragAcceptFiles (bool accept) |
If a window can process dropped files, DragAcceptFiles sets accept to true. | |
TCurrentEvent & | GetCurrentEvent () |
Returns the current event to be processed in the message queue. | |
void | SethAccel (HACCEL) |
Public Member Functions inherited from owl::TEventHandler | |
virtual bool | Find (TEventInfo &info, TEqualOperator op=0) |
Searches the list of response table entries looking for a match. | |
TResult | Dispatch (TEventInfo &info, TParam1, TParam2=0) |
Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handling function. | |
TResult | DispatchMsg (TMsgId, uint id, TParam1, TParam2) |
Search for the event given the message and it and dispatch to the event handler if found. | |
Public Member Functions inherited from owl::TStreamableBase | |
virtual | ~TStreamableBase () |
Protected Member Functions | |
TWindow () | |
Protected constructor for use by immediate virtually derived classes. | |
void | Init (TWindow *parent, LPCTSTR title, TModule *module) |
Normal initialization of a default constructed TWindow. | |
void | Init (TWindow *parent, const tstring &title, TModule *module) |
void | Init (HWND hWnd, TModule *module) |
Wrapper initialization of a default constructed TWindow. | |
virtual THandle | PerformCreate () |
Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow. | |
void | SetHandle (THandle) |
Sets the window handle in a derived class. | |
void | GetHWndState (bool forceStyleSync=false) |
Copies the style, coordinate, and the resource id (but not the title) from the existing HWnd into the TWindow members. | |
void | GetWindowTextTitle () |
Updates the TWindow internal caption (Title) from the current window's caption. | |
virtual void | GetWindowClass (WNDCLASS &wndClass) |
Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structure with registration attributes, thus, allowing instances of TWindow to be registered. | |
virtual auto | GetWindowClassName () -> TWindowClassName |
void | PerformSetupAndTransfer () |
Ensures that the window is fully set up; then transfers data into the window. | |
virtual void | SetupWindow () |
Performs setup following creation of an associated MS-Windows window. | |
virtual void | CleanupWindow () |
Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an opportunity to clean up HWND related resources. | |
void | DispatchScroll (uint scrollCode, uint thumbPos, HWND hWndCtrl) |
Called by EvHScroll and EvVScroll to dispatch messages from scroll bars. | |
void | LoadAcceleratorTable () |
Loads a handle to the window's accelerator table specified in the TWindowAttr structure (Attr.AccelTable). | |
virtual void | RemoveChild (TWindow *child) |
Removes a child window. | |
TWindow * | GetWindowPtr (HWND hWnd) const |
Calls TApplication:GetWindowPtr on the application associated with this window. | |
These events are processed by TWindow | |
void | EvClose () |
The default response to a WM_CLOSE message is to call CloseWindow() and then have the window deleted if the Handle was really destroyed. | |
bool | EvCreate (CREATESTRUCT &) |
Response method for an incoming WM_CREATE message. | |
void | EvDestroy () |
Responds to an incoming WM_DESTROY message. | |
int | EvCompareItem (uint ctrlId, const COMPAREITEMSTRUCT &compareInfo) |
Handles WM_COMPAREITEM message (for owner draw controls) by forwarding message to control itself. | |
void | EvDeleteItem (uint ctrlId, const DELETEITEMSTRUCT &deleteInfo) |
Handles WM_DELETEITEM message (for owner draw controls) by forwarding message to control itself. | |
void | EvDrawItem (uint ctrlId, const DRAWITEMSTRUCT &drawInfo) |
void | EvMeasureItem (uint ctrlId, MEASUREITEMSTRUCT &measureInfo) |
Handles WM_MEASUREITEM message (for owner draw controls & menus) by forwarding message to control itself. | |
void | EvHScroll (uint scrollCode, uint thumbPos, HWND hWndCtl) |
Response method for an incoming WM_HSCROLL message. | |
void | EvVScroll (uint scrollCode, uint thumbPos, HWND hWndCtl) |
Response method for an incoming WM_VSCROLL message. | |
void | EvMove (const TPoint &clientOrigin) |
Save the normal position of the window. | |
void | EvNCDestroy () |
Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface element. | |
bool | EvQueryEndSession (uint flags) |
Respond to Windows attempt to close down. | |
void | EvSize (uint sizeType, const TSize &size) |
Response method for an incoming WM_SIZE message. | |
void | EvLButtonDown (uint modKeys, const TPoint &point) |
Response method for an incoming WM_LBUTTONDOWN message. | |
bool | EvEraseBkgnd (HDC) |
Handler for WM_ERASEBKGND. | |
void | EvPaint () |
Response method for an incoming WM_PAINT message. | |
void | EvSysColorChange () |
Respond to WM_SYSCOLORCHANGE by broadcasting it to all children. | |
Input validation message handler | |
void | EvChildInvalid (HWND hWnd) |
Handle message posted to us by a control needing assistance in dealing with invalid inputs. | |
System messages | |
void | EvCompacting (uint compactRatio) |
The default message handler for WM_COMPACTING. | |
void | EvDevModeChange (LPCTSTR devName) |
The default message handler for WM_DEVMODECHANGE. | |
void | EvEnable (bool enabled) |
The default message handler for WM_ENABLE. | |
void | EvEndSession (bool endSession, uint flags) |
Provides default handling for WM_ENDSESSION. | |
void | EvFontChange () |
The default message handler for WM_FONTCHANGE. | |
void | EvSysCommand (uint cmdType, const TPoint &point) |
Responds to a user-selected command from the System menu or when the user selects the maximize or minimize box. | |
void | EvTimeChange () |
The default message handler for WM_TIMECHANGE. | |
void | EvTimer (uint timerId) |
The default message handler for WM_TIMER. | |
void | EvSettingChange (uint flags, LPCTSTR section) |
Window manager messages | |
void | EvActivate (uint active, bool minimized, HWND hWndOther) |
Default message handler for WM_ACTIVATE. | |
void | EvActivateApp (bool active, DWORD threadId) |
The default message handler for WM_ACTIVATEAPP. | |
void | EvCancelMode () |
The default message handler for WM_CANCELMODE. | |
void | EvGetMinMaxInfo (MINMAXINFO &minmaxinfo) |
The default message handler for WM_GETMINMAXINFO. | |
int | EvGetText (int bufSize, TCHAR *buf) |
The default message handler for WM_GETTEXT. | |
int | EvGetTextLength () |
The default message handler for WM_GETTEXTLENGTH. | |
void | EvKillFocus (HWND hWndGetFocus) |
Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later. | |
uint | EvMouseActivate (HWND hTopLevel, uint hitCode, TMsgId) |
The default message handler for WM_MOUSEACTIVATE. | |
The following are called under Win32 only | |
void | EvHotKey (int idHotKey, uint modifiers, uint vk) |
bool | EvCopyData (HWND hwnd, const COPYDATASTRUCT &) |
void | EvNextDlgCtl (TParam1 handleOrDirectionFlag, bool isHandle) |
void | EvParentNotify (const TParentNotify &) |
The default message handler for WM_PARENTNOTIFY. | |
HICON | EvQueryDragIcon () |
The default message handler for WM_QUERYDRAGICON. | |
bool | EvQueryOpen () |
The default message handler for WM_QUERYOPEN. | |
void | EvQueueSync () |
The default message handler for WM_QUEUESYNC. | |
bool | EvSetCursor (HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg) |
Response method for an incoming WM_SETCURSOR message. | |
void | EvSetFocus (HWND hWndLostFocus) |
The default message handler for WM_SETFOCUS. | |
HFONT | EvGetFont () |
The default message handler for WM_GETFONT. | |
void | EvSetFont (HFONT hFont, bool redraw) |
The default message handler for WM_SETFONT. | |
void | EvSetRedraw (bool redraw) |
The default message handler for WM_SETREDRAW. | |
void | EvSetText (LPCTSTR text) |
The default message handler for WM_SETTEXT. | |
void | EvShowWindow (bool show, uint status) |
The default message handler for WM_SHOWWINDOW. | |
void | EvWindowPosChanged (const WINDOWPOS &windowPos) |
The default message handler for WM_WINDOWPOSCHANGED. | |
bool | EvWindowPosChanging (WINDOWPOS &) |
The default message handler for WM_WINDOWPOSCHANGING. | |
Controls | |
HBRUSH | EvCtlColor (HDC hDC, HWND hWndChild, uint ctlType) |
Handler for control color messages (WM_CTLCOLOR family). | |
Keyboard input | |
void | EvChar (uint key, uint repeatCount, uint flags) |
The default message handler for WM_CHAR. | |
void | EvDeadChar (uint deadKey, uint repeatCount, uint flags) |
The default message handler for WM_DEADCHAR. | |
void | EvKeyDown (uint key, uint repeatCount, uint flags) |
The default message handler for WM_KEYDOWN. | |
void | EvKeyUp (uint key, uint repeatCount, uint flags) |
The default message handler for WM_KEYUP. | |
void | EvSysChar (uint key, uint repeatCount, uint flags) |
The default message handler for WM_SYSCHAR. | |
void | EvSysDeadChar (uint key, uint repeatCount, uint flags) |
The default message handler for WM_SYSDEADCHAR. | |
void | EvSysKeyDown (uint key, uint repeatCount, uint flags) |
The default message handler for WM_SYSKEYDOWN. | |
void | EvSysKeyUp (uint key, uint repeatCount, uint flags) |
The default message handler for WM_SYSKEYUP. | |
Mouse input | |
void | EvLButtonDblClk (uint modKeys, const TPoint &point) |
The default message handler for WM_LBUTTONDBLCLK. | |
void | EvLButtonUp (uint modKeys, const TPoint &point) |
The default message handler for WM_LBUTTONUP. | |
void | EvMButtonDblClk (uint modKeys, const TPoint &point) |
The default message handler for WM_MBUTTONDBLCLK. | |
void | EvMButtonDown (uint modKeys, const TPoint &point) |
The default message handler for WM_MBUTTONDOWN. | |
void | EvMButtonUp (uint modKeys, const TPoint &point) |
The default message handler for WM_MBUTTONUP. | |
void | EvMouseMove (uint modKeys, const TPoint &point) |
The default message handler for WM_MOUSEMOVE. | |
void | EvMouseHWheel (uint modKeys, int zDelta, const TPoint &point) |
Event handler for WM_MOUSEHWHEEL. | |
void | EvMouseWheel (uint modKeys, int zDelta, const TPoint &point) |
Event handler for WM_MOUSEWHEEL. | |
void | EvRButtonDblClk (uint modKeys, const TPoint &point) |
The default message handler for WM_RBUTTONDBLCLK. | |
void | EvRButtonDown (uint modKeys, const TPoint &point) |
The default message handler for WM_RBUTTONDOWN. | |
void | EvRButtonUp (uint modKeys, const TPoint &point) |
The default message handler for WM_RBUTTONUP. | |
Menu related messages | |
void | EvInitMenu (HMENU hMenu) |
The default message handler for WM_INITMENU. | |
void | EvInitMenuPopup (HMENU hPopupMenu, uint index, bool isSysMenu) |
Handle WM_INITMENUPOPUP while embeded to generate command enable messages for our server menu items. | |
int32 | EvMenuChar (uint nChar, uint menuType, HMENU hMenu) |
The default message handler for WM_MENUCHAR. | |
void | EvMenuSelect (uint menuItemId, uint flags, HMENU hMenu) |
The default message handler for WM_MENUSELECT. | |
void | EvContextMenu (HWND childHwnd, int x, int y) |
The default message handler for WM_CONTEXTMENU. | |
Dialog [Menu] messages | |
uint | EvGetDlgCode (const MSG *msg) |
The default message handler for WM_GETDLGCODE. | |
void | EvEnterIdle (uint source, HWND hWndDlg) |
The default message handler for WM_ENTERIDLE. | |
Print manager messages | |
void | EvSpoolerStatus (uint jobStatus, uint jobsLeft) |
The default message handler for WM_SPOOLERSTATUS. | |
Clipboard messages | |
void | EvAskCBFormatName (uint bufLen, TCHAR *buffer) |
The default message handler for WM_ASKCBFORMATNAME. | |
void | EvChangeCBChain (HWND hWndRemoved, HWND hWndNext) |
The default message handler for WM_CHANGECBCHAIN. | |
void | EvDrawClipboard () |
The default message handler for WM_DRAWCLIPBOARD. | |
void | EvDestroyClipboard () |
The default message handler for WM_DESTROYCLIPBOARD. | |
void | EvHScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos) |
The default message handler for WM_HSCROLLCLIPBOARD. | |
void | EvPaintClipboard (HWND hWnd, const PAINTSTRUCT &) |
The default message handler for WM_PAINTCLIPBOARD. | |
void | EvRenderAllFormats () |
The default message handler for WM_RENDERALLFORMATS. | |
void | EvRenderFormat (uint dataFormat) |
The default message handler for WM_RENDERFORMAT. | |
void | EvSizeClipboard (HWND hWndViewer, const TRect &) |
The default message handler for WM_SIZECLIPBOARD. | |
void | EvVScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos) |
The default message handler for WM_VSCROLLCLIPBOARD. | |
Palette manager messages | |
void | EvPaletteChanged (HWND hWndPalChg) |
The default message handler for WM_PALETTECHANGED. | |
void | EvPaletteIsChanging (HWND hWndPalChg) |
The default message handler for WM_PALETTEISCHANGING. | |
bool | EvQueryNewPalette () |
The default message handler for WM_QUERYNEWPALETTE. | |
Drag-n-drop messages | |
void | EvDropFiles (TDropInfo dropInfo) |
The default message handler for WM_DROPFILES. | |
List box messages | |
int | EvCharToItem (uint ch, HWND hWndListBox, int caretIndex) |
The default message handler for WM_CHARTOITEM. | |
int | EvVKeyToItem (uint key, HWND hWndListBox, int caretIndex) |
The default message handler for WM_VKEYTOITEM. | |
Non-client messages | |
bool | EvNCActivate (bool active) |
The default message handler for WM_NCACTIVATE. | |
uint | EvNCCalcSize (bool calcValidRects, NCCALCSIZE_PARAMS &) |
The default message handler for WM_NCCALCSIZE. | |
bool | EvNCCreate (CREATESTRUCT &) |
The default message handler for WM_NCCREATE. | |
uint | EvNCHitTest (const TPoint &) |
The default message handler for WM_NCHITTEST. | |
void | EvNCLButtonDblClk (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCLBUTTONDBLCLK. | |
void | EvNCLButtonDown (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCLBUTTONDOWN. | |
void | EvNCLButtonUp (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCLBUTTONUP. | |
void | EvNCMButtonDblClk (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCMBUTTONDBLCLK. | |
void | EvNCMButtonDown (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCMBUTTONDOWN. | |
void | EvNCMButtonUp (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCMBUTTONUP. | |
void | EvNCMouseMove (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCMOUSEMOVE. | |
void | EvNCPaint (HRGN) |
The default message handler for WM_NCPAINT. | |
void | EvNCRButtonDblClk (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCRBUTTONDBLCLK. | |
void | EvNCRButtonDown (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCRBUTTONDOWN. | |
void | EvNCRButtonUp (uint codeHitTest, const TPoint &) |
The default message handler for WM_NCRBUTTONUP. | |
Icon messages | |
HICON | EvGetIcon (bool isBigIcon) |
HICON | EvSetIcon (bool isBigIcon, HICON) |
Protected Member Functions inherited from owl::TEventHandler | |
bool | SearchEntries (const TGenericTableEntry *entries, TEventInfo &info, TEqualOperator op) |
Low-level response table search function. | |
Static Protected Member Functions | |
Callback procs for hooking TWindow to native window | |
static LRESULT CALLBACK | InitWndProc (HWND, UINT msg, WPARAM, LPARAM) |
Callback process for hooking TWindow to native window. | |
Friends | |
void * | GetMessageReceiverMemberFunctionAddress () |
TResult CALLBACK | DispatchWindowMessage (TWindow *w, TMsgId msg, TParam1 param1, TParam2 param2) |
Children iteration functions | |
using | TChildrenIterator = TChildrenIteratorTemplate<TWindow> |
using | TConstChildrenIterator = TChildrenIteratorTemplate<const TWindow> |
using | TChildrenRange = TChildrenRangeTemplate<TWindow> |
using | TConstChildrenRange = TChildrenRangeTemplate<const TWindow> |
auto | GetChildren () |
Returns a TWindow::TChildrenRange that can be iterated by standard means. | |
auto | GetChildren () const |
Const overload of TWindow::GetChildren. | |
TWindow * | Next () |
Returns a pointer to the next sibling window in the window's sibling list. | |
auto | Next () const -> const TWindow * |
TWindow * | Previous () |
Returns a pointer to the TWindow's previous sibling (the window previous to the TWindow in its parent's child window list) | |
auto | Previous () const -> const TWindow * |
TWindow * | GetFirstChild () |
Returns a pointer to the first child window, which is the first window created in the interface object's child list. | |
auto | GetFirstChild () const -> const TWindow * |
TWindow * | GetLastChild () |
Returns a pointer to the last child window in the interface object's child list. | |
auto | GetLastChild () const -> const TWindow * |
uint | NumChildren () const |
Returns the number of child windows of the window. | |
Scrolling and scrollbars | |
typedef std::pair< int, int > | TScrollRange |
bool | GetScrollInfo (int bar, SCROLLINFO *scrollInfo) const |
Retrieves the properties of the given scroll bar. | |
SCROLLINFO | GetScrollInfo (int bar, uint mask=SIF_ALL) const |
Function-style overload Returns selected properties of the given scroll bar. | |
int | SetScrollInfo (int bar, SCROLLINFO *scrollInfo, bool redraw=true) |
Sets the properties of the given scroll bar. | |
int | GetScrollPos (int bar) const |
Returns the thumb position in the scroll bar. | |
int | SetScrollPos (int bar, int pos, bool redraw=true) |
Sets the thumb position in the scroll bar. | |
int | GetScrollTrackPos (int bar) const |
Returns the thumb track position in the scroll bar. | |
void | GetScrollRange (int bar, int &minPos, int &maxPos) const |
Returns the minimum and maximum positions in the scroll bar. | |
TScrollRange | GetScrollRange (int bar) const |
Function-style overload. | |
void | SetScrollRange (int bar, int minPos, int maxPos, bool redraw=true) |
Sets the thumb position in the scroll bar. | |
void | SetScrollRange (int bar, const TScrollRange &, bool redraw=true) |
Overload taking the range as a pair. | |
int | GetScrollPage (int bar) const |
Returns the page property (SCROLLINFO::nPage) of the given scroll bar. | |
void | SetScrollPage (int bar, int page, bool redraw=true) |
Sets the page property (SCROLLINFO::nPage) of the given scroll bar. | |
bool | EnableScrollBar (uint sbFlags=SB_BOTH, uint arrowFlags=ESB_ENABLE_BOTH) |
Disables or enables one or both of the scroll bar arrows on the scroll bars associated with this window. | |
void | ShowScrollBar (int bar, bool show=true) |
Displays or hides the scroll bar. | |
void | ScrollWindow (int dx, int dy, const TRect *scroll=nullptr, const TRect *clip=nullptr) |
Scrolls a window in the vertical (dx) and horizontal (dy) directions. | |
void | ScrollWindowEx (int dx, int dy, const TRect *scroll=0, const TRect *clip=0, HRGN hUpdateRgn=nullptr, TRect *update=0, uint flags=0) |
Scrolls a window in the vertical (dx) and horizontal (dy) directions. | |
Unconditionally shut down a given window. | |
Destroy() is called to destroy the Handle, & then the window is deleted. Non-static version is safe as long as it is inline and not called on itself | |
void | ShutDownWindow (int retVal=0) |
This inline version of ShutDownWindow calls the static version of ShutDownWindow. | |
static void | ShutDownWindow (TWindow *win, int retVal=0) |
This version of ShutDownWindow unconditionally shuts down a given window, calls Destroy on the interface element, and then deletes the interface object. | |
Messages | |
TResult | SendMessage (TMsgId, TParam1=0, TParam2=0) const |
Sends a message (msg) to a specified window or windows. | |
TResult | SendDlgItemMessage (int childId, TMsgId, TParam1=0, TParam2=0) |
Sends a message (msg) to the control specified in childId. | |
bool | PostMessage (TMsgId, TParam1=0, TParam2=0) |
Posts a message (msg) to the window in the application's message queue. | |
HWND | SetCapture () |
Sets the mouse capture to the current window. | |
HWND | SetFocus () |
Sets the keyboard focus to current window and activates the window that receives the focus by sending a WM_SETFOCUS message to the window. | |
bool | IsWindowEnabled () const |
Returns true if the window is enabled. | |
virtual bool | EnableWindow (bool enable) |
Allows the given window to receive input from the keyboard of mouse. | |
void | SetRedraw (bool redraw) |
Sends a WM_SETREDRAW message to a window so that changes can be redrawn (redraw = true) or to prevent changes from being redrawn (redraw = false). | |
bool | TrackMouseEvent (uint flags=TME_HOVER|TME_LEAVE, int hoverTime=HOVER_DEFAULT) |
Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time. | |
bool | CancelMouseEvent (uint flags=TME_HOVER|TME_LEAVE) |
Encapsulates a call to TrackMouseEvent, passing the TME_CANCEL flag. | |
TRACKMOUSEEVENT | QueryMouseEventTracking () const |
Returns the current state of mouse event tracking initiated by TrackMouseEvent. | |
static HWND | GetCapture () |
Returns the handle of the window that has captured the mouse. | |
static void | ReleaseCapture () |
Releases the mouse capture from this window. | |
static HWND | GetFocus () |
Gets a handle to the window that has the focus. | |
Window coordinates, dimensions... | |
void | ClientToScreen (TPoint &point) const |
Converts the client coordinates specified in point to screen coordinates for the new window. | |
TPoint | MapClientToScreen (const TPoint &p) const |
Function-style version of ClientToScreen. | |
void | MapClientToScreen (TPoint *p, int count) const |
Maps the given points, specified in client coordinates in this window, to screen coordinates. | |
template<size_t Count> | |
void | MapClientToScreen (TPoint(&p)[Count]) const |
Overload for array See MapClientToScreen(TPoint*, int). | |
TRect | MapClientToScreen (const TRect &r) const |
Functional-style overload for TRect; converts the given rectangle coordinates and returns the result. | |
void | ScreenToClient (TPoint &point) const |
Uses the screen coordinates specified in point to calculate the client window's coordinates and then places the new coordinates into point. | |
TPoint | MapScreenToClient (const TPoint &p) const |
Functional-style version of ScreenToClient. | |
void | MapScreenToClient (TPoint *p, int count) const |
Maps the given points, specified in screen coordinates, to client coordinates in this window. | |
template<size_t Count> | |
void | MapScreenToClient (TPoint(&p)[Count]) const |
Overload for array See MapScreenToClient(TPoint*, int). | |
TRect | MapScreenToClient (const TRect &r) const |
Functional-style overload for TRect; converts the given rectangle coordinates and returns the result. | |
void | MapWindowPoints (HWND hWndTo, TPoint *pts, int count) const |
Maps a set of points in one window to a relative set of points in another window. | |
void | MapWindowPoints (const TWindow &wndTo, TPoint *p, int n) const |
Overload for TWindow See MapWindowPoints(HWND, TPoint*, int). | |
template<size_t Count> | |
void | MapWindowPoints (HWND hWndTo, TPoint(&p)[Count]) const |
Overload for array See MapWindowPoints(HWND, TPoint*, int). | |
template<size_t Count> | |
void | MapWindowPoints (const TWindow &wndTo, TPoint(&p)[Count]) const |
Overload for TWindow and array See MapWindowPoints(HWND, TPoint*, int). | |
TPoint | MapWindowPoints (HWND hWndTo, const TPoint &p) const |
Functional-style overload for TPoint; converts the given point coordinates and returns the result. | |
TPoint | MapWindowPoints (const TWindow &wndTo, const TPoint &p) const |
Overload for TWindow and TPoint See MapWindowPoints(HWND, const TPoint&). | |
TRect | MapWindowPoints (HWND hWndTo, const TRect &r) const |
Functional-style overload for TRect; converts the given rectangle coordinates and returns the result. | |
TRect | MapWindowPoints (const TWindow &wndTo, const TRect &r) const |
Overload for TWindow and TRect See MapWindowPoints(HWND, const TRect&). | |
TRect | MapWindowRect (HWND hWndTo) const |
Maps the window's rectangle (GetWindowRect) to client coordinates in the given destination window. | |
TRect | MapWindowRect (const TWindow &wndTo) const |
Overload for TWindow See MapWindowRect(HWND). | |
TRect | MapClientRect (HWND hWndTo) const |
Maps the window's client rectangle (GetClientRect) to client coordinates in the given destination window. | |
TRect | MapClientRect (const TWindow &wndTo) const |
Overload for TWindow See MapClientRect(HWND). | |
void | GetClientRect (TRect &rect) const |
Gets the coordinates of the window's client area and then copies them into the object referred to by TRect. | |
TRect | GetClientRect () const |
Gets the coordinates of the window's client area (the area in a window you can use for drawing). | |
HWND | ChildWindowFromPoint (const TPoint &point) const |
Determines which of the child windows contains the point specified in TPoint. | |
void | GetWindowRect (TRect &rect) const |
Gets the screen coordinates of the window's rectangle and copies them into rect. | |
TRect | GetWindowRect () const |
Gets the screen coordinates of the window's rectangle. | |
TRect | GetChildRect (HWND hWnd) const |
Returns the window rectangle of the given window, specified in this window's client coordinates. | |
TRect | GetChildRect (const TWindow &wnd) const |
Overload for TWindow See GetChildRect(HWND). | |
static HWND | WindowFromPoint (const TPoint &point) |
Returns the handle of the window in which the specified point (point) lies. | |
static void | AdjustWindowRect (TRect &rect, uint32 style, bool menu) |
Calculates the size of the window rectangle according to the indicated client-rectangle size. | |
static void | AdjustWindowRectEx (TRect &rect, uint32 style, bool menu, uint32 exStyle) |
Calculates the size of a window rectangle that has an extended style. | |
Window positioning(Z), sibling relationships | |
void | BringWindowToTop () |
Brings a pop-up or child window to the top of the stack of overlapping windows and activates it. | |
HWND | SetActiveWindow () |
Activates a top-level window. | |
HWND | GetLastActivePopup () const |
Returns the last active pop-up window in the list. | |
HWND | GetNextWindow (uint dirFlag) const |
Finds the handle associated with either the next or previous window in the window manager's list. | |
HWND | GetTopWindow () const |
Returns a handle to the top window currently owned by this parent window. | |
HWND | GetWindow (uint cmd) const |
Returns the handle of the window that has the indicated relationship to this window. | |
bool | SetWindowPos (HWND hWndInsertAfter, const TRect &rect, uint flags) |
Changes the size of the window pointed to by rect. | |
bool | SetWindowPos (HWND hWndInsertAfter, int x, int y, int w, int h, uint flags) |
Set the new window position. | |
static HWND | GetActiveWindow () |
Retrieves the handle of the active window. | |
static HWND | GetDesktopWindow () |
Returns a handle to the desktop window. | |
Caret, cursor, font | |
void | CreateCaret (HBITMAP hBitmap) |
Creates a new caret for the system. | |
void | CreateCaret (bool isGray, int width, int height) |
Create a new caret for the system with the specified shape, bitmap shade, width, and height. | |
void | HideCaret () |
Removes the caret from the specified display screen. | |
void | ShowCaret () |
Displays the caret in the specified shape in the active window at the current position. | |
void | SetWindowFont (HFONT font, bool redraw=true) |
Sets the font that a control uses to draw text. | |
void | SetWindowFont (const TFont &font, bool redraw=true) |
Sets the font that a control uses to draw text. | |
HFONT | GetWindowFont () |
Gets the font the control uses to draw text. | |
static uint | GetCaretBlinkTime () |
Retrieves the caret blink rate in milliseconds. | |
static void | GetCaretPos (TPoint &point) |
Gets the position of the caret in the coordinates of the client window. | |
static TPoint | GetCaretPos () |
static void | SetCaretBlinkTime (uint16 milliSecs) |
Sets the caret blink rate in milliseconds. | |
static void | SetCaretPos (int x, int y) |
Sets the position of the caret in the coordinates of the client window. | |
static void | SetCaretPos (const TPoint &pos) |
Sets the position of the caret in the coordinates of the client window. | |
static void | DestroyCaret () |
DestroyCaret first checks the ownership of the caret. | |
static void | GetCursorPos (TPoint &pos) |
Retrieves the cursor's current position (in window screen coordinates) and copies the values into the structure pointed to by pos. | |
static TPoint | GetCursorPos () |
static TPoint | GetMessagePos () |
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encapsulates many functions that control window behavior and specify window creation and registration attributes.
TWindow is a generic window that can be resized and moved. You can construct an instance of TWindow, though normally you use TWindow as a base for your specialized window classes. In general, to associate and disassociate a TWindow object with a window element, you need to follow these steps:
The ObjectWindows destroy process consists of two parts: (1) call Destroy to destroy the interface element and (2) then delete the C++ object. However, it is perfectly valid to call Destroy on the interface element without deleting the C++ object and then to call Create at a later time to re-create the window. Because it is also valid to construct a C++ window object on the stack or as an aggregated member, the Destroy function cannot assume it should delete the C++ object.
The user-generated WM_CLOSE event handler, EvClose, also causes a C++ object to be deleted by passing the this pointer to the application. The C++ object is deleted automatically because the EvClose event frequently occurs in response to a user action, and this is the most convenient place for the deletion to take place. Later, when it's safe to do so, the application then deletes the window pointer. Because the stack often contains selectors that refer to the addresses of objects that may become invalid during the delete process, it is not safe to delete the this pointer while events are still being processed. If the addresses become invalid, they could cause trouble when they are reloaded from the stack.
TWindow is the base class for all window classes, including TFrameWindow, TControl, TDialog, and TMDIChild. The ObjectWindows hierarchy diagram shows the many classes that are derived from TWindow.
|
explicit |
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be created and displayed along with parent.
Also sets the title of the window and initializes the window's creation attributes.
The following paragraphs describe procedures common to both constructor syntaxes. module specifies the application or DLL that owns the TWindow instance. ObjectWindows needs the correct value of module to find needed resources. If module is 0, TWindow sets its module according to the following rules:
Definition at line 341 of file window.cpp.
References Init().
Constructs a TWindow that is used as an alias for a non-ObjectWindows window, and sets wfAlias.
Because the HWND is already available, this constructor, unlike the other TWindow constructor, performs the "thunking" and extraction of HWND information instead of waiting until the function Create creates the interface element.
The following paragraphs describe procedures common to both constructor syntaxes. module specifies the application or DLL that owns the TWindow instance. ObjectWindows needs the correct value of module to find needed resources. If module is 0, TWindow sets its module according to the following rules:
Definition at line 381 of file window.cpp.
References Init(), and PRECONDITION.
|
overridevirtual |
Destroys this window (unless this is an alias) and the children.
First, restores the underlying window's WindowProc (i.e. reverts the subclassing). Then, destroys the children and, in turn, the underlying window (unless aliased). Finally, dissociates this from the parent and application, and deallocates acquired resources.
Definition at line 544 of file window.cpp.
References _T, DefWindowProc(), Destroy(), GetChildren(), GetHandle(), owl::TResIdT< T >::GetString(), GetWindowProc(), IsFlagSet(), owl::TResIdT< T >::IsString(), owl::TWindowAttr::Menu, RemoveChild(), SetCaption(), SetCursor(), SetScroller(), SetWindowProc(), TRACEX, owl::TApplication::Uncondemn(), WARNX, and owl::wfAlias.
|
protected |
Protected constructor for use by immediate virtually derived classes.
Immediate derivitives must call an Init() before constructions are done.
Definition at line 392 of file window.cpp.
Calculates the size of the window rectangle according to the indicated client-rectangle size.
rect refers to the structure that contains the client rectangle's coordinates. style specifies the style of the window. menu is true if the window has a menu.
Definition at line 2271 of file window.h.
References AdjustWindowRect().
|
inlinestatic |
Calculates the size of a window rectangle that has an extended style.
TRect refers to the class that contains the client rectangle's coordinates. style specifies the window styles of the window to be adjusted. menu returns true if the window has a menu. exStyle indicates the extended styles to be used for the window. Extended styles include the following styles:
WS_EX_ACCEPTFILES The
window can make use of drag and drop files.WS_EX_DLGMODALFRAME The
window has a double border that can be created with a title bar if the WS_CAPTION style flag is specified.WS_EX_NOPARENTNOTIFY The
child window created from this style does not send parent notify messages to the parent window when the child is created or destroyed.WS_EX_TOPMOST A
window having this style is placed above windows that are not topmost and remains above the non-topmost windows even when it's deactivated.WS_EX_TRANSPARENT A
window having this style is transparent, that is, any windows beneath this window are not concealed by this window.Definition at line 2296 of file window.h.
References AdjustWindowRectEx().
void owl::TWindow::AssignContextMenu | ( | TPopupMenu * | menu | ) |
Associates a pop-up menu with the window so that it can automatically handle a WM_CONTEXTMENU message.
Definition at line 3879 of file window.cpp.
Definition at line 2929 of file window.cpp.
References ClearFlag(), GetModule(), Init(), and owl::wfDetached.
|
inline |
Brings a pop-up or child window to the top of the stack of overlapping windows and activates it.
Definition at line 2690 of file window.h.
References BringWindowToTop(), GetHandle(), and PRECONDITION.
Encapsulates a call to TrackMouseEvent, passing the TME_CANCEL flag.
See TrackMouseEvent.
Definition at line 3368 of file window.cpp.
References TrackMouseEvent().
|
virtual |
Use this function to determine if it is okay to close a window.
Returns true if the associated interface element can be closed. Calls the CanClose member function of each of its child windows. Returns false if any of the CanClose calls returns false. In your application's main window, you can override TWindow's CanClose and call TWindow::MessageBox to display a YESNOCANCEL message prompting the user as follows:
YES Save
the dataNO Do
not save the data, but close the windowCANCEL Cancel
the close operation and return to the edit windowThe following example shows how to write a CanClose function that displays a message box asking if the user wants to save a drawing that has changed. To save time, CanClose uses the IsDirty flag to see if the drawing has changed. If so, CanClose queries the user before closing the window.
Reimplemented in ocf::TOleView, ocf::TOleWindow, owl::TTreeViewCtrlView, owl::TListViewCtrlView, owl::TWindowView, owl::TDialogView, owl::TEdit, owl::TEditFile, owl::TEditView, owl::TListBoxView, owl::TPaneSplitterView, owl::TRichEditView, and owl::TTabbedView.
Definition at line 2795 of file window.cpp.
References GetChildren().
Places a check mark in (or removes a check mark from) the button specified in buttonId.
If check is nonzero, the check mark is placed next to the button; if 0, the check mark is removed. For buttons having three states, check can be 0 (clear), 1 (checked), or 2 (gray).
Definition at line 3219 of file window.h.
References CheckDlgButton(), GetHandle(), and PRECONDITION.
|
inline |
Checks the radio button specified by checkButtonId and removes the check mark from the other radio buttons in the group.
firstButtonId and lastButtonId specify the first and last buttons, respectively, in the group.
Definition at line 3232 of file window.h.
References CheckRadioButton(), GetHandle(), and PRECONDITION.
Sends the specified message to all immediate children using SendMessage.
Definition at line 3340 of file window.cpp.
References GetApplication(), GetWindow(), owl::TApplication::ResumeThrow(), and SendMessage().
Determines which of the child windows contains the point specified in TPoint.
Returns a handle to the window that contains the point, or 0 if the point lies outside the parent window.
Definition at line 2238 of file window.h.
References GetHandle(), and PRECONDITION.
Returns a pointer to the window in the child window list that has the supplied id.
Returns 0 if no child window has the indicated id.
Definition at line 3275 of file window.cpp.
Definition at line 681 of file window.h.
References ChildWithId().
|
protectedvirtual |
Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an opportunity to clean up HWND related resources.
This function is the complement to SetupWindow.
Override this function in your derived class to handle window cleanup. Derived classes should call the base class's version of CleanupWindow as the last step before returning. The following example from the sample program, APPWIN.CPP, illustrates this process:
Reimplemented in owl::TComboBox, ocf::TOleFrame, ocf::TOleView, ocf::TOleWindow, owl::TDecoratedFrame, owl::TFrameWindow, owl::TGadgetWindow, owl::TMemComboBox, owl::TPaneSplitter, owl::TPropertySheet, owl::TSplashWindow, and owl::TTraceWindow.
Definition at line 2640 of file window.cpp.
Converts the client coordinates specified in point to screen coordinates for the new window.
Definition at line 2248 of file window.h.
References ClientToScreen(), GetHandle(), and PRECONDITION.
Determines if it is okay to close a window before actually closing the window.
If this is the main window of the application, calls GetApplication->CanClose. Otherwise, calls this->CanClose to determine whether the window can be closed. After determining that it is okay to close the window, CloseWindow calls Destroy to destroy the HWND.
Reimplemented in owl::TDialog.
Definition at line 2809 of file window.cpp.
References owl::TApplication::CanClose(), CanClose(), Destroy(), GetApplication(), IsFlagSet(), and owl::wfMainWindow.
|
virtual |
Creates the window interface element to be associated with this ObjectWindows interface element.
Specifically, Create performs the following window creation tasks:
Reimplemented in owl::TDialog, owl::TEditView, owl::TGadgetWindow, owl::TListBoxView, owl::TMDIClient, owl::TPropertyPage, owl::TPropertySheet, owl::TRichEditView, owl::TSplashWindow, and owl::TTabbedWindow.
Definition at line 2399 of file window.cpp.
References _T, CHECK, DisableAutoCreate(), GetApplication(), owl::GetCreationWindow(), GetDlgItem(), GetHandle(), GetHWndState(), GetWindowProc(), GetWindowPtr(), GetWindowTextTitle(), owl::TWindowAttr::Id, InitWndProc(), IsFlagSet(), LoadAcceleratorTable(), ModifyExStyle(), PerformCreate(), PerformSetupAndTransfer(), owl::TXWindow::Raise(), Register(), owl::TApplication::ResumeThrow(), SendMessage(), SetCaption(), owl::SetCreationWindow(), SetFlag(), SetHandle(), SubclassWindowFunction(), WARNX, owl::wfFromResource, owl::wfMainWindow, owl::wfPredefinedClass, and WS_EX_APPWINDOW.
Create a new caret for the system with the specified shape, bitmap shade, width, and height.
If width or height is 0, the corresponding system-defined border size is used.
Definition at line 3363 of file window.h.
References CreateCaret(), GetHandle(), and PRECONDITION.
Creates a new caret for the system.
HBITMAP specifies the bitmapped caret shape.
Definition at line 3350 of file window.h.
References CreateCaret(), GetHandle(), and PRECONDITION.
bool owl::TWindow::CreateChildren | ( | ) |
Creates the child windows in the child list whose auto-create flags (with wfAutoCreate mask) are set.
If all of the child windows are created successfully, CreateChildren returns true.
Definition at line 2995 of file window.cpp.
References _T, GetChildren(), NumChildren(), WARNX, and owl::wfAutoCreate.
TResult owl::TWindow::DefaultProcessing | ( | ) |
Handles default processing of events, which includes continued processing of menu/accelerators commands and enablers, as well as notifications.
Serves as a general-purpose default processing function that handles a variety of messages. After being created and before calling DefaultProcessing, however, a window completes the following sequence of events (illustrated in the Default Message-Processing Flowchart).
If the incoming message is not a command or command enable message, WindowProc immediately searches the window's response table for a matching entry. If the incoming message is a command or command enable message, WindowProc calls EvCommand or EvCommandEnable. EvCommand and EvCommandEnable begin searching for a matching entry in the focus window's response table. If an entry is found, the corresponding function is dispatched; otherwise ObjectWindows calls DefaultProcessing to finish the recursive walk back up the parent chain, searching for a match until the receiving window (the window that initially received the message) is reached. At this point, one of the following actions occurs:
The following diagram illustrates this sequence of message-processing events:
Definition at line 852 of file window.cpp.
References _T, DefWindowProc(), GetApplication(), GetCurrentEvent(), GetDlgCtrlID(), owl::HiUint16(), owl::LoUint16(), WARNX, owl::wfAlias, and WM_COMMAND_ENABLE.
Virtual function provides final default processing for an incoming message Calls original window proc that was subclassed, using ::CallWindowProc to make sure that registers get setup correctly.
Performs default Windows processing and passes the incoming Windows message. You usually do not need to call this function directly. Classes such as TMDIFrame and TMDIChild override this function to perform specialized default processing.
Reimplemented in ocf::TOleMDIFrame, owl::TDecoratedMDIFrame, owl::TMDIFrame, and owl::TMDIChild.
Definition at line 1237 of file window.cpp.
References GetApplication(), GetHandle(), owl::TApplication::HasSuspendedException(), PRECONDITION, and owl::TApplication::ResumeThrow().
Destroys an MS-Windows element associated with the TWindow.
First, Destroy calls EnableAutoCreate for each window in the child list to ensure that windows in the child list will be re-created if this is re-created. Then, it destroys the associated interface element. If a derived window class expects to be destructed directly, it should call Destroy as the first step in its destruction so that any virtual functions and event handlers can be called during the destroy sequence.
Reimplemented in ocf::TOleFrame, owl::TMDIChild, and owl::TDialog.
Definition at line 2160 of file window.cpp.
References _T, ClearFlag(), owl::TApplication::EndModal(), GetApplication(), GetChildren(), GetHandle(), IsFlagSet(), owl::TApplication::ResumeThrow(), SetFocus(), SetHandle(), WARNX, owl::wfAlias, and owl::wfModalWindow.
|
inlinestatic |
DestroyCaret first checks the ownership of the caret.
If a window in the current task owns the caret, DestroyCaret destroys the caret and removes it from the screen.
Definition at line 3376 of file window.h.
References DestroyCaret().
void owl::TWindow::DetachHandle | ( | ) |
Definition at line 2939 of file window.cpp.
References ClearFlag(), SetFlag(), SetHandle(), owl::wfDetached, and owl::wfFullyCreated.
|
inline |
Disables the feature that allows an associated child window interface element to be created and displayed along with its parent window.
Call DisableAutoCreate for pop-up windows and controls if you want to create and display them at a time later than their parent windows.
Definition at line 1814 of file window.h.
References ClearFlag(), and owl::wfAutoCreate.
|
inline |
Disables (for the interface object) the transfer mechanism, which allows state data to be transferred to and from a transfer buffer.
Definition at line 1835 of file window.h.
References ClearFlag(), and owl::wfTransfer.
Called by EvHScroll and EvVScroll to dispatch messages from scroll bars.
Definition at line 1795 of file window.cpp.
References DefaultProcessing(), EvCommand(), ForwardMessage(), GetCurrentEvent(), GetDlgCtrlID(), GetWindowPtr(), and owl::MkParam1().
|
virtual |
Do actual modal execution using the Begin/End Modal support of TApplication.
Reimplemented in owl::TFileOpenDialog, owl::TFileSaveDialog, owl::TChooseColorDialog, owl::TChooseFontDialog, owl::TCommonDialog, owl::TDialog, owl::TPrintDialog, and owl::TOpenSaveDialog.
Definition at line 2508 of file window.cpp.
References owl::TApplication::BeginModal(), Create(), GetApplication(), GetStyle(), PRECONDITION, SetFlag(), and owl::wfModalWindow.
If a window can process dropped files, DragAcceptFiles sets accept to true.
Definition at line 4263 of file window.cpp.
References owl::TShell::DragAcceptFiles(), GetHandle(), and PRECONDITION.
|
inline |
DrawMenuBar redraws the menu bar.
This function should be called to redraw the menu if the menu is changed after the window is created.
Definition at line 3313 of file window.h.
References DrawMenuBar(), GetHandle(), and PRECONDITION.
|
inline |
Ensures that an associated child window interface element is created and displayed along with its parent window.
By default, this feature is enabled for windows and controls, but disabled for dialog boxes.
Definition at line 1805 of file window.h.
References SetFlag(), and owl::wfAutoCreate.
|
inline |
Disables or enables one or both of the scroll bar arrows on the scroll bars associated with this window.
sbFlags, which specifies the type of scroll bar, can be one of the Scroll Bar constants (SB_CTL, SB_HORZ, SB_VERT, or SB_BOTH). By default, the arrows on both the horizontal and vertical scroll bars are either enabled or disabled. arrowFlags, which indicates whether the scroll bar arrows are enabled or disabled, can be one of the Enable Scroll Bar constants (ESB_ENABLE_BOTH, ESB_DISABLE_LTUP, ESB_DISABLE_RTDN, ESB_DISABLE_BOTH). By default, the arrows on both the horizontal and vertical scroll bars are enabled.
Definition at line 3029 of file window.h.
References GetHandle(), and PRECONDITION.
Reimplemented in owl::TGadgetWindow, and owl::TGridPicker.
Definition at line 4180 of file window.cpp.
References owl::TTooltip::Activate(), GetHandle(), and SetTooltip().
|
inline |
Enables the transfer mechanism, which allows state data to be transferred between the window and a transfer buffer.
Definition at line 1828 of file window.h.
References SetFlag(), and owl::wfTransfer.
Allows the given window to receive input from the keyboard of mouse.
If enable is true, the window can receive input. Use the function IsWindowEnabled to determine if the window has been enabled.
Reimplemented in owl::TMDIChild.
Definition at line 2172 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Enumerates all the items in the property list of the current window and passes them one by one to the callback function indicated in proc.
The process continues until every item has been enumerated or until proc returns zero. proc holds the address of the callback function.
Definition at line 2481 of file window.h.
References GetHandle(), and PRECONDITION.
Default message handler for WM_ACTIVATE.
Definition at line 3578 of file window.h.
References DefaultProcessing().
The default message handler for WM_ACTIVATEAPP.
Definition at line 3587 of file window.h.
References DefaultProcessing().
The default message handler for WM_ASKCBFORMATNAME.
Definition at line 3594 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_CANCELMODE.
Definition at line 3601 of file window.h.
References DefaultProcessing().
The default message handler for WM_CHANGECBCHAIN.
Definition at line 3608 of file window.h.
References DefaultProcessing().
The default message handler for WM_CHAR.
Definition at line 3615 of file window.h.
References DefaultProcessing().
The default message handler for WM_CHARTOITEM.
Definition at line 3622 of file window.h.
References DefaultProcessing().
Handle message posted to us by a control needing assistance in dealing with invalid inputs.
Responds to a WM_CHILDINVALID message posted by a child edit control. Indicates that the contents of the child window are invalid.
Definition at line 2917 of file window.cpp.
References PRECONDITION, SendMessage(), and WM_CHILDINVALID.
|
protected |
The default response to a WM_CLOSE message is to call CloseWindow() and then have the window deleted if the Handle was really destroyed.
Definition at line 2828 of file window.cpp.
References CloseWindow(), owl::TApplication::Condemn(), DefaultProcessing(), GetApplication(), GetHandle(), IsFlagSet(), owl::wfAlias, and owl::wfDeleteOnClose.
WindowProc calls EvCommand to handle WM_COMMAND messages.
id is the identifier of the menu item or control. hWndCtl holds a value that represents the control sending the message. If the message is not from a control, it is 0. notifyCode holds a value that represents the control's notification message. If the message is from an accelerator, notifyCode is 1; if the message is from a menu, notifyCode is 0.
Reimplemented in ocf::TOleWindow, owl::TDecoratedFrame, owl::TFloatingFrame, owl::TFrameWindow, owl::TGadgetWindow, owl::TTinyCaption, owl::TPickListPopup, and owl::TEdgeSlip.
Definition at line 999 of file window.cpp.
References _T, DefaultProcessing(), GetWindowPtr(), and TRACEX.
|
virtual |
Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-handling function or calls DefaultProcessing to handle the incoming message.
Reimplemented in ocf::TOleWindow, owl::TDecoratedFrame, owl::TFloatingFrame, owl::TFrameWindow, owl::TGadgetWindow, and owl::TEdgeSlip.
Definition at line 1135 of file window.cpp.
References owl::TEventHandler::Dispatch(), owl::TEventHandler::Find(), and WM_COMMAND_ENABLE.
The default message handler for WM_COMPACTING.
Definition at line 3636 of file window.h.
References DefaultProcessing().
|
protected |
Handles WM_COMPAREITEM message (for owner draw controls) by forwarding message to control itself.
Definition at line 1689 of file window.cpp.
References DefaultProcessing(), and GetWindowPtr().
The default message handler for WM_CONTEXTMENU.
Respond to a right button click or VK_APPS key press in the window. If a context menu is set, display it.
Definition at line 3891 of file window.cpp.
References ClientToScreen(), DefaultProcessing(), GetApplication(), GetContextMenu(), GetHandle(), owl::TApplication::GetMainWindow(), HandleMessage(), and WM_OWLHELPHIT.
|
inlineprotected |
Definition at line 3642 of file window.h.
References DefaultProcessing().
|
protected |
Response method for an incoming WM_CREATE message.
Performs setup and data transfer now that we are created & have a Handle. Should return true if the
Definition at line 1587 of file window.cpp.
References DefaultProcessing(), and PerformSetupAndTransfer().
Handler for control color messages (WM_CTLCOLOR family).
If the passed control ctl
is a child encapsulated by OWL, then the text and background color of the control is used. If the control is not encapsulated by OWL, or the control does not specify a color (TColor::None), then colors are assigned by the parent (dialog). If the parent has no colors set, default colors will be used.
If the background color is set to TColor::Transparent, then the background mode of the device context hDC
is set to TRANSPARENT and NULL_BRUSH is returned. Otherwise a solid brush of the background color is returned.
ctl
window handle for a match against the subcontrols. To determine the handles of the subcontrols, use TComboBox::GetEditHandle and TComboBox::GetListHandle (or TComboBox::GetInfo to get both). These functions are encapsulations of the Windows API function GetComboBoxInfo.Definition at line 1983 of file window.cpp.
References CHECK, DefaultProcessing(), GetWindowPtr(), owl::TColor::None, SetTextColor(), and owl::TColor::Transparent.
The default message handler for WM_DEADCHAR.
Definition at line 3649 of file window.h.
References DefaultProcessing().
|
protected |
Handles WM_DELETEITEM message (for owner draw controls) by forwarding message to control itself.
Definition at line 1701 of file window.cpp.
References DefaultProcessing(), ForwardMessage(), GetHandle(), and GetWindowPtr().
|
protected |
Responds to an incoming WM_DESTROY message.
Calls CleanupWindow() to let derived classes cleanup Clears the wfFullyCreated flag since this window is no longer fully created
If the TWindow is the application's main window posts a 'quit' message to end the application, unless already in ~TApplication() (MainWindow == 0)
Definition at line 2850 of file window.cpp.
References CleanupWindow(), ClearFlag(), DefaultProcessing(), GetApplication(), IsFlagSet(), owl::wfAlias, owl::wfFullyCreated, and owl::wfMainWindow.
|
inlineprotected |
The default message handler for WM_DESTROYCLIPBOARD.
Definition at line 3656 of file window.h.
References DefaultProcessing().
The default message handler for WM_DEVMODECHANGE.
Definition at line 3663 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_DRAWCLIPBOARD.
Definition at line 3677 of file window.h.
References DefaultProcessing().
|
protected |
Definition at line 1715 of file window.cpp.
References DefaultProcessing(), owl::TDrawItem::Draw(), ForwardMessage(), GetHandle(), GetWindowPtr(), and owl::ItemData2DrawItem().
The default message handler for WM_DROPFILES.
Definition at line 3670 of file window.h.
References DefaultProcessing().
The default message handler for WM_ENABLE.
Definition at line 3684 of file window.h.
References DefaultProcessing().
Provides default handling for WM_ENDSESSION.
If the session is ending, throws the exception TXEndSession, thus shutting down the entire applicaton.
Definition at line 2900 of file window.cpp.
References DefaultProcessing().
The default message handler for WM_ENTERIDLE.
Definition at line 3926 of file window.cpp.
References DefaultProcessing(), GetWindowPtr(), IdleAction(), IsFlagSet(), and owl::wfMainWindow.
Handler for WM_ERASEBKGND.
If the background color (see TWindow::SetBkgndColor) is not set, or it has been set to TColor::None, then this function simply forwards the message to DefaultProcessing. The default processing uses the brush specified in the window class (WNDCLASS:hbrBackground) to clear the client area. If the background color is set to TColor::Transparent, no clearing is done, and the function simply returns true
. Otherwise, the current background color is used to clear the client area, and true
is returned, indicating no further erasing is required.
If you want to handle erasure in your Paint override, then override this handler and return false. Paint will then receive true
in its erase
parameter, and you must ensure that all of the background is painted within the invalidated region.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms648055.aspx
Definition at line 1924 of file window.cpp.
References DefaultProcessing(), owl::TDC::FillSolidRect(), GetClientRect(), owl::TColor::None, and owl::TColor::Transparent.
|
inlineprotected |
The default message handler for WM_FONTCHANGE.
Definition at line 3691 of file window.h.
References DefaultProcessing().
The default message handler for WM_GETDLGCODE.
Definition at line 3698 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_GETFONT.
Definition at line 3705 of file window.h.
References DefaultProcessing().
Definition at line 1459 of file window.h.
References owl::InUse().
|
inlineprotected |
The default message handler for WM_GETMINMAXINFO.
Definition at line 3712 of file window.h.
References DefaultProcessing().
The default message handler for WM_GETTEXT.
Definition at line 3738 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_GETTEXTLENGTH.
Definition at line 3746 of file window.h.
References DefaultProcessing().
Definition at line 1331 of file window.h.
References owl::InUse().
Response method for an incoming WM_HSCROLL message.
If the message is from a scrollbar control, calls DispatchScroll() otherwise passes the message to the TWindow's scroller if it has been constructed, else calls DefaultProcessing()
Assumes, because of a Windows bug, that if the window has the scrollbar style, it will not have scrollbar controls
Definition at line 1865 of file window.cpp.
References DefaultProcessing(), DispatchScroll(), GetWindowLong(), and owl::TScroller::HScroll().
The default message handler for WM_HSCROLLCLIPBOARD.
Definition at line 3755 of file window.h.
References DefaultProcessing().
The default message handler for WM_INITMENU.
Definition at line 3764 of file window.h.
References DefaultProcessing().
Handle WM_INITMENUPOPUP while embeded to generate command enable messages for our server menu items.
Very similar to TFrameWindow::EvInitMenuPopup; could rearrange code to share better.
Definition at line 3809 of file window.cpp.
References DefaultProcessing(), EvCommandEnable(), GetHandle(), GetMenu(), owl::IDW_FIRSTMDICHILD, IsFlagSet(), and owl::wfAlias.
The default message handler for WM_KEYDOWN.
Definition at line 3771 of file window.h.
References DefaultProcessing().
The default message handler for WM_KEYUP.
Definition at line 3778 of file window.h.
References DefaultProcessing().
Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later.
Definition at line 1611 of file window.cpp.
References DefaultProcessing(), GetHandle(), IsFlagSet(), and owl::wfFullyCreated.
The default message handler for WM_LBUTTONDBLCLK.
Definition at line 3785 of file window.h.
References DefaultProcessing().
Response method for an incoming WM_LBUTTONDOWN message.
If the TWindow's Scroller has been constructed and if auto-scrolling has been requested, captures mouse input, loops until a WM_LBUTTONUP message comes in calling the Scroller's AutoScroll method, and then releases capture on mouse input. Will also break if a WM_MOUSEMOVE comes in without the left button down indicating a lost WM_LBUTTONUP
Definition at line 2101 of file window.cpp.
References owl::TScroller::AutoScroll(), DefaultProcessing(), GetApplication(), owl::TScroller::IsAutoMode(), ReleaseCapture(), owl::TApplication::ResumeThrow(), and SetCapture().
The default message handler for WM_LBUTTONUP.
Definition at line 3792 of file window.h.
References DefaultProcessing().
The default message handler for WM_MBUTTONDBLCLK.
Definition at line 3799 of file window.h.
References DefaultProcessing().
The default message handler for WM_MBUTTONDOWN.
Definition at line 3806 of file window.h.
References DefaultProcessing().
The default message handler for WM_MBUTTONUP.
Definition at line 3813 of file window.h.
References DefaultProcessing().
|
protected |
Handles WM_MEASUREITEM message (for owner draw controls & menus) by forwarding message to control itself.
win->HandleMessage(WM_MEASUREITEM, ctrlId, TParam2(&measureInfo)); win->ForewardMessage();
Definition at line 1740 of file window.cpp.
References ChildWithId(), DefaultProcessing(), owl::TEventHandler::Dispatch(), owl::TEventHandler::Find(), owl::GetCreationWindow(), GetDlgItem(), GetHandle(), GetWindowPtr(), owl::ItemData2DrawItem(), owl::TDrawItem::Measure(), and SendMessage().
The default message handler for WM_MENUCHAR.
Definition at line 3820 of file window.h.
References DefaultProcessing().
The default message handler for WM_MENUSELECT.
Definition at line 3827 of file window.h.
References DefaultProcessing().
The default message handler for WM_MOUSEACTIVATE.
Definition at line 3834 of file window.h.
References DefaultProcessing().
Event handler for WM_MOUSEHWHEEL.
Responds to horizontal mouse wheel event if Scroller exists.
Definition at line 1821 of file window.cpp.
References DefaultProcessing(), owl::TScroller::ScrollBy(), owl::TScroller::XLine, and owl::TScroller::XPage.
The default message handler for WM_MOUSEMOVE.
Definition at line 3841 of file window.h.
References DefaultProcessing().
Event handler for WM_MOUSEWHEEL.
Responds to vertical mouse wheel event if Scroller exists.
Definition at line 1840 of file window.cpp.
References DefaultProcessing(), owl::TScroller::ScrollBy(), owl::TScroller::YLine, and owl::TScroller::YPage.
Save the normal position of the window.
If IsIconic() or IsZoomed() ignore the position since it does not reflect the normal state
Definition at line 1666 of file window.cpp.
References DefaultProcessing(), GetHandle(), GetWindowLong(), GetWindowRect(), IsIconic(), IsZoomed(), ScreenToClient(), owl::TWindowAttr::X, and owl::TWindowAttr::Y.
The default message handler for WM_NCACTIVATE.
Definition at line 3848 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_NCCALCSIZE.
Definition at line 3855 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_NCCREATE.
Definition at line 3862 of file window.h.
References DefaultProcessing().
|
protected |
Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface element.
Sets the Handle data member of the TWindow to zero to indicate that an interface element is no longer associated with the object
Definition at line 2871 of file window.cpp.
References DefaultProcessing(), and SetHandle().
The default message handler for WM_NCHITTEST.
Definition at line 3869 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCLBUTTONDBLCLK.
Definition at line 3876 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCLBUTTONDOWN.
Definition at line 3883 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCLBUTTONUP.
Definition at line 3890 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCMBUTTONDBLCLK.
Definition at line 3897 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCMBUTTONDOWN.
Definition at line 3904 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCMBUTTONUP.
Definition at line 3911 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCMOUSEMOVE.
Definition at line 3918 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCPAINT.
Definition at line 3925 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCRBUTTONDBLCLK.
Definition at line 3932 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCRBUTTONDOWN.
Definition at line 3939 of file window.h.
References DefaultProcessing().
The default message handler for WM_NCRBUTTONUP.
Definition at line 3946 of file window.h.
References DefaultProcessing().
Definition at line 1337 of file window.h.
References owl::InUse().
Handles WM_NOTIFY and subdispatch messages from child controls.
This is the default message handler for WM_NOTIFY.
Reimplemented in owl::TPropertyPage.
Definition at line 1075 of file window.cpp.
References _T, DefaultProcessing(), GetHandle(), GetParent(), GetWindowPtr(), RouteCommandEnable(), and WARNX.
|
protected |
Response method for an incoming WM_PAINT message.
Calls Paint(), performing Windows-required paint setup and cleanup before and after. if the TWindow has a TScroller, also calls its BeginView() and EndView() methods before and after call to Paint()
Definition at line 2041 of file window.cpp.
References owl::TScroller::BeginView(), DefaultProcessing(), owl::TScroller::EndView(), IsFlagSet(), Paint(), owl::TPaintDC::Ps, and owl::wfAlias.
|
inlineprotected |
The default message handler for WM_PAINTCLIPBOARD.
Definition at line 3953 of file window.h.
References DefaultProcessing().
The default message handler for WM_PALETTECHANGED.
Definition at line 3960 of file window.h.
References DefaultProcessing().
The default message handler for WM_PALETTEISCHANGING.
Definition at line 3967 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_PARENTNOTIFY.
Definition at line 3974 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_QUERYDRAGICON.
Definition at line 4021 of file window.h.
References DefaultProcessing().
Respond to Windows attempt to close down.
Determines if this app or window is ready to close.
Definition at line 2882 of file window.cpp.
References owl::TApplication::CanClose(), CanClose(), DefaultProcessing(), GetApplication(), IsFlagSet(), owl::wfAlias, and owl::wfMainWindow.
|
inlineprotected |
The default message handler for WM_QUERYNEWPALETTE.
Definition at line 4028 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_QUERYOPEN.
Definition at line 4035 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_QUEUESYNC.
Definition at line 4042 of file window.h.
References DefaultProcessing().
The default message handler for WM_RBUTTONDBLCLK.
Definition at line 4063 of file window.h.
References DefaultProcessing().
The default message handler for WM_RBUTTONDOWN.
Definition at line 4070 of file window.h.
References DefaultProcessing().
The default message handler for WM_RBUTTONUP.
Definition at line 4077 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_RENDERALLFORMATS.
Definition at line 4049 of file window.h.
References DefaultProcessing().
The default message handler for WM_RENDERFORMAT.
Definition at line 4056 of file window.h.
References DefaultProcessing().
Response method for an incoming WM_SETCURSOR message.
If a cursor has been set for this window using TWindow::SetCursor, and the mouse is over the client area, the cursor is used. Otherwise, the cursor for the window class is used (default).
Definition at line 2081 of file window.cpp.
References DefaultProcessing(), GetHandle(), and SetCursor().
The default message handler for WM_SETFOCUS.
Definition at line 4084 of file window.h.
References DefaultProcessing().
The default message handler for WM_SETFONT.
Manages the lifetime of the private font.
Definition at line 4094 of file window.h.
References DefaultProcessing().
Definition at line 1460 of file window.h.
References owl::InUse().
The default message handler for WM_SETREDRAW.
Definition at line 4108 of file window.h.
References DefaultProcessing().
The default message handler for WM_SETTEXT.
Definition at line 4115 of file window.h.
References DefaultProcessing().
Definition at line 1287 of file window.h.
References owl::InUse().
The default message handler for WM_SHOWWINDOW.
Definition at line 4122 of file window.h.
References DefaultProcessing().
Response method for an incoming WM_SIZE message.
Saves the normal size of the window in Attr. Also calls the SetPageSize() and SetBarRange() methods of the TWindow's scroller, if it has been constructed.
Definition at line 1632 of file window.cpp.
References DefaultProcessing(), GetExStyle(), GetHandle(), GetWindowRect(), owl::TWindowAttr::H, SendMessage(), owl::TScroller::SetPageSize(), owl::TScroller::SetSBarRange(), TraceWindowPlacement(), and owl::TWindowAttr::W.
The default message handler for WM_SIZECLIPBOARD.
Definition at line 4129 of file window.h.
References DefaultProcessing().
The default message handler for WM_SPOOLERSTATUS.
Definition at line 4136 of file window.h.
References DefaultProcessing().
The default message handler for WM_SYSCHAR.
Definition at line 4143 of file window.h.
References DefaultProcessing().
|
protected |
Respond to WM_SYSCOLORCHANGE by broadcasting it to all children.
Definition at line 696 of file window.cpp.
References ChildBroadcastMessage(), and DefaultProcessing().
Responds to a user-selected command from the System menu or when the user selects the maximize or minimize box.
Applications that modify the system menu must process EvSysCommand messages. Any EvSysCommand messages not handled by the application must be passed to DefaultProcessing. The parameter cmdType can be one of the following system commands:
SC_CLOSE Close
the window.SC_HOTKEY Activate
the specified window.SC_HSCROLL Scroll
horizontally.SC_KEYMENU Retrieve
a menu through a keystroke.SC_MAXIMIZE
(or SC_ZOOM) Maximize the window.SC_MINIMIZE
(or SC_ICON) Minimize the window.SC_MOUSEMENU Retrieve
a menu through a mouse click.SC_NEXTWINDOW Move
to the next window.SC_PREVWINDOW Move
to the previous window.SC_SCREENSAVE Execute
the specified screen saver.SC_SIZE Size
the windowSC_TASKLIST Activate
the Windows Task Manager.SC_VSCROLL Scroll
vertically.In the following example, EvSysCommand either processes system messages or calls DefaultProcessing:
Definition at line 4014 of file window.h.
References DefaultProcessing().
The default message handler for WM_SYSDEADCHAR.
Definition at line 4150 of file window.h.
References DefaultProcessing().
The default message handler for WM_SYSKEYDOWN.
Definition at line 4157 of file window.h.
References DefaultProcessing().
The default message handler for WM_SYSKEYUP.
Definition at line 4164 of file window.h.
References DefaultProcessing().
|
inlineprotected |
The default message handler for WM_TIMECHANGE.
Definition at line 4171 of file window.h.
References DefaultProcessing().
The default message handler for WM_TIMER.
Definition at line 4178 of file window.h.
References DefaultProcessing().
The default message handler for WM_VKEYTOITEM.
Definition at line 3629 of file window.h.
References DefaultProcessing().
Response method for an incoming WM_VSCROLL message.
If the message is from a scrollbar control, calls DispatchScroll() otherwise passes the message to the TWindow's scroller if it has been constructed, else calls DefaultProcessing()
Assumes, because of a Windows bug, that if the window has the scrollbar style, it will not have scrollbar controls
Definition at line 1892 of file window.cpp.
References DefaultProcessing(), DispatchScroll(), GetWindowLong(), and owl::TScroller::VScroll().
The default message handler for WM_VSCROLLCLIPBOARD.
Definition at line 4196 of file window.h.
References DefaultProcessing().
The default message handler for WM_WINDOWPOSCHANGED.
Definition at line 4205 of file window.h.
References DefaultProcessing().
The default message handler for WM_WINDOWPOSCHANGING.
Definition at line 4212 of file window.h.
References DefaultProcessing().
|
virtual |
Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.
Reimplemented in owl::TPickListPopup, owl::TDialog, and owl::TPropertySheet.
Definition at line 2498 of file window.cpp.
References DoExecute().
Changes the window from active to inactive or vice versa.
If invert is nonzero, the window is flashed. If invert is 0, the window is returned to its original state–either active or inactive.
Definition at line 2914 of file window.h.
References GetHandle(), and PRECONDITION.
|
delete |
auto owl::TWindow::FormatMessageBox | ( | const tstring & | formatStr, |
const tstring & | caption, | ||
uint | flags, | ||
... ) const -> int |
Definition at line 4361 of file window.cpp.
References _T, MessageBox(), and WARNX.
Forwards the window's current message.
Calls SendMessage if send is true; otherwise calls PostMessage.
Definition at line 3326 of file window.cpp.
References ForwardMessage(), GetCurrentEvent(), GetHandle(), and HandleMessage().
Forwards the window's current message.
Calls SendMessage if send is true; otherwise calls PostMessage.
Definition at line 3302 of file window.cpp.
References GetApplication(), GetCurrentEvent(), owl::TApplication::ResumeThrow(), and SendMessage().
|
inlinestatic |
|
inline |
Gets a pointer to the TApplication object associated with this.
Use GetApplication to obtain access to data and functions in the TApplication object.
Returns the overriding background color set for the window.
If the window has no overriding background color, then TColor::None is returned. In this case the WNDCLASS::hbrBackground setting will determine the background color. If the window performs no background erasing, then TColor::Transparent is returned. See TWindow::SetBkgndColor, TWindow::EvEraseBkgnd and TWindow::EvCtlColor.
|
inline |
Returns the Title member of TWindow.
Returns 0 if the caption has not yet been set.
|
inlinestatic |
|
inlinestatic |
Definition at line 1204 of file window.h.
References GetCaretPos().
Gets the position of the caret in the coordinates of the client window.
point refers to the structure that receives the client coordinates of the caret.
Definition at line 3397 of file window.h.
References GetCaretPos().
|
inline |
Returns a TWindow::TChildrenRange that can be iterated by standard means.
This function allows iteration over the children using range-based for-loops or algorithms based on ranges and iterators, such as those in the C++ standard library. For example:
|
inline |
Const overload of TWindow::GetChildren.
Retrieves the 32-bit value containing information about the window class.
If unsuccessful, returns 0. Depending on the value of index, GetClassLong can retrieve the following information:
GCL_CBCLSEXTRA Size
in bytes of memory associated with this classGCL_CBWINDEXTRA Size
of extra window memory associated with each windowGCL_HBRBACKGROUND Handle
of the background brush associated with the classGCL_HCURSOR Handle
of the cursorGCL_HICON Handle
of the iconGCL_HMODULE Handle
of the module that registered the classGCL_MENUNAME Address
of the menu name stringGCL_STYLE The
style bits associated with a window classGCL_WNDPROC Address
of the window procedure associated with this class Definition at line 2326 of file window.h.
References GetHandle(), and PRECONDITION.
Returns the Windows class name for this object's window handle.
This function is a wrapper for the Windows API function GetClassName. http://msdn.microsoft.com/en-us/library/windows/desktop/ms633582.aspx
Definition at line 2307 of file window.h.
References PRECONDITION.
Gets a 16-bit value containing information about the class or style of the window.
If unsuccessful; returns 0. Depending on the value of index, GetClassWord can retrieve the following information:
GCW_CBCLSEXTRA Number
of additional class informationGCW_CBWINDEXTRA Number
of bytes of additional window informationGCW_HBRBACKGROUND Handle
of the background brushGCW_HCURSOR Handle
of the cursorGCW_HICON Handle
of the iconGCW_HMODULE Handle
of the moduleGCW_STYLE The
style bits associated with a window class Definition at line 2351 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Gets the coordinates of the window's client area (the area in a window you can use for drawing).
Definition at line 2217 of file window.h.
References GetClientRect().
Gets the coordinates of the window's client area and then copies them into the object referred to by TRect.
Definition at line 3624 of file window.cpp.
References GetClientRect(), GetHandle(), owl::TWindowAttr::H, and owl::TWindowAttr::W.
|
inline |
|
inline |
Returns the current event to be processed in the message queue.
Definition at line 2047 of file window.h.
References GetApplication(), and owl::TApplication::GetCurrentEvent().
Definition at line 1212 of file window.h.
References GetCursorPos().
Retrieves the cursor's current position (in window screen coordinates) and copies the values into the structure pointed to by pos.
Definition at line 3465 of file window.h.
References GetCursorPos().
|
inlinestatic |
|
inline |
Returns the ID of the control.
Definition at line 3097 of file window.h.
References GetHandle(), and PRECONDITION.
Retrieves the handle of a control specified by childId.
Definition at line 3108 of file window.h.
References GetHandle(), and PRECONDITION.
Definition at line 1172 of file window.h.
References GetWindowFont().
Translates the text of a specified control into an integer value and returns it.
The parameter 'translated' points to a variable that is set to 'true' on success, 'false' otherwise. The parameter 'isSigned' indicates that the retrieved value is signed (the default).
Definition at line 3504 of file window.cpp.
References GetDlgItemInt(), GetHandle(), and PRECONDITION.
String-aware overload.
Definition at line 4437 of file window.cpp.
References owl::CopyText(), GetDlgItem(), and GetWindowTextLength().
Retrieves the text of a control specified by childId.
text points to the text buffer to receive the text. maxLen specifies the maximum length of the caption, which is truncated if it exceeds this length.
Definition at line 3133 of file window.h.
References GetHandle(), and PRECONDITION.
auto owl::TWindow::GetExStyle | ( | ) | const |
Gets the extra style bits of the window.
Definition at line 3575 of file window.cpp.
|
inline |
Definition at line 562 of file window.h.
References GetFirstChild().
|
inlinestatic |
|
inline |
Copies the style, coordinate, and the resource id (but not the title) from the existing HWnd into the TWindow members.
Definition at line 3463 of file window.cpp.
References owl::TWindowAttr::ExStyle, GetParentH(), GetWindowLong(), GetWindowRect(), owl::TWindowAttr::H, owl::TWindowAttr::Id, IsFlagSet(), ScreenToClient(), owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::wfFromResource, owl::TWindowAttr::X, and owl::TWindowAttr::Y.
|
inline |
Returns Attr.Id, the ID used to find the window in a specified parent's child list.
Definition at line 1881 of file window.h.
References owl::TWindowAttr::Id.
|
inline |
Returns the last active pop-up window in the list.
Definition at line 2749 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Definition at line 564 of file window.h.
References GetLastChild().
|
inline |
Returns the handle to the menu of the indicated window.
If the window has no menu, the return value is 0.
Definition at line 3244 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Returns a pointer to the module object.
Definition at line 1841 of file window.h.
References owl::Module.
Returns either the next or the previous control in the dialog box.
hWndCtrl identifies the control in the dialog box where the search begins. If previous is 0, GetNextDlgGroupItem searches for the next control. If previous is nonzero, it searches for the previous control.
Definition at line 3190 of file window.h.
References GetHandle(), and PRECONDITION.
Returns the handle of the first control that lets the user press the Tab key to move to the next control (that is, the first control with the WS_TABSTOP style associated with it).
hWndCtrl identifies the control in the dialog box where the search begins. If previous is 0, GetNextDlgTabItem searches for the next control. If previous is nonzero, it searches for the previous control.
Definition at line 3205 of file window.h.
References GetHandle(), and PRECONDITION.
Finds the handle associated with either the next or previous window in the window manager's list.
dirFlag specifies the direction of the search. Under the Win 32 API, GetNextWindow returns either the next or the previous window's handle. If the application is not running under Win32, GetNextWindow returns the next window's handle.
Definition at line 2738 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Retrieves the OWL object of the parent window. If none exists, returns 0.
Definition at line 2013 of file window.h.
References GetParentO().
|
inline |
Return the handle of the parent.
Definition at line 1999 of file window.h.
References GetHandle(), and GetParent().
|
inline |
Returns a handle to the property list of the specified window.
Unlike the Syntax 1 GetProp function, string points to the string whose handle is to be retrieved. If the specified string is not found in the property list for this window, returns NULL.
Definition at line 2533 of file window.h.
References GetHandle(), and PRECONDITION.
Returns a handle to the property list of the specified window.
atom contains a value that identifies the character string whose handle is to be retrieved. If the specified string is not found in the property list for this window, returns NULL.
Definition at line 2495 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
bool owl::TWindow::GetScrollInfo | ( | int | bar, |
SCROLLINFO * | scrollInfo ) const |
Retrieves the properties of the given scroll bar.
The 'scrollInfo' parameter must be properly initialized according to the Windows API documentation for SCROLLINFO. Returns true on success.
Definition at line 4038 of file window.cpp.
References GetHandle(), and PRECONDITION.
SCROLLINFO owl::TWindow::GetScrollInfo | ( | int | bar, |
uint | mask = SIF_ALL ) const |
Function-style overload Returns selected properties of the given scroll bar.
Valid values for the 'mask' parameter are the same as for the SCROLLINFO::fMask member documented by the Windows API.
Definition at line 4053 of file window.cpp.
References _T, GetScrollInfo(), owl::InUse(), and WARNX.
Returns the page property (SCROLLINFO::nPage) of the given scroll bar.
Definition at line 4161 of file window.cpp.
References GetScrollInfo().
Returns the thumb position in the scroll bar.
The position returned is relative to the scrolling range. If bar is SB_CTL, it returns the position of a control in the scroll bar. If bar is SB_HORZ, it returns the position of a horizontal scroll bar. If bar is SB_VERT, it returns the position of a vertical scroll bar.
Definition at line 4080 of file window.cpp.
References GetScrollInfo().
TWindow::TScrollRange owl::TWindow::GetScrollRange | ( | int | bar | ) | const |
Returns the minimum and maximum positions in the scroll bar.
If bar is SB_CTL, it returns the position of a control in the scroll bar. If bar is SB_HORZ, it returns the position of a horizontal scroll bar. If bar is SB_VERT, it returns the position of a vertical scroll bar. minPos and maxPos hold the lower and upper range, respectively, of the scroll bar positions. If there are no scroll bar controls, or if the scrolls are non-standard, minPos and maxPos are zero.
Definition at line 4118 of file window.cpp.
References GetScrollInfo().
Returns the thumb track position in the scroll bar.
Call this function only during the processing of a scroll message with the SB_THUMBTRACK or SB_THUMBPOSITION code. See GetScrollPos for valid values for the 'bar' parameter.
Definition at line 4104 of file window.cpp.
References GetScrollInfo().
auto owl::TWindow::GetStyle | ( | ) | const |
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
Definition at line 3558 of file window.cpp.
Returns a handle to the system menu so that an application can access the system menu.
Definition at line 3256 of file window.h.
References GetHandle(), and PRECONDITION.
Returns the overriding text color set for the window.
If the window has no overriding text color, then TColor::None is returned. In this case the system setting will determine the text color.
|
inlinevirtual |
Reimplemented in owl::TGadgetWindow, and owl::TGridPicker.
|
inline |
Returns a handle to the top window currently owned by this parent window.
If no children exist, GetTopWindow returns 0.
Definition at line 2796 of file window.h.
References GetHandle(), and PRECONDITION.
Retrieves the screen coordinates of the rectangle that encloses the updated region of the specified window.
erase specifies whether GetUpdateRect should erase the background of the updated region.
Definition at line 2927 of file window.h.
References GetHandle(), and PRECONDITION.
Copies a window's update region into a region specified by region.
If erase is true, GetUpdateRgn erases the background of the updated region and redraws nonclient regions of any child windows. If erase is false, no redrawing occurs. If the call is successful, GetUpdateRgn returns a value indicating the kind of region that was updated. If the region has no overlapping borders, it returns SIMPLEREGION; if the region has overlapping borders, it returns COMPLEXREGION; if the region is empty, it returns NULLREGION; if an error occurs, it returns ERROR.
Definition at line 4250 of file window.cpp.
References GetHandle(), and PRECONDITION.
Returns the handle of the window that has the indicated relationship to this window.
cmd, which indicates the type of relationship to be obtained, can be one of the following values:
GW_CHILD If
the given window is a parent window, the return value indicates the child window at the top of the Z order (the position of a window in a series of overlapping windows arranged in a stack). Otherwise, the return value is 0. Only child windows are examined.GW_HWNDFIRST The
return value indicates the window at the top of the Z order. If this window is a topmost window, the return value identifies the topmost window at the top of the Z order. If this window is a top-level window, the return value identifies the top-level window at the bottom of the Z order. If this window is a child window, the return value indicates the sibling window at the bottom of the Z order.GW_HWNDNEXT The
return value identifies the window below the given window in the Z order. If this window is a topmost window, the return value identifies the topmost window below this window. If this window is a top-level window, the return value indicates the top-level window below this window. If this window is a child window, the return value indicates the sibling window below this window.GW_HWNDPREV The
return value identifies the window above the given window in the Z order. If this window is a topmost window, the return value identifies the topmost window above this window. If this window is a top-level window, the return value indicates the top-level window above this window. If this window is a child window, the return value indicates the sibling window above this window.GW_OWNER The
return value identifies this window's owner window, if one exists.Definition at line 2784 of file window.h.
References GetHandle().
|
inline |
Returns the TWindowAttr structure, which contains the window's creation attributes.
|
inline |
Returns the TWindowAttr structure, which contains the window's creation attributes.
Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structure with registration attributes, thus, allowing instances of TWindow to be registered.
This function, along with GetWindowClassName, allows Windows classes to be used for the specified ObjectWindows class and its derivatives. It sets the fields of the passed WNDCLASS parameter to the default attributes appropriate for a TWindow. The fields and their default attributes for the class are the following:
cbClsExtra 0
(the number of extra bytes to reserve after the Window class structure). This value is not used by ObjectWindows.cbWndExtra 0
(the number of extra bytes to reserve after the Window instance). This value is not used by ObjectWindows.hInstance The
instance of the class in which the window procedure existshIcon 0
(Provides a handle to the class resource.) By default, the application must create an icon if the application's window is minimized.hCursor IDC_ARROW
(provides a handle to a cursor resource)hbrBackground COLOR_WINDOW
+ 1 (the system background color)lpszMenuName 0
(Points to a string that contains the name of the class's menu.) By default, the windows in this class have no assigned menus.lpszClassName Points
to a string that contains the name of the window class.lpfnWndProc The
address of the window procedure. This value is not used by ObjectWindows.style Style
field.The style field can contain one or more of the following values:
CS_BYTEALIGNCLIENT Aligns
the window's client on a byte boundary in the x direction. This alignment, designed to improve performance, determines the width and horizontal position of the window.CS_BYTEALIGNWINDOW Aligns
a window on a byte boundary in the x direction. This alignment, designed to improve performance, determines the width and horizontal position of the window.CS_CLASSDC Allocates
a single device context (DC) that's going to be shared by all of the window in the class. This style controls how multi-threaded applications that have windows belonging to the same class share the same DC.CS_DBLCLKS Sends
a double-click mouse message to the window procedure when the mouse is double-clicked on a window belonging to this class.CS_GLOBALCLASS Allows
an application to create a window class regardless of the instance parameter. You can also create a global class by writing a DLL that contains the window class.CS_HREDRAW If
the size of the window changes as a result of some movement or resizing, redraws the entire window.CS_NOCLOSE Disables
the Close option on this window's system menu.CS_OWNDC Enables
each window in the class to have a different DC.CS_PARENTDC Passes
the parent window's DC to the child windows.CS_SAVEBITS Saves
the section of the screen as a bitmap if the screen is covered by another window. This bitmap is later used to recreate the window when it is no longer obscured by another window.CS_VREDRAW If
the height of the client area is changed, redraws the entire window.After the Windows class structure has been filled with default values by the base class, you can override this function to change the values of the Windows class structure. For example, you might want to change the window's colors or the cursor displayed.
Register unique classes for windows that want system background colors so that full-drag erasing uses the right color (NT fails to let window erase itself)
Reimplemented in owl::TDialog, owl::TGlyphButton, owl::TGridPicker, owl::TPopupPicker, and owl::TPictureWindow.
Definition at line 2247 of file window.cpp.
References GetModule(), GetWindowClassName(), owl::TColor::Index(), InitWndProc(), owl::TColor::IsSysColor(), LoadCursor(), owl::TColor::None, and owl::TColor::Transparent.
|
protectedvirtual |
Reimplemented in owl::TCoolBar, owl::TAnimateCtrl, owl::TColumnHeader, owl::TComboBox, owl::TDateTimePicker, owl::TGroupBox, owl::THotKey, owl::TIPAddress, owl::TListBox, owl::TListViewCtrl, owl::TMonthCalendar, owl::TPageScroller, owl::TPictureWindow, owl::TProgressBar, owl::TTooltip, owl::TButton, owl::TCheckBox, owl::TComboBoxEx, owl::TDialog, owl::TEdit, owl::TGauge, owl::TGlyphButton, owl::TMDIClient, owl::TNoteTab, owl::TGridPicker, owl::TRadioButton, owl::TRichEdit, owl::TScrollBar, owl::TSlider, owl::TStatic, owl::TSysLink, owl::TTabControl, owl::TTreeViewCtrl, and owl::TUpDown.
Definition at line 2273 of file window.cpp.
References _stprintf, _T, COUNTOF, owl::TColor::None, and owl::TColor::Transparent.
|
inline |
Gets the font the control uses to draw text.
The return value is a handle of the font the control uses. If a system default font is being used, GetWindowFont returns NULL.
Definition at line 3489 of file window.h.
References GetHandle(), PRECONDITION, and SendMessage().
Retrieves information about the window depending on the value stored in index.
The values returned, which provide information about the window, include the following GWL_Xxxx window style constants:
GWL_EXSTYLE The
extended window styleGWL_STYLE The
window style (position, device context creation, size, and so on)In the case of a dialog box, additional information can be retrieved, such as:
DWL_DLGPROC The
address of the procedure processed by the dialog boxDWL_MSGRESULT The
value that a message processed by the dialog box returnsDWL_USER Additional
information that pertains to the application, such as pointers or handles the application uses. Definition at line 2388 of file window.h.
References GetHandle(), and PRECONDITION.
Retrieves information about the window depending on the value stored in index.
The values returned, which provide information about the window, include the following GWLP_Xxxx window style constants:
GWLP_WNDPROC The
address of the window procedure being processedGWLP_HINSTANCE GWLP_HWNDPARENT GWLP_USERDATA GWLP_ID
Definition at line 2418 of file window.h.
References GetHandle(), and PRECONDITION.
auto owl::TWindow::GetWindowPlacement | ( | ) | const |
Wrapper for Windows API.
Returns display and placement information (normal, minimized, and maximized) about the window. Throws TXOwl on failure. To get extended error information, call GetLastError.
Definition at line 3950 of file window.cpp.
References _T, GetHandle(), GetWindowPlacement(), and PRECONDITION.
|
inline |
Definition at line 2459 of file window.h.
References GetHandle(), GetWindowLongPtr(), and PRECONDITION.
Calls TApplication:GetWindowPtr on the application associated with this window.
Then, given the handle to this window (hWnd), GetWindowPtr returns the TWindow pointer associated with this window.
Definition at line 3567 of file window.h.
References GetApplication(), and owl::GetWindowPtr().
|
inline |
Gets the screen coordinates of the window's rectangle.
Definition at line 2257 of file window.h.
References GetWindowRect().
Gets the screen coordinates of the window's rectangle and copies them into rect.
Definition at line 3609 of file window.cpp.
References GetHandle(), GetWindowRect(), owl::TWindowAttr::H, owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.
Obtains a copy of the region of the window within which the system permits drawing.
Returns the type of region.
Definition at line 2998 of file window.h.
References PRECONDITION.
|
inline |
Returns a handle to the task that created the specified window.
Definition at line 3557 of file window.h.
References GetHandle(), HTASK, and PRECONDITION.
tstring owl::TWindow::GetWindowText | ( | ) | const |
String-aware overload.
Definition at line 4415 of file window.cpp.
References owl::CopyText(), and GetWindowTextLength().
Copies the window's title into a buffer pointed to by string.
maxCount indicates the maximum number of characters to copy into the buffer. A string of characters longer than maxCount is truncated. GetWindowText returns the length of the string or 0 if no title exists.
Definition at line 2655 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Returns the length, in characters, of the specified window's title.
If the window is a control, returns the length of the text within the control. If the window does not contain any text, GetWindowTextLength returns 0.
Definition at line 2641 of file window.h.
References GetHandle(), and PRECONDITION.
|
protected |
Updates the TWindow internal caption (Title) from the current window's caption.
GetWindowTextTitle is used to keep Title synchronized with the actual window state when there is a possibility that the state might have changed.
Definition at line 3437 of file window.cpp.
References _T, GetWindowText(), GetWindowTextLength(), and strnewdup().
Retrieves information about this window depending on the value of index.
GetWindowWord returns one of the following values that indicate information about the window:
GWW_HINSTANCE The
instance handle of the module owning the windowGWW_HWNDPARENT The
handle of the parent windowGWW_ID The
ID number of the child window Definition at line 2442 of file window.h.
References GetHandle(), and PRECONDITION.
Dispatches the given message using the response table.
Similar to SendMessage but goes directly to the OWL window, bypassing the Windows message queue.
Definition at line 1392 of file window.cpp.
References GetApplication(), and owl::TApplication::ResumeThrow().
|
inline |
Removes the caret from the specified display screen.
The caret is hidden only if the current task's window owns the caret. Although the caret is not visible, it can be displayed again using ShowCaret.
Definition at line 3409 of file window.h.
References GetHandle(), HideCaret(), and PRECONDITION.
Either highlights or removes highlighting from a top-level item in the menu.
idItem indicates the menu item to be processed. hilite (which contains a value that indicates if the idItem is to be highlighted or is to have the highlight removed) can be one or more of the following constants:
MF_BYCOMMAND The
idItem parameter contains the menu item's identifier.MF_BYPOSITION The
idItem parameter contains the zero-based relative position of the menu item.MF_HILITE Highlights
the menu item. If this value is not specified, highlighting is removed from the item.MF_UNHILITE Removes
the menu item's highlighting. If the menu is set to the specified condition, HiliteMenuItem returns true; otherwise, it returns false.Definition at line 3301 of file window.h.
References GetHandle(), and PRECONDITION.
Responds to a request by a child window to hold its HWND when it is losing focus.
Stores the child's HWND in HoldFocusHwnd.
Reimplemented in owl::TFrameWindow.
Definition at line 1601 of file window.cpp.
Called when no messages are waiting to be processed, IdleAction performs idle processing as long as true is returned.
idleCount specifies the number of times idleAction has been called between messages.
Propagate idle action to all children if count==0, and to any children that previously said they wanted more time.
Reimplemented in ocf::TOleDialog, owl::TDialog, owl::TFlatComboBox, owl::TFlatEdit, owl::TFlatListBox, owl::TFrameWindow, owl::TGadgetWindow, and owl::TTraceWindow.
Definition at line 671 of file window.cpp.
References ClearFlag(), GetFirstChild(), IdleAction(), IsFlagSet(), Next(), SetFlag(), and owl::wfPropagateIdle.
Wrapper initialization of a default constructed TWindow.
Is ignored if called more than once.
Definition at line 422 of file window.cpp.
References GetHWndState(), GetParentH(), GetWindowPtr(), GetWindowTextTitle(), PRECONDITION, SetCaption(), SetFlag(), SetHandle(), SubclassWindowFunction(), TYPESAFE_DOWNCAST, owl::wfAlias, and owl::wfFullyCreated.
Normal initialization of a default constructed TWindow.
Is ignored if called more than once.
Definition at line 401 of file window.cpp.
References EnableAutoCreate(), owl::TWindowAttr::ExStyle, owl::TWindowAttr::H, owl::TWindowAttr::Id, SetCaption(), owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.
|
staticprotected |
Callback process for hooking TWindow to native window.
Initial WndProc called when an OWL window is first created. Subclasses the window function by installing the window proc then calls the window proc to get this first message to the window.
Definition at line 189 of file owl.cpp.
References owl::GetCreationWindow(), owl::GetDefWindowProc(), and owl::SetCreationWindow().
Invalidates (mark for painting) the entire client area of a window.
The window then receives a message to redraw the window. By default, the background of the client area is marked for erasing.
Definition at line 2822 of file window.h.
References GetHandle(), InvalidateRect(), and PRECONDITION.
Invalidates a specified client area.
By default, the background of the client area to be invalidated is marked for erasing.
Definition at line 2834 of file window.h.
References GetHandle(), InvalidateRect(), and PRECONDITION.
Invalidates a client area within a region specified by the hRgn parameter when the application receives a WM_PAINT message.
The region to be invalidated is assumed to have client coordinates. If hRgn is 0, the entire client area is included in the region to be updated. The parameter erase specifies whether the background with the update region needs to be erased when the region to be updated is determined. If erase is true, the background is erased; if erase is false, the background is not erased when the Paint function is called. By default, the background within the region is marked for erasing.
Definition at line 2852 of file window.h.
References GetHandle(), InvalidateRgn(), and PRECONDITION.
Returns true if the window is a child window or a descendant window of this window.
A window is considered a child window if it is the direct descendant of a given parent window and the parent window is in a chain of windows leading from the original overlapped or pop-up window down to the child window. hWnd identifies the window to be tested.
Definition at line 3176 of file window.h.
References GetHandle(), and PRECONDITION.
Indicates if the child button specified in the integer parameter, buttonId, is checked, or if a button is grayed, checked, or neither.
If the return value is 0, the button is unchecked. If the return value is 1, the button is checked. If the return value is 3, the button state is undetermined. This function sends a BM_GETCHECK message to the specified button control.
Definition at line 3161 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Returns true if window is iconic or minimized.
Definition at line 2628 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Returns true if an HWND is being used.
Definition at line 2040 of file window.h.
References GetHandle().
|
inline |
Returns true if the window is enabled.
Use the function EnableWindow to enable or disable a window.
Definition at line 2161 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Returns true if the window is visible.
By default, TWindow's constructor sets the window style attribute (WS_VISIBLE) so that the window is visible.
Definition at line 2605 of file window.h.
References GetHandle(), and owl::TWindowAttr::Style.
|
inline |
Returns true if window is zoomed or maximized.
Definition at line 2617 of file window.h.
References GetHandle(), and PRECONDITION.
Gets rid of the timer and removes any WM_TIMER messages from the message queue.
timerId contains the ID number of the timer event to be killed.
Definition at line 3325 of file window.h.
References GetHandle().
Definition at line 610 of file window.h.
References owl::TModule::LoadAccelerators(), owl::Module, and PRECONDITION.
|
protected |
Loads a handle to the window's accelerator table specified in the TWindowAttr structure (Attr.AccelTable).
If the accelerator does not exist, LoadAcceleratorTable produces an "Unable to load accelerator table" diagnostic message.
Definition at line 2307 of file window.cpp.
References _T, owl::TWindowAttr::AccelTable, GetModule(), LoadAccelerators(), and WARNX.
Definition at line 609 of file window.h.
References owl::TModule::LoadBitmap(), owl::Module, and PRECONDITION.
Definition at line 612 of file window.h.
References owl::TModule::LoadCursor(), owl::Module, and PRECONDITION.
|
inline |
Definition at line 614 of file window.h.
References owl::TModule::LoadHtml(), owl::Module, and PRECONDITION.
Definition at line 613 of file window.h.
References owl::TModule::LoadIcon(), owl::Module, and PRECONDITION.
Definition at line 611 of file window.h.
References owl::TModule::LoadMenu(), owl::Module, and PRECONDITION.
Definition at line 608 of file window.h.
References owl::TModule::LoadString(), owl::Module, and PRECONDITION.
Prevents or enables window drawing for one window at a time.
If the window is locked, returns true; otherwise, returns false, which indicates either that an error occurred or that some other window is already locked. If any drawing is attempted within a locked window or locked child windows, the extent of the attempted operation is saved within a bounding rectangle. When the window is then unlocked, the area within the rectangle is invalidated, causing a paint message to be sent to this window. If any drawing occurred while the window was locked for updates, the area is invalidated.
Definition at line 2945 of file window.h.
References GetHandle(), and PRECONDITION.
Maps a set of points in one window to a relative set of points in another window.
hWndTo specifies the window to which the points are converted. points points to the array containing the points. If hWndTo is 0, the points are converted to screen coordinates. count specifies the number of points structures in the array.
Definition at line 2206 of file window.h.
References GetHandle(), MapWindowPoints(), and PRECONDITION.
|
inline |
Definition at line 3547 of file window.h.
References MessageBox().
Creates and displays a message box that contains a message (text), a title (caption), and icons or push buttons (type).
If caption is 0, the default title is displayed. Although flags is set to one push button by default, it can contain a combination of the MB_Xxxx message constants. This function returns one of the following constants:
IDABORT User
selected the abort button.IDCANCEL User
selected the cancel button.IDIGNORE User
selected the ignore button.IDNO User
selected the no button.IDOK User
selected the OK buttonIDRETRY User
selected the retry button.IDYES User
selected the yes button. Definition at line 4284 of file window.cpp.
References GetApplication(), GetHandle(), owl::TApplication::MessageBox(), and PRECONDITION.
Definition at line 4303 of file window.cpp.
References GetApplication(), GetHandle(), LoadString(), MessageBox(), and PRECONDITION.
Definition at line 4292 of file window.cpp.
References GetApplication(), GetHandle(), LoadString(), MessageBox(), and PRECONDITION.
auto owl::TWindow::MessageBoxIndirect | ( | HINSTANCE | resourceModule, |
TResId | text, | ||
TResId | caption, | ||
uint | styleFlags, | ||
TResId | icon, | ||
DWORD_PTR | contextHelpId, | ||
MSGBOXCALLBACK | callback, | ||
DWORD | languageId ) const -> int |
Displays a standard message box.
Wrapper for Windows API.
Definition at line 4318 of file window.cpp.
auto owl::TWindow::MessageBoxIndirect | ( | TResId | icon, |
const tstring & | text, | ||
const tstring & | caption, | ||
uint | flags = MB_OK ) const -> int |
Displays a standard message box using the given icon.
The flag MB_USERICON is automatically combined with the given flags, so there is no need to specify it. Wrapper for Windows API.
this->GetModule()->GetHandle()
.Definition at line 4346 of file window.cpp.
References PRECONDITION.
Modifies the style bits of the window.
Definition at line 3599 of file window.cpp.
Modifies the style bits of the window.
Definition at line 3591 of file window.cpp.
Repositions the window.
rect references the left and top coordinates and the width and height of the new screen rectangle. If repaint is false, the window is not repainted after it is moved.
Definition at line 2583 of file window.h.
References MoveWindow().
Repositions the specified window.
x and y specify the new upper left coordinates of the window; w and h specify the new width and height, respectively. If repaint is false, the window is not repainted after it is moved.
Definition at line 2571 of file window.h.
References SetWindowPos().
|
inline |
unsigned owl::TWindow::NumChildren | ( | ) | const |
Returns the number of child windows of the window.
Definition at line 2954 of file window.cpp.
|
inline |
Repaints the client area (the area you can use for drawing) of a window.
Called by base classes when responding to a WM_PAINT message, Paint serves as a placeholder for derived types that define Paint member functions. Paint is called by EvPaint and requested automatically by Windows to redisplay the window's contents. dc is the paint display context supplied to text and graphics output functions. The supplied reference to the rect structure is the bounding rectangle of the area that requires painting. erase indicates whether the background needs erasing.
Reimplemented in owl::TGadgetWindow, owl::TGauge, owl::TGlyphButton, owl::TNoteTab, owl::TGridPicker, owl::TPopupPicker, owl::TColorPicker, owl::TSplitter, owl::TPreviewPage, owl::TPictureWindow, and owl::TRichEditPagePreview.
Definition at line 2071 of file window.cpp.
|
protectedvirtual |
Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow.
PerformCreate can be overridden to provide alternate implementations.
In strict mode we ignore the argument passed, and we build the menu-or-id parameter to CreateWindowEx purely based on TWindow data members. In old mode we treat the argument like before and assume that it is already a composed menu-or-id union. In case it represents a menu, we take ownership of the allocated menu (which should have been created by the caller).
Reimplemented in owl::TCommonDialog, owl::TDialog, owl::TFindReplaceDialog, owl::TMDIFrame, owl::TMDIChild, owl::TUpDown, owl::TFindDialog, and owl::TReplaceDialog.
Definition at line 2345 of file window.cpp.
References owl::TWindowAttr::ExStyle, GetHandle(), GetModule(), GetWindowClassName(), owl::TWindowAttr::H, owl::TWindowAttr::Menu, owl::TWindowAttr::Param, PRECONDITION, owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.
|
protected |
Ensures that the window is fully set up; then transfers data into the window.
Definition at line 2528 of file window.cpp.
References SetFlag(), SetupWindow(), owl::tdSetData, TransferData(), and owl::wfFullyCreated.
Posts a message (msg) to the window in the application's message queue.
PostMessage returns without waiting for the corresponding window to process the message.
Definition at line 2103 of file window.h.
References GetHandle(), and PRECONDITION.
Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message.
If you return true, further processing of the message is halted
Allows preprocessing of queued messages prior to dispatching. If you override this method in a derived class, be sure to call the base class's PreProcessMsg because it handles the translation of accelerator keys.
Reimplemented in ocf::TOleDialog, owl::TDecoratedFrame, owl::TDialog, owl::TFrameWindow, owl::TMDIClient, owl::TMDIChild, owl::TGridPicker, owl::TPropertySheet, and owl::TGadgetWindow.
Definition at line 644 of file window.cpp.
References GetHandle(), GetTooltip(), IsChild(), and PRECONDITION.
TWindow * owl::TWindow::Previous | ( | ) |
Returns a pointer to the TWindow's previous sibling (the window previous to the TWindow in its parent's child window list)
If the TWindow was the first child added to the list, returns a pointer to the last child added
Definition at line 3069 of file window.cpp.
Definition at line 560 of file window.h.
References Previous().
TRACKMOUSEEVENT owl::TWindow::QueryMouseEventTracking | ( | ) | const |
Returns the current state of mouse event tracking initiated by TrackMouseEvent.
Encapsulates a call to TrackMouseEvent, passing the TME_QUERY flag. See TrackMouseEvent and Windows API structure TRACKMOUSEEVENT. http://msdn.microsoft.com/en-gb/library/windows/desktop/ms645604.aspx
Definition at line 3380 of file window.cpp.
References CHECK, GetHandle(), owl::InUse(), and TrackMouseEvent().
|
inline |
Redraws the rectangle specified by update and the region specified by hUpdateRgn.
redrawFlags can be a combination of one or more of the following RDW_Xxxx Redraw Window constants used to invalidate or validate a window:
Flags that invalidate a window
RDW_ERASE When
the window is repainted, it receives a WM_ERASEBKGND message. IfRDW_INVALIDATE is
not also specified, this flag has no effect.RDW_FRAME Any
part of the non-client area of the window receives a WM_NCPAINT message if it intersects the region to be updated.RDW_INTERNALPAINT A
WM_PAINT message is posted to the window whether or not it contains an invalid region.RDW_INVALIDATE Invalidates
either hUpdateRgn or update. In cases where both are 0, the entire window becomes invalid.Flags that validate a window
RDW_NOERASE The
window is prevented from receiving any WM_ERASEBKGND messages.RDW_NOFRAME The
window is prevented from receiving any WM_NCPAINT messages. The flag RDW_VALIDATE must also be used with this flag.RDW_NOINTERNALPAINT The
window is prevented from receiving internal WM_PAINT messages, but does not prevent the window from receiving WM_PAINT messages from invalid regions.RDW_VALIDATE Validates
update and hUpdateRgn. However, if both are 0, the entire window area is validated. The flag does not have any effect on internal WM_PAINT messages.Flags that control when the window is repainted
RDW_ERASENOW Before
the function returns, the specified windows will receive WM_NCPAINT and WM_ERASEBKGND messages.RDW_UPDATENOW Before
the function returns, the specified windows will receive WM_NCPAINT, WM_ERASEBKGND, as well as WM_PAINT messages.Definition at line 2986 of file window.h.
References GetHandle(), and PRECONDITION.
|
virtual |
Registers the Windows registration class of this window, if this window is not already registered.
Calls GetWindowClassName and GetWindowClass to retrieve the Windows registration class name and attributes of this window. Register returns true if this window is registered.
Definition at line 2749 of file window.cpp.
References CHECK, GetModule(), GetWindowClass(), and GetWindowClassName().
Registers a hotkey ID with the current application.
modifiers can be a combination of keys that must be pressed to activate the specified hotkey, such as HOTKEYF_SHIFT, HOTKEYF_CONTROL, and HOTKEYF_ALT.
Definition at line 3500 of file window.h.
References GetHandle(), and PRECONDITION.
|
inlinestatic |
Releases the mouse capture from this window.
Definition at line 2130 of file window.h.
References ReleaseCapture().
Removes a child window.
Uses the ObjectWindows list of objects rather the Window's HWND list.
Reimplemented in owl::TDecoratedFrame, owl::TFrameWindow, and owl::TLayoutWindow.
Definition at line 707 of file window.cpp.
Definition at line 1027 of file window.h.
References RemoveProp().
Removes the property specified by str, a null-terminated string, from the application's property list.
Returns the handle of the given string or NULL if no string exists in the window's property list.
Definition at line 2546 of file window.h.
References GetHandle(), and PRECONDITION.
Removes the property specified by atom from the application's property list.
atom indicates the string to be removed. Returns the handle of the given string or NULL if no string exists in the window's property list.
Definition at line 2508 of file window.h.
References GetHandle(), and PRECONDITION.
Calls SetWindowRgn(nullptr, repaint)
.
void owl::TWindow::RouteCommandEnable | ( | HWND | hInitCmdTarget, |
TCommandEnabler & | commandEnabler ) |
Walks the chain of windows from the initial target window to this window.
If it finds a window to receive the message, RouteCommandEnable dispatches the command enabler to that window. hInitCmdTarget is the handle to the initial command target window, which can be focus window but does not need to be. ce is a reference to the command enabler. Other classes use this function to perform particular command enabling tasks: For example, TFrameWindow calls RouteCommandEnable to perform the majority of its menu command enabling tasks. When it is an embedded window, TOleWindow also uses RouteCommandEnable to perform command enabling.
Don't process for windows out of our window tree (esp. other apps)
Definition at line 1161 of file window.cpp.
References EvCommandEnable(), GetApplication(), GetParent(), GetWindowPtr(), and WM_COMMAND_ENABLE.
Uses the screen coordinates specified in point to calculate the client window's coordinates and then places the new coordinates into point.
Definition at line 2192 of file window.h.
References GetHandle(), PRECONDITION, and ScreenToClient().
|
inline |
Scrolls a window in the vertical (dx) and horizontal (dy) directions.
scroll indicates the area to be scrolled. If 0, the entire client area is scrolled. clip specifies the clipping rectangle to be scrolled. Only the area within clip is scrolled. If clip is 0, the entire window is scrolled.
Definition at line 3057 of file window.h.
References GetHandle(), PRECONDITION, and ScrollWindow().
|
inline |
Scrolls a window in the vertical (dx) and horizontal (dy) directions.
scroll indicates the area to be scrolled. If 0, the entire client area is scrolled. clip specifies the clipping rectangle to be scrolled. Only the area within clip is scrolled. If clip is 0, the entire window is scrolled. update indicates the region that will receive the boundaries of the area that becomes invalidated as a result of scrolling. flags, which determines how the window's children are scrolled, can be one of the following SW_Xxxx Scroll Window constants:
SW_ERASE Erases
the invalidated region after sending an erase background message to the window indicated by the SW_INVALIDATE flag value.SW_INVALIDATE Invalidates
the region indicated by the hUpdate parameter.SW_SCROLLCHILDREN Scrolls
all the child window intersecting the rectangle pointed to by the scroll parameter. Definition at line 3079 of file window.h.
References GetHandle(), PRECONDITION, and ScrollWindowEx().
|
inline |
Sends a message (msg) to the control specified in childId.
Definition at line 2092 of file window.h.
References GetHandle(), and PRECONDITION.
Sends a message (msg) to a specified window or windows.
After it calls the window procedure, it waits until the window procedure has processed the message before returning.
Definition at line 3288 of file window.cpp.
References GetApplication(), GetHandle(), PRECONDITION, owl::TApplication::ResumeThrow(), and SendMessage().
|
inline |
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
Definition at line 2063 of file window.h.
References IsWindow(), owl::MkParam1(), PRECONDITION, and SendMessage().
|
inline |
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
Definition at line 2055 of file window.h.
References owl::MkParam1(), and SendMessage().
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.
Definition at line 2074 of file window.h.
References SendMessage().
Definition at line 2291 of file window.cpp.
References owl::TWindowAttr::AccelTable, GetHandle(), and LoadAcceleratorTable().
|
inline |
Activates a top-level window.
Returns a handle to the previously active window.
Definition at line 2712 of file window.h.
References GetHandle(), and PRECONDITION.
Sets the background color for the window.
If the given color is TColor::None, the WNDCLASS::hbrBackground setting will determine the background color. If the given color is TColor::Transparent, no background erasing will be performed. Otherwise, the given color will override WNDCLASS::hbrBackground. See TWindow::EvEraseBkgnd and TWindow::EvCtlColor.
Definition at line 1925 of file window.h.
References GetHandle(), and Invalidate().
Definition at line 695 of file window.h.
References SetCaption().
Copies title to an allocated string pointed to by title.
Sets the caption of the interface element to title. Deletes any previous title. If the given title is 0, then the internal caption is initialized to 0, and no update of the interface element is done.
Definition at line 3410 of file window.cpp.
References GetHandle(), SetWindowText(), and strnewdup().
Sets the window title to the resource string identified by the given id.
Definition at line 3426 of file window.cpp.
References LoadString(), and SetCaption().
|
inline |
Sets the mouse capture to the current window.
All mouse input is directed to this window.
Definition at line 2121 of file window.h.
References GetHandle(), and PRECONDITION.
Sets the caret blink rate in milliseconds.
Definition at line 3420 of file window.h.
References SetCaretBlinkTime().
Sets the position of the caret in the coordinates of the client window.
pos indicates the client coordinates of the caret.
Definition at line 3442 of file window.h.
References SetCaretPos().
Sets the position of the caret in the coordinates of the client window.
x and y indicate the client coordinates of the caret.
Definition at line 3431 of file window.h.
References SetCaretPos().
Sets the long value at the specified offset (index).
Depending on the value of index, SetClassLong sets a handle to a background brush, cursor, icon, module, menu, window function, or extra class bytes.
Definition at line 2335 of file window.h.
References GetHandle(), and PRECONDITION.
Sets the word value at the specified offset (index).
Depending on the value of index, SetClassLong sets the number of bytes of class information, of additional window information, or the style bits. Unlike SetClassLong, SetClassWord uses one of the following GCW_xxxx Class Word constants:
GCW_HBRBACKGROUND Sets
a handle for a background brush.GCW_HCURSOR Sets
a handle of a cursor.GCW_HICON Sets
a handle of an icon.GCW_STYLE Sets
a style bit for a window class. Definition at line 2365 of file window.h.
References GetHandle(), and PRECONDITION.
Sets the mouse cursor for the window, loading the given resId
from the given module
.
If module
is nullptr
, then resId
can be one of the IDC_xxxx constants that represent different kinds of cursors. See the Windows documentation for a list of valid values. If the mouse is over the client area, the function immediately updates the cursor. If resId
is 0, then the cursor for the window class is used, according to the default processing for the WM_SETCURSOR message (see EvSetCursor).
Definition at line 3766 of file window.cpp.
References GetClientRect(), GetCursorPos(), GetHandle(), owl::TResIdT< T >::GetPointerRepresentation(), owl::TModule::LoadCursor(), LoadCursor(), ScreenToClient(), and SetCursor().
Definition at line 1169 of file window.h.
References SetWindowFont().
Sets the child window with the Id (childId) in the window to the integer value specified in value.
If isSigned is true, the value is signed.
Definition at line 3120 of file window.h.
References GetHandle(), PRECONDITION, and SetDlgItemInt().
Definition at line 1156 of file window.h.
References SetDlgItemText().
Sets the title or text of a control in a dialog box.
childId identifes the control. text points to the text buffer containing the text that is to be copied into the control.
Definition at line 3146 of file window.h.
References GetHandle(), PRECONDITION, and SetDlgItemText().
Definition at line 1157 of file window.h.
References SetDlgItemText().
Definition at line 693 of file window.h.
References SetDocTitle().
Default behavior for updating document title is to pass it to parent frame.
Stores the title of the document (docname). index is the number of the view displayed in the document's caption bar. In order to determine what the view number should be, SetDocTitle makes two passes: the first pass checks to see if there's more than one view, and the second pass, if there is more than one view, assigns the next number to the view. If there is only one view, index is 0; therefore, the document does not display a view number. When TDocument is checking to see if more than one view exists, index is -1. In such cases, only the document's title is displayed in the caption bar. SetDocTitle returns true if there is more than one view and TDocument displays the number of the view passed in index.
Reimplemented in owl::TWindowView, owl::TDialogView, owl::TEditView, owl::TFrameWindow, owl::TListBoxView, owl::TPaneSplitterView, owl::TRichEditView, ocf::TOleView, owl::TTreeViewCtrlView, owl::TListViewCtrlView, owl::TWindowView, owl::TDialogView, owl::TEditView, owl::TFrameWindow, owl::TListBoxView, owl::TPaneSplitterView, owl::TRichEditView, and owl::TTabbedView.
Definition at line 778 of file window.cpp.
References SetDocTitle().
Sets the extra style bits of the window.
Definition at line 3583 of file window.cpp.
|
inline |
Sets the keyboard focus to current window and activates the window that receives the focus by sending a WM_SETFOCUS message to the window.
All future keyboard input is directed to this window, and any previous window that had the input focus loses it. If successful, SetFocus returns a handle to the window that has the focus; otherwise, it returns NULL.
Definition at line 2151 of file window.h.
References GetHandle(), and PRECONDITION.
Definition at line 4394 of file window.cpp.
Sets the specified window's menu to the menu indicated by hMenu.
If hMenu is 0, the window's current menu is removed. SetMenu returns 0 if the menu remains unchanged; otherwise, it returns a nonzero value.
Definition at line 3278 of file window.h.
References GetHandle(), and PRECONDITION.
Sets the default module for this window.
Definition at line 1847 of file window.h.
References owl::Module.
Sets the parent for the specified window by setting Parent to the specified new Parent window object.
Removes this window from the child list of the previous parent window, if any, and adds this window to the new parent's child list.
Definition at line 738 of file window.cpp.
References GetHandle(), GetParentH(), RemoveChild(), and SetParent().
Adds an item to the property list of the specified window.
str points to the string used to identify the entry data to be added to the property list.
Definition at line 2558 of file window.h.
References GetHandle(), and PRECONDITION.
Adds an item to the property list of the specified window.
atom contains a value that identifies the data entry to be added to the property list.
Definition at line 2519 of file window.h.
References GetHandle(), and PRECONDITION.
Sends a WM_SETREDRAW message to a window so that changes can be redrawn (redraw = true) or to prevent changes from being redrawn (redraw = false).
Definition at line 2182 of file window.h.
References GetHandle(), PRECONDITION, and SendMessage().
Sets the scroller object for this window.
This window assumes ownership of the scroller object, and will delete it when done and on subsequent sets.
Definition at line 788 of file window.cpp.
int owl::TWindow::SetScrollInfo | ( | int | bar, |
SCROLLINFO * | scrollInfo, | ||
bool | redraw = true ) |
Sets the properties of the given scroll bar.
Returns the current position of the scroll bar thumb.
Definition at line 4067 of file window.cpp.
References GetHandle(), and PRECONDITION.
Sets the page property (SCROLLINFO::nPage) of the given scroll bar.
Definition at line 4170 of file window.cpp.
References SetScrollInfo().
Sets the thumb position in the scroll bar.
Parameter 'bar' identifies the position (horizontal, vertical, or scroll bar control) to return and can be one of the SB_Xxxx scroll bar constants. Returns the current position of the scroll bar thumb.
Definition at line 4092 of file window.cpp.
References SetScrollInfo().
void owl::TWindow::SetScrollRange | ( | int | bar, |
const TScrollRange & | r, | ||
bool | redraw = true ) |
Overload taking the range as a pair.
Definition at line 4152 of file window.cpp.
References SetScrollRange().
Sets the thumb position in the scroll bar.
bar identifies the position (horizontal, vertical, or scroll bar control) to set and can be one of the SB_Xxxx scroll bar constants. minPos and maxPos specify the lower and upper range, respectively, of the scroll bar positions.
Definition at line 4142 of file window.cpp.
References SetScrollInfo().
Sets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
Definition at line 3567 of file window.cpp.
Sets the text color for the window.
If the given color is TColor::None, the system setting will determine the text color.
true
(default) is passed for shouldUpdate
, then the whole window is invalidated. Definition at line 1951 of file window.h.
References GetHandle(), Invalidate(), PRECONDITION, and owl::TColor::Transparent.
Creates a timer object associated with this window.
timerID contains the ID number of the timer to be created, timeout specifies the length of time in milliseconds, and proc identifies the address of the function that's to be notified when the timed event occurs. If proc is 0, WM_TIMER messages are placed in the queue of the application that called SetTimer for this window.
Definition at line 3339 of file window.h.
References GetHandle().
Definition at line 4212 of file window.cpp.
References Create(), GetHandle(), and SendMessage().
Sets TransferBuffer and TransferBufferSize.
The size is inferred from the type of the passed pointer.
Definition at line 1980 of file window.h.
References SetTransferBuffer().
Sets TransferBuffer and TransferBufferSize.
The size is inferred from the type of the passed array.
Definition at line 1988 of file window.h.
References SetTransferBuffer().
|
protectedvirtual |
Performs setup following creation of an associated MS-Windows window.
The first virtual function called when the HWindow becomes valid. TWindow's implementation performs window setup by iterating through the child list, attempting to create an associated interface element for each child window object for which autocreation is enabled. (By default, autocreation is enabled for windows and controls, and disabled for dialog boxes.) If a child window cannot be created, SetupWindow calls TXWindow with an IDS_CHILDCREATEFAIL message.
If the receiver has a TScroller object, calls the scroller's SetBarRange() method.
SetupWindow can be redefined in derived classes to perform additional special initialization. Note that the HWindow is valid when the overridden SetupWindow is called, and that the children's HWindows are valid after calling the base classes' SetupWindow function.
The following example from the sample program, APPWIN.CPP, illustrates the use of an overridden SetupWindow to setup a window, initialize .INI entries, and tell Windows that we want to accept drag and drop transactions:
Reimplemented in owl::TTabCheckList, owl::TComboBox, owl::TCoolBar, owl::TInputDialog, owl::TPageScroller, owl::TProgressBar, ocf::TOleDialog, ocf::TOleFrame, ocf::TOleWindow, owl::TButton, owl::TCheckList, owl::TClipboardViewer, owl::TComboBoxEx, owl::TCommonDialog, owl::TDecoratedFrame, owl::TDialog, owl::TEdgeSlip, owl::TDragList, owl::TEdit, owl::TEditFile, owl::TEditSearch, owl::TFlatComboBox, owl::TFlatEdit, owl::TFlatListBox, owl::TFrameWindow, owl::TGadgetWindow, owl::TGauge, owl::TGlyphButton, owl::TMemComboBox, owl::TNoteTab, owl::TPaneSplitter, owl::TGridPicker, owl::TColorPicker, owl::TPickListDialog, owl::TPreviewWin, owl::TPrinterAbortDlg, owl::TPropertySheet, owl::TRichEdit, owl::TRichEditView, owl::TRollDialog, owl::TScrollBar, owl::TSlider, owl::TSplashWindow, and owl::TTraceWindow.
Definition at line 2575 of file window.cpp.
References _T, CreateChildren(), GetApplication(), owl::TApplication::GetTooltip(), IsFlagSet(), owl::TScroller::SetSBarRange(), owl::TScroller::SetWindow(), owl::tdSetData, TRACEX, TransferData(), and owl::wfMainWindow.
Sets the font that a control uses to draw text.
If the given font owns the underlying font handle (HFONT), the window will share ownership. If the given font does not own the handle, neither will the window. In any case, the given TFont object does not need to outlive the window. However, if the underlying font handle is not owned, the caller must make sure that the font handle outlives the window. In this last case, the call is equivalent to SetWindowFont (font.GetHandle(), redraw)
.
Definition at line 3859 of file window.cpp.
References _T, SetWindowFont(), and WARN.
Sets the font that a control uses to draw text.
The caller must make sure the font handle outlives the window.
Definition at line 3476 of file window.h.
References GetHandle(), PRECONDITION, and SendMessage().
Changes information about the window.
Depending on the value of index, SetWindowLong sets a handle to a background brush, cursor, icon, module, menu, or window function. The window style can be one of the GWL_xxxx values that represent styles.
Definition at line 2400 of file window.h.
References GetHandle(), and PRECONDITION.
Changes information about the window. For a list of constants, see GetWindowLongPtr()
Definition at line 2428 of file window.h.
References GetHandle(), and PRECONDITION.
void owl::TWindow::SetWindowPlacement | ( | const WINDOWPLACEMENT & | place | ) |
Wrapper for Windows API.
Sets the window to a display mode and screen position. place
points to a window placement structure that specifies whether the window is to be hidden, minimized or displayed as an icon, maximized, restored to a previous position, activated in its current form, or activated and displayed in its normal position. Throws TXOwl on failure. To get extended error information, call GetLastError.
Definition at line 3967 of file window.cpp.
References _T, GetHandle(), PRECONDITION, and SetWindowPlacement().
Changes the size of the window pointed to by rect.
flags contains one of the SWP_Xxxx Set Window Position constants (described below) that specify the size and position of the window. If flags is set to SWP_NOZORDER, SetWindowPos ignores the hWndInsertAfter parameter and retains the current ordering of the child, pop-up, or top-level windows.
Definition at line 2809 of file window.h.
References SetWindowPos().
Set the new window position.
Changes the size of the window pointed to by x, y, w, and h. flags contains one of the SWP_Xxxx Set Window Position constants that specify the size and position of the window. If flags is set to SWP_NOZORDER, SetWindowPos ignores the hWndInsertAfter parameter and retains the current ordering of the child, pop-up, or top-level windows.
SWP_Xxxx Set Window Position Constants
SWP_DRAWFRAME Draws
a frame around the window.SWP_FRAMECHANGED Sends
a message to the window to recalculate the window's size. If this flag is not set, a recalculate size message is sent only at the time the window's size is being changed.SWP_HIDEWINDOW Hides
the window.SWP_NOACTIVATE Does
not activate the window. If this flag is not set, the window is activated and moved to the top of the stack of windows.SWP_NOCOPYBITS Discards
the entire content area of the client area of the window. If this flag is not set, the valid contents are saved and copied into the window after the window is resized or positioned.SWP_NOMOVE Remembers
the window's current position.SWP_NOSIZE Remembers
the window's current size.SWP_NOREDRAW Does
not redraw any changes to the window. If this flag is set, no repainting of any window area (including client, nonclient, and any window part uncovered as a result of a move) occurs. When this flag is set, the application must explicitly indicate if any area of the window is invalid and needs to be redrawn.SWP_NOZORDER Remembers
the current Z-order (window stacking order).SWP_SHOWWINDOW Displays
the window. Definition at line 3665 of file window.cpp.
References GetHandle(), owl::TWindowAttr::H, owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.
Definition at line 2467 of file window.h.
References GetHandle(), PRECONDITION, and SetWindowLongPtr().
Sets the area within the window where the system permits drawing.
If the call is successful the system takes ownership of the given region. You must then not make any further function calls with this region handle.
Definition at line 3011 of file window.h.
References PRECONDITION.
Overload for TRegion.
SetWindowRgn(TRegion{...})
or SetWindowRegion(std::move(rgn))
. Definition at line 4024 of file window.cpp.
References PRECONDITION.
Definition at line 1058 of file window.h.
References SetWindowText().
Sets the window's text to the given string (by copying).
Note that this does not update this window's Title member. Use SetCaption if the window's Title member needs to be synchronized with the window's text.
Definition at line 2669 of file window.h.
References GetHandle(), PRECONDITION, and SetWindowText().
Sets the window title to the resource string identified by the given id.
Definition at line 2679 of file window.h.
References LoadString(), and SetWindowText().
Changes information about the window.
index specifies a byte offset of the word to be changed to the new value (newWord).
Definition at line 2452 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Displays the caret in the specified shape in the active window at the current position.
Definition at line 3453 of file window.h.
References GetHandle(), PRECONDITION, and ShowCaret().
Shows or hides all owned pop-up windows according to the value of show.
Definition at line 2593 of file window.h.
References GetHandle(), PRECONDITION, and ShowOwnedPopups().
Displays or hides the scroll bar.
bar specifies whether the bar is a control itself or part of the window's nonclient area. If bar is part of the nonclient area, it can be one of the SB_Xxxx scroll bar constants (specifically, SB_BOTH, SB_HORZ, or SB_VERT). If it is a control, it should be SB_CTRL. If show is true, the scroll bar is displayed; if false, it is hidden.
Definition at line 3043 of file window.h.
References GetHandle(), PRECONDITION, and ShowScrollBar().
Displays this TWindow in a given state.
Can be called either before or after the Window is created. If before, the show state is placed into Attr for use at creation
After ensuring that the TWindow interface element has a valid handle, ShowWindow displays the TWindow on the screen in a manner specified by cmdShow, which can be one of the following SW_Xxxx Show Window constants:
SW_SHOWDEFAULT Show
the window in its default configuration. Should be used at startup.SW_HIDE Hide
the window and activate another window.SW_MINIMIZE Minimize
the window and activate the top-level window in the list.SW_RESTORE Same
as SW_SHOWNORMAL.SW_SHOW Show
the window in the window's current size and position.SW_SHOWMAXIMIZED Activate
and maximize the window.SW_SHOWMINIMIZED Activate
window as an icon.SW_SHOWNA Display
the window as it is currently.SW_SHOWMINNOACTIVE Display
the window as an icon.SW_SHOWNORMAL Activate
and display the window in its original size and position.SW_SHOWSMOOTH Show
the window after updating it in a bitmap. Reimplemented in owl::TMDIChild.
Definition at line 3713 of file window.cpp.
References gBatchMode, GetHandle(), HandleMessage(), and owl::TWindowAttr::Style.
This inline version of ShutDownWindow calls the static version of ShutDownWindow.
Definition at line 1874 of file window.h.
References ShutDownWindow().
This version of ShutDownWindow unconditionally shuts down a given window, calls Destroy on the interface element, and then deletes the interface object.
Instead of using ShutDownWindow, you can call Destroy directly and then delete the interface object.
Definition at line 3397 of file window.cpp.
References Destroy().
void owl::TWindow::SubclassWindowFunction | ( | ) |
Installs the instance thunk as the WindowProc and saves the old window function in DefaultProc.
Definition at line 2720 of file window.cpp.
References DefWindowProc(), GetHandle(), GetWindowProc(), PRECONDITION, and SetWindowProc().
void owl::TWindow::TraceWindowPlacement | ( | ) |
Definition at line 306 of file window.cpp.
References GetHandle(), GetWindowPlacement(), and TRACEX.
bool owl::TWindow::TrackMouseEvent | ( | uint | flags = TME_HOVER | TME_LEAVE, |
int | hoverTime = HOVER_DEFAULT ) |
Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time.
Encapsulates the eponymous Windows API function. http://msdn.microsoft.com/en-gb/library/windows/desktop/ms646265.aspx
Definition at line 3357 of file window.cpp.
References GetHandle().
|
virtual |
Transfers data to or from any window with or without children and returns the total size of the data transferred.
Transfer is a general mechanism for data transfer that can be used with or without using TransferData. The direction supplied specifies whether data is to be read from or written to the supplied buffer, or whether the size of the transfer data is simply to be returned. Data is not transferred to or from any child windows whose wfTransfer flag is not set. The return value is the size (in bytes) of the transfer data.
Reimplemented in owl::TColumnHeader, owl::TComboBox, owl::TDateTimePicker, owl::THotKey, owl::TIPAddress, owl::TListBox, owl::TMonthCalendar, owl::TTransferBufferWindowBase, owl::TCheckBox, owl::TCheckList, owl::TComboBoxEx, owl::TEdit, owl::TMemComboBox, owl::TNoteTab, owl::TRichEdit, owl::TScrollBar, owl::TStatic, owl::TTabControl, and owl::TTreeViewCtrl.
Definition at line 2655 of file window.cpp.
References GetChildren(), owl::tdSizeData, and owl::wfTransfer.
|
virtual |
Transfers data between the TWindow's data buffer and the child windows in its ChildList (data is not transfered between any child windows whose wfTransfer flag is not set)
A window usually calls TransferData during setup and closing of windows and relies on the constructor to set TransferBuffer to something meaningful. TransferData calls the Transfer member function of each participating child window, passing a pointer to TransferBuffer as well as the direction specified in direction (tdSetData, tdGetData, or tdSizeData).
Reimplemented in owl::TTransferWindow< TDataSource >, owl::TDelegatedTransferWindow, owl::TTransferBufferWindowBase, and owl::TInputDialog.
Definition at line 2691 of file window.cpp.
References _T, owl::TXWindow::Raise(), owl::tdSizeData, Transfer(), and WARN.
Unregisters a hotkey ID with the current application.
Definition at line 3509 of file window.h.
References GetHandle(), and PRECONDITION.
|
inline |
Updates the client area of the specified window by immediately sending a WM_PAINT message.
Definition at line 2901 of file window.h.
References GetHandle(), PRECONDITION, and UpdateWindow().
|
inline |
Calls the function ValidateRect to validate (that is, remove from the area to be updated) the entire client area (the area you can use for drawing).
Definition at line 2864 of file window.h.
References GetHandle(), PRECONDITION, and ValidateRect().
Validates a portion of the client area indicated by rect.
Definition at line 2875 of file window.h.
References GetHandle(), PRECONDITION, and ValidateRect().
Validates the client area within a region of the current window.
hRgn is a handle to the client area that is to be removed from the region to be updated. If hRgn is NULL, the entire client area is removed from the region to be updated.
Definition at line 2889 of file window.h.
References GetHandle(), PRECONDITION, and ValidateRgn().
First virtual function called to handling incoming messages to a TWindow.
Processes incoming messages by calling EvCommand to handle WM_COMMAND messages, EvCommandEnable to handle WM_COMMAND_ENABLE messages, and dispatching for all other messages.
Definition at line 1409 of file window.cpp.
References _T, DefWindowProc(), owl::TEventHandler::Dispatch(), EvCommand(), EvCommandEnable(), EvNotify(), owl::TEventHandler::Find(), GetApplication(), GetHandle(), owl::HiUint16(), IsFlagSet(), owl::LoUint16(), PRECONDITION, TRACEX, TYPE_UNIQUE_ID, owl::wfMainWindow, and WM_COMMAND_ENABLE.
Invokes a specified help system.
helpFile points to a string containing the directory path and name of the help file. command, which indicates the type of help requested, can be one of the Windows Help_xxxx constants such as HELP_CONTEXT, HELP_HELPONHELP, HELP_INDEX, HELP_MULTIKEY, HELP_QUIT, or HELP_SETINDEX. data contains keywords that indicate the help topic items. For example, in the sample ObjectWindows file, HELP.CPP, WinHelp is called with the arguments HELP_CONTEXT and HELP_MENUITEMA if the F1 key is pressed.
You can also include bitmaps in your Help file by referencing their file names or by copying them from the Clipboard. For more information about how to create Help files, see the online Help documentation.
Definition at line 3540 of file window.h.
References GetHandle(), and PRECONDITION.