OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
ipaddres.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1998 by Bidus Yura, All Rights Reserved
4//
5/// \file
6/// Implementation of the TIPAddress class
7//----------------------------------------------------------------------------
8#include <owl/pch.h>
9
10#include <owl/ipaddres.h>
11
12
13namespace owl {
14
16DIAG_DECLARE_GROUP(OwlCommCtrl); // Common Controls diagnostic group
17
18//
19//
20//
21TIPAddress::TIPAddress(TWindow* parent, int id, int x, int y, int w, int h,
22 TModule* module)
23:
24 TControl(parent,id,_T(""),x,y,w,h,module)
25{
26 InitializeCommonControls(ICC_INTERNET_CLASSES);
27}
28
29
30//
31//
32//
33TIPAddress::TIPAddress(TWindow* parent, int resourceId, TModule* module)
34:
35 TControl(parent, resourceId, module)
36{
37 InitializeCommonControls(ICC_INTERNET_CLASSES);
38}
39
40//
41/// Constructs a IP address object to encapsulate (alias) an existing control.
42//
44:
45 TControl(hWnd, module)
46{
47 InitializeCommonControls(ICC_INTERNET_CLASSES);
48}
49
50//
51//
52//
56
58{
59 return TWindowClassName{WC_IPADDRESS};
60}
61
62
63//
64//
65//
66uint
68{
69 if (!buffer && direction != tdSizeData) return 0;
70 TIPAddressBits* ipData = static_cast<TIPAddressBits*>(buffer);
71 if (direction == tdGetData)
72 GetAddress(*ipData);
73 else if (direction == tdSetData)
74 SetAddress(*ipData);
75
76 return sizeof(TIPAddressBits);
77}
78} // OWL namespace
79/* ========================================================================== */
TControl(TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, TModule *module=nullptr)
Invokes TWindow's constructor, passing it parent (parent window), title (caption text),...
Definition control.cpp:43
Also used as transfer buffer.
Definition ipaddres.h:32
TIPAddress(TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
Definition ipaddres.cpp:21
uint Transfer(TIPAddressBits &address, TTransferDirection direction)
Safe overload.
Definition ipaddres.h:86
void SetAddress(const TIPAddressBits &address)
Definition ipaddres.h:117
virtual auto GetWindowClassName() -> TWindowClassName
Definition ipaddres.cpp:57
int GetAddress(TIPAddressBits &address) const
Definition ipaddres.h:123
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:78
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition module.h:50
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
HWND THandle
TWindow encapsulates an HWND.
Definition window.h:418
#define _T(x)
Definition cygwin.h:51
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition window.h:92
@ tdSizeData
Return the size of data transferred by the class.
Definition window.h:95
@ tdSetData
Set data from the buffer into the window.
Definition window.h:94
@ tdGetData
Get data from the window into the buffer.
Definition window.h:93
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
void InitializeCommonControls(uint controlFlags)
Wrapper for the Windows API function InitCommmonControlsEx.
Definition commctrl.cpp:19
OWL_DIAGINFO
Definition animctrl.cpp:14
unsigned int uint
Definition number.h:25
DIAG_DECLARE_GROUP(OwlThread)