45class TPadWindow :
public TWindow {
51 Attr.Style = WS_CHILD | WS_VISIBLE;
53#if defined(DEBUG_PADS)
56 s <<
_T(
"Pad") << (
_T(
'0') + edge);
72 TRemViewBucket(
TWindow* parent);
76 bool SetDocTitle(LPCTSTR,
int);
82 void EvCommandEnable(TCommandEnabler& ce);
89TRemViewBucket::TRemViewBucket(
TWindow* parent)
92 Attr.Style = WS_CHILD | WS_DISABLED;
100TRemViewBucket::SetDocTitle(LPCTSTR,
int)
109TRemViewBucket::FindRemoteWindow()
115 HWND focusHwnd = GetFocus();
116 HWND hwnd = focusHwnd;
127 hwnd = ::GetParent(hwnd);
136TRemViewBucket::EvCommand(
uint id, THandle hWndCtl,
uint notifyCode)
140 TWindow* handler = FindRemoteWindow();
145 handler = GetParentO();
150 return handler->
EvCommand(
id, hWndCtl, notifyCode);
157TRemViewBucket::EvNotify(
uint id,
TNotify & notifyInfo)
161 TWindow* handler = FindRemoteWindow();
166 handler = GetParentO();
171 return handler->
EvNotify(
id, notifyInfo);
182 TWindow* handler = FindRemoteWindow();
187 handler = GetParentO();
221 bool trackMenuSelection,
232 new TRemViewBucket(
this);
286 for (
int edge = 0; edge < 4; edge++)
320 OcApp->AddUserFormatName(name, resultName,
id);
331 if (close && OcShutDown == DontCare) {
332 OcShutDown = ViewInitiated;
334 else if (!close && OcShutDown == ViewInitiated) {
335 OcShutDown = DontCare;
345void DisconnectDocServer_(
TWindow& win)
348 DisconnectDocServer_(child);
365 if (!
GetHandle() || OcShutDown == UserInitiated)
370 if (OcShutDown == DontCare) {
371 OcShutDown = UserInitiated;
373 DisconnectDocServer_(child);
376 if (!
OcApp->CanClose()) {
378 OcShutDown = DontCare;
390 if (dllServer && OcShutDown != ServerInitiated) {
426 OcApp->EvActivate(active);
456 if (receiver->
Find(eventInfo))
457 return receiver->
Dispatch(eventInfo, param1, param2);
462 return Dispatch(eventInfo, param1, param2);
479 TRACEX(OcfOleMenu, 0,
_T(
"EvOcAppInsMenus called while HOldMenu is ") << hex <<
505 sharedMenu.
Width[5]);
506 shMenuDescr.
Merge(compMenuDesc);
510 for (
int i = 0; i < 6; i++)
517 TRACEX(OcfOleMenu, 0,
_T(
"Merged menu ") << hex <<
static_cast<void*
>(sharedMenu.
HMenu));
528 if (!appMenus.
HMenu) {
530 TRACEX(OcfOleMenu, 0,
_T(
"EvOcAppMenus(0) resetting Old ") << hex <<
543 TRACEX(OcfOleMenu, 0,
_T(
"EvOcAppMenus called while HOldMenu is ") << hex <<
549 TRACEX(OcfOleMenu, 0,
_T(
"Saved Old ") << hex <<
static_cast<void*
>(
HOldMenu));
552 TRACEX(OcfOleMenu, 0,
_T(
"Set merged ") << hex <<
static_cast<void*
>(appMenus.
HMenu));
579 rect->bottom -= sbr.bottom+1;
605 int* edges = (
int*)space;
606 bool needLayout =
false;
607 for (
int i = 0; i < 4; i++) {
610 int edge = edges && edges[i] ? edges[i]+1 : 0;
664 for (
int i = 0; i < 6; i++) {
668 if (state ==
uint(-1))
670 TRACEX(OcfOleMenu, 1,
_T(
"Stashing ") << hex <<
static_cast<void*
>(shMenuDescr.
GetSubMenu(m+j)));
702 TRACEX(OcfOleMenu, 0,
_T(
"EvOcAppRestoreUI resetting Old ") << hex <<
729 OcShutDown = ServerInitiated;
#define PRECONDITION(condition)
#define TRACEX(group, level, message)
OCF Application host class. Owner of & host for a TOcApp object.
void SetOcApp(TOcApp *app)
Initial set of OcApp being passed to us to use.
HMENU HOldMenu
Stores the handle to the container's previously saved copy of the menu.
owl::TResult EvOcEvent(owl::TParam1 param1, owl::TParam2 param2)
Responds to a WM_OCEVENT message and subdispatches it to one of the EvOcXxxx event-handling functions...
int StashCount
Holds the number of menu bars that have been stored.
void EvSize(owl::uint sizeType, const owl::TSize &size)
Passes a WM_SIZE message to TLayoutWindow.
owl::TMenu StashedContainerPopups
Holds the stored, shared pop-up menus.
void Destroy(int retVal) override
Checks with all the connected servers to ensure that they can close before destroying the frame windo...
void EvActivateApp(bool active, DWORD threadId)
Responds to a EV_WM_ACTIVATEAPP message sent when a window is activated or deactivated.
TOleFrame(LPCTSTR title, owl::TWindow *clientWnd, bool trackMenuSelection=false, owl::TModule *module=0)
Constructs a TOleFrame object with the specified caption for the frame window (title),...
bool EvOcAppBorderSpaceReq(owl::TRect *rect)
Responds to an OC_APPBORDERSPACEREQ message sent to a container.
void EvOcAppRestoreUI()
Responds to an OC_APPRESTOREUI message by restoring the container's normal menu and borders because i...
~TOleFrame()
Destroys a TOleFrame object.
bool EvOcAppProcessMsg(MSG *msg)
Responds to an EV_OC_APPROCESSMSG message sent to the container asking the server to process accelera...
void DestroyStashedPopups()
Destroys the previously stored shared pop-up menus.
TOcApp * OcApp
Points to the ObjectComponents application associated with this frame window.
void AddUserFormatName(LPCTSTR name, LPCTSTR resultName, LPCTSTR id)
Adds user defined formats and the corresponding names to the list of Clipboard formats.
void StashContainerPopups(const owl::TMenuDescr &shMenuDescr)
Stores a local copy of the pop-up menus so they can be used for menu merging and then destroyed later...
bool EvOcAppInsMenus(TOcMenuDescr &sharedMenu)
Responds to an EV_OC_APPINSMENUS message by merging the container's menu into the shared menu.
bool EvOcAppShutdown()
Responds to an OC_APPSHUTDOWN message indicating that the last embedded object has been closed.
void EvTimer(owl::uint timerId)
If this is a DLL server, EvTimer responds to a timer message by running an idle loop if the message q...
bool EvOcAppFrameRect(owl::TRect *rect)
Responds to an OC_APPFRAMERECT message sent to a container.
void SetupWindow() override
Associates the ObjectComponents application with the window's HWND so that the TOcApp and the window ...
bool EvOcAppMenus(TOcMenuDescr &md)
Responds to an OC_OCAPPMENUS sent to the container.
void OleViewClosing(bool close)
Sets the OcShutDown data member to ViewInitiated (if close is true and OcShutDown = DontCare) or Dont...
void EvOcAppStatusText(LPCTSTR rect)
Responds to an OC_APPSTATUSTEXT message by displaying text from the server on this container's status...
void CleanupWindow() override
Performs normal window cleanup of any HWND-related resources.
bool EvOcAppBorderSpaceSet(owl::TRect *rect)
Responds to an OC_APPBORDERSPACESET message by making room in the container's frame window for the bo...
The generic OLE2 window. Use as a client of a frame window.
virtual bool OleShutDown()
Shuts down the associated ObjectComponents partners, if possible.
TColor()
Construct a null color.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
TDecoratedFrame automatically positions its client window (you must supply a client window) so that i...
TDecoratedFrame(TWindow *parent, LPCTSTR title, TWindow *clientWnd, bool trackMenuSelection=false, TModule *module=0)
Constructs a TDecoratedFrame object with the specified parent window (parent), window caption (title)...
void EvSize(uint sizeType, const TSize &size)
Forward our size event to the layout window base, and not the frame base.
TLocation
Enumeration describing the possible locations of a Gadgetwindow [Used mainly for location of Toolbar ...
@ Bottom
Refers to bottom edge of frame.
@ Top
Refers to top edge of frame.
@ Left
Refers to left edge of frame.
@ Right
Refers to right edge of frame.
void SetupWindow() override
Override SetupWindow in order to layout & position decorations Calls TLayoutWindow::Layout to size an...
virtual void Insert(TWindow &decoration, TLocation location=Top)
Insert a decoration window into position at one of the four edges.
A nested class, TEventInfo provides specific information about the type of message sent,...
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-handl...
Derived from TWindow, TFrameWindow controls such window-specific behavior as keyboard navigation and ...
virtual TWindow * GetClientWindow()
Returns a pointer to the client window.
virtual bool SetMenu(HMENU newMenu)
Overrides TWindow's non-virtual SetMenu function, thus allowing derived classes the opportunity to im...
const TMenuDescr * GetMenuDescr() const
Returns a pointer to the menu descriptor for the frame window.
When specifying the layout metrics for a window, four layout constraints are needed.
virtual void Layout()
Causes the window to resize and position its children according to the specified metrics.
bool GetChildLayoutMetrics(const TWindow &child, TLayoutMetrics &metrics)
Gets the layout metrics of the child window.
void SetChildLayoutMetrics(TWindow &child, const TLayoutMetrics &metrics)
Sets the metrics for the window and removes any existing ones.
Derived from TGadgetWindow, TMessageBar implements a message bar with one text gadget as wide as the ...
void SetText(const tstring &text)
Forwards the message in the message bar to the text gadget for formatting.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TNotify is a thin wrapper around the NMHDR structure.
TRect is a mathematical class derived from tagRect.
The tagSIZE struct is defined as.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
bool KillTimer(UINT_PTR timerId)
Gets rid of the timer and removes any WM_TIMER messages from the message queue.
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
void SetBkgndColor(TColor color, bool shouldUpdate=true)
Sets the background color for the window.
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 cre...
virtual void EvCommandEnable(TCommandEnabler &ce)
Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-h...
auto GetChildren()
Returns a TWindow::TChildrenRange that can be iterated by standard means.
virtual void Destroy(int retVal=0)
Destroys an MS-Windows element associated with the TWindow.
void EvActivateApp(bool active, DWORD threadId)
The default message handler for WM_ACTIVATEAPP.
TWindow * GetParentO() const
Return the OWL's parent for this window.
TWindowAttr & GetWindowAttr()
Returns the TWindowAttr structure, which contains the window's creation attributes.
HMENU GetMenu() const
Returns the handle to the menu of the indicated window.
UINT_PTR SetTimer(UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
Creates a timer object associated with this window.
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.
bool PostMessage(TMsgId, TParam1=0, TParam2=0)
Posts a message (msg) to the window in the application's message queue.
bool IsWindowVisible() const
Returns true if the window is visible.
virtual bool ShowWindow(int cmdShow)
Displays this TWindow in a given state.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
void EvTimer(uint timerId)
The default message handler for WM_TIMER.
void GetClientRect(TRect &rect) const
Gets the coordinates of the window's client area and then copies them into the object referred to by ...
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
auto ChildWithId(int id) const -> const TWindow *
Definition of classes for CommonControl encapsulation.
Definition of TDecoratedMDIFrame class.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
#define NoErase
don't erase, wait for Paint
#define ocrEmbeddedObject
Include for OC, gets common headers when precompiled headers are enabled.
char * strnewdup(const char *s, size_t minAllocSize=0)
Object Component Framework (COM encapsulation).
const TDecoratedFrame::TLocation SpaceLoc[]
const int IDW_REMVIEWBUCKET
const int IDW_PADDECORATION
@ amExeMode
may be overridden per instance if running DLL
@ amEmbedding
cmdline, overridden per Instance if embedded DLL
TWindow * GetWindowPtr(HWND, const TApplication *)
Raw function to retrieve a TWindow pointer given an HWND from the a given app, or any app (app==0).
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
LRESULT TResult
Result type.
DIAG_DEFINE_GROUP_INIT(OWL_INI, OwlApp, 1, 0)
EV_MESSAGE(BM_SETSTYLE, BMSetStyle)
Definition of OWL signatures for ObjectComponents messages.
TOleWindow - Class encapsulating a window which can be an OLE container or server window.
#define TYPESAFE_DOWNCAST(object, toClass)
Definition of class TStatusBar.
int H
height of the window