OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
olewindo.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Implementation of TOleWindow. Window class that supports OLE 2
7/// container & server using OCF TOcView & TOcRemView
8//----------------------------------------------------------------------------
9#include <ocf/pch.h>
10
11#include <owl/window.h>
12#include <owl/gdiobjec.h>
13#include <owl/scroller.h>
14#include <ocf/ocdoc.h>
15#include <ocf/ocview.h>
16#include <ocf/occtrl.h>
17#include <ocf/oleframe.h>
18#include <ocf/olewindo.h>
19#include <owl/uimetric.h>
20#include <owl/edit.rh>
21#include <owl/docview.rh>
22#include <ocf/oleview.rh>
23
24namespace ocf {
25
26using namespace owl;
27
28using namespace std;
29
31DIAG_DECLARE_GROUP(OcfRemView);//????????????????????????????????????????????????????????
32
33///----------------------------------------------------------------------------
34/// Size of rectangle in two clks must occur to be a doubleClick
35/// ---- moved in StartDrag ----
36/// TSize DblClkDelta(TUIMetric::CxDoubleClk/2,
37/// TUIMetric::CyDoubleClk/2);
38
39//----------------------------------------------------------------------------
40// TOleClientDC
41//
42
43//
44/// Constructs a TOleClientDC object . The parameter win references the window that
45/// TOleClientDC uses to create a device context (DC). If the scale parameter is
46/// true, TOleClientDC takes care of scaling. However, if your application handles
47/// scaling, you can pass scale as false.
48/// Scrolling is controlled by the presence of a scroller (TScroller). TOleClientDC
49/// by default takes care of both scaling and scrolling.
50//
52:
53 TClientDC(win)
54{
55 win.SetupDC(*this, scale);
56}
57
58//----------------------------------------------------------------------------
59// TOleWindow
60//
61
78
79 EV_COMMAND_ENABLE(CM_FILECLOSE, CeFileClose),
80
81 EV_COMMAND(CM_EDITDELETE, CmEditDelete),
82 EV_COMMAND_ENABLE(CM_EDITDELETE, CeEditDelete),
83 EV_COMMAND(CM_EDITCUT, CmEditCut),
84 EV_COMMAND_ENABLE(CM_EDITCUT, CeEditCut),
85 EV_COMMAND(CM_EDITCOPY, CmEditCopy),
86 EV_COMMAND_ENABLE(CM_EDITCOPY, CeEditCopy),
87 EV_COMMAND(CM_EDITPASTE, CmEditPaste),
88 EV_COMMAND_ENABLE(CM_EDITPASTE, CeEditPaste),
89 EV_COMMAND(CM_EDITPASTESPECIAL, CmEditPasteSpecial),
90 EV_COMMAND_ENABLE(CM_EDITPASTESPECIAL, CeEditPasteSpecial),
91 EV_COMMAND(CM_EDITPASTELINK, CmEditPasteLink),
92 EV_COMMAND_ENABLE(CM_EDITPASTELINK, CeEditPasteLink),
93 EV_COMMAND(CM_EDITINSERTOBJECT, CmEditInsertObject),
94
95 EV_COMMAND(CM_EDITINSERTCONTROL, CmEditInsertControl),
96 EV_COMMAND_ENABLE(CM_EDITINSERTOBJECT, CeEditInsertObject),
97 EV_COMMAND_ENABLE(CM_EDITINSERTCONTROL, CeEditInsertControl),
98
99 EV_COMMAND_ENABLE(CM_EDITLINKS, CeEditLinks),
100 EV_COMMAND(CM_EDITLINKS, CmEditLinks),
101 EV_COMMAND_ENABLE(CM_EDITOBJECT, CeEditObject),
102 EV_COMMAND_ENABLE(CM_EDITCONVERT, CeEditConvert),
103 EV_COMMAND(CM_EDITCONVERT, CmEditConvert),
104 EV_COMMAND_ENABLE(CM_EDITSHOWOBJECTS, CeEditShowObjects),
105 EV_COMMAND(CM_EDITSHOWOBJECTS, CmEditShowObjects),
106
107 EV_MESSAGE(WM_OCEVENT, EvOcEvent),
108/// EV_OC_VIEWDISCARDUNDO, // !CQ not processing this yet...
109
110 // Container specific messages
111 //
125
126 // Server specific messages
127 //
145
146 // Ambient properties
147 //
176
177 // Standard Events
178 //
181
182
183 // Ctrl events
184 //
197
199
200//
201/// Constructs a TOleWindow object associated with the specified parent window and
202/// module instance.
203//
205:
206 TWindow(parent, 0, module),
207 Pos(0, 0, 0, 0),
208 Remote(false),
209 ShowObjects(false)
210{
211 // Initialize virtual base, in case the derived-most used default ctor
212 //
213 TWindow::Init(parent, 0, module);
214
215 // Derived class will need to create a OcDocument object to hold the OLE
216 // parts that we create and a OcView to provide OLE services
217 //
218 OcApp = 0;
219 OcDoc = 0;
220 OcView = 0;
221
222 Init();
223}
224
225//
226/// Initializes the TOleWindow object with the appropriate window style and
227/// initializes the necessary data members (for example, sets the accelerator ID to
228/// IDA_OLEVIEW).
229//
230void
232{
233 // Clip children to not paint on in-place servers, & clip siblings to not
234 // paint on floating tool palettes
235 //
236 Attr.Style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
237
238 Attr.AccelTable = IDA_OLEVIEW;
240 DragPart = 0;
241 DragDC = 0;
242
243 // Minimum part size
244 //
245 HDC dc = GetDC(0);
246 MinWidth = GetDeviceCaps(dc, LOGPIXELSX) / 4;
247 MinHeight = GetDeviceCaps(dc, LOGPIXELSY) / 4;
248 ReleaseDC(0, dc);
249
250 // Snag the OcApp from the TOleFrame object for quick reference
251 //
252 TOleFrame* olefr = TYPESAFE_DOWNCAST(GetApplication()->GetMainWindow(), TOleFrame);
253 CHECK(olefr);
254 OcApp = olefr->GetOcApp();
255 OcApp->AddRef();
256}
257
258//
259/// Checks to see if there are any open views, and, if no open views exist, destroys
260/// the TOleWindow object.
261//
263{
264 // Let the OC objects go. They will delete themselves when they can
265 // If it's a remote view, then the last release is called by the container.
266 //
267 if (OcDoc)
268 OcDoc->Close(); // close all the embedded parts first
269 if (OcView && !IsRemote()) {
270 OcView->ReleaseObject(); // use ReleaseObject here to tell it we are gone
271 OcView = 0;
272 }
273
274 delete OcDoc;
275 if (OcApp) {
276 OcApp->Release();
277 OcApp = 0;
278 }
279}
280
281//
282/// Establishes a connection between the TOcView object and the view's HWND so the
283/// view can send notification messages to the window.
284//
285void
287{
288 if (!OcView)
289 CreateOcView(0, false, 0); // don't have much context by this time
290 CHECK(OcView);
292 OcView->SetupWindow(*this, IsRemote());
293}
294
295//
296/// Called to perform the actual setting up of the OcView member
297//
298/// Creates an ObjectComponents view associated with the embedded object. Associates
299/// the view with the document template specified in tpl. If isEmbedded is true, a
300/// remote view is created (that is, a TOcRemView instead of a TOcView). The outer
301/// parameter refers to the IUnknown interface with which the view will aggregate
302/// itself.
303///
304/// Derived class needs to construct the TOcView/TOcRemView here & return it
305//
306TOcView*
307TOleWindow::CreateOcView(TRegLink* link, bool isRemote, IUnknown* outer)
308{
309 if (!OcDoc)
310 OcDoc = new TOcDocument(*GetOcApp());
311
312 if (!OcView) {
313 TRegList* regList = link ? &link->GetRegList() : 0;
314
315 // Create a remote view on the server document if it embeded, else make a
316 // normal container view [capable of hosting OCXes or 'normal' servers]
317 //
318 if (isRemote)
319 OcView = new TOcRemView(*GetOcDoc(), regList, outer);
320 else
321
322 // By default, our 32-bit container support can 'hold' embedded objects
323 // and OCX controls. So we'll default to a 'TOcxView'. However, this
324 // can be optimized if the container will never contain any OLE controls.
325 //
326#if !defined(OWL_NO_OCX_CONTAINER_SUPPORT)
327 OcView = new TOcxView(*GetOcDoc(), regList, outer);
328#endif
329
330 Remote = isRemote;
331 }
332 return OcView;
333}
334
335//
336/// Overrides the usual EvCommandEnable message in order to enable the OLE verbs
337/// from CM_EDITFIRSTVERB to CM_EDITLASTVERB. These commands enable the OLE-specific
338/// Edit menu selections, such as Edit, Open, and Play. Many of the other commands
339/// are passed to TWindow::EvCommand for normal processing.
340/// If a window is embedded, however, TOleWindow calls upon TWindow's
341/// RouteCommandEnable to perform command enabling.
342//
343void
345{
346 if (CM_EDITFIRSTVERB <= commandEnabler.GetId() && commandEnabler.GetId() <= CM_EDITLASTVERB) {
347 CeEditVerbs(commandEnabler);
348 }
349 else if (IsRemote()) {
350 // Get the focus, in case it is a child that should receive the cmds
351 // fall back to this window in case the Ole menu bar stole focus!
352 //
353 THandle hCmdTarget = ::GetFocus();
354 if (hCmdTarget != GetHandle() && !IsChild(hCmdTarget))
355 hCmdTarget = GetHandle();
356
357 RouteCommandEnable(hCmdTarget, commandEnabler);
358 }
359 else {
360 TWindow::EvCommandEnable(commandEnabler);
361 }
362}
363
364//
365/// Overrides the usual EvCommand message to handle the OLE verbs from
366/// CM_EDITFIRSTVERB to CM_EDITLASTVERB. These commands, which are defined in
367/// oleview.rh, correspond to the OLE-specific Edit menu selections such as Edit,
368/// Open, and Play. All of the other commands are passed to TWindow::EvCommand for
369/// normal processing.
370//
373{
374 TRACEX(OcfRemView, 1, _T("TOleWindow::EvCommand - id(") << id << _T("), ctl(") <<\
375 hex << static_cast<void*>(hCtl) << _T("), code(") << notifyCode << _T(")"));
376
377 if (hCtl == 0) {
378 if (CM_EDITFIRSTVERB <= id && id <= CM_EDITLASTVERB) {
379 EvDoVerb(id - CM_EDITFIRSTVERB);
380 return 0;
381 }
382 }
383 return TWindow::EvCommand(id, hCtl, notifyCode);
384}
385
386//
387/// Intercept CanClose() to interpose OpenEdit semantics. OLE2 servers don't
388/// prompt the user on close--just save & close.
389///
390/// Returns true if the window can be closed. Checks all the server's child windows'
391/// CanClose functions, which must return true before the window can be closed.
392/// Terminates any open editing transactions before closing the window; otherwise,
393/// passes control to TWindow::CanClose.
394///
395bool
397{
398 // We don't want to close the view for DLL servers
399 //
401 TOleFrame* olefr = TYPESAFE_DOWNCAST(GetApplication()->GetMainWindow(), TOleFrame);
402 CHECK(olefr);
403 olefr->ShowWindow(SW_HIDE);
404 OleShutDown();
405 return false;
406 }
407
408 if (GetOcRemView() || TWindow::CanClose()) {
409 if (OcDoc)
410 OcDoc->Close();
411 return true;
412 }
413 return false;
414}
415
416//
417/// Invalidates the area where the embedded object exists. The server uses this
418/// function to tell OLE that the part (the embedded object), has changed. OLE then
419/// asks the server to redraw the part into a new metafile so that OLE can redraw
420/// the object for the container application even when the server application is not
421/// active.
422//
423void
425{
426 if (GetOcRemView())
427 GetOcRemView()->Invalidate(invalid);
428}
429
430//
431/// Checks whether the window is in Open-Edit mode.
432//
433bool
435{
436 TOcRemView* ocRemView = const_cast<TOleWindow*>(this)->GetOcRemView();
437 return ocRemView && ocRemView->GetState() == TOcRemView::OpenEditing;
438}
439
440//
441//
442//
443TOcPart*
445{
446 TRect rect;
447
448 // Pass size request on if caller does not specify
449 //
450 if (!pos) {
451 pos = &rect;
452 GetInsertPosition(*pos);
453 }
454
455 TOcPart* part;
456 try {
457 part = new TOcPart (*GetOcDoc());
458 part->Init(&initInfo, *pos);
459 SetSelection(part);
460 OcView->Rename();
462 }
463 catch (TXOle& /*xole*/) {
464 return 0;
465 }
466 return part;
467}
468
469//
470//
471//
472TOcPart*
473TOleWindow::InsertObject(CLSID& objIID, TRect* pos)
474{
475 TOcInitInfo initInfo(OcView);
476
477 // Initialize InitInfo structure
478 //
479 initInfo.CId = (BCID) &objIID; // Object's GUID
480 initInfo.Where = iwNew; // Flag it's a new embedding
481 initInfo.How = ihEmbed; // Want embedded
482
483 return InsertObject(initInfo, pos);
484}
485
486//
487//
488//
489TOcPart*
491{
492 // Get IID of OCX from specified ProgID
493 //
494 CLSID objIID = CLSID_NULL;
495 HRESULT hr = ::CLSIDFromProgID(objProgId, &objIID);
496
497 if (FAILED(hr)) {
498 return 0;
499 }
500 return InsertObject(objIID, pos);
501}
502
503
504//
505//
506//
509{
510 TRect rect;
511
512 // Pass size request on if caller does not specify
513 //
514 if (!pos) {
515 pos = &rect;
516 GetInsertPosition(*pos);
517 }
518
519 // If user did not specify the size (i.e. right & bottom), use
520 // some default values...
521 //
522 if (pos->left == pos->right)
523 pos->right = pos->left + 100;
524 if (pos->top == pos->bottom)
525 pos->bottom = pos->top + 100;
526
527 TOcControl* ctrl;
528 try {
529 ctrl = new TOcControl (*GetOcDoc());
530 ctrl->Init(&initInfo, *pos);
531 SetSelection(ctrl);
532 OcView->Rename();
534 ctrl->SetId(id);
535 }
536 catch (TXOle& /*xole*/) {
537 return 0;
538 }
539 return ctrl;
540}
541
542//
543//
544//
546TOleWindow::InsertControl(CLSID& ocxIID, TRect* pos, int id)
547{
548 TOcInitInfo initInfo(OcView);
549
550 // Initialize InitInfo structure
551 //
552 initInfo.CId = (BCID) &ocxIID; // OCX's GUID
553 initInfo.Where = iwNewOcx; // Flag it's an OCX
554 initInfo.How = ihEmbed; // Want embedded
555
556 return InsertControl(initInfo, pos, id);
557}
558
559//
560//
561//
563TOleWindow::InsertControl(const TString& ocxProgID, TRect* pos, int id)
564{
565 // Get IID of OCX from specified ProgID
566 //
567 CLSID ocxIID = CLSID_NULL;
568 HRESULT hr = ::CLSIDFromProgID(ocxProgID, &ocxIID);
569
570 if (FAILED(hr)) {
571 return 0;
572 }
573 return InsertControl(ocxIID, pos, id);
574}
575
576
577//
578//
579//
582{
583 // Iterate through all parts of this window
584 //
585 for (TOcPartCollectionIter i(GetOcDoc()->GetParts()); i; i++) {
586 TOcPart* p = *i;
587
588 // NOTE: Here we'll simply dynamic_cast the TOcPart pointer to a
589 // TOcControl. A more OLEish approach would be to querry for
590 // a control interface [IBControl for example] as a safety
591 // measure first.
592 //
594 if (pCtrl) {
595 IOleObject* pOleObject = 0;
596 if (SUCCEEDED(pCtrl->QueryServer(IID_IOleObject, (void**)&pOleObject))) {
597
598 // !BB Could add a call to pOleObject->GetUserType to retrieve
599 // !BB the name of the control for debugging purposes...
600 CLSID userClsId;
601 if (SUCCEEDED(pOleObject->GetUserClassID(&userClsId)) &&
602 userClsId == ocxIID) {
603 if (id == 0 || pCtrl->GetId() == id) {
604 pOleObject->Release();
605 return pCtrl;
606 }
607 }
608 pOleObject->Release();
609 }
610 }
611 }
612
613 // Control proxy was not found
614 //
615 return 0;
616}
617
618
619//
620/// Enables the FileClose command, which lets the user exit from the window view.
621//
622void
624{
625 // if open editing server, reflect the container's name in "close" option
626 //
627 if (IsOpenEditing() && GetOcRemView() && GetOcRemView()->GetKind() != TOcRemView::Link) {
628 TCHAR strCloseMenu[128];
629 owl::tstring optName = GetModule()->LoadString(IDS_CLOSESERVER);
631 if (title.Length() > 0) {
632 _tcscpy(strCloseMenu, optName.c_str());
633 _tcscat(strCloseMenu, title);
634 //LPCTSTR str = title;
635 //optName += str;
636 }
637 //ce.SetText(optName.c_str());
638 ce.SetText(&strCloseMenu[0]);
639 }
640}
641
642//
643/// Enables a command with an ID of CM_EDITINSERTOBJECT if the OcApp and OcView
644/// objects exist. Disables the command otherwise.
645//
646void
651
652//
653/// Enables a command with an ID of CM_EDITINSERTCONTROL if the OcApp and OcView
654/// objects exist. Disables the command otherwise.
655//
656void
661
662//
663/// Gets the position (rect) where the embedded object is inserted. You need to
664/// override this function if you want to override any default position.
665///
666/// \note Currently we're using only the top left point for position, size is
667/// redundant.
668//
669void
671{
672 TOleClientDC dc(*this);
673
674 // Default insertion point is at 0.5" away from current viewport origin
675 //
676 rect.left = dc.GetDeviceCaps(LOGPIXELSX) / 2; // in pixels
677 rect.top = dc.GetDeviceCaps(LOGPIXELSY) / 2; // in pixels
678
679 // Adjust the position of embedded object to be in pixels and reflect the
680 // zoom factor.
681 //
682 dc.LPtoDP((TPoint*)&rect, 1);
683
684 // No size yet.
685 //
686 rect.right = rect.left;
687 rect.bottom = rect.top;
688}
689
690//
691/// Responds to a command with an ID of CM_EDITINSERTOBJECT by creating,
692/// initializing, painting, and selecting an OLE object (TOcPart object).
693//
694void
696{
697 if (!OcView)
698 return;
699 TOcInitInfo initInfo(OcView);
700
701 if (OcApp->Browse(initInfo)) {
702 InsertObject(initInfo);
703 }
704}
705
706//
707/// Responds to a command with an ID of CM_EDITINSERTCONTROL by creating,
708/// initializing, painting, and selecting an OCX control (TOcControl object).
709//
710void
712{
713 if (!OcView)
714 return;
715 TOcInitInfo initInfo(OcView);
716
717 if (OcApp->BrowseControls(initInfo)) {
718 InsertControl(initInfo);
719 }
720}
721
722//
723/// Enables a command with an ID of CM_EDITDELETE, which lets the user delete the
724/// selected object from the view.
725//
726void
731
732//
733/// Responds to a command with an ID of CM_EDITDELETE by deleting the selected text.
734//
735void
737{
738 if (!DragPart)
739 return;
740
742 EvOcViewPartInvalid(changeInfo);
743
744 DragPart->Delete();
745 DragPart = 0;
746}
747
748//
749/// Enables a command with an ID of CM_EDITCUT, which lets a user copy and delete
750/// the selected object from the view.
751//
752void
757
758//
759/// Responds to a command with an ID of CM_EDITCUT by copying the selected text to
760/// the clipboard before cutting the text.
761//
762void
769
770//
771/// Enables a command with an ID of CM_EDITCOPY, which lets the user copy selected
772/// object to the clipboard.
773//
774void
779
780//
781/// Responds to a command with an ID of CM_EDITCOPY by copying the selected text to
782/// the clipboard.
783//
784void
790
791//
792/// Enables a PasteLink command with an ID of CM_EDITPASTELINK, which lets the user
793/// link to the embedded object on the clipboard. See the ocrxxxx Clipboard
794/// Constants for a description of the available clipboard formats.
795//
796void
801
802//
803/// Responds to a command with an ID of CM_EDITPASTELINK by creating a link between
804/// the current document and the object on the clipboard.
805//
806void
808{
809 if (OcView)
810 OcView->Paste(true);
811}
812
813//
814/// Enables a command with an ID of CM_EDITPASTE, which lets the user paste the
815/// embedded object from the clipboard.
816//
817void
822
823//
824/// Responds to a command with an ID of CM_EDITPASTE by pasting an object from the
825/// clipboard into the document.
826//
827void
829{
830 if (!OcView)
831 return;
832 OcView->Paste(false);
834}
835
836//
837/// Enables the PasteSpecial command, which lets the user select a clipboard format
838/// to be pasted or paste linked. See the ocrxxxx Clipboard Constants for a
839/// description of the available clipboard formats.-
840//
841void
846
847//
848/// Responds to a command with an ID of CM_EDITPASTESPECIAL by letting the user
849/// select an object from a list of available formats for pasting from the clipboard
850/// onto the document.
851//
852void
854{
855 if (!OcView)
856 return;
857 TOcInitInfo initInfo(OcView);
858
859 if (OcView->BrowseClipboard(initInfo)) {
860 if (!OcView->PasteNative(initInfo)) { // Not native data
861 EvOcViewPasteObject(initInfo);
862 }
864 }
865}
866
867//
868/// Enables a command with an ID of CM_EDITOBJECT, which lets the user edit the
869/// embedded object.
870//
871void
873{
874 // Downcast to get at submenu item
875 //
877 if (!me)
878 return;
879
880 int verbPos = me->GetPosition(); // remember the verb menu position
881 TMenu editMenu(me->GetMenu());
882
883 owl::tstring optName = GetModule()->LoadString(IDS_EDITOBJECT);
884 if (!DragPart) {
885 // Remove the verb menu, if any
886 //
887 if (editMenu.GetSubMenu(verbPos)) {
888 editMenu.DeleteMenu(verbPos, MF_BYPOSITION);
889 editMenu.InsertMenu(verbPos, MF_GRAYED | MF_BYPOSITION | MF_STRING,
890 CM_EDITOBJECT, optName.c_str());
891 }
892 ce.Enable(false);
893 return;
894 }
895
896 // Add verb menu
897 //
898 TOcVerb ocVerb;
899 TMenu* verbMenu = CreateVerbPopup(ocVerb);
900 owl::tstring newMenuName(OleStr(ocVerb.TypeName));
901 newMenuName += _T(" ");
902 newMenuName += optName;
903 editMenu.ModifyMenu(verbPos, MF_ENABLED | MF_BYPOSITION | MF_POPUP,
904 reinterpret_cast<TMenuItem>(verbMenu->GetHandle()), newMenuName.c_str());
905 delete verbMenu;
906 ce.Enable(true);
907}
908
909//
910/// Enables a command with an ID of CM_EDITCONVERT, which lets the user convert the
911/// selected object from one format to another. This is an OLE-specific pop-up menu option.
912//
913void
918
919/// Responds to a command with an ID of CM_EDITCONVERT by converting an object from
920/// one type to another.
921void
926
927//
928/// Enables a command with an ID of CM_EDITLINKS, which lets the user manually
929/// update the list of linked items in the current view.
930//
931void
936
937//
938/// Responds to a command with an ID of CM_EDITLINKS by updating the user-selected
939/// list of linked items in the current view.
940//
941void
947
948//
949/// Enables the Edit|Verbs command, which lets the user select one of the
950/// OLE-specific verbs from the Edit menu: for example, Edit, Open, or Play.
951//
952void
957
958//
959/// Responds to a command with an ID of CM_EDITSHOWOBJECTS by toggling the value of
960/// the ShowObjects data member.
961//
962void
968
969//
970/// Checks or unchecks the Edit|Show Objects menu command according to the value of
971/// the ShowObjects data member.
972//
973void
978
979//
980/// Returns true if the container's view holds an in-place active embedded object.
981//
982bool
984{
985 return OcView && OcView->GetActivePart() != 0;
986}
987
988//
989/// Performs hit testing to tell where the cursor is located within the window and
990/// what object the cursor is moving over. If the cursor is within an embedded
991/// object, EvSetCursor changes the shape of the cursor.
992/// When the cursor is over an inactive part and not on a handle, EvSetCursor uses
993/// an arrow cursor. If the cursor is on one of the handles of the embedded part,
994/// EvSetCursor changes the cursor to a resizing cursor.
995//
996bool
997TOleWindow::EvSetCursor(THandle hWnd, uint hitTest, uint mouseMsg)
998{
999 TPoint pt;
1000 GetCursorPos(pt);
1001 ScreenToClient(pt);
1002 TOcPart* p = OcView ? OcView->GetActivePart() : 0;
1003
1004 if (hitTest == HTCLIENT) {
1005 if (p) { // there is an activated part
1006 TUIHandle handle(p->GetRect(), TUIHandle::Framed);
1007 if (handle.HitTest(pt) == TUIHandle::MidCenter) {
1008 return false; // let the inplace server set its cursor shape
1009 }
1010 else { // use arrow cursor
1011 ::SetCursor(::LoadCursor(0, IDC_ARROW));
1012 return true;
1013 }
1014 }
1015 }
1016
1017 // Set cursor for resize when cursor over inactive part
1018 //
1019 if (!p && DragPart) {
1020 TRect rect(DragPart->GetRect());
1021 TOleClientDC dc(*this);
1022 dc.LPtoDP((TPoint*)&rect, 2);
1023
1026
1027 if (handle.HitTest(pt) != TUIHandle::Outside)
1028 ::SetCursor(::LoadCursor(0, TResId(handle.GetCursorId(handle.HitTest(pt)))));
1029 else
1030 ::SetCursor(::LoadCursor(0, IDC_ARROW));
1031
1032 return true;
1033 }
1034
1035 return ShowCursor(hWnd, hitTest, mouseMsg);
1036}
1037
1038//
1039/// Handles the WM_NCHITTEST message, setting the cursor according to its position
1040/// on the screen. By default, the cursor is always an arrow. But by overriding the
1041/// ShowCursor function, you can specify the conditions under which the cursor
1042/// should change and to which bitmap it should change.
1043/// HWND is the window containing the cursor, hitTest is a constant that represents
1044/// the current position of the mouse (for a list of possible values, see the
1045/// WM_NCHITTEST topic), and mouseMsg is a constant that represents the current
1046/// mouse action, such as WM_MOUSEACTIVATE.
1047/// For an example of an implementation of the ShowCursor function, see Step 17 of
1048/// the OWL tutorial.
1049//
1050bool
1051TOleWindow::ShowCursor(THandle /*hWnd*/, uint /*hitTest*/, uint /*mouseMsg*/)
1052{
1053 ::SetCursor(::LoadCursor(0, IDC_ARROW));
1054 return true;
1055}
1056
1057//
1058// Find out if drag and drop needs to be started
1059//
1060bool
1062{
1063 static TSize DblClkDelta(TUIMetric::CxDoubleClk/2,
1065
1066 // no part no drag
1067 if (!DragPart)
1068 return false;
1069
1070 // maybe it was a double click
1071 if (abs(point.X()-DragStart.X()) <= DblClkDelta.cx ||
1072 abs(point.Y()-DragStart.Y()) <= DblClkDelta.cy)
1073 return false;
1074
1075 // start drag and drop anyway if outside client area
1076 if (!InClient(*DragDC, point))
1077 return true;
1078
1079 // start if ctrl or ctrl-shift is pressed but not if alt since move inside client area
1080 // doesn't really make sense (a move is a move don't bother ole for that)
1081 if ((modKeys & MK_CONTROL))
1082 return true;
1083
1084 return false;
1085}
1086
1087//
1088/// This is a response method for an incoming EV_WM_DROPFILES message.
1089/// Accept dropped file from file manager
1090//
1091void
1093{
1094 if (!OcView) {
1095 dropInfo.DragFinish();
1096 return;
1097 }
1098 int fileCount = dropInfo.DragQueryFileCount();
1099 for (int index = 0; index < fileCount; index++) {
1100 int fileLength = dropInfo.DragQueryFileNameLen(index)+1;
1101 TAPointer<OLECHAR> filePath(new OLECHAR[fileLength]);
1102 dropInfo.DragQueryFile(index, OleStr((OLECHAR*)filePath), fileLength);
1103
1104 TOcInitInfo initInfo(ihEmbed, iwFile, OcView);
1105 initInfo.Path = filePath;
1106
1107 TRect rect;
1108 GetInsertPosition(rect);
1109 TOcPart* part = new TOcPart (*GetOcDoc());
1110 part->Init(&initInfo, rect);
1111 SetSelection(part);
1112
1113 OcView->Rename();
1115 }
1116 dropInfo.DragFinish();
1117}
1118
1119//
1120/// Responds to a mouse button double click message. EvLButtonDblClk performs hit
1121/// testing to see which embedded object, if any, is being clicked on, then in-place
1122/// activates the embedded object.
1123//
1124void
1126{
1127 if (!OcDoc || !OcView)
1128 return;
1129 TOleClientDC dc(*this);
1130 TPoint point(point_);
1131 dc.DPtoLP(&point);
1132
1133 TOcPart* p = GetOcDoc()->GetParts().Locate(point);
1134
1135 if (modKeys & MK_CONTROL) {
1136 if (p)
1137 p->Open(true); // Ctrl key forces open editing
1138 }
1139 else {
1140 SetSelection(p);
1141
1142 if (p && p == GetOcView()->GetActivePart()) { // resync the active flag
1143 p->Activate(false);
1144 }
1145
1146 GetOcView()->ActivatePart(p); // In-place activation
1147 }
1148}
1149
1150//
1151/// Selects the embedded object indicated in the part parameter. When the embedded
1152/// object is selected, a selection box is drawn around the area. After an embedded
1153/// object is selected, the user can perform operations on the embedded object: for
1154/// example, moving, sizing, or copying the embedded object to the clipboard.
1155//
1156void
1158{
1159 if (part == DragPart)
1160 return;
1161
1162 // Invalidate old part
1163 //
1164 TOcPartChangeInfo changeInfo(DragPart, invView);
1165 if (DragPart) {
1166 DragPart->Select(false);
1167 DragPart->Activate(false);
1168 EvOcViewPartInvalid(changeInfo);
1169 }
1170
1171 DragPart = part;
1172 changeInfo.SetPart(DragPart);
1173 if (DragPart) {
1174 part->Select(true); // select this one
1175 EvOcViewPartInvalid(changeInfo);
1176 }
1177}
1178
1179//
1180/// Responds to a right button down message. Performs additional hit testing to see
1181/// which embedded object, if any, is being clicked on and displays a local menu
1182/// with appropriate options for the embedded object.
1183/// point refers to the place where the mouse is located. modKeys holds the values
1184/// for a combined key and transaction, such as a Shift+Double-click of the mouse
1185/// button.
1186//
1187void
1189{
1191
1192 // Perform hit test on parts...
1193 //
1194 TPoint oldPoint = point_;
1195 TOleClientDC dc(*this);
1196 TPoint point(point_);
1197 dc.DPtoLP(&point);
1198
1199 TOcPart* p = GetOcDoc()->GetParts().Locate(point);
1200 SetSelection(p);
1201
1202 if (DragPart) {
1203 // Create popup menu
1204 //
1205 TMenu menu(GetModule()->LoadMenu(IDM_OLEPOPUP), AutoDelete);
1206 TPopupMenu popMenu(menu.GetSubMenu(0));
1207
1208 if (popMenu.GetHandle()) {
1209 TOcVerb ocVerb;
1210 TMenu* verbMenu = CreateVerbPopup(ocVerb);
1211
1212 owl::tstring optName = GetModule()->LoadString(IDS_EDITOBJECT);
1213 owl::tstring newMenuName(OleStr(ocVerb.TypeName));
1214 newMenuName += _T(" ");
1215 newMenuName += optName;
1216 popMenu.ModifyMenu(CM_EDITOBJECT, MF_ENABLED | MF_BYCOMMAND | MF_POPUP,
1217 reinterpret_cast<TMenuItem>(verbMenu->GetHandle()), newMenuName.c_str());
1218 delete verbMenu;
1219
1220 // Add the verb menu
1221 //
1222 ClientToScreen(oldPoint);
1223
1224 // Route commands through main window
1225 //
1226 popMenu.TrackPopupMenu(TPM_RIGHTBUTTON, oldPoint, 0, *this);
1227 }
1228 }
1229}
1230
1231//
1232/// If an embedded object is no longer the active embedded object, either because
1233/// the user has ended an in-place editing session or because the user has clicked
1234/// outside the embedded object, call Deactivate to unselect the object. Returns
1235/// true if successful.
1236//
1237bool
1239{
1240 // Deactivate active part, if any
1241 //
1242 if (DragPart && DragPart->IsActive()) {
1243 SetSelection(0);
1244 return true;
1245 }
1246 else
1247 return false;
1248}
1249
1250//
1251/// Selects the embedded object at the specified point (measured in logical units).
1252/// Returns true if the object is captured by the mouse drag; otherwise, returns
1253/// false.
1254//
1255bool
1257{
1259
1260 // If the point is not on the current selection, perform hit test on parts
1261 // to find & select one
1262 //
1263 if (!DragPart || !DragPart->IsVisible(TRect(point, TSize(1,1))))
1264 SetSelection(GetOcDoc()->GetParts().Locate(point));
1265
1266 // If a part is now selected, manipulate it.
1267 //
1268 if (DragPart) {
1270 DragRect.right++;
1271 DragRect.bottom++;
1272 if (DragPart->IsSelected()) {
1275 DragHit = handle.HitTest(point);
1276 }
1277 else {
1279 }
1280
1281 if (!DragDC)
1282 DragDC = new TOleClientDC(*this);
1284
1285 DragStart = DragPt = point;
1286 SetCapture();
1287
1288 return true;
1289 }
1290
1291 return false;
1292}
1293
1294//
1295/// Responds to a left button down message by beginning a mouse drag transaction at
1296/// the given point. Performs additional hit testing to see which embedded object,
1297/// if any, is being clicked on. The modKeys parameter holds the values for a key
1298/// combination such as a shift and double click of the mouse button.
1299/// See also EvRButtonDown
1300//
1301void
1303{
1304 // Deactivating in-place active object, if any
1305 //
1306 if (Deactivate())
1307 return;
1308
1309 // Convert the point to logical unit
1310 //
1311 if (!DragDC)
1312 DragDC = new TOleClientDC(*this);
1313
1314 TPoint point(point_);
1315 DragDC->DPtoLP(&point);
1316 Select(modKeys, point);
1317}
1318
1319//
1320/// Returns true if point is inside the client area of the window. Returns false otherwise.
1321//
1322bool
1324{
1325 TRect logicalRect = GetClientRect();
1326
1327 dc.DPtoLP((TPoint*)&logicalRect, 2);
1328 return logicalRect.Contains(point);
1329}
1330
1331//
1332/// Responds to a mouse move message with the appropriate transaction. If the mouse
1333/// is being dragged, the embedded object is moved. If a resizing operation occurs,
1334/// then the embedded object is resized. This message is handled only when a mouse
1335/// dragging or resizing action involving the embedded object occurs.
1336//
1337void
1338TOleWindow::EvMouseMove(uint modKeys, const TPoint& point_)
1339{
1340 if (!DragDC)
1341 return;
1342
1343 // Convert the point to logical unit
1344 //
1345 TPoint point(point_);
1346 DragDC->DPtoLP(&point);
1347
1348 // A MidCenter hit is a move
1349 //
1351 DragDC->DrawFocusRect(DragRect); // erase old rect
1352
1353 // check if initiate drag and drop
1354 if (StartDrag(modKeys, point)) {
1355 TOcDropAction outAction;
1357 outAction);
1358
1360 EvOcViewPartInvalid(changeInfo);
1363
1364 // Delete the dragged part since it was dragged out
1365 //
1366 if (outAction == daDropMove) {
1367 DragPart->Delete();
1368 DragPart = 0;
1369 }
1370 }
1371 else {
1372 TPoint delta = point - DragPt;
1373 DragRect.Offset(delta.x, delta.y);
1374 DragDC->DrawFocusRect(DragRect); // draw new rect
1375 }
1376 }
1377 // All other non-outside hits are resizes
1378 //
1379 else if (DragHit != TUIHandle::Outside) { // handle
1380 DragDC->DrawFocusRect(DragRect); // erase old rect
1381 int dl = (DragHit%3) == 0 ? point.x - DragPt.x : 0;
1382 int dr = (DragHit%3) == 2 ? point.x - DragPt.x : 0;
1383 int dt = (DragHit/3) == 0 ? point.y - DragPt.y : 0;
1384 int db = (DragHit/3) == 2 ? point.y - DragPt.y : 0;
1385
1386 // maintain minimum part size
1387 //
1388 if ((DragRect.Width() + dr - dl) >= MinWidth) {
1389 DragRect.left += dl;
1390 DragRect.right += dr;
1391 }
1392 if ((DragRect.Height() + db - dt) >= MinHeight) {
1393 DragRect.top += dt;
1394 DragRect.bottom += db;
1395 }
1396
1397 DragDC->DrawFocusRect(DragRect); // draw new rect
1398 }
1399
1400 DragPt = point;
1401}
1402
1403//
1404/// Responds to a left button up message by ending a mouse drag action. point refers
1405/// to the place where the mouse is located. modKeys holds the values for a combined
1406/// key and mouse transaction.
1407//
1408void
1409TOleWindow::EvLButtonUp(uint /*modKeys*/, const TPoint& /*point*/)
1410{
1411 if (DragPart) {
1413
1414 // All non-outside hits are moves or resizes
1415 //
1416 if (DragHit != TUIHandle::Outside) {
1417 EvOcViewPartInvalid(changeInfo);
1420 DragPart->SetSize(DragRect.Size()); // A MidCenter hit is a move only
1421 EvOcViewPartInvalid(changeInfo);
1422 }
1424
1427 }
1428
1429 if (DragDC) {
1430 delete DragDC;
1431 DragDC = 0;
1432 DragRect.SetNull();
1433 }
1434}
1435
1436//
1437/// Passes the event to TWindow::EvSize for normal processing and forwards the event
1438/// to TOcView::EvResize to let a possible in-place server adjust its size.
1439//
1440void
1441TOleWindow::EvSize(uint sizeType, const TSize& size)
1442{
1443 TWindow::EvSize(sizeType, size);
1444 if (OcView)
1445 OcView->EvResize();
1446}
1447
1448//
1449/// Responds to a message forwarded from the MDI child window (if one exists) and
1450/// lets the TOcView class know that the view window child window frame has been
1451/// activated or deactivated.
1452/// The hWndActivated parameter contains a handle to the MDI child window being
1453/// activated. Both the child window being activated being activated and the child
1454/// window (hWndDeactivated) being deactivated receive this message.
1455//
1456void
1457TOleWindow::EvMDIActivate(THandle hActivated, THandle /*hDeactivated*/)
1458{
1459 if (OcView)
1460 OcView->EvActivate(hActivated == *Parent);
1461}
1462
1463/// Forwards the WM_MOUSEACTIVATE message to the top parent of the TOleWindow object.
1464uint
1465TOleWindow::EvMouseActivate(THandle topParent, uint /*hitCode*/, uint /*msg*/)
1466{
1467 if (topParent)
1468 ForwardMessage(topParent);
1469
1470 return MA_ACTIVATE;
1471}
1472
1473//
1474/// Responds to a change in focus of the window. hWndLostFocus contains a handle to
1475/// the window losing the focus. EvSetFocus checks to see if an in-place server
1476/// exists and, if so, passes the focus to the in-place server.
1477//
1478void
1480{
1481 TWindow::EvSetFocus(hLostFocus);
1482 if (OcView)
1483 OcView->EvSetFocus(true); // Maybe active part (if any) wants focus
1484}
1485
1486//
1487/// In response to a WM_HSCROLL message, EvHScroll calls TWindow::EvHScroll and
1488/// invalidates the window.
1489//
1490void
1491TOleWindow::EvHScroll(uint scrollCode, uint thumbPos, THandle hCtl)
1492{
1493 TWindow::EvHScroll(scrollCode, thumbPos, hCtl);
1494
1496}
1497
1498//
1499/// In response to a WM_VSCROLL message, EvVScroll calls TWindow::EvVScroll and
1500/// invalidates the window.
1501//
1502void
1503TOleWindow::EvVScroll(uint scrollCode, uint thumbPos, THandle hCtl)
1504{
1505 TWindow::EvVScroll(scrollCode, thumbPos, hCtl);
1506
1508}
1509
1510//
1511/// Handles WM_MENUSELECT to provide hint text in the container's status bar, based
1512/// on the menu item id. It treats popup items separately and asks them for their
1513/// ids. This implementation is similar to the code in TDecoratedFrame.
1514//
1515void
1516TOleWindow::EvMenuSelect(uint menuItemId, uint flags, HMENU hMenu)
1517{
1518 if (GetOcRemView()) {
1519 if (flags == 0xFFFF && hMenu == 0) { // menu closing
1521 return;
1522 }
1523 else if (flags & MF_POPUP)
1524 {
1525 TMenu popupMenu(hMenu);
1526 const int posItem = menuItemId;
1527 menuItemId = popupMenu.GetMenuItemID(posItem);
1528 }
1529 else if (flags & (MF_SEPARATOR | MF_MENUBREAK | MF_MENUBARBREAK))
1530 {
1531 menuItemId = 0; // display an empty help message
1532 }
1533 owl::tstring text = GetModule()->LoadString(menuItemId);
1534 GetOcRemView()->SetContainerStatusText(text.c_str());
1535 }
1536 else
1537 TWindow::EvMenuSelect(menuItemId, flags, hMenu);
1538}
1539
1540//
1541/// Responds to a WM_OCEVENT message and subdispatches the message based on wParam.
1542/// ObjectComponents sends WM_OCEVENT messages when it needs to communicate with an
1543/// OLE-generated event; for example, if a server wants to display toolbars.
1544//
1545TResult
1547{
1548 TEventHandler::TEventInfo eventInfo(WM_OCEVENT, static_cast<uint>(param1));
1549 if (Find(eventInfo))
1550 return Dispatch(eventInfo, param1, param2);
1551 return 0;
1552}
1553
1554//
1555/// Asks the container for the caption in its frame window. Returns the frame
1556/// window's caption.
1557//
1558LPCTSTR
1560{
1561 TCHAR title[128];
1562 Parent->GetWindowText(title, 128);
1563 ContainerName = title;
1564
1565 return ContainerName.c_str();
1566}
1567
1568//
1569/// Sets the window's caption to title. The new caption is the name of the in-place
1570/// active server merged with the caption of the container's window. In the case of
1571/// an MDI child window, the new caption is the in-place server's name merged with
1572/// the caption of the MDI child window. When the child window is maximized, the
1573/// merged caption is appended to the end of the main frame window's caption.
1574//
1575void
1577{
1578 if (title && *title)
1579 Parent->SetWindowText(title);
1580 else if (GetOcRemView() && GetOcRemView()->GetKind() == TOcRemView::Link) {
1581 LPCTSTR caption = GetFileName();
1582 if (caption)
1583 Parent->SetWindowText(caption);
1584 }
1585}
1586
1587//
1588/// Requests that the server create space for a tool bar in the view of an embedded
1589/// object.
1590/// If the TOleWindow object is unable to handle the message,
1591/// EvOcViewBorderSpaceReq returns false, the default value.
1592//
1593bool
1595{
1596 return false;
1597}
1598
1599//
1600/// Requests that the server's tool bar be placed in the container's view of an
1601/// embedded object.
1602/// If the TOleWindow object is unable to handle the message, EvOcViewBorderSpaceSet
1603/// returns false, the default value.
1604//
1605bool
1607{
1608 return false;
1609}
1610
1611//
1612/// Requests a given object be dropped at a specified place on the container's
1613/// window.
1614/// If the TOleWindow object is unable to handle the message, EvOcViewDrop returns
1615/// false.
1616//
1617bool
1619{
1620 return true; // ok to drop anything, we can take it...
1621}
1622
1623//
1624/// Handles an OC_VIEWDRAG message asking the container to provide visual feedback
1625/// while the user is dragging the embedded object.
1626/// If the TOleWindow object is unable to handle the message, EvOcViewDrag returns
1627/// false.
1628//
1629bool
1631{
1632 TClientDC dc(*this);
1633 TPen pen(TColor(128, 128, 128), 4, PS_DOT);
1634 dc.SelectObject(pen);
1635 dc.SelectStockObject(HOLLOW_BRUSH);
1636 dc.SetROP2(R2_NOTXORPEN);
1637
1638 dc.Rectangle(*ddInfo.Pos);
1639 return true;
1640}
1641
1642//
1643/// Asks the container to scroll the view window and updates any internal state as
1644/// needed. EvOcViewScroll is called when the server is resizing or a drop
1645/// interaction occurs near the edge of the window.
1646/// If the TOleWindow object is unable to handle the message, EvOcViewScroll returns
1647/// false.
1648//
1649bool
1651{
1652 return false;
1653}
1654
1655//
1656/// Gets the size of the rectangle (the site) where the embedded object is to be
1657/// placed. rect refers to the size of the bounding rectangle that encloses the
1658/// embedded object.
1659//
1660bool
1662{
1663 TOleClientDC dc(*this);
1664
1665 return dc.LPtoDP((TPoint*)rect, 2);
1666}
1667
1668//
1669/// Converts the rect to logical units. This area, referred to as the site, is
1670/// measured in logical units that take into account any scaling factor. rect refers
1671/// to the size of the bounding rectangle that encloses the embedded object.
1672//
1673bool
1675{
1676 TOleClientDC dc(*this);
1677
1678 return dc.DPtoLP((TPoint*)rect, 2);
1679}
1680
1681//
1682/// Responds to an OC_VIEWGETSCALE message and gets the scaling for the server
1683/// object, causing the embedded object to be displayed using the correct scaling
1684/// value (for example, 120%). scaleFactor indicates the scaling factor, the ratio
1685/// between the size of the embedded object and the size of the site where the
1686/// object is to be displayed.
1687/// If the TOleWindow object is unable to handle the message, EvOcViewGetScale
1688/// returns false.
1689//
1690bool
1692{
1693 scaleFactor = Scale;
1694 return true;
1695}
1696
1697//
1698/// Notifies ObjectWindows container applications that an embedded object is active.
1699/// ocPart is the embedded object that has been activated. EvOcViewPartActivate
1700/// returns true after the embedded object has been activated.
1701//
1702bool
1704{
1705 SetSelection(&ocPart);
1706 return true;
1707}
1708
1709//
1710/// Pastes an OLE object into the document pointed to by the TOleWindow::OcDoc data
1711/// member.
1712//
1713bool
1715{
1716 TRect rect;
1717 GetInsertPosition(rect);
1718 TOcPart* part = new TOcPart (*GetOcDoc());
1719 part->Init(&init, rect);
1720 init.ReleaseDataObject();
1721 return true;
1722}
1723
1724//
1725/// Asks the server to paint an object at a given position on a specified device
1726/// context.
1727/// If the TOleWindow object is unable to handle the message, EvOcViewPaint returns
1728/// false.
1729//
1730bool
1732{
1733 // Paint according to the view paint structure
1734 //
1735 TDC dc(vp.DC);
1736 Pos = *vp.Pos;
1737
1738 // Paint embedded objects
1739 //
1740
1741 bool metafile = dc.GetDeviceCaps(TECHNOLOGY) == DT_METAFILE;
1742 SetupDC(dc, !metafile);
1743
1744 if (vp.Moniker) {
1745 PaintLink(dc, true, Pos, *vp.Moniker);
1746 }
1747 else if (vp.PaintSelection) {
1748 PaintSelection(dc, true, Pos, vp.UserData);
1749 }
1750 else {
1751 Paint(dc, true, Pos);
1752 PaintParts(dc, true, Pos, metafile);
1753 }
1754
1755 Pos.SetNull();
1756
1757 return true;
1758}
1759
1760//
1761/// Asks the server to close a currently open document and its associated view.
1762/// If the TOleWindow object is unable to handle the message, EvOcViewClose returns
1763/// false.
1764///
1765/// TOcRemView is going away, disconnect TOleWindow with it so we don't use it
1766/// later. If this is a remote view, then close the doc too.
1767//
1768bool
1770{
1771 if (IsRemote() && OcDoc)
1772 OcDoc->Close();
1773
1774 // The view is being destroyed (this event is sent from ~TOcRemView), so forget it.
1775 // The window may outlive it and still receive messages, so handlers must check
1776 // OcView for null [bugs:#50].
1777 //
1778 OcView = 0;
1779 return true;
1780}
1781
1782//
1783/// Asks the server to write an embedded object's data (the part as represented by
1784/// the ocSave parameter) into storage.
1785/// If the TOleWindow object is unable to handle the message, EvOcViewSavePart
1786/// returns false.
1787//
1788bool
1790{
1791 return true;
1792}
1793
1794//
1795/// Requests that an embedded object load itself.
1796/// If the TOleWindow object is unable to handle the message, EvOcViewLoadPart
1797/// returns false.
1798//
1799bool
1801{
1802 return true;
1803}
1804
1805//
1806/// The server asks itself the size of its current rectangle and lets the container
1807/// know about the size of the server's view in pixels.
1808/// If the TOleWindow object is unable to handle the message, EvOcViewPartSize
1809/// returns false.
1810//
1811bool
1813{
1814 return false;
1815}
1816
1817//
1818/// Asks the container to open an existing document, which will be used for linking
1819/// from the embedding site.
1820/// If the TOleWindow object is unable to handle the message, EvOcViewOpenDoc
1821/// returns false.
1822//
1823bool
1825{
1826 return true;
1827}
1828
1829//
1830/// Requests that the menus in a composite menu (a menu composed of both the
1831/// server's and the container's menus).
1832/// If the TOleWindow object is unable to handle the message, EvOcViewInsMenus
1833/// returns false.
1834//
1835bool
1837{
1838 return false;
1839}
1840
1841//
1842/// Asks the server to provide its tool bars for display in the container's window.
1843/// Returns true if tool bars are supplied.
1844/// If the TOleWindow object is unable to handle the message, EvOcViewShowTools
1845/// returns false.
1846//
1847bool
1849{
1850 TWindow* mainWindow = GetApplication()->GetMainWindow();
1851 CHECK(mainWindow);
1852 TWindow* toolBar = mainWindow->ChildWithId(IDW_TOOLBAR);
1853 if (!toolBar)
1854 return false;
1855 tbi.HTopTB = THandle(*toolBar);
1856 return true;
1857}
1858
1859//
1860/// Requests the color palette to draw the object.
1861/// If the TOleWindow object is unable to handle the message, EvOcViewGetPalette
1862/// returns false.
1863//
1864bool
1865TOleWindow::EvOcViewGetPalette(LOGPALETTE * * /*palette*/)
1866{
1867 return false;
1868}
1869
1870//
1871/// Requests clipboard data in the specified format.
1872/// If the TOleWindow object is unable to handle the message, EvOcViewClipData
1873/// returns false.
1874//
1875bool
1877{
1878 return false;
1879}
1880
1881//
1882// Set format data into server
1883//
1884bool
1886{
1887 return false;
1888}
1889
1890//
1891/// Handles the EV_OC_AMBIENT_GETBACKCOLOR message, which is sent by an OCX control.
1892/// Returns false by default. You should override the default implementation so the
1893/// function stores the window background color in rgb and returns true.
1894//
1895bool
1897{
1898 return false;
1899}
1900
1901/// Handles the EV_OC_AMBIENT_GETFORECOLOR message, which is sent by an OCX control.
1902/// Returns false by default. You should override the default implementation so the
1903/// function stores the window forecolor in rgb and returns true.
1904bool
1906{
1907 return false;
1908}
1909
1910/// Handles the EV_OC_AMBIENT_GETLOCALEID message, which is sent by an OCX control.
1911/// Returns false by default. You should override the default implementation so the
1912/// function stores the window locale ID in locale and returns true.
1913bool
1915{
1916 return false;
1917}
1918
1919/// Handles the EV_OC_AMBIENT_GETTEXTALIGN message, which is sent by an OCX control.
1920/// Returns false by default. You should override the default implementation so the
1921/// function stores the window text alignment in show and returns true.
1922bool
1924{
1925 return false;
1926}
1927
1928/// Handles the EV_OC_AMBIENT_GETMESSAGEREFLECT message, which is sent by an OCX
1929/// control. Returns false by default. You should override the default
1930/// implementation so the function stores whether or not the window reflects
1931/// messages back to the control in msgReflect and returns true.
1932bool
1934{
1935 return false;
1936}
1937
1938/// Handles the EV_OC_AMBIENT_GETUSERMODE message, which is sent by an OCX control.
1939/// Returns false by default. You should override the default implementation so the
1940/// function stores whether or not the window is in user mode in mode and returns
1941/// true.
1942bool
1944{
1945 return false;
1946}
1947
1948/// Handles the EV_OC_AMBIENT_GETUIDEAD message, which is sent by an OCX control.
1949/// Returns false by default. You should override the default implementation so the
1950/// function stores whether or not the window's user interface is disabled in dead
1951/// and returns true.
1952bool
1954{
1955 return false;
1956}
1957
1958/// Handles the EV_OC_AMBIENT_GETSHOWGRABHANDLES message, which is sent by an OCX
1959/// control. Returns false by default. You should override the default
1960/// implementation so the function stores whether or not the window shows grab
1961/// handles in show and returns true.
1962bool
1964{
1965 return false;
1966}
1967
1968/// Handles the EV_OC_AMBIENT_GETSHOWHATCHING message, which is sent by an OCX
1969/// control. Returns false by default. You should override the default
1970/// implementation so the function stores whether or not the window shows hatching
1971/// in show and returns true.
1972bool
1974{
1975 return false;
1976}
1977
1978/// Handles the EV_OC_AMBIENT_GETDISPLAYASDEFAULT message, which is sent by an OCX
1979/// control. Returns false by default. You should override the default
1980/// implementation so the function stores whether or not the control is a default
1981/// control (buttons only) in disp and returns true.
1982bool
1984{
1985 return false;
1986}
1987
1988/// Handles the EV_OC_AMBIENT_GETSUPPORTSMNEMONICS message, which is sent by an OCX
1989/// control. Returns false by default. You should override the default
1990/// implementation so the function stores whether or not the window supports
1991/// mnemonics in support and returns true.
1992bool
1994{
1995 return false;
1996}
1997
1998/// Handles the EV_OC_AMBIENT_GETDISPLAYNAME message, which is sent by an OCX
1999/// control. Returns false by default. You should override the default
2000/// implementation so the function stores a control name (used in error messages) in
2001/// name and returns true.
2002bool
2004{
2005 return false;
2006}
2007
2008/// Handles the EV_OC_AMBIENT_GETSCALEUNITS message, which is sent by an OCX
2009/// control. Returns false by default. You should override the default
2010/// implementation so the function stores the window scale units in units and
2011/// returns true.
2012bool
2014{
2015 return false;
2016}
2017
2018/// Handles the EV_OC_AMBIENT_GETFONT message, which is sent by an OCX control.
2019/// Returns false by default. You should override the default implementation so the
2020/// function stores the window font information in font and returns true.
2021bool
2023{
2024 return false;
2025}
2026
2027/// Handles the EV_OC_AMBIENT_SETBACKCOLOR message, which is sent by an OCX control.
2028/// Returns false by default. You can override the default implementation so the
2029/// window changes its background color to rgb and returns true.
2030bool
2032{
2033 return false;
2034}
2035
2036/// Handles the EV_OC_AMBIENT_SETFORECOLOR message, which is sent by an OCX control.
2037/// Returns false by default. You can override the default implementation so the
2038/// window changes its background color to rgb and returns true.
2039bool
2041{
2042 return false;
2043}
2044
2045/// Handles the EV_OC_AMBIENT_SETLOCALEID message, which is sent by an OCX control.
2046/// Returns false by default. You can override the default implementation so the
2047/// window changes its locale ID to locale and returns true.
2048bool
2050{
2051 return false;
2052}
2053
2054/// Handles the EV_OC_AMBIENT_SETTEXTALIGN message, which is sent by an OCX control.
2055/// Returns false by default. You can override the default implementation so the
2056/// window aligns text according to the value in align and returns true.
2057bool
2059{
2060 return false;
2061}
2062
2063/// Handles the EV_OC_AMBIENT_SETMESSAGEREFLECT message, which is sent by an OCX
2064/// control. Returns false by default. You can override the default implementation
2065/// so the window does or doesn't reflect messages according to the value in
2066/// msgReflect.
2067bool
2069{
2070 return false;
2071}
2072
2073/// Handles the EV_OC_AMBIENT_SETUSERMODE message, which is sent by an OCX control.
2074/// Returns false by default. You can override the default implementation so the
2075/// window sets user mode equal to the value in mode.
2076bool
2078{
2079 return false;
2080}
2081
2082/// Handles the EV_OC_AMBIENT_SETUIDEAD message, which is sent by an OCX control.
2083/// Returns false by default. You can override the default implementation so the
2084/// window enables or disables itself according to the value in dead.
2085bool
2087{
2088 return false;
2089}
2090
2091/// Handles the EV_OC_AMBIENT_SETSHOWGRABHANDLES message, which is sent by an OCX
2092/// control. Returns false by default. You can override the default implementation
2093/// so the window shows or hides grab handles according to the value in show.
2094bool
2096{
2097 return false;
2098}
2099
2100/// Handles the EV_OC_AMBIENT_SETSETSHOWHATCHING message, which is sent by an OCX
2101/// control. Returns false by default. You can override the default implementation
2102/// so the window shows or hides hatching according to the value in hatching.
2103bool
2105{
2106 return false;
2107}
2108
2109/// Handles the EV_OC_AMBIENT_SETDISPLAYASDEFAULT message, which is sent by an OCX
2110/// control. Returns false by default. You can override the default implementation
2111/// so the window displays itself as a default control (if the window represents a
2112/// button control) if disp is true.
2113bool
2115{
2116 return false;
2117}
2118
2119/// Handles the EV_OC_AMBIENT_SETSUPPORTSMNEMONICS message, which is sent by an OCX
2120/// control. Returns false by default. You can override the default implementation
2121/// so the window turns its support for mnemonics on or off according to the value
2122/// in support.
2123bool
2125{
2126 return false;
2127}
2128
2129/// Handles the EV_OC_AMBIENT_SETDISPLAYNAME message, which is sent by an OCX
2130/// control. Returns false by default. You can override the default implementation
2131/// so the window changes its display name (for error messages) to name and returns true.
2132bool
2134{
2135 return false;
2136}
2137
2138/// Handles the EV_OC_AMBIENT_SETSCALEUNITS message, which is sent by an OCX
2139/// control. Returns false by default. You can override the default implementation
2140/// so the window sets its scale units equal to units and returns true.
2141bool
2143{
2144 return false;
2145}
2146
2147/// Handles the EV_OC_AMBIENT_SETFONT message, which is sent by an OCX control.
2148/// Returns false by default. You can override the default implementation so the
2149/// window changes its font to font and returns true.
2150bool
2152{
2153 return false;
2154}
2155
2156//
2157// Control Event Dispatches
2158
2159//
2160/// Handles the EV_OC_CTRLCLICK message, which is sent by an OCX control. Returns
2161/// false by default. You can override the default implementation so the window
2162/// responds to the message and returns true.
2163//
2164bool
2166{
2167 return false;
2168}
2169
2170/// Handles the EV_OC_CTRLDBLCLICK message, which is sent by an OCX control. Returns
2171/// false by default. You can override the default implementation so the window
2172/// responds to the message and returns true.
2173bool
2175{
2176 return false;
2177}
2178
2179/// Handles the EV_OC_CTRLMOUSEDOWN message, which is sent by an OCX control.
2180/// Returns false by default. You can override the default implementation so the
2181/// window responds to the message and returns true.
2182bool
2184{
2185 return false;
2186}
2187
2188/// Handles the EV_OC_CTRLMOUSEUP message, which is sent by an OCX control. Returns
2189/// false by default. You can override the default implementation so the window
2190/// responds to the message and returns true.
2191bool
2193{
2194 return false;
2195}
2196
2197/// Handles the EV_OC_CTRLMOUSEMOVE message, which is sent by an OCX control.
2198/// Returns false by default. You can override the default implementation so the
2199/// window responds to the message and returns true.
2200bool
2202{
2203 return false;
2204}
2205
2206/// Handles the EV_OC_CTRLKEYDOWN message, which is sent by an OCX control. Returns
2207/// false by default. You can override the default implementation so the window
2208/// responds to the message and returns true.
2209bool
2211{
2212 return false;
2213}
2214
2215/// Handles the EV_OC_CTRLKEYUP message, which is sent by an OCX control. Returns
2216/// false by default. You can override the default implementation so the window
2217/// responds to the message and returns true.
2218bool
2220{
2221 return false;
2222}
2223
2224/// Handles the EV_OC_CTRLERROREVENT message, which is sent by an OCX control.
2225/// Returns false by default. You can override the default implementation so the
2226/// window responds to the message and returns true.
2227bool
2229{
2230 return false;
2231}
2232
2233/// Handles the EV_OC_CTRLFOCUS message, which is sent by an OCX control. Returns
2234/// false by default. You can override the default implementation so the window
2235/// responds to the message and returns true.
2236bool
2238{
2239 return false;
2240}
2241
2242/// Handles the EV_OC_CTRLPROPERTYCHANGE message, which is sent by an OCX control.
2243/// Returns false by default. You can override the default implementation so the
2244/// window responds to the message and returns true.
2245bool
2247{
2248 return false;
2249}
2250
2251/// Handles the EV_OC_PROPERTYREQUESTEDIT message, which is sent by an OCX control.
2252/// Returns false by default. You can override the default implementation so the
2253/// window responds to the message and returns true.
2254bool
2256{
2257 return false;
2258}
2259
2260/// Handles the EV_OC_CTRLCUSTOMEVENT message, which is sent by an OCX control.
2261/// Returns false by default. You can override the default implementation so the
2262/// window responds to the message and returns true.
2263bool
2265{
2266 return false;
2267}
2268
2269//
2270/// Repaints the embedded objects on the given device context. The erase parameter
2271/// is true if the background of the embedded object is to be repainted. rect
2272/// indicates the area that needs repainting. metafile indicates whether or not the
2273/// object is a metafile.
2274//
2275bool
2276TOleWindow::PaintParts(TDC& dc, bool, TRect&, bool metafile)
2277{
2278 if (!GetOcDoc())
2279 return false;
2280
2281 TRect clientRect;
2282 TRect logicalRect = GetClientRect();
2283
2284 if (IsRemote()) {
2285 clientRect = GetWindowRect();
2286 clientRect.Offset(-clientRect.left, -clientRect.top);
2287 }
2288 else {
2289 clientRect = logicalRect;
2290 }
2291
2292 TPoint scrollPos(0, 0);
2293
2294 if (!metafile) {
2295 dc.DPtoLP((TPoint*)&logicalRect, 2);
2296 }
2297 else {
2298 if (Scroller) {
2299 scrollPos.x = (int)Scroller->XPos;
2300 scrollPos.y = (int)Scroller->YPos;
2301 }
2302 }
2303
2304 for (TOcPartCollectionIter i(GetOcDoc()->GetParts()); i; i++){
2305 TOcPart& p = *(i.Current());
2306 if (p.IsVisible(logicalRect) || metafile) {
2307 TRect r = p.GetRect();
2308 r.Offset(-scrollPos.x, -scrollPos.y);
2309 p.Draw(dc, r, clientRect, asDefault);
2310
2311 if (metafile)
2312 continue;
2313
2314 // Paint selection
2315 //
2316 if ((p.IsSelected() || ShowObjects) && r.Width() > 0 && r.Height() > 0) {
2317 uint handleStyle = p.IsLink() ? TUIHandle::DashFramed : TUIHandle::Framed;
2318 if (p.IsSelected())
2319 handleStyle |= TUIHandle::Grapples;
2320 TUIHandle(r, handleStyle).Paint(dc);
2321 }
2322 }
2323 }
2324 return true;
2325}
2326
2327//
2328/// Sets the ratio of the embedded object's size to the size of the site.
2329//
2330void
2332{
2333 Scale.SetScale(percent);
2334 Invalidate();
2335}
2336
2337//
2338/// Gets the logical units (typically pixels) per inch for a document so that the
2339/// document's embedded objects can be painted correctly on the screen device
2340/// context.
2341//
2342void
2344{
2345 TScreenDC dc;
2346
2347 logPerUnit.cx = dc.GetDeviceCaps(LOGPIXELSX);
2348 logPerUnit.cy = dc.GetDeviceCaps(LOGPIXELSY);
2349}
2350
2351//
2352/// Determines the viewport's origin and extent (the logical coordinates and the
2353/// size of the device context). Sets up the device context (DC) before painting the
2354/// embedded object. dc refers to the DC and scale indicates that the scaling factor
2355/// to use when painting the embedded object is a ratio between the site and the
2356/// embedded object.
2357//
2358void
2359TOleWindow::SetupDC(TDC& dc, bool scale)
2360{
2361 dc.SetMapMode(MM_ANISOTROPIC);
2362
2363 // Setup window and viewport origin according to scroll amount
2364 //
2365 TPoint scrollPos(0, 0);
2366 if (Scroller) {
2367 scrollPos.x = (int)Scroller->XPos;
2368 scrollPos.y = (int)Scroller->YPos;
2369 }
2370
2371 if (!scale) {
2372 dc.SetWindowOrg(scrollPos);
2373 return;
2374 }
2375
2376 // Don't scale the scrolling amount
2377 //
2378 if (Scale.SiteSize.cx)
2379 scrollPos.x = (int)(((uint32)scrollPos.x * Scale.PartSize.cx +
2380 Scale.SiteSize.cx/2) / Scale.SiteSize.cx);
2381 if (Scale.SiteSize.cy)
2382 scrollPos.y = (int)(((uint32)scrollPos.y * Scale.PartSize.cy +
2383 Scale.SiteSize.cy/2) / Scale.SiteSize.cy);
2384 dc.SetWindowOrg(scrollPos);
2385
2387
2388 // set the window and viewport extaccording to zoom factor
2389 //
2390 TSize ext;
2391 GetLogPerUnit(ext);
2392 dc.SetWindowExt(ext);
2393
2394 ext.cx = dc.GetDeviceCaps(LOGPIXELSX);
2395 ext.cy = dc.GetDeviceCaps(LOGPIXELSY);
2396
2397 if (Scale.PartSize.cx)
2398 ext.cx = (int)(((uint32)ext.cx * Scale.SiteSize.cx + Scale.PartSize.cx/2) /
2399 Scale.PartSize.cx);
2400 if (Scale.PartSize.cy)
2401 ext.cy = (int)(((uint32)ext.cy * Scale.SiteSize.cy + Scale.PartSize.cy/2) /
2402 Scale.PartSize.cy);
2403 dc.SetViewportExt(ext);
2404}
2405
2406//
2407/// Sets up the dc for proper scaling and scrolling and then calls the derived
2408/// class's Paint method to paint the contents of the dc.
2409//
2410void
2412{
2413 if (IsFlagSet(wfAlias))
2414 DefaultProcessing(); // use application-defined wndproc
2415
2416 else {
2417 TPaintDC dc(*this);
2418 TRect& rect = *(TRect*)&dc.Ps.rcPaint;
2419
2420 if (Scroller)
2421 Scroller->BeginView(dc, rect);
2422
2423 bool metafile = dc.GetDeviceCaps(TECHNOLOGY) == DT_METAFILE;
2424 SetupDC(dc, !metafile);
2425 Paint(dc, dc.Ps.fErase, rect);
2426 PaintParts(dc, dc.Ps.fErase, rect, metafile);
2427
2428 if (Scroller)
2429 Scroller->EndView();
2430 }
2431}
2432
2433//
2434/// Informs an active container that one of its embedded objects needs to be
2435/// redrawn. Changes in the container's part should be reflected in any other,
2436/// non-active views. Returns true after all views have been notified of the
2437/// necessary changes.
2438/// If the TOleWindow object is unable to handle the message, EvOcViewPartInvalid
2439/// returns false.
2440//
2441bool
2443{
2444 // Our document is now dirty...
2445
2446 // Reflect the change in part in other (non-active) views
2447 //
2448 TRect rect(changeInfo.GetPart()->GetRect());
2449 rect.right++;
2450 rect.bottom++;
2451 TOleClientDC dc(*this);
2452 dc.LPtoDP((TPoint*)&rect, 2);
2453
2454 InvalidateRect(rect); // Multiview support to be done in derived classes
2455
2456 // Notify container if this is an intermediate container
2457 //
2458 InvalidatePart((TOcInvalidate)changeInfo.GetType());
2459
2460 return true; // stop further processing by OCF
2461}
2462
2463//
2464/// Creates and enables a pop-up menu option (ocVerb) on the Edit menu. The verb
2465/// describes an action (for example, Edit, Open, Play) that is appropriate for the
2466/// embedded object.
2467//
2470{
2471 TPopupMenu* verbMenu = new TPopupMenu(NoAutoDelete);
2472 while (DragPart->EnumVerbs(ocVerb)) {
2473 verbMenu->AppendMenu(MF_STRING|MF_ENABLED,
2474 (uint)CM_EDITFIRSTVERB + ocVerb.VerbIndex,
2475 (LPCTSTR)OleStr(ocVerb.VerbName));
2476 }
2477
2478 verbMenu->AppendMenu(MF_SEPARATOR, 0, 0);
2479 owl::tstring optName = GetModule()->LoadString(IDS_EDITCONVERT);
2480 verbMenu->AppendMenu(MF_STRING, CM_EDITCONVERT, optName.c_str());
2481
2482 return verbMenu;
2483}
2484
2485//
2486/// Executes an OLE-related menu option from the Edit menu (for example, Edit, Copy,
2487/// or Play) that is associated with the selected object.
2488//
2489void
2491{
2492 DragPart->DoVerb(whichVerb);
2493}
2494
2495//
2496/// Attaches the view to its ObjectWindows parent window so that the user can
2497/// perform open editing on the embedded object, or if the embedded object has been
2498/// de-activated while in-place editing was occurring.
2499/// If the TOleWindow object is unable to handle the message, EvOcViewAttachWindow
2500/// returns false.
2501//
2502bool
2504{
2505 TOleFrame* mainWindow = TYPESAFE_DOWNCAST(GetApplication()->GetMainWindow(),
2506 TOleFrame);
2507 if (!mainWindow)
2508 return false; // server app is shutting down
2509
2510 if (attach) {
2511 if (IsOpenEditing()) {
2512 // Derived class needs to managed setting up frame differently, like
2513 // for MDI etc.
2514 //
2515 mainWindow->SetClientWindow(this);
2516 }
2517 }
2518 else {
2519 if (IsOpenEditing() && Parent != mainWindow)
2520 Parent->PostMessage(WM_CLOSE);
2521 SetParent(mainWindow->GetRemViewBucket()); // simple reparent
2522 }
2523 return true;
2524}
2525
2526//
2527/// Handles the EV_OC_VIEWDOVERB message. Returns false. Implement your own event
2528/// handler to control how the window responds to verbs selected by the user.
2529//
2530bool
2532{
2533 return false;
2534}
2535
2536//
2537// Perform the action indentified by verb
2538//
2539bool
2541{
2542 return false;
2543}
2544
2545//
2546/// Shuts down the associated ObjectComponents partners, if possible.
2547//
2548bool
2550{
2551 if (IsRemote()) {
2552 TOcRemView* ocRemView = GetOcRemView();
2553 if (IsOpenEditing())
2554 ocRemView->Disconnect();
2555 }
2556 else {
2557 if (OcView)
2558 OcView->EvClose();
2559 }
2560 return true;
2561}
2562
2563//
2564/// Performs normal window cleanup and informs the TOcView object that the window is closed.
2565//
2566void
2568{
2569 TOleFrame* mainWindow = TYPESAFE_DOWNCAST(GetApplication()->GetMainWindow(),
2570 TOleFrame);
2571 if (mainWindow)
2572 mainWindow->OleViewClosing(true);
2573 OleShutDown();
2574 if (mainWindow)
2575 mainWindow->OleViewClosing(false);
2577}
2578
2579//
2580/// Responds to an OC_VIEWSETSCALE message and handles the scaling for server
2581/// application, ensuring that the embedded object is displayed using the correct
2582/// scaling values (for example, 120%). The server uses this value in its paint
2583/// procedure when the embedded object needs to be redrawn. scaleFactor indicates
2584/// the scaling factor, the ratio between the size of the embedded object and the
2585/// size of the site where the object is to be displayed.
2586/// If the TOleWindow object is unable to handle the message, EvOcViewSetScale
2587/// returns false.
2588//
2589bool
2591{
2592 Scale = scaleFactor;
2593 return true;
2594}
2595
2596//
2597/// Handles the EV_OC_VIEWGETITEMNAME. Returns false.
2598//
2599bool
2601{
2602 return false;
2603}
2604
2605//----------------------------------------------------------------------------
2606// Linking Spport
2607//
2608
2609//
2610/// Responds to an OC_VIEWSETLINK message TOcLinkView sends when the server document
2611/// provides a link to a container document. EvOcViewSetLink establishes the link
2612/// between a TOleLinkView and a TOcLinkView. view references the view with which
2613/// the document or selection is associated. Returns false if unsuccessful.
2614/// Doc/View applications use TOleView 's implementation of this function.
2615//
2616bool
2618{
2619 return false;
2620}
2621
2622//
2623/// EvOcViewBreakLink responds to an OC_VIEWBREAKLINK message that TOcLinkView sends
2624/// when the server document that provides the link shuts down. EvOcViewBreakLink
2625/// breaks the link with a server document or a selection by deleting the
2626/// TOleLinkView associated with the TOcLinkView (view). Returns false if
2627/// unsuccessful. Doc/View applications use TOleView's EvOcViewBreakLink, which
2628/// overrides TOleWindow's version.
2629//
2630bool
2632{
2633 return false;
2634}
2635
2637
2638#if OWL_PERSISTENT_STREAMS
2639
2640//
2641//
2642//
2643void*
2644TOleWindow::Streamer::Read(ipstream& is, uint32 /*version*/) const
2645{
2646 owl::ReadBaseObject((TWindow*)GetObject(), is);
2647
2648 GetObject()->Remote = false; // intialized in CreateOcView()
2649 GetObject()->OcApp = 0; // initialized in Init()
2650 GetObject()->OcDoc = 0;
2651 GetObject()->OcView = 0;
2652 GetObject()->Init();
2653
2654 is >> GetObject()->Scale; // current scaling factor
2655 is >> GetObject()->Pos; // current position
2656 is >> GetObject()->ShowObjects; // Show embedded part frames?
2657
2658 return GetObject();
2659}
2660
2661//
2662//
2663//
2664void
2665TOleWindow::Streamer::Write(opstream& os) const
2666{
2667 owl::WriteBaseObject((TWindow*)GetObject(), os);
2668 os << GetObject()->Scale; // current scaling factor
2669 os << GetObject()->Pos; // current position
2670 os << GetObject()->ShowObjects; // Show embedded part frames?
2671}
2672
2673#endif
2674
2675
2676
2677} // OCF namespace
2678
2679//==============================================================================
2680
#define CHECK(condition)
Definition checks.h:239
#define PRECONDITION(condition)
Definition checks.h:227
#define TRACEX(group, level, message)
Definition checks.h:263
bool Convert(TOcPart *ocPart, bool b)
Open the Convert dialog, and perform the conversion if OK.
Definition ocapp.cpp:448
owl::ulong _IFUNC AddRef()
Definition ocapp.h:215
bool BrowseControls(TOcInitInfo &initInfo)
Definition ocapp.cpp:362
bool Copy(TOcPart *ocPart)
Copy Selected embedded object.
Definition ocapp.cpp:383
owl::ulong _IFUNC Release()
Definition ocapp.h:216
bool Browse(TOcInitInfo &initInfo)
Definition ocapp.cpp:356
bool IsOptionSet(owl::uint32 option) const
Definition ocapp.h:302
owl::uint EnableEditMenu(TOcMenuEnable enable, IBDataConsumer *ocview)
Definition ocapp.cpp:350
bool Drag(TOcDataProvider *ocData, TOcDropAction inAction, TOcDropAction &outAction)
Drag a selection.
Definition ocapp.cpp:416
Class representing an embedded control within a document.
Definition occtrl.h:78
owl::uint GetId() const
Definition occtrl.h:106
bool Init(TOcInitInfo *initInfo, owl::TRect pos)
Definition occtrl.cpp:265
void SetId(owl::uint id)
Definition occtrl.h:107
TOcControl(TOcDocument &document, int id=0, TOcControlEvent *pEv=nullptr)
Construct a new part with a given temp id.
Definition occtrl.cpp:226
TOcDocument(TOcApp &app, LPCTSTR fileName=0)
Definition ocdoc.cpp:36
TOcPartCollection & GetParts()
Definition ocdoc.h:51
Used to obtain the native clipboard format data.
Definition ocview.h:416
TOcInitHow How
Definition ocobject.h:120
owl::uint32 ReleaseDataObject()
Definition ocobject.h:114
TOcInitWhere Where
Definition ocobject.h:121
Used to obtain the item name for building monikers.
Definition ocview.h:403
View/Data change info.
Definition ocpart.h:216
void SetPart(TOcPart *part)
Definition ocpart.h:228
TOcPart * GetPart()
Definition ocpart.h:227
TOcPart * Locate(owl::TPoint &point)
walk thru Part collection & return the last one that logical point hits, (first one in Z order)
Definition ocpart.cpp:830
OC part class represents an embeded or linked part in a document.
Definition ocpart.h:38
virtual bool Init(TOcInitInfo *initInfo, owl::TRect pos)
Perform common ctor initialization.
Definition ocpart.cpp:128
bool Open(bool open)
Definition ocpart.h:100
bool IsVisible(const owl::TRect &logicalRect) const
Definition ocpart.h:69
int Detach()
Definition ocpart.cpp:761
HRESULT QueryServer(const IID &iid, void **iface)
Query server for its interfaces.
Definition ocpart.cpp:239
bool Draw(HDC dc, const owl::TRect &pos, const owl::TRect &clip, TOcAspect aspect=asDefault)
Definition ocpart.cpp:707
bool EnumVerbs(const TOcVerb &)
Definition ocpart.cpp:738
bool Activate(bool activate)
Definition ocpart.cpp:642
bool IsSelected() const
Definition ocpart.h:76
bool IsLink() const
Definition ocpart.h:81
void SetPos(const owl::TPoint &pos)
Set part to the new position given in logical units.
Definition ocpart.cpp:605
void Delete()
Delete this object.
Definition ocpart.cpp:208
void SetSize(const owl::TSize &size)
Set part to the new size given in logical units.
Definition ocpart.cpp:616
TOcPart(TOcDocument &document, int id=0)
Construct a new part with a given temp id Must call Init method to complete initialization.
Definition ocpart.cpp:26
void Select(bool select)
Definition ocpart.h:74
bool DoVerb(owl::uint)
Definition ocpart.cpp:747
bool IsActive() const
Definition ocpart.h:79
owl::TRect GetRect() const
Definition ocpart.h:67
Used to obtain the size of the rectangle that encloses the selection.
Definition ocview.h:364
Remote Viewer object for a server document.
Definition ocremvie.h:26
TState GetState() const
Definition ocremvie.h:69
owl::TString GetContainerTitle()
Get the window text of the container.
Definition ocremvie.cpp:280
@ Link
Load-from-file is really a link.
Definition ocremvie.h:67
void Invalidate(TOcInvalidate)
Invalidate the site within the active view.
Definition ocremvie.cpp:217
bool SetContainerStatusText(LPCTSTR text)
Definition ocremvie.h:160
@ OpenEditing
Open editing.
Definition ocremvie.h:60
void Disconnect()
Disconnect from the client site.
Definition ocremvie.cpp:227
TOcRemView(TOcDocument &doc, TOcContainerHost *cs, TOcServerHost *ss, owl::TRegList *regList=0, IUnknown *outer=0)
New constructor that uses host interfaces.
Definition ocremvie.cpp:44
Use when doing parts save and load.
Definition ocview.h:326
owl::TSize PartSize
Definition ocview.h:471
owl::TSize SiteSize
Definition ocview.h:470
void SetScale(owl::uint16 percent)
Change the scaling factor.
Definition ocview.cpp:1207
LPCOLESTR TypeName
Definition ocpart.h:205
owl::uint VerbIndex
Definition ocpart.h:207
LPCOLESTR VerbName
Definition ocpart.h:206
The TOcView partner is a container (viewer) of a given (server/client) document.
Definition ocview.h:136
virtual void ReleaseObject()
Should only be called by the owner/creator of this object.
Definition ocview.cpp:173
virtual bool EvSetFocus(bool set)
Returns true if view keeps focus, false if the inplace server got it.
Definition ocview.cpp:352
TOcPart * GetActivePart()
Definition ocview.h:178
void EvResize()
Definition ocview.cpp:303
bool ActivatePart(TOcPart *part)
Activate a given part.
Definition ocview.cpp:444
bool BrowseClipboard(TOcInitInfo &initInfo)
Definition ocview.cpp:928
bool BrowseLinks()
Definition ocview.cpp:375
virtual void Rename()
Definition ocview.cpp:393
void SetupWindow(HWND hWin, bool embedded=false)
Definition ocview.cpp:229
bool Paste(bool linking=false)
Definition ocview.cpp:959
void EvActivate(bool activate)
View is activated/deactivated.
Definition ocview.cpp:338
bool PasteNative(TOcInitInfo &init, owl::TPoint *where=0)
Paste native data into the container.
Definition ocview.cpp:937
virtual void EvClose()
View is shuting down.
Definition ocview.cpp:313
TOcxView(TOcDocument &doc, owl::TRegList *regList=0, IUnknown *outer=0)
TOcxView Class Implementation.
Definition occtrl.cpp:706
Derived from TClientDC, TOleClientDC is a helper class that translates between two different coordina...
Definition olewindo.h:385
TOleClientDC(TOleWindow &win, bool scale=true)
Constructs a TOleClientDC object .
Definition olewindo.cpp:51
Decorated frame that supports OLE 2 using OCF.
Definition oleframe.h:65
TOcApp * GetOcApp()
Gets the ObjectComponents application associated with this frame window.
Definition oleframe.h:136
owl::TWindow * GetRemViewBucket()
Returns a pointer to the OLE frame's hidden helper window that holds all inactive server windows.
Definition oleframe.h:146
void OleViewClosing(bool close)
Sets the OcShutDown data member to ViewInitiated (if close is true and OcShutDown = DontCare) or Dont...
Definition oleframe.cpp:329
The generic OLE2 window. Use as a client of a frame window.
Definition olewindo.h:91
void EvSize(owl::uint sizeType, const owl::TSize &size)
Passes the event to TWindow::EvSize for normal processing and forwards the event to TOcView::EvResize...
bool EvOcViewLoadPart(TOcSaveLoad &ocLoad)
Requests that an embedded object load itself.
virtual bool EvOcAmbientSetBackColor(long rgb)
Handles the EV_OC_AMBIENT_SETBACKCOLOR message, which is sent by an OCX control.
bool EvOcViewSetLink(TOcLinkView &view)
Responds to an OC_VIEWSETLINK message TOcLinkView sends when the server document provides a link to a...
bool EvOcViewBorderSpaceReq(owl::TRect *rect)
Requests that the server create space for a tool bar in the view of an embedded object.
void SetupWindow() override
Establishes a connection between the TOcView object and the view's HWND so the view can send notifica...
Definition olewindo.cpp:286
virtual bool EvOcCtrlKeyDown(TCtrlKeyEvent *pev)
Handles the EV_OC_CTRLKEYDOWN message, which is sent by an OCX control.
bool HasActivePart()
Returns true if the container's view holds an in-place active embedded object.
Definition olewindo.cpp:983
virtual void InvalidatePart(TOcInvalidate invalid)
Invalidates the area where the embedded object exists.
Definition olewindo.cpp:424
TOcDocument * OcDoc
Holds the ObjectComponents document associated with this TOleWindow.
Definition olewindo.h:338
virtual bool EvOcAmbientSetSupportsMnemonics(bool support)
Handles the EV_OC_AMBIENT_SETSUPPORTSMNEMONICS message, which is sent by an OCX control.
void EvMDIActivate(HWND hWndActivated, HWND hWndDeactivated)
Responds to a message forwarded from the MDI child window (if one exists) and lets the TOcView class ...
bool EvOcViewGetItemName(TOcItemName &item)
Handles the EV_OC_VIEWGETITEMNAME. Returns false.
TOcView * GetOcView()
Points to the ObjectComponents container view associated with this window.
Definition olewindo.h:414
virtual bool EvOcAmbientSetTextAlign(short align)
Handles the EV_OC_AMBIENT_SETTEXTALIGN message, which is sent by an OCX control.
void CeFileClose(owl::TCommandEnabler &ce)
Enables the FileClose command, which lets the user exit from the window view.
Definition olewindo.cpp:623
void CeEditObject(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITOBJECT, which lets the user edit the embedded object.
Definition olewindo.cpp:872
void CmEditConvert()
Responds to a command with an ID of CM_EDITCONVERT by converting an object from one type to another.
Definition olewindo.cpp:922
virtual bool EvOcCtrlMouseUp(TCtrlMouseEvent *pev)
Handles the EV_OC_CTRLMOUSEUP message, which is sent by an OCX control.
void CmEditDelete()
Responds to a command with an ID of CM_EDITDELETE by deleting the selected text.
Definition olewindo.cpp:736
void EvOcViewSetTitle(LPCTSTR title)
Sets the window's caption to title.
void CeEditDelete(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITDELETE, which lets the user delete the selected object from th...
Definition olewindo.cpp:727
virtual bool EvOcAmbientGetMessageReflect(bool *msgReflect)
Handles the EV_OC_AMBIENT_GETMESSAGEREFLECT message, which is sent by an OCX control.
virtual bool EvOcAmbientGetUserMode(bool *mode)
Handles the EV_OC_AMBIENT_GETUSERMODE message, which is sent by an OCX control.
virtual bool EvOcCtrlKeyUp(TCtrlKeyEvent *pev)
Handles the EV_OC_CTRLKEYUP message, which is sent by an OCX control.
bool EvOcViewGetPalette(LOGPALETTE **palette)
Requests the color palette to draw the object.
void EvCommandEnable(owl::TCommandEnabler &) override
Overrides the usual EvCommandEnable message in order to enable the OLE verbs from CM_EDITFIRSTVERB to...
Definition olewindo.cpp:344
owl::TPoint DragPt
Indicates the point (in logical units) where the mouse is over the dragged object.
Definition olewindo.h:322
virtual void SetSelection(TOcPart *part)
Selects the embedded object indicated in the part parameter.
bool EvOcViewPartActivate(TOcPart &ocPart)
Notifies ObjectWindows container applications that an embedded object is active.
void CmEditPasteLink()
Responds to a command with an ID of CM_EDITPASTELINK by creating a link between the current document ...
Definition olewindo.cpp:807
TOcPart * InsertObject(TOcInitInfo &initInfo, owl::TRect *pos=0)
Definition olewindo.cpp:444
bool EvOcViewShowTools(TOcToolBarInfo &tbi)
Asks the server to provide its tool bars for display in the container's window.
bool EvOcViewScroll(TOcScrollDir scrollDir)
Asks the container to scroll the view window and updates any internal state as needed.
bool EvOcViewSavePart(TOcSaveLoad &ocSave)
Asks the server to write an embedded object's data (the part as represented by the ocSave parameter) ...
bool EvOcViewSetSiteRect(owl::TRect *rect)
Converts the rect to logical units.
void EvVScroll(owl::uint scrollCode, owl::uint thumbPos, HWND hWndCtl)
In response to a WM_VSCROLL message, EvVScroll calls TWindow::EvVScroll and invalidates the window.
owl::TPoint DragStart
Holds the point where the dragging of the embedded object began.
Definition olewindo.h:328
void CeEditCut(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITCUT, which lets a user copy and delete the selected object fro...
Definition olewindo.cpp:753
virtual bool EvOcAmbientGetForeColor(long *rgb)
Handles the EV_OC_AMBIENT_GETFORECOLOR message, which is sent by an OCX control.
virtual void SetupDC(owl::TDC &dc, bool scale=true)
Determines the viewport's origin and extent (the logical coordinates and the size of the device conte...
owl::TResult EvOcEvent(owl::TParam1 param1, owl::TParam2 param2)
Responds to a WM_OCEVENT message and subdispatches the message based on wParam.
TOcControl * GetOcControlOfOCX(CLSID ocxIID, owl::uint id=0)
Definition olewindo.cpp:581
virtual bool ShowCursor(HWND wnd, owl::uint hitTest, owl::uint mouseMsg)
Handles the WM_NCHITTEST message, setting the cursor according to its position on the screen.
virtual bool EvOcCtrlPropertyRequestEdit(TCtrlPropertyEvent *pev)
Handles the EV_OC_PROPERTYREQUESTEDIT message, which is sent by an OCX control.
void CmEditPaste()
Responds to a command with an ID of CM_EDITPASTE by pasting an object from the clipboard into the doc...
Definition olewindo.cpp:828
virtual bool EvOcCtrlErrorEvent(TCtrlErrorEvent *pev)
Handles the EV_OC_CTRLERROREVENT message, which is sent by an OCX control.
int MinWidth
The minimum width of the part.
Definition olewindo.h:358
virtual bool EvOcAmbientGetSupportsMnemonics(bool *support)
Handles the EV_OC_AMBIENT_GETSUPPORTSMNEMONICS message, which is sent by an OCX control.
bool IsOpenEditing() const
Checks whether the window is in Open-Edit mode.
Definition olewindo.cpp:434
virtual bool EvOcAmbientGetDisplayAsDefault(bool *disp)
Handles the EV_OC_AMBIENT_GETDISPLAYASDEFAULT message, which is sent by an OCX control.
bool EvOcViewGetScale(TOcScaleFactor &scaleFactor)
Responds to an OC_VIEWGETSCALE message and gets the scaling for the server object,...
void EvPaint()
Sets up the dc for proper scaling and scrolling and then calls the derived class's Paint method to pa...
virtual bool EvOcAmbientSetScaleUnits(owl::TString *units)
Handles the EV_OC_AMBIENT_SETSCALEUNITS message, which is sent by an OCX control.
void CmEditCopy()
Responds to a command with an ID of CM_EDITCOPY by copying the selected text to the clipboard.
Definition olewindo.cpp:785
virtual bool EvOcAmbientGetDisplayName(owl::TString **name)
Handles the EV_OC_AMBIENT_GETDISPLAYNAME message, which is sent by an OCX control.
LPCTSTR EvOcViewTitle()
Asks the container for the caption in its frame window.
void CmEditLinks()
Responds to a command with an ID of CM_EDITLINKS by updating the user-selected list of linked items i...
Definition olewindo.cpp:942
virtual bool EvOcAmbientGetScaleUnits(owl::TString **units)
Handles the EV_OC_AMBIENT_GETSCALEUNITS message, which is sent by an OCX control.
bool EvSetCursor(HWND hWndCursor, owl::uint hitTest, owl::uint mouseMsg)
Performs hit testing to tell where the cursor is located within the window and what object the cursor...
Definition olewindo.cpp:997
virtual bool EvOcViewTransformCoords(owl::uint verb)
virtual bool EvOcAmbientGetBackColor(long *rgb)
Handles the EV_OC_AMBIENT_GETBACKCOLOR message, which is sent by an OCX control.
virtual bool EvOcAmbientGetLocaleID(long *locale)
Handles the EV_OC_AMBIENT_GETLOCALEID message, which is sent by an OCX control.
owl::TPopupMenu * CreateVerbPopup(const TOcVerb &ocVerb)
Creates and enables a pop-up menu option (ocVerb) on the Edit menu.
virtual bool EvOcCtrlClick(TCtrlEvent *pev)
Handles the EV_OC_CTRLCLICK message, which is sent by an OCX control.
void EvLButtonDblClk(owl::uint modKeys, const owl::TPoint &point)
Responds to a mouse button double click message.
TOleWindow(owl::TWindow *parent=0, owl::TModule *module=0)
Constructs a TOleWindow object associated with the specified parent window and module instance.
Definition olewindo.cpp:204
virtual bool EvOcViewPartInvalid(TOcPartChangeInfo &changeInfo)
Informs an active container that one of its embedded objects needs to be redrawn.
void CmEditPasteSpecial()
Responds to a command with an ID of CM_EDITPASTESPECIAL by letting the user select an object from a l...
Definition olewindo.cpp:853
virtual bool EvOcCtrlDblClick(TCtrlEvent *pev)
Handles the EV_OC_CTRLDBLCLICK message, which is sent by an OCX control.
virtual bool OleShutDown()
Shuts down the associated ObjectComponents partners, if possible.
virtual bool EvOcAmbientSetLocaleID(long locale)
Handles the EV_OC_AMBIENT_SETLOCALEID message, which is sent by an OCX control.
bool Remote
Returns true if the window represents an embedded server. Returns false otherwise.
Definition olewindo.h:351
void CeEditPasteLink(owl::TCommandEnabler &ce)
Enables a PasteLink command with an ID of CM_EDITPASTELINK, which lets the user link to the embedded ...
Definition olewindo.cpp:797
virtual LPCTSTR GetFileName()
On linking must be implemented and return the file name.
Definition olewindo.h:486
virtual bool Select(owl::uint modKeys, owl::TPoint &point)
Selects the embedded object at the specified point (measured in logical units).
virtual bool EvOcAmbientSetUserMode(bool mode)
Handles the EV_OC_AMBIENT_SETUSERMODE message, which is sent by an OCX control.
bool EvOcViewBorderSpaceSet(owl::TRect *rect)
Requests that the server's tool bar be placed in the container's view of an embedded object.
void CeEditPasteSpecial(owl::TCommandEnabler &ce)
Enables the PasteSpecial command, which lets the user select a clipboard format to be pasted or paste...
Definition olewindo.cpp:842
void CeEditInsertObject(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITINSERTOBJECT if the OcApp and OcView objects exist.
Definition olewindo.cpp:647
owl::TRect DragRect
Holds the rectangle being dragged.
Definition olewindo.h:325
virtual bool EvOcAmbientSetShowHatching(bool show)
Handles the EV_OC_AMBIENT_SETSETSHOWHATCHING message, which is sent by an OCX control.
owl::TUIHandle::TWhere DragHit
Indicates the position in the embedded object where the user points and clicks the mouse.
Definition olewindo.h:316
virtual bool PaintLink(owl::TDC &dc, bool erase, owl::TRect &rect, owl::TString &moniker)
Repaints part of an object on the given device context.
Definition olewindo.h:471
virtual bool EvOcAmbientGetTextAlign(short *align)
Handles the EV_OC_AMBIENT_GETTEXTALIGN message, which is sent by an OCX control.
owl::TRect Pos
Holds the current area in the window where the object is embedded.
Definition olewindo.h:335
bool EvOcViewDrag(TOcDragDrop &ddInfo)
Handles an OC_VIEWDRAG message asking the container to provide visual feedback while the user is drag...
void EvDoVerb(owl::uint whichVerb)
Executes an OLE-related menu option from the Edit menu (for example, Edit, Copy, or Play) that is ass...
TOcPart * DragPart
Points to the embedded object (the part) being dragged.
Definition olewindo.h:310
int MinHeight
The minimum height of the part.
Definition olewindo.h:361
owl::tstring ContainerName
Holds the name of the container.
Definition olewindo.h:348
void EvLButtonDown(owl::uint modKeys, const owl::TPoint &point)
Responds to a left button down message by beginning a mouse drag transaction at the given point.
virtual bool EvOcCtrlMouseMove(TCtrlMouseEvent *pev)
Handles the EV_OC_CTRLMOUSEMOVE message, which is sent by an OCX control.
virtual bool EvOcAmbientSetShowGrabHandles(bool show)
Handles the EV_OC_AMBIENT_SETSHOWGRABHANDLES message, which is sent by an OCX control.
bool EvOcViewBreakLink(TOcLinkView &view)
EvOcViewBreakLink responds to an OC_VIEWBREAKLINK message that TOcLinkView sends when the server docu...
void EvDropFiles(owl::TDropInfo dropInfo)
This is a response method for an incoming EV_WM_DROPFILES message.
virtual bool EvOcAmbientGetShowGrabHandles(bool *show)
Handles the EV_OC_AMBIENT_GETSHOWGRABHANDLES message, which is sent by an OCX control.
TOcControl * InsertControl(TOcInitInfo &initInfo, owl::TRect *pos=0, int id=0)
Definition olewindo.cpp:508
void Init()
Initializes the TOleWindow object with the appropriate window style and initializes the necessary dat...
Definition olewindo.cpp:231
TOcApp * GetOcApp()
Returns the ObjectComponents application associated with this window.
Definition olewindo.h:434
virtual bool EvOcAmbientSetUIDead(bool dead)
Handles the EV_OC_AMBIENT_SETUIDEAD message, which is sent by an OCX control.
bool EvOcViewDoVerb(owl::uint verb)
Handles the EV_OC_VIEWDOVERB message.
virtual void GetInsertPosition(owl::TRect &rect)
Gets the position (rect) where the embedded object is inserted.
Definition olewindo.cpp:670
virtual void GetLogPerUnit(owl::TSize &logPerUnit)
Gets the logical units (typically pixels) per inch for a document so that the document's embedded obj...
bool InClient(owl::TDC &dc, owl::TPoint &point)
Returns true if point is inside the client area of the window. Returns false otherwise.
void EvLButtonUp(owl::uint modKeys, const owl::TPoint &point)
Responds to a left button up message by ending a mouse drag action.
bool EvOcViewInsMenus(TOcMenuDescr &sharedMenu)
Requests that the menus in a composite menu (a menu composed of both the server's and the container's...
virtual bool EvOcAmbientSetForeColor(long rgb)
Handles the EV_OC_AMBIENT_SETFORECOLOR message, which is sent by an OCX control.
virtual bool EvOcAmbientSetDisplayName(owl::TString *name)
Handles the EV_OC_AMBIENT_SETDISPLAYNAME message, which is sent by an OCX control.
void CeEditConvert(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITCONVERT, which lets the user convert the selected object from ...
Definition olewindo.cpp:914
owl::uint EvMouseActivate(HWND topParent, owl::uint hitCode, owl::uint msg)
Forwards the WM_MOUSEACTIVATE message to the top parent of the TOleWindow object.
~TOleWindow()
Checks to see if there are any open views, and, if no open views exist, destroys the TOleWindow objec...
Definition olewindo.cpp:262
virtual bool EvOcCtrlPropertyChange(TCtrlPropertyEvent *pev)
Handles the EV_OC_CTRLPROPERTYCHANGE message, which is sent by an OCX control.
bool EvOcViewPasteObject(TOcInitInfo &init)
Pastes an OLE object into the document pointed to by the TOleWindow::OcDoc data member.
owl::TDC * DragDC
Points to the device context used while an object is being dragged.
Definition olewindo.h:319
void EvRButtonDown(owl::uint modKeys, const owl::TPoint &point)
Responds to a right button down message.
TOcScaleFactor Scale
Holds the current scaling factor. The server uses this information to determine how to scale the docu...
Definition olewindo.h:331
void CeEditShowObjects(owl::TCommandEnabler &ce)
Checks or unchecks the Edit|Show Objects menu command according to the value of the ShowObjects data ...
Definition olewindo.cpp:974
bool EvOcViewClose()
Asks the server to close a currently open document and its associated view.
virtual bool EvOcAmbientGetFont(IDispatch **font)
Handles the EV_OC_AMBIENT_GETFONT message, which is sent by an OCX control.
virtual bool EvOcAmbientGetShowHatching(bool *show)
Handles the EV_OC_AMBIENT_GETSHOWHATCHING message, which is sent by an OCX control.
void EvMenuSelect(owl::uint menuItemId, owl::uint flags, HMENU hMenu)
Handles WM_MENUSELECT to provide hint text in the container's status bar, based on the menu item id.
void CeEditPaste(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITPASTE, which lets the user paste the embedded object from the ...
Definition olewindo.cpp:818
virtual bool EvOcAmbientSetDisplayAsDefault(bool disp)
Handles the EV_OC_AMBIENT_SETDISPLAYASDEFAULT message, which is sent by an OCX control.
bool EvOcViewPartSize(TOcPartSize &size)
The server asks itself the size of its current rectangle and lets the container know about the size o...
virtual bool EvOcAmbientSetMessageReflect(bool msgReflect)
Handles the EV_OC_AMBIENT_SETMESSAGEREFLECT message, which is sent by an OCX control.
bool EvOcViewOpenDoc(LPCTSTR path)
Asks the container to open an existing document, which will be used for linking from the embedding si...
void CleanupWindow() override
Performs normal window cleanup and informs the TOcView object that the window is closed.
virtual bool EvOcCtrlCustomEvent(TCtrlCustomEvent *pev)
Handles the EV_OC_CTRLCUSTOMEVENT message, which is sent by an OCX control.
void CeEditLinks(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITLINKS, which lets the user manually update the list of linked ...
Definition olewindo.cpp:932
void CmEditCut()
Responds to a command with an ID of CM_EDITCUT by copying the selected text to the clipboard before c...
Definition olewindo.cpp:763
TOcRemView * GetOcRemView()
Returns the server's view associated with this window.
Definition olewindo.h:426
void CmEditInsertControl()
Responds to a command with an ID of CM_EDITINSERTCONTROL by creating, initializing,...
Definition olewindo.cpp:711
virtual bool PaintSelection(owl::TDC &dc, bool erase, owl::TRect &rect, void *userData=0)
Repaints the selected portion of a document on the given device context.
Definition olewindo.h:458
TOcApp * OcApp
Holds the ObjectComponents application associated with this TOleWindow.
Definition olewindo.h:344
bool ShowObjects
Is true if the embedded object's frame (the gray or shaded brushes around the object) is displayed.
Definition olewindo.h:355
auto EvCommand(owl::uint id, HWND hWndCtl, owl::uint notifyCode) -> owl::TResult override
Overrides the usual EvCommand message to handle the OLE verbs from CM_EDITFIRSTVERB to CM_EDITLASTVER...
Definition olewindo.cpp:372
void CeEditInsertControl(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITINSERTCONTROL if the OcApp and OcView objects exist.
Definition olewindo.cpp:657
void EvMouseMove(owl::uint modKeys, const owl::TPoint &point)
Responds to a mouse move message with the appropriate transaction.
bool EvOcViewDrop(TOcDragDrop &ddInfo)
Requests a given object be dropped at a specified place on the container's window.
bool IsRemote() const
Returns true if the window represents an embedded server.
Definition olewindo.h:448
bool EvOcViewPaint(TOcViewPaint &vp)
Asks the server to paint an object at a given position on a specified device context.
virtual bool EvOcCtrlFocus(TCtrlFocusEvent *pev)
Handles the EV_OC_CTRLFOCUS message, which is sent by an OCX control.
void CeEditVerbs(owl::TCommandEnabler &ce)
Enables the Edit|Verbs command, which lets the user select one of the OLE-specific verbs from the Edi...
Definition olewindo.cpp:953
virtual TOcView * CreateOcView(owl::TRegLink *link, bool isRemote, IUnknown *outer)
Called to perform the actual setting up of the OcView member.
Definition olewindo.cpp:307
TOcView * OcView
Holds the ObjectComponents view or remote view (the server's) associated with the TOleWindow view.
Definition olewindo.h:341
bool EvOcViewClipData(TOcFormatData &format)
Requests clipboard data in the specified format.
virtual bool EvOcAmbientGetUIDead(bool *dead)
Handles the EV_OC_AMBIENT_GETUIDEAD message, which is sent by an OCX control.
bool EvOcViewAttachWindow(bool attach)
Attaches the view to its ObjectWindows parent window so that the user can perform open editing on the...
virtual bool EvOcCtrlMouseDown(TCtrlMouseEvent *pev)
Handles the EV_OC_CTRLMOUSEDOWN message, which is sent by an OCX control.
bool EvOcViewSetScale(TOcScaleFactor &scaleFactor)
Responds to an OC_VIEWSETSCALE message and handles the scaling for server application,...
virtual bool Deactivate()
If an embedded object is no longer the active embedded object, either because the user has ended an i...
void CeEditCopy(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITCOPY, which lets the user copy selected object to the clipboar...
Definition olewindo.cpp:775
bool EvOcViewSetData(TOcFormatData &format)
void CmEditShowObjects()
Responds to a command with an ID of CM_EDITSHOWOBJECTS by toggling the value of the ShowObjects data ...
Definition olewindo.cpp:963
virtual bool EvOcAmbientSetFont(IDispatch *font)
Handles the EV_OC_AMBIENT_SETFONT message, which is sent by an OCX control.
void CmEditInsertObject()
Responds to a command with an ID of CM_EDITINSERTOBJECT by creating, initializing,...
Definition olewindo.cpp:695
TOcDocument * GetOcDoc()
Returns the ObjectComponents document associated with this window.
Definition olewindo.h:405
void EvHScroll(owl::uint scrollCode, owl::uint thumbPos, HWND hWndCtl)
In response to a WM_HSCROLL message, EvHScroll calls TWindow::EvHScroll and invalidates the window.
bool EvOcViewGetSiteRect(owl::TRect *rect)
Gets the size of the rectangle (the site) where the embedded object is to be placed.
void EvSetFocus(HWND hWndLostFocus)
Responds to a change in focus of the window.
virtual void SetScale(owl::uint16 percent)
Sets the ratio of the embedded object's size to the size of the site.
virtual bool StartDrag(owl::uint modKeys, owl::TPoint &point)
virtual bool PaintParts(owl::TDC &dc, bool erase, owl::TRect &rect, bool metafile)
Repaints the embedded objects on the given device context.
OLE API related exception object.
Definition except.h:33
Pointer to an array of type T.
Definition pointer.h:103
TFrameWindow * GetMainWindow()
Return the current main window.
Definition applicat.h:592
A device context class derived from TWindowDC, TClientDC provides access to the client area owned by ...
Definition dc.h:640
TClientDC(HWND wnd)
Creates a TClientDC object with the given owned window.
Definition windowdc.cpp:71
TColor()
Construct a null color.
Definition color.h:509
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
Definition window.h:209
uint GetId() const
Retrieves the id of the command.
Definition window.h:1695
virtual void Enable(bool enable=true)
Enables or disables the command sender.
Definition window.cpp:301
virtual void SetCheck(int check)=0
Changes the check state of the command sender to either unchecked, checked, or indeterminate.
virtual void SetText(LPCTSTR text)=0
Changes the text associated with a command sender; for example, text associated with a menu item or t...
@ Unchecked
Command is not enabled.
Definition window.h:226
@ Checked
Command is enabled.
Definition window.h:227
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
virtual bool SetViewportOrg(const TPoint &origin, TPoint *oldOrg=nullptr)
Sets this DC's viewport origin to the given origin value, and saves the previous origin in oldOrg.
Definition dc.cpp:444
virtual int GetDeviceCaps(int index) const
Used under WIN3.1 or later, GetDeviceCaps returns capability information about this DC.
Definition dc.cpp:373
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
Definition dc.cpp:113
virtual int SetMapMode(int mode)
Sets the current window mapping mode of this DC to mode.
Definition dc.cpp:431
bool DPtoLP(TPoint *points, int count=1) const
Converts each of the count points in the points array from device points to logical points.
Definition dc.h:1406
int SetROP2(int mode)
Sets the current foreground mix mode mode of this DC to the given mode value and returns the previous...
Definition dc.h:1180
bool LPtoDP(TPoint *points, int count=1) const
Converts each of the count points in the points array from logical points to device points.
Definition dc.h:1423
bool DrawFocusRect(int x1, int y1, int x2, int y2)
Draws the given rectangle on this DC in the style used to indicate focus.
Definition dc.h:1854
bool Rectangle(int x1, int y1, int x2, int y2)
Draws and fills a rectangle of the given size on this DC with the current pen and brush objects.
Definition dc.h:2298
virtual bool SetWindowExt(const TSize &extent, TSize *oldExtent=nullptr)
Sets this DC's window x- and y-extents to the given extent values.
Definition dc.cpp:536
virtual void SelectStockObject(int index)
Selects into the DC a predefined stock pen, brush, font, or palette.
Definition dc.cpp:206
bool SetWindowOrg(const TPoint &origin, TPoint *oldOrg=nullptr)
Sets the origin of the window associated with this DC to the given origin value, and saves the previo...
Definition dc.cpp:506
virtual bool SetViewportExt(const TSize &extent, TSize *oldExtent=nullptr)
Sets this DC's viewport x- and y-extents to the given extent values.
Definition dc.cpp:474
auto SetClientWindow(TWindow *) -> TWindow *override
Overrides TFrameWindows virtual function.
Definition decframe.cpp:189
TDropInfo is a simple class that supports file-name drag-and-drop operations using the WM_DROPFILES m...
Definition wsyscls.h:257
tstring DragQueryFile(uint index) const
String-aware overload.
Definition wsyscls.cpp:91
uint DragQueryFileCount() const
Returns the number of dropped files in this TDropInfo object.
Definition wsyscls.cpp:120
uint DragQueryFileNameLen(uint index) const
Returns the length of the name of the file in this TDropInfo object corresponding to the given index.
Definition wsyscls.cpp:130
void DragFinish() const
Releases any memory allocated for the transferring of this TDropInfo object's files during drag opera...
Definition wsyscls.cpp:70
A nested class, TEventInfo provides specific information about the type of message sent,...
Definition eventhan.h:170
virtual bool Find(TEventInfo &info, TEqualOperator op=0)
Searches the list of response table entries looking for a match.
Definition eventhan.cpp:371
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...
Definition eventhan.cpp:396
The TMenu class encapsulates window menus.
Definition menu.h:77
uint GetMenuItemID(int posItem) const
Returns the ID of the menu item at the position specified by posItem.
Definition menu.cpp:174
bool ModifyMenu(uint item, uint flags, TMenuItem newItem=-1, LPCTSTR newStr=nullptr)
Changes an existing menu item from the item specified in item to newItem.
Definition menu.h:480
bool InsertMenu(uint item, uint flags, TMenuItem newItem=-1, LPCTSTR newStr=nullptr)
Inserts a new text menu item or pop-up menu into the menu after the menu item specified in item.
Definition menu.h:458
bool DeleteMenu(uint item, uint flags)
Removes the menu item (item) from the menu or deletes the menu item if it's a pop-up menu.
Definition menu.h:375
HMENU GetSubMenu(int posItem) const
Returns the handle of the menu specified by posItem.
Definition menu.h:446
bool AppendMenu(uint flags, TMenuItem newItem=static_cast< unsigned int >(-1), LPCTSTR newStr=nullptr)
Adds a text menu item to the end of the menu.
Definition menu.h:342
virtual HMENU GetHandle() const
Returns the handle to the menu.
Definition menu.h:310
Derived from TCommandEnabler, TMenuItemEnabler is a command enabler for menu items.
Definition framewin.h:39
int GetPosition()
Returns the position of the menu item.
Definition framewin.h:288
HMENU GetMenu()
Returns the menu that holds the item being enabled or disabled.
Definition framewin.h:280
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:78
A DC class that wraps begin and end paint calls for use in an WM_PAINT response function.
Definition dc.h:671
PAINTSTRUCT Ps
The paint structure associated with this TPaintDC object.
Definition dc.h:677
TPen is derived from TGdiObject.
Definition gdiobjec.h:138
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
int X() const
Returns the x coordinate of the point.
Definition geometry.h:463
int Y() const
Returns the Y coordinate of the point.
Definition geometry.h:472
TPopupMenu creates an empty pop-up menu to add to an existing window or pop-up menu.
Definition menu.h:189
TPopupMenu(TAutoDelete autoDelete=AutoDelete)
Constructs an empty pop-up menu.
Definition menu.cpp:419
int TrackPopupMenu(uint flags, int x, int y, int rsvd, HWND wnd, const TRect *rect=nullptr)
Allows the application to create a pop-up menu at the specified location in the specified window.
Definition menu.h:561
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
int Height() const
Returns the height of this rectangle (bottom - top).
Definition geometry.h:1048
TRect & Offset(int dx, int dy)
Changes this rectangle so its corners are offset by the given delta values.
Definition geometry.cpp:114
const TPoint & TopLeft() const
Returns the upperleft point.
Definition geometry.h:983
int Width() const
Returns the width of this rectangle (right - left).
Definition geometry.h:1039
bool Contains(const TPoint &point) const
Returns true if the given point lies within this rectangle; otherwise, it returns false.
Definition geometry.h:1200
void SetNull()
Sets the left, top, right, and bottom of the rectangle to 0.
Definition geometry.h:1075
TSize Size() const
Returns the size of rectangle.
Definition geometry.h:1057
A registration parameter table, composed of a list of TRegItems.
Definition registry.h:531
Derived from TWindowDC, TScreenDC is a DC class that provides direct access to the screen bitmap.
Definition dc.h:610
The tagSIZE struct is defined as.
Definition geometry.h:234
TSize()
Default constructor that does nothing.
Definition geometry.h:1406
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Definition string.h:67
int Length() const
The length in characters of this string.
Definition string.h:327
Assists in drawing user manupulators for on-screen objects.
Definition uihelper.h:186
static uint16 GetCursorId(TWhere where)
Helper function to convert a where code into a cursor shape Id.
Definition uihandle.cpp:184
@ Outside
Hit completely outside the object.
Definition uihelper.h:222
@ MidCenter
Somewhere inside the rectangle.
Definition uihelper.h:217
TUIHandle(const TRect &frame, uint style=HandlesIn|Grapples|HatchBorder, int thickness=5)
Constructs a TUIHandle object for the specified frame, with eight grapples drawn in a hatched border ...
Definition uihandle.cpp:70
@ Grapples
Eight grapple boxes are drawn.
Definition uihelper.h:238
@ DashFramed
Frame rect is drawn dashed.
Definition uihelper.h:237
@ HandlesIn
Handles on the inside of the rectange.
Definition uihelper.h:234
@ Framed
Frame rect is drawn solid.
Definition uihelper.h:236
TWhere HitTest(const TPoint &point) const
Compares a given point (point) to various parts of the rectangle.
Definition uihandle.cpp:129
static const TUIMetric CyDoubleClk
Definition uimetric.h:71
static const TUIMetric CxDoubleClk
Definition uimetric.h:70
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
static void GetCursorPos(TPoint &pos)
Retrieves the cursor's current position (in window screen coordinates) and copies the values into the...
Definition window.h:3465
bool SetCursor(TModule *module, TResId resId)
Sets the mouse cursor for the window, loading the given resId from the given module.
Definition window.cpp:3766
HMENU LoadMenu(TResId id) const
Definition window.h:611
HWND SetCapture()
Sets the mouse capture to the current window.
Definition window.h:2121
virtual void SetParent(TWindow *newParent)
Sets the parent for the specified window by setting Parent to the specified new Parent window object.
Definition window.cpp:738
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
Definition window.h:1855
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...
Definition window.cpp:341
virtual void EvCommandEnable(TCommandEnabler &ce)
Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-h...
Definition window.cpp:1135
void EvHScroll(uint scrollCode, uint thumbPos, HWND hWndCtl)
Response method for an incoming WM_HSCROLL message.
Definition window.cpp:1865
void EvVScroll(uint scrollCode, uint thumbPos, HWND hWndCtl)
Response method for an incoming WM_VSCROLL message.
Definition window.cpp:1892
virtual void InvalidateRect(const TRect &rect, bool erase=true)
Invalidates a specified client area.
Definition window.h:2834
void Init(TWindow *parent, LPCTSTR title, TModule *module)
Normal initialization of a default constructed TWindow.
Definition window.cpp:401
static void ReleaseCapture()
Releases the mouse capture from this window.
Definition window.h:2130
TModule * GetModule() const
Returns a pointer to the module object.
Definition window.h:1841
void RouteCommandEnable(HWND hInitCmdTarget, TCommandEnabler &ce)
Walks the chain of windows from the initial target window to this window.
Definition window.cpp:1161
void ClientToScreen(TPoint &point) const
Converts the client coordinates specified in point to screen coordinates for the new window.
Definition window.h:2248
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
Definition window.h:3176
virtual void CleanupWindow()
Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an ...
Definition window.cpp:2640
void GetWindowRect(TRect &rect) const
Gets the screen coordinates of the window's rectangle and copies them into rect.
Definition window.cpp:3609
HCURSOR LoadCursor(TResId id) const
Definition window.h:612
TResult ForwardMessage(HWND handle, bool send=true)
Forwards the window's current message.
Definition window.cpp:3302
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
Definition window.cpp:852
virtual TResult EvCommand(uint id, HWND hWndCtl, uint notifyCode)
WindowProc calls EvCommand to handle WM_COMMAND messages.
Definition window.cpp:999
virtual bool CanClose()
Use this function to determine if it is okay to close a window.
Definition window.cpp:2795
void EvSetFocus(HWND hWndLostFocus)
The default message handler for WM_SETFOCUS.
Definition window.h:4084
void ScreenToClient(TPoint &point) const
Uses the screen coordinates specified in point to calculate the client window's coordinates and then ...
Definition window.h:2192
virtual bool ShowWindow(int cmdShow)
Displays this TWindow in a given state.
Definition window.cpp:3713
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
Definition window.cpp:2575
virtual void Paint(TDC &dc, bool erase, TRect &rect)
Repaints the client area (the area you can use for drawing) of a window.
Definition window.cpp:2071
bool IsFlagSet(uint mask)
Returns the state of the bit flag in Attr.Flags whose mask is supplied.
Definition window.h:1797
static HWND GetFocus()
Gets a handle to the window that has the focus.
Definition window.h:2139
void EvMenuSelect(uint menuItemId, uint flags, HMENU hMenu)
The default message handler for WM_MENUSELECT.
Definition window.h:3827
void EvSize(uint sizeType, const TSize &size)
Response method for an incoming WM_SIZE message.
Definition window.cpp:1632
void GetClientRect(TRect &rect) const
Gets the coordinates of the window's client area and then copies them into the object referred to by ...
Definition window.cpp:3624
HWND THandle
TWindow encapsulates an HWND.
Definition window.h:418
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
Definition window.h:2822
HWND GetHandle() const
Returns the handle of the window.
Definition window.h:2020
auto ChildWithId(int id) const -> const TWindow *
Definition window.h:681
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition objstrm.h:391
Base class for writing streamable objects.
Definition objstrm.h:480
char TCHAR
Definition cygwin.h:42
#define _tcscat
Definition cygwin.h:83
#define _tcscpy
Definition cygwin.h:79
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition eventhan.h:492
Definition of abstract GDI object class and derived classes.
void ReadBaseObject(Base *base, ipstream &in)
Definition objstrm.h:1159
void WriteBaseObject(Base *base, opstream &out)
Definition objstrm.h:1150
@ AutoDelete
Definition gdibase.h:70
@ NoAutoDelete
Definition gdibase.h:70
UINT_PTR TMenuItem
Represents an unsigned integer or handle which identifies a new menu item.
Definition menu.h:34
int LoadString(uint id, TCHAR *buf, int maxChars) const
Loads a string resource identified by id into the buffer pointed to by buff.
Definition module.cpp:586
@ wfAlias
TWindow is an alias to a preexisting HWND.
Definition window.h:59
Include for OC, gets common headers when precompiled headers are enabled.
Object Component Framework (COM encapsulation).
Definition appdesc.h:22
EV_OC_CTRLEVENT_KEYUP
Definition olewindo.cpp:192
@ asDefault
Definition ocobject.h:69
EV_OC_VIEWSETLINK
Definition oleview.cpp:49
EV_OC_VIEWSETTITLE
Definition olewindo.cpp:114
EV_OC_VIEWDROP
Definition olewindo.cpp:117
EV_OC_VIEWSETSITERECT
Definition oledialg.cpp:20
@ meEnableBrowseClipboard
Definition ocobject.h:148
@ meEnableBrowseLinks
Definition ocobject.h:149
@ meEnablePasteLink
Definition ocobject.h:147
@ meEnablePaste
Definition ocobject.h:146
EV_OC_VIEWSHOWTOOLS
Definition olewindo.cpp:132
owl::uint32 BCID
Definition ocbocole.h:114
EV_OC_VIEWGETPALETTE
Definition olewindo.cpp:133
EV_OC_AMBIENT_GETFORECOLOR
Definition olewindo.cpp:149
EV_OC_VIEWCLOSE
Definition oleview.cpp:46
@ iwFile
Definition ocobject.h:101
@ iwNewOcx
Definition ocobject.h:106
@ iwNew
Definition ocobject.h:104
EV_OC_AMBIENT_SETSCALEUNITS
Definition olewindo.cpp:174
EV_OC_VIEWSCROLL
Definition olewindo.cpp:119
EV_OC_AMBIENT_GETFONT
Definition olewindo.cpp:161
EV_OC_CTRLEVENT_FOCUS
Definition olewindo.cpp:187
@ ihEmbed
Definition ocobject.h:95
EV_OC_CTRLEVENT_CLICK
Definition olewindo.cpp:179
EV_OC_VIEWBORDERSPACESET
Definition olewindo.cpp:116
EV_OC_AMBIENT_GETDISPLAYNAME
Definition olewindo.cpp:159
EV_OC_VIEWPASTEOBJECT
Definition olewindo.cpp:124
EV_OC_AMBIENT_GETSHOWHATCHING
Definition olewindo.cpp:156
EV_OC_VIEWINSMENUS
Definition oleview.cpp:45
TOcInvalidate
Definition ocobject.h:59
@ invView
Definition ocobject.h:61
@ invData
Definition ocobject.h:60
EV_OC_VIEWOPENDOC
Definition oleview.cpp:47
EV_OC_AMBIENT_SETUIDEAD
Definition olewindo.cpp:168
EV_OC_AMBIENT_SETSHOWHATCHING
Definition olewindo.cpp:170
EV_OC_AMBIENT_SETSHOWGRABHANDLES
Definition olewindo.cpp:169
EV_OC_AMBIENT_SETDISPLAYASDEFAULT
Definition olewindo.cpp:171
EV_OC_CTRLEVENT_DBLCLICK
Definition olewindo.cpp:180
EV_OC_AMBIENT_SETFONT
Definition olewindo.cpp:175
EV_OC_AMBIENT_GETSUPPORTSMNEMONICS
Definition olewindo.cpp:158
EV_OC_VIEWPAINT
Definition olewindo.cpp:128
EV_OC_VIEWTITLE
Definition olewindo.cpp:113
EV_OC_VIEWPARTINVALID
EV_OC_VIEWDISCARDUNDO, // !CQ not processing this yet...
Definition oleview.cpp:39
EV_OC_AMBIENT_GETTEXTALIGN
Definition olewindo.cpp:151
EV_OC_VIEWPARTACTIVATE
Definition olewindo.cpp:123
EV_OC_VIEWBORDERSPACEREQ
Definition olewindo.cpp:115
EV_OC_CTRLEVENT_KEYDOWN
Definition olewindo.cpp:191
EV_OC_AMBIENT_SETSUPPORTSMNEMONICS
Definition olewindo.cpp:172
EV_OC_AMBIENT_SETUSERMODE
Definition olewindo.cpp:167
EV_OC_AMBIENT_SETBACKCOLOR
Definition olewindo.cpp:162
EV_OC_AMBIENT_GETUSERMODE
Definition olewindo.cpp:153
EV_OC_AMBIENT_GETDISPLAYASDEFAULT
Definition olewindo.cpp:157
EV_OC_CTRLEVENT_PROPERTYCHANGE
Definition olewindo.cpp:193
EV_OC_VIEWPARTSIZE
Definition olewindo.cpp:137
EV_OC_AMBIENT_GETMESSAGEREFLECT
Definition olewindo.cpp:152
_T("!ForeColor")
EV_OC_AMBIENT_GETBACKCOLOR
Definition olewindo.cpp:148
EV_OC_AMBIENT_GETUIDEAD
Definition olewindo.cpp:154
EV_OC_VIEWSETDATA
Definition olewindo.cpp:135
EV_OC_VIEWCLIPDATA
Definition olewindo.cpp:134
EV_OC_AMBIENT_SETLOCALEID
Definition olewindo.cpp:164
EV_OC_AMBIENT_GETSCALEUNITS
Definition olewindo.cpp:160
EV_OC_VIEWSETSCALE
Definition olewindo.cpp:140
TOcPartCollection::Iterator TOcPartCollectionIter
Definition ocpart.h:195
EV_OC_CTRLEVENT_PROPERTYREQUESTEDIT
Definition olewindo.cpp:194
EV_OC_AMBIENT_GETSHOWGRABHANDLES
Definition olewindo.cpp:155
EV_OC_VIEWGETITEMNAME
Definition oleview.cpp:51
EV_OC_VIEWGETSITERECT
Definition olewindo.cpp:121
EV_OC_CTRLEVENT_MOUSEUP
Definition olewindo.cpp:190
EV_OC_AMBIENT_SETTEXTALIGN
Definition olewindo.cpp:165
EV_OC_VIEWSAVEPART
Definition oleview.cpp:43
EV_OC_CTRLEVENT_MOUSEDOWN
Definition olewindo.cpp:188
EV_OC_VIEWATTACHWINDOW
Definition oleview.cpp:48
EV_OC_AMBIENT_GETLOCALEID
Definition olewindo.cpp:150
@ amExeMode
may be overridden per instance if running DLL
Definition ocreg.h:88
TOcDropAction
Definition ocobject.h:39
@ daDropMove
Definition ocobject.h:42
@ daDropLink
Definition ocobject.h:43
@ daDropCopy
Definition ocobject.h:41
EV_OC_VIEWGETSCALE
Definition olewindo.cpp:120
TOcScrollDir
Definition ocobject.h:52
EV_OC_AMBIENT_SETFORECOLOR
Definition olewindo.cpp:163
EV_OC_CTRLEVENT_MOUSEMOVE
Definition olewindo.cpp:189
EV_OC_VIEWBREAKLINK
Definition oleview.cpp:50
EV_OC_CTRLEVENT_CUSTOMEVENT
Definition olewindo.cpp:196
EV_OC_VIEWDRAG
Definition olewindo.cpp:118
EV_OC_AMBIENT_SETDISPLAYNAME
Definition olewindo.cpp:173
EV_OC_CTRLEVENT_ERROREVENT
Definition olewindo.cpp:195
EV_OC_VIEWLOADPART
Definition oleview.cpp:44
EV_OC_AMBIENT_SETMESSAGEREFLECT
Definition olewindo.cpp:166
EV_OC_VIEWDOVERB
Definition olewindo.cpp:144
EV_WM_LBUTTONUP
Definition docking.cpp:2057
EV_WM_SETCURSOR
Definition docking.cpp:100
EV_WM_DROPFILES
Definition mdiclien.cpp:33
EV_WM_MOUSEACTIVATE
Definition floatfra.cpp:30
EV_WM_HSCROLL
Definition notetab.cpp:55
EV_WM_LBUTTONDBLCLK
Definition docking.cpp:963
EV_WM_PAINT
Definition control.cpp:28
EV_WM_MOUSEMOVE
Definition docking.cpp:2055
const int IDW_TOOLBAR
Definition decframe.h:24
unsigned long uint32
Definition number.h:34
EV_WM_RBUTTONDOWN
Definition gadgetwi.cpp:49
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
OWL_DIAGINFO
Definition animctrl.cpp:14
EV_WM_SETFOCUS
Definition edit.cpp:84
END_RESPONSE_TABLE
Definition button.cpp:26
EV_WM_MENUSELECT
Definition decframe.cpp:33
LRESULT TResult
Result type.
Definition dispatch.h:52
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79
EV_COMMAND_ENABLE(CM_FILENEW, CeFileNew)
EV_WM_VSCROLL
Definition scrollba.cpp:18
unsigned int uint
Definition number.h:25
EV_WM_LBUTTONDOWN
Definition checklst.cpp:195
EV_MESSAGE(BM_SETSTYLE, BMSetStyle)
EV_WM_SIZE
Definition decframe.cpp:34
IMPLEMENT_STREAMABLE1(TApplication, TModule)
EV_COMMAND(IDOK, CmOkCancel)
DIAG_DECLARE_GROUP(OwlThread)
EV_WM_MDIACTIVATE
Definition mdichild.cpp:30
#define WM_OCEVENT
Definition ocapp.h:337
Definition of TOcControl class - Proxy object representing a control in.
Definition of TOcDocument Class.
Definition of Compound Document TOcView Class.
TOleWindow - Class encapsulating a window which can be an OLE container or server window.
#define TYPESAFE_DOWNCAST(object, toClass)
Definition defs.h:269
Definition of class TScroller.
#define OleStr(s)
Definition string.h:128
Base struct for all control event messages.
Definition occtrl.h:366
For viewdrop & viewdrag.
Definition ocview.h:303
owl::TRect * Pos
Definition ocview.h:306
For part adornment painting over part, & painting views.
Definition ocview.h:312
void * UserData
User data.
Definition ocview.h:319
owl::TRect * Pos
Definition ocview.h:314
bool PaintSelection
paint the selection only
Definition ocview.h:317
owl::TString * Moniker
moniker if any
Definition ocview.h:318
Definition of TUIMetric, a UI metrics provider class.
Base window class TWindow definition, including HWND encapsulation.