OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
occtrl.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// (c) Copyright 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Implementation of the TOcControl Class and helpers
7/// These class encapsulate the hosting of OCX controls...
8//----------------------------------------------------------------------------
9#include <ocf/pch.h>
10#include <ocf/ocstorag.h>
11#include <ocf/ocdoc.h>
12#include <ocf/ocapp.h>
13#include <ocf/ocview.h>
14#include <ocf/occtrl.h>
15#include <ocf/autodefs.h>
16#include <ocf/automacr.h>
17
18namespace ocf {
19
20using namespace owl;
21
22// Routine to convert TOcControl* to TOcxView* [treated as opaque pointers]
23// for exposing delegated properties..
24//
25static ObjectPtr
26GetControlView(ObjectPtr ctl);
27
28//
29//
30//
33
34//
35//
36//
41
42//
43/// \note Does not invoke 'Cleanup' before initializing data member with
44/// newly retrieved information. Invoke 'Cleanup' explicitly if
45/// object has already retrieved event information.
46//
47void
48TEventEntry::Init(int index, ITypeInfo* typeInfo)
49{
50 PRECONDITION(typeInfo);
51 LPFUNCDESC funcDesc= 0;
52 if (SUCCEEDED(typeInfo->GetFuncDesc(index, &funcDesc))) {
53 CHECK(funcDesc);
54 IDOfEvent = funcDesc->memid;
55 ParamCount= funcDesc->cParams;
56 NameAndParams= new BSTR[funcDesc->cParams+1];
57
58 uint i;
59 typeInfo->GetNames(funcDesc->memid, NameAndParams,
60 funcDesc->cParams+1, &i);
61 CHECK(i == uint(funcDesc->cParams+1));
62 typeInfo->ReleaseFuncDesc(funcDesc);
63 }
64}
65
66//
67//
68//
69void
71{
72 if (NameAndParams) {
73 for (int i=0; i <= (int)ParamCount; i++)
74 ::SysFreeString(NameAndParams[i]);
75 delete [] NameAndParams;
76 NameAndParams = 0;
77 }
78}
79
80//
81//
82//
84 :EventList(0), Count(0), EventIID(CLSID_NULL)
85{
86 PRECONDITION(eventTypeInfo);
87
88 LPTYPEATTR tAttr = 0;
89 if (SUCCEEDED(eventTypeInfo->GetTypeAttr(&tAttr))) {
90 EventIID = tAttr->guid;
91 Count = tAttr->cFuncs;
92 if (Count) {
94 for (int i=0; i < (int)Count; i++)
95 EventList[i].Init(i, eventTypeInfo);
96 }
97 eventTypeInfo->ReleaseTypeAttr(tAttr);
98 }
99}
100
101//
102//
103//
105{
106 delete [] EventList;
107}
108
109//
110//
111//
114 PRECONDITION(index < (int)Count);
116 return EventList[index];
117}
118
119///RAYK - help contexts?
120//
121// Control container ambient property support
122//
124 EXPOSE_PROPRW_ID(DISPID_AMBIENT_BACKCOLOR, BackColor, TAutoLong, _T("!BackColor"), _T("@BackColor_"), 0)
125 EXPOSE_PROPRW_ID(DISPID_AMBIENT_FORECOLOR, ForeColor, TAutoLong, _T("!ForeColor"), _T("@ForeColor_"), 0)
126 EXPOSE_PROPRW_ID(DISPID_AMBIENT_LOCALEID, LocaleID, TAutoLong, _T("!LocaleID"), _T("@LocaleID_"), 0)
127 EXPOSE_PROPRW_ID(DISPID_AMBIENT_TEXTALIGN, TextAlign, TAutoShort, _T("!TextAlign"), _T("@TextAlign_"), 0)
128 EXPOSE_PROPRW_ID(DISPID_AMBIENT_MESSAGEREFLECT, MessageReflect, TAutoBool, _T("!MessageReflect"), _T("@MsgReflect_"), 0)
129 EXPOSE_PROPRW_ID(DISPID_AMBIENT_USERMODE, UserMode, TAutoBool, _T("!UserMode"), _T("@UserMode_"), 0)
130 EXPOSE_PROPRW_ID(DISPID_AMBIENT_UIDEAD, UIDead, TAutoBool, _T("!UIDead"), _T("@UIDead_"), 0)
131 EXPOSE_PROPRW_ID(DISPID_AMBIENT_SHOWGRABHANDLES, ShowGrabHandles, TAutoBool, _T("!ShowGrabHandles"), _T("@GrabHdl_"), 0)
132 EXPOSE_PROPRW_ID(DISPID_AMBIENT_SHOWHATCHING, ShowHatching, TAutoBool, _T("!ShowHatching"), _T("@ShowHat_"), 0)
133 EXPOSE_PROPRW_ID(DISPID_AMBIENT_DISPLAYASDEFAULT, DisplayAsDefault, TAutoBool, _T("!DisplayAsDefault"), _T("@DispDef_"), 0)
134 EXPOSE_PROPRW_ID(DISPID_AMBIENT_SUPPORTSMNEMONICS,SupportsMnemonics,TAutoBool, _T("!SupportsMnemonics"),_T("@Mnemonics_"), 0)
135 EXPOSE_PROPRW_ID(DISPID_AMBIENT_DISPLAYNAME, DisplayName, TAutoString, _T("!DisplayName"), _T("@DispName_"), 0)
136 EXPOSE_PROPRW_ID(DISPID_AMBIENT_SCALEUNITS, ScaleUnits, TAutoString, _T("!ScaleUnits"), _T("@ScaleUnits_"),0)
137 EXPOSE_PROPRW_ID(DISPID_AMBIENT_FONT, Font, TAutoDispatch,_T("!Font"), _T("@Font_"), 0)
138END_AUTOCLASS(TOcxView, tfNormal, _T("TOcxView"), _T("@TOcxView_"), 0)
139
140#if defined(_MSC_VER)
141# pragma warning(push)
142# pragma warning(disable: 4838) // warning C4838: conversion from 'unsigned long' to 'long' requires a narrowing conversion.
143#endif
144
145//
146// Control standard extended properties and standard events
147//
149 //
150 // Standard extended properties
151 //
152 EXPOSE_PROPRO_ID(0x80010008L, Parent, TAutoDispatch,_T("!Parent"), _T("!Parent"), 0)
153 EXPOSE_PROPRW_ID(0x80010007L, Visible, TAutoBool, _T("!Visible"), _T("!Visible"), 0)
154 EXPOSE_PROPRW_ID(0x80010037L, Cancel, TAutoBool, _T("!Cancel"), _T("@Cancel_"), 0)
155 EXPOSE_PROPRW_ID(0x80010038L, Default, TAutoBool, _T("!Default"), _T("@Default_"), 0)
156 EXPOSE_PROPRW_ID(0x80010000L, Name, TAutoString, _T("!Name"), _T("@ObjName_"), 0)
157 EXPOSE_PROPRW_ID(0x80010100L, Left, TAutoLong, _T("!Left"), _T("!Left"), 0)
158 EXPOSE_PROPRW_ID(0x80010101L, Top, TAutoLong, _T("!Top"), _T("!Top"), 0)
159 EXPOSE_PROPRW_ID(0x80010102L, Width, TAutoLong, _T("!Width"), _T("!Width"), 0)
160 EXPOSE_PROPRW_ID(0x80010103L, Height, TAutoLong, _T("!Height"), _T("!Height"), 0)
161
162 // Expose ambient properties
163 //
164 EXPOSE_DELEGATE(TOcxView, _T("TOcxView"), GetControlView)
165
166END_AUTOCLASS(TOcControl, tfNormal, _T("TOcControl"), _T("@TOcControl_"), 0)
167
168#if defined(_MSC_VER)
169# pragma warning(pop)
170#endif
171
172//
173// Control standard extended properties and standard events
174//
176 //
177 // Standard events
178 //
179 EXPOSE_METHOD_ID(DISPID_CLICK, Click, TAutoLong, _T("!Click"), _T("@Click_"), 0)
180 EXPOSE_METHOD_ID(DISPID_DBLCLICK, DblClick, TAutoLong, _T("!DblClick"), _T("@DblClick_"), 0)
181 EXPOSE_METHOD_ID(DISPID_MOUSEDOWN, MouseDown,TAutoLong, _T("!MouseDown"), _T("@MouseDown_"), 0)
182 REQUIRED_ARG(TAutoShort, _T("!Button"))
183 REQUIRED_ARG(TAutoShort, _T("!Shift"))
186 EXPOSE_METHOD_ID(DISPID_MOUSEUP, MouseUp, TAutoLong, _T("!MouseUp"), _T("@MouseUp_"), 0)
187 REQUIRED_ARG(TAutoShort, _T("!Button"))
188 REQUIRED_ARG(TAutoShort, _T("!Shift"))
191 EXPOSE_METHOD_ID(DISPID_MOUSEMOVE, MouseMove,TAutoLong, _T("!MouseMove"), _T("@MouseMove_"), 0)
192 REQUIRED_ARG(TAutoShort, _T("!Button"))
193 REQUIRED_ARG(TAutoShort, _T("!Shift"))
196 EXPOSE_METHOD_ID(DISPID_KEYDOWN, KeyDown, TAutoLong, _T("!KeyDown"), _T("@KeyDown_"), 0)
197 REQUIRED_ARG(TAutoShortRef, _T("!KeyCode"))
198 REQUIRED_ARG(TAutoShort, _T("!Shift"))
199 EXPOSE_METHOD_ID(DISPID_KEYUP, KeyUp, TAutoLong, _T("!KeyUp"), _T("@KeyUp_"), 0)
200 REQUIRED_ARG(TAutoShortRef, _T("!KeyCode"))
201 REQUIRED_ARG(TAutoShort, _T("!Shift"))
202 EXPOSE_METHOD_ID(DISPID_ERROREVENT, ErrorEvent, TAutoLong, _T("!ErrorEvent"),_T("&ErrorEvent_"),0)
203 REQUIRED_ARG(TAutoShort, _T("!Number"))
204 REQUIRED_ARG(TAutoString,_T("!Description"))
205 REQUIRED_ARG(TAutoLong, _T("!SCode"))
206 REQUIRED_ARG(TAutoString,_T("!Source"))
207 REQUIRED_ARG(TAutoString,_T("!HelpFile"))
208 REQUIRED_ARG(TAutoLong, _T("!HelpContext"))
209 REQUIRED_ARG(TAutoBoolRef,_T("!CancelDisplay"))
210 EXPOSE_METHOD_ID(DISPID_CATCH_ALL, CustomEvent, TAutoLong, _T("!CustomEvent"), _T("@CustomEvent_"),0)
211 REQUIRED_ARG(TAutoLongRef, _T("!Number"))
212
213END_AUTOCLASS(TOcControlEvent, tfNormal, _T("TOcControlEvent"), _T("@TOcCtrlEvent_"), 0)
214
215//
216//
217//
218ObjectPtr GetControlView(ObjectPtr ctl)
219{
220 return (ObjectPtr)((TOcControl*)ctl)->GetActiveControlView();
221}
222
223//
224/// Construct a new part with a given temp id
225//
227 :TOcPart(document, id), pUserName(new TString), BCtrlI(0),
228 pIExtended(0), pEvents(pEv), EventList(0)
229{
230 *pUserName = GetName();
231 if (pEvents)
232 pEventsOwnership=false;
233 else
234 pEventsOwnership=true;
235}
236
237//
238/// Construct a part from a named stream in an oc doc's storage
239//
240TOcControl::TOcControl(TOcDocument& document, LPCTSTR name)
241 :TOcPart(document, name), pUserName(0), BCtrlI(0), pIExtended(0),
242 pEvents(0), EventList(0)
243{
244// !rayk
245 pEventsOwnership=true;
246}
247
248//
249//
250//
252{
253 if (pIExtended)
256 delete pEvents;
257 delete pUserName;
258 delete EventList;
259}
260
261//
262//
263//
264bool
266{
267 return TOcPart::Init(initInfo, objPos);
268}
269
270//
271/// Perform common ctor initialization
272//
273bool
275{
276 if (TOcPart::InitObj((TOcInitInfo *)nullptr) == false)
277 return false;
278
279 if (initInfo) {
280 if (!pIExtended)
281 pIExtended = (TServedObject*)CreateAutoObject(this, ClassInfo);
282
283 if (!pEvents)
284 pEvents = new TOcControlEvent();
285
286 // There must be an IStorage associated with each part, make sure the
287 // ctor got it OK
288 //
289 initInfo->Storage = Storage->GetIStorage();
290
291 // Create part helper
292 //
296
297 // Get the interfaces we need & then release the object itself
298 //
299 if (HRSucceeded(BPart->QueryInterface(IID_IBPart, (LPVOID *)&BPartI)))
300 BPartI->Release();
301 if (HRSucceeded(BPart->QueryInterface(IID_IBLinkable, (LPVOID *)&BLPartI)))
302 BLPartI->Release();
303 if (HRSucceeded(BPart->QueryInterface(IID_IBControl, (LPVOID *)&BCtrlI)))
304 BCtrlI->Release();
305
306 // Initialize the Extended/Ambient IDispatch
307 //
308 HRESULT hr;
309 IBSite* BSiteI;
310 hr = QueryInterface(IID_IBSite, (LPVOID *)&BSiteI);
311 if (HRSucceeded(hr)) {
312 IDispatch* pID = 0;
313 TOcView* activeView = OcDocument.GetActiveView();
314 CHECK(activeView);
315 if ((pIExtended) &&(SUCCEEDED(pIExtended->QueryObject(IID_IDispatch,
316 (LPVOID *)&pID)))) {
317 BCtrlI->SetAmbientDispatch(pID);
318 pID->Release();
319 }
320
321 // Init the part
322 //
323 if (!BPartI || !HRSucceeded(hr = BPartI->Init(BSiteI, initInfo))) {
324 BSiteI->Release();
325 BPart->Release();
326 BPart = 0;
328 }
329 BSiteI->Release();
330
331 Rename();
332 if (initInfo->How == ihLink) // Remember that we are a link
333 Flags |= Link;
334
335 // Initialize the Events IDispatch
336 //
338
339 // New parts become active when they are init'd above. Make sure that
340 // our view knows that we are active too.
341 //
342 if (initInfo->Where == iwNew) {
343 Flags |= Active;
344 activeView->ActivatePart(this);
345 }
346 }
347 else
349
350 }
351 return true;
352}
353
354//
355/// Retrieves the ITypeInfo the 'default source' event object of this
356/// control.
357/// \note Receiver must 'Release' the returned object, if successful.
358//
361{
362 ITypeInfo* pRet = nullptr;
363 if (GetBControlI())
365 return pRet;
366}
367
368//
369/// Retrieves a list of events generated by this control.
370/// Returns true if the event list was successfully retrieved.
371//
372bool
374{
375 // Skip if we've already retrieved the event list
376 //
377 if (EventList && EventList->GetCount())
378 return true;
379
380 // Retrieve Event ITypeInfo
381 //
382 ITypeInfo* eventTypeInfo = GetEventTypeInfo();
383 if (!eventTypeInfo)
384 return false;
385
386 // Allocate new EventList object
387 //
388 EventList = new TEventList(eventTypeInfo);
389 eventTypeInfo->Release();
390 return true;
391}
392
393//
394//
395//
398{
399 return EventList;
400}
401
402//
403/// Retrieves the primary IDispatch of the control.
404/// \note Receiver must 'Release' the returned object, if successful.
405//
406IDispatch*
408{
409 IDispatch* pDisp = 0;
410 if (GetBControlI())
411 GetBControlI()->GetCtrlDispatch(&pDisp);
412 return pDisp;
413}
414
415//
416//
417//
418void
420{
421 if (!pEvents)
422 return;
423
424 pEvents->pCtrl = this;
426
427 IDispatch* pID = 0;
429 if (SUCCEEDED(pS->QueryObject(IID_IDispatch, (void**)&pID))) {
430 IID iidEv;
431
432 BCtrlI->GetEventIID(&iidEv);
433 pS->iidEvent = iidEv;
434
435 ITypeInfo* pITypeInfo;
436 LPTYPEATTR pTA;
437 UINT i;
438 UINT cEvents;
439
440 BCtrlI->GetEventTypeInfo(&pITypeInfo);
441 if (pITypeInfo) {
442 pITypeInfo->GetTypeAttr(&pTA);
443 if (pTA) {
444 cEvents = pTA->cFuncs;
445 pITypeInfo->ReleaseTypeAttr(pTA);
446 for (i = 0; i < cEvents; i++) {
447 LPFUNCDESC pFD;
448
449 if (SUCCEEDED(pITypeInfo->GetFuncDesc(i, &pFD))) {
450 ObjectPtr object = this; // copy in case of ptr adjustment
451
452 // see if we have a method associated with this DISPID
453 // if not, find one with the same name and see if the
454 // number of parameters matches
455 //
456 TAutoSymbol* sym = pS->Class->FindId(pFD->memid, object);
457 if (!sym) {
458 UINT cNames;
459 BSTR bstrName; // Event name(function only)
460 DISPID dispid; // Event name(function only)
461 if (SUCCEEDED(pITypeInfo->GetNames(pFD->memid, &bstrName,
462 1, &cNames))) {
463 sym = pS->Class->Lookup(OleStr(bstrName),
464 LANGIDFROMLCID(LOCALE_USER_DEFAULT),
465 asAnyCommand, dispid);
466 if (sym &&
467 (sym->DispId == -1 || sym->DispId == 0) &&
468 sym->TestFlag(DISPATCH_METHOD) && // check type
469 pS->Class->GetArgCount(*sym) == pFD->cParams) {
470 sym->DispId = pFD->memid;
471 }
472
473 SysFreeString(bstrName);
474 }
475 }
476 pITypeInfo->ReleaseFuncDesc(pFD);
477 }
478 }
479 }
480 pITypeInfo->Release();
481 }
483 pID->Release();
484 }
485}
486
487//
488//
489//
490TOcView*
495
496//
497//
498//
500TOcControl::CreateAutoObject(const void* obj, TAutoClass& clsInfo)
501{
502 TAppDescriptor* appDesc;
503 TUnknown* result = 0;
504 appDesc = &(OcDocument.OcApp.GetRegistrar().GetAppDescriptor());
505 if (appDesc) {
506 result = appDesc->CreateAutoObject(obj, clsInfo.GetTypeInfo(),
507 obj, clsInfo.GetTypeInfo(), 0);
508 if (result)
509 ((TServedObject*)result)->AddRef();
510 }
511 return result;
512}
513
514//
515/// Callback from TUnknown's implementation of QueryInterface
516//
517HRESULT
518TOcControl::QueryObject(const IID & iid, void * * iface)
519{
520 PRECONDITION(iface);
521 HRESULT hr;
522
523 // interfaces
524 //
525 HRSucceeded(hr = IBControlSite_QueryInterface(this, iid, iface))
526
527 // helpers
528 //
529 || HRSucceeded(hr = TOcPart::QueryObject(iid, iface))
530 || (pIExtended &&(HRSucceeded(hr = pIExtended->QueryObject(iid, iface))))
531 ;
532 return hr;
533}
534
535
536/// Extended property support
537//
538void
540{
541 *pUserName = name;
542}
543
544//
545//
546//
547TString&
549{
550 return *pUserName;
551}
552
553//
554/// Retrieves the extended IDispatch (exposing extended properties)
555//
556IDispatch*
558{
559 IDispatch* pID = 0;
561 if (view) {
562 if (HRSucceeded(view->QueryInterface(IID_IDispatch, (LPVOID *)&pID)))
563 pID->Release();
564 }
565 return pID;
566}
567
568//
569//
570//
571void
573{
574 TPoint nuPos(int(value), Pos.y);
575 SetPos(nuPos);
576 UpdateRect();
577}
578
579//
580//
581//
582void
584{
585 TSize nuSize(int(value), Size.cy);
586 SetSize(nuSize);
587 UpdateRect();
588}
589
590//
591//
592//
593void
595{
596 TPoint nuPos(Pos.x, int(value));
597 SetPos(nuPos);
598 UpdateRect();
599}
600
601//
602//
603//
604void
606{
607 TSize nuSize(Size.cx, int(Value));
608 SetSize(nuSize);
609 UpdateRect();
610}
611
612//
613/// Event support
614//
615HRESULT _IFUNC
617{
619 if (!view)
620 return HR_FAIL;
621
622 if (fGotFocus && (view->GetActivePart()) &&
623 (view->GetActivePart() != this))
624 view->GetActivePart()->Activate (FALSE);
625
626 TCtrlFocusEvent ev(this, fGotFocus);
628 return HR_NOERROR;
629}
630
631//
632//
633//
634HRESULT _IFUNC
636{
638 if (!view)
639 return HR_FAIL;
640
641 TCtrlPropertyEvent ev(this, dispid);
643 return HR_NOERROR;
644}
645
646//
647//
648//
649HRESULT _IFUNC
651{
653 if (!view)
654 return HR_FAIL;
655
656 TCtrlPropertyEvent ev(this, dispid);
658 return ev.accept ? HR_OK : HR_FALSE;
659}
660
661//
662//
663//
664HRESULT _IFUNC
666 TPointF * lpptfContainer, DWORD flags)
667{
669 if (!view)
670 return HR_FAIL;
671
672 TCtrlTransformCoords ev(this, lpptlHimetric, lpptfContainer, flags);
673 if (!view->ForwardEvent(OC_VIEWTRANSFORMCOORDS, &ev)) {
674
675 // default if not handled is to go from himetric to pixels and back again
676 // if you want otherwise, you should override this, or answer the
677 // message differently.
678
679 HDC dc = ::GetDC(0);
680 int xPixPerInch = ::GetDeviceCaps(dc, LOGPIXELSX);
681 int yPixPerInch = ::GetDeviceCaps(dc, LOGPIXELSY);
682 ReleaseDC(0, dc);
683 if (flags & XFORMCOORDS_HIMETRICTOCONTAINER) {
684 lpptfContainer->x = (float)MAP_LOGHIM_TO_PIX(lpptlHimetric->x, xPixPerInch);
685 lpptfContainer->y = (float)MAP_LOGHIM_TO_PIX(lpptlHimetric->y, yPixPerInch);
686 }
687 else if (flags & XFORMCOORDS_CONTAINERTOHIMETRIC) {
688 lpptlHimetric->x = MAP_PIX_TO_LOGHIM((ULONG)lpptfContainer->x, xPixPerInch);
689 lpptlHimetric->y = MAP_PIX_TO_LOGHIM((ULONG)lpptfContainer->y, yPixPerInch);
690 }
691 }
692 return S_OK;
693}
694
695//
696//
697//
698HRESULT _IFUNC TOcControl::Init(UINT, IBControl*, UINT)
699{
700 return ResultFromScode(E_NOTIMPL);
701}
702
703//
704/// TOcxView Class Implementation
705//
706TOcxView::TOcxView(TOcDocument& doc, TRegList* regList, IUnknown* outer)
707:
708 TOcView(doc, regList, outer),
709 pBlankString(new TString(" "))
710 //pDisplayName(new TString("Control")),
711 //pScaleUnits(new TString("Control"))
712{
713 TAppDescriptor* appDesc;
714
715 appDesc = &(OcApp.GetRegistrar().GetAppDescriptor());
716 if (appDesc) {
718 (VOID*)this, ClassInfo.GetTypeInfo(),
719 (VOID*)this, ClassInfo.GetTypeInfo(),
720 0);
721 if (pIAmbients)
723 }
724}
725
726//
727//
728//
730{
731 if (pIAmbients)
733 delete pBlankString;
734}
735
736//
737//
738//
739HRESULT
740TOcxView::QueryObject(const IID & iid, void * * iface)
741{
742 PRECONDITION(iface);
743 HRESULT hr;
744
745 // interfaces
746 //
747
748 if (pIAmbients && (HRSucceeded(hr = pIAmbients->QueryObject(iid, iface))))
749 {
750 }
751 // helpers
752 //
753 else if (HRSucceeded(hr = TOcView::QueryObject(iid, iface)))
754 {
755 }
756
757 return hr;
758}
759
760//
761//
762//
763void
765{
766 AmbientChanged(DISPID_AMBIENT_BACKCOLOR);
767}
768
769void
771{
772 AmbientChanged(DISPID_AMBIENT_FORECOLOR);
773}
774
775void
777{
778 AmbientChanged(DISPID_AMBIENT_LOCALEID);
779}
780
781void
783{
784 AmbientChanged(DISPID_AMBIENT_MESSAGEREFLECT);
785}
786
787void
789{
790 AmbientChanged(DISPID_AMBIENT_TEXTALIGN);
791}
792
793void
795{
796 AmbientChanged(DISPID_AMBIENT_USERMODE);
797}
798
799void
801{
802 AmbientChanged(DISPID_AMBIENT_UIDEAD);
803}
804
805void
807{
808 AmbientChanged(DISPID_AMBIENT_SHOWGRABHANDLES);
809}
810
811void
813{
814 AmbientChanged(DISPID_AMBIENT_SUPPORTSMNEMONICS);
815}
816
817void
819{
820 AmbientChanged(DISPID_AMBIENT_SHOWHATCHING);
821}
822
823void
825{
826 AmbientChanged(DISPID_AMBIENT_DISPLAYASDEFAULT);
827}
828
829void
831{
832 //pDisplayName = &name;
833 AmbientChanged(DISPID_AMBIENT_DISPLAYNAME);
834}
835
836void
838{
839 //pScaleUnits = &unit;
840 AmbientChanged(DISPID_AMBIENT_SCALEUNITS);
841}
842
843void
845{
846 AmbientChanged(DISPID_AMBIENT_FONT);
847}
848
849
850void
855
856void
861
862void
864{
866}
867
868void
873
874void
879
880void
885
886void
891
892void
897
898void
903
904void
909
910void
915
916void
921
922void
927
928void
929TOcxView::SetAmbFont(IDispatch* fontDisp)
930{
932}
933
934long
936{
937 return GetAmbientValue(OC_AMBIENT_GETBACKCOLOR, RGB(0x80, 0x80, 0x80));
938}
939
940
941long
943{
944 return GetAmbientValue(OC_AMBIENT_GETFORECOLOR, RGB(0x00, 0x00, 0x00));
945}
946
947
948long
950{
951 return GetAmbientValue(OC_AMBIENT_GETLOCALEID, LOCALE_USER_DEFAULT);
952}
953
954
955bool
960
961
962short
964{
965 return (short)(GetAmbientValue(OC_AMBIENT_GETTEXTALIGN, 0) & 0xffff);
966}
967
968
969bool
971{
972 return (bool)(GetAmbientValue(OC_AMBIENT_GETUSERMODE, true) & 0xf);
973}
974
975
976bool
978{
979 return (bool)(GetAmbientValue(OC_AMBIENT_GETUIDEAD, false) & 0xf);
980}
981
982
983bool
988
989
990bool
992{
993 return (bool)(GetAmbientValue(OC_AMBIENT_GETSHOWHATCHING, false) & 0xf);
994}
995
996
997bool
1002
1003
1004bool
1009
1010
1011TString&
1013{
1014 TString* value;
1015 return ForwardEvent(OC_AMBIENT_GETDISPLAYNAME, &value) ? *value : *pBlankString;
1016}
1017
1018
1019TString&
1021{
1022 TString* value;
1023 return ForwardEvent(OC_AMBIENT_GETSCALEUNITS, &value) ? *value : *pBlankString;
1024}
1025
1026
1027IDispatch*
1029{
1030 IDispatch* value;
1031
1032 // NOTE: If view handles the message, it should AddRef the font
1033 //
1034 return ForwardEvent(OC_AMBIENT_GETFONT, &value) ? value: 0;
1035}
1036
1037
1038void
1040{
1041 // Will loop through all known controls and let them
1042 // know when an ambient property changes
1043 //
1044 for (TOcPartCollectionIter i(OcDocument.GetParts()); i; i++) {
1045 TOcPart* ocPart = (TOcPart*)i.Current();
1046 IBControl* CtrlI;
1047 if (SUCCEEDED(ocPart->QueryInterface(IID_IBControl, (LPVOID *)&CtrlI))) {
1048#if 0
1049 // !BB The following order of call looks very suspicious to me
1050 // !BB Shouldn't one release only and only when the interface pointer
1051 // !BB will no longer be used?? Or, I am missing some subtle issue
1052 // !BB about OLE controls and Ambient property changed.
1053 CtrlI->Release();
1054 CtrlI->AmbientChanged(dispid);
1055#else
1056 CtrlI->AmbientChanged(dispid);
1057 CtrlI->Release();
1058#endif
1059 }
1060 }
1061}
1062
1063long
1064TOcxView::GetAmbientValue(long ambientMsg, long def)
1065{
1066 uint32 value;
1067 return ForwardEvent(int(ambientMsg), &value) ? value : def;
1068}
1069
1070//
1071// TOcControlEvent Class Implementation
1072// Support for standard events and generic custom event
1073//
1078
1084
1085void
1087{
1088 if (!pIEvents)
1089 pIEvents = (TServedObject *)CreateAutoObject(this, ClassInfo);
1090}
1091
1092TUnknown*
1094{
1095 if (pCtrl) {
1096 clsInfo.AutoIds = false;
1097 pIEvents = (TServedObject*)pCtrl->CreateAutoObject(obj, clsInfo);
1098 return pIEvents;
1099 }
1100 else
1101 return 0;
1102}
1103
1104//
1105//
1106//
1107HRESULT
1109{
1111 if (!view)
1112 return E_FAIL;
1113
1114 TCtrlEvent ev(pCtrl, dispid);
1115 view->ForwardEvent(msg, &ev);
1116 return S_OK;
1117}
1118
1119//
1120//
1121//
1122HRESULT
1124 short button, short shift,
1125 long x, long y)
1126{
1128 if (!view)
1129 return E_FAIL;
1130
1131 TCtrlMouseEvent ev(pCtrl, id, button, shift, x, y);
1132 view->ForwardEvent(msg, &ev);
1133 return S_OK;
1134}
1135
1136//
1137//
1138//
1139HRESULT
1141 short* keyCode, short shift)
1142{
1144 if (!view)
1145 return E_FAIL;
1146
1147 TCtrlKeyEvent ev(pCtrl, id, *keyCode, shift);
1148 view->ForwardEvent(msg, &ev);
1149 return S_OK;
1150}
1151
1152//
1153//
1154//
1155HRESULT
1157 SCODE SCode, TAutoString Source,
1158 TAutoString HelpFile, long HelpContext,
1159 bool* CancelDisplay)
1160{
1162 if (!view)
1163 return E_FAIL;
1164
1165 TCtrlErrorEvent ev(pCtrl, Number, Description, SCode, Source, HelpFile,
1166 HelpContext, *CancelDisplay);
1168 return S_OK;
1169}
1170
1171//
1172//
1173//
1174HRESULT
1176{
1178 if (!view)
1179 return HR_FAIL;
1180
1181 TAutoStack* autoStack = (TAutoStack*)args;
1182 TCtrlCustomEvent ev(pCtrl, autoStack->DispId, autoStack);
1184 return HR_NOERROR;
1185}
1186
1187//
1188//
1189//
1190HRESULT
1192{
1193 return ForwardClickEvent(OC_CTRLEVENT_CLICK, DISPID_CLICK);
1194}
1195
1196//
1197//
1198//
1199HRESULT
1201{
1202 return ForwardClickEvent(OC_CTRLEVENT_DBLCLICK, DISPID_DBLCLICK);
1203}
1204
1205//
1206//
1207//
1208HRESULT
1209TOcControlEvent::MouseDown(short button, short shift, long x, long y)
1210{
1211 return ForwardMouseEvent(OC_CTRLEVENT_MOUSEDOWN, DISPID_MOUSEDOWN,
1212 button, shift, x, y);
1213}
1214
1215//
1216//
1217//
1218HRESULT
1219TOcControlEvent::MouseMove(short button, short shift, long x, long y)
1220{
1221 return ForwardMouseEvent(OC_CTRLEVENT_MOUSEMOVE, DISPID_MOUSEMOVE,
1222 button, shift, x, y);
1223}
1224
1225//
1226//
1227//
1228HRESULT
1229TOcControlEvent::MouseUp(short button, short shift, long x, long y)
1230{
1232 DISPID_MOUSEUP, button, shift, x, y);
1233}
1234
1235//
1236//
1237//
1238HRESULT
1239TOcControlEvent::KeyDown(short * keyCode, short shift)
1240{
1241 return ForwardKeyEvent(OC_CTRLEVENT_KEYDOWN, DISPID_KEYDOWN,
1242 keyCode, shift);
1243}
1244
1245//
1246//
1247//
1248HRESULT
1249TOcControlEvent::KeyUp(short * keyCode, short shift)
1250{
1251 return ForwardKeyEvent(OC_CTRLEVENT_KEYUP, DISPID_KEYUP,
1252 keyCode, shift);
1253}
1254
1255//
1256//
1257//
1258typedef HRESULT (PASCAL *REGPROC)();
1259
1260//
1261//
1262//
1263static HRESULT
1264OcInvokeProc(LPCTSTR libraryName, LPCSTR procName)
1265{
1266 HRESULT hr = ResultFromScode (E_FAIL);
1267
1268 HINSTANCE libHandle = LoadLibrary(libraryName);
1269 if (libHandle <= HINSTANCE(HINSTANCE_ERROR))
1270 return hr;
1271
1272 REGPROC dllRegProc;
1273 dllRegProc = (REGPROC)::GetProcAddress (libHandle, procName);
1274 if (dllRegProc) {
1275 hr = dllRegProc();
1276 }
1277
1278 FreeLibrary(libHandle);
1279 return hr;
1280}
1281
1282//
1283//
1284//
1285_OCFFUNC(HRESULT)
1286OcRegisterControl(LPTSTR libraryName)
1287{
1288 // NOTE: The new recommendation is to refrain from loading the control
1289 // until the 'SelfRegister' string has been found in the VERSIONINFO
1290 // resource...
1291 //
1292 return OcInvokeProc(libraryName, "DllRegisterServer");
1293}
1294
1295//
1296//
1297//
1298_OCFFUNC(HRESULT)
1299OcUnregisterControl (CLSID classId)
1300{
1301 HRESULT hr;
1302 LPOLESTR str;
1303 hr = StringFromCLSID (classId, &str);
1304
1305 if (SUCCEEDED(hr)) {
1306 TCHAR temp[64];
1307 _tcscpy (temp, OleStr(str));
1308
1309 TCHAR key[255];
1310 wsprintf (key, _T("CLSID\\%s\\InprocServer32"), temp);
1311 CoTaskMemFree(str);
1312
1313 TCHAR ocxPath[_MAX_PATH];
1314 long len = sizeof(ocxPath);
1315 hr = (HRESULT)RegQueryValue (TRegKey::GetClassesRoot(),
1316 key, ocxPath,
1317 (LONG *)&len);
1318 if (SUCCEEDED(hr)) {
1319
1320 // NOTE: The new recommendation is to refrain from loading the control
1321 // until the 'SelfRegister' string has been found in the VERSIONINFO
1322 // resource...
1323 //
1324 hr = OcInvokeProc(ocxPath, "DllUnregisterServer");
1325 }
1326 }
1327 return hr;
1328}
1329
1330
1331} // OCF namespace
1332
1333//==============================================================================
1334
OLE Automation Class Definitions.
Automation Symbol Table, Command, and Proxy Macro Definitions.
#define DISPID_CATCH_ALL
Definition automacr.h:1045
#define EXPOSE_PROPRO_ID(id, cmd, cls, name, doc, help)
Definition automacr.h:113
#define REQUIRED_ARG(cls, name)
Definition automacr.h:128
#define DEFINE_AUTOCLASS(cls)
Definition automacr.h:61
#define EXPOSE_DELEGATE(cls, name, locator)
Definition automacr.h:134
#define CHECK(condition)
Definition checks.h:239
#define PRECONDITION(condition)
Definition checks.h:227
virtual HRESULT _IFUNC GetEventTypeInfo(ITypeInfo **ppTypeInfo)=0
virtual HRESULT _IFUNC GetCtrlDispatch(IDispatch **ppDispatch)=0
virtual HRESULT _IFUNC AmbientChanged(DISPID dispid)=0
virtual HRESULT _IFUNC SetEventDispatch(IDispatch *)=0
virtual HRESULT _IFUNC GetEventIID(IID *iidEvent)=0
IBSite – Supported by container apps for each linked/embedded object.
Definition ocbocole.h:442
TUnknown * CreateAutoObject(TObjectDescriptor obj, TServedObject &app, IUnknown *outer=0)
Creates a TServedObject helper which implements IDispatch on behalf of the class described via the 'o...
Definition appdesc.cpp:205
TAutoSymbol * Lookup(TCHAR *name, owl::TLangId lang, short symFlags, long &id)
Definition autosym.cpp:216
bool AutoIds
generate ID's automatically if true (default)
Definition autodefs.h:182
TAutoSymbol * FindId(long id, ObjectPtr &objptr)
Definition autosym.cpp:103
short GetArgCount(TAutoSymbol &sym)
Definition autosym.cpp:207
const std::type_info & GetTypeInfo() const
Definition autodefs.h:1469
Automation argument stack abstraction.
Definition autodefs.h:813
Based on reference counted TString with added automation functionality.
Definition autodefs.h:492
Definition occtrl.h:37
BSTR * NameAndParams
Definition occtrl.h:48
TEventEntry()
Definition occtrl.cpp:31
DISPID IDOfEvent
Definition occtrl.h:46
~TEventEntry()
Definition occtrl.cpp:37
owl::uint ParamCount
Definition occtrl.h:47
void Init(int index, ITypeInfo *typeInfo)
Definition occtrl.cpp:48
void Cleanup()
Definition occtrl.cpp:70
TEventEntry & operator[](int index)
Definition occtrl.cpp:113
owl::uint GetCount() const
Definition occtrl.h:60
owl::uint Count
Definition occtrl.h:64
TEventList(ITypeInfo *typeInfo)
Definition occtrl.cpp:83
TEventEntry * EventList
Definition occtrl.h:63
GUID EventIID
Definition occtrl.h:65
HRESULT BOleComponentCreate(IUnknown **retIface, IUnknown *outer, owl::uint32 idClass)
Create a BOle helper for one of our OC objects in this app.
Definition ocapp.cpp:213
TOcRegistrar & GetRegistrar()
Definition ocapp.h:162
OC Control Event class for standard control events.
Definition occtrl.h:202
long MouseUp(short Button, short Shift, long X, long Y)
Definition occtrl.cpp:1229
long MouseDown(short Button, short Shift, long X, long Y)
Definition occtrl.cpp:1209
HRESULT CustomEvent(long *args)
Definition occtrl.cpp:1175
long KeyUp(short *KeyCode, short Shift)
Definition occtrl.cpp:1249
long ErrorEvent(short number, TAutoString Description, SCODE SCode, TAutoString Source, TAutoString HelpFile, long helpContext, bool *CancelDisplay)
Definition occtrl.cpp:1156
TUnknown * CreateAutoObject(const void *obj, TAutoClass &clsInfo)
Definition occtrl.cpp:1093
HRESULT ForwardClickEvent(owl::uint msg, DISPID id)
Definition occtrl.cpp:1108
long KeyDown(short *KeyCode, short Shift)
Definition occtrl.cpp:1239
HRESULT ForwardKeyEvent(owl::uint msg, DISPID id, short *KeyCode, short Shift)
Definition occtrl.cpp:1140
TOcControl * pCtrl
Definition occtrl.h:237
virtual void InitEventDispatch()
Definition occtrl.cpp:1086
HRESULT ForwardMouseEvent(owl::uint msg, DISPID id, short Button, short Shift, long X, long Y)
Definition occtrl.cpp:1123
long MouseMove(short Button, short Shift, long X, long Y)
Definition occtrl.cpp:1219
TServedObject * pIEvents
Definition occtrl.h:238
Class representing an embedded control within a document.
Definition occtrl.h:78
TOcControlEvent * pEvents
Definition occtrl.h:153
TEventList * GetEventList() const
Definition occtrl.cpp:397
void SetEventDispatch()
Definition occtrl.cpp:419
owl::TString & GetUserName()
Definition occtrl.cpp:548
void SetTop(long Value)
Definition occtrl.cpp:594
bool Init(TOcInitInfo *initInfo, owl::TRect pos)
Definition occtrl.cpp:265
HRESULT QueryObject(const IID &iid, void **iface)
Callback from TUnknown's implementation of QueryInterface.
Definition occtrl.cpp:518
HRESULT _IFUNC TransformCoords(owl::TPointL *lpptlHimetric, owl::TPointF *lpptfContainer, DWORD flags)
Definition occtrl.cpp:665
bool InitObj(TOcInitInfo *initInfo)
Perform common ctor initialization.
Definition occtrl.cpp:274
TServedObject * pIExtended
Definition occtrl.h:152
bool pEventsOwnership
Definition occtrl.h:154
TEventList * EventList
Definition occtrl.h:156
IBControl * BCtrlI
Definition occtrl.h:150
bool FillEventList()
Retrieves a list of events generated by this control.
Definition occtrl.cpp:373
void SetLeft(long Value)
Definition occtrl.cpp:572
ITypeInfo * GetEventTypeInfo()
Retrieves the ITypeInfo the 'default source' event object of this control.
Definition occtrl.cpp:360
HRESULT _IFUNC OnPropertyRequestEdit(DISPID dispid)
Definition occtrl.cpp:650
IDispatch * GetCtlDispatch()
Retrieves the primary IDispatch of the control.
Definition occtrl.cpp:407
owl::TString * pUserName
Definition occtrl.h:151
HRESULT _IFUNC OnPropertyChanged(DISPID dispid)
Definition occtrl.cpp:635
IDispatch * GetParent()
Retrieves the extended IDispatch (exposing extended properties).
Definition occtrl.cpp:557
friend TOcControlEvent
Definition occtrl.h:194
TOcView * GetActiveControlView()
Definition occtrl.cpp:491
IBControl * GetBControlI()
Definition occtrl.h:93
void SetUserName(owl::TString &name)
Extended property support.
Definition occtrl.cpp:539
HRESULT _IFUNC OnControlFocus(BOOL fGotFocus)
Event support.
Definition occtrl.cpp:616
TOcControl(TOcDocument &document, int id=0, TOcControlEvent *pEv=nullptr)
Construct a new part with a given temp id.
Definition occtrl.cpp:226
TUnknown * CreateAutoObject(const void *obj, TAutoClass &clsInfo)
Definition occtrl.cpp:500
void SetHeight(long Value)
Definition occtrl.cpp:605
void SetWidth(long Value)
Definition occtrl.cpp:583
OC Document class, holds parts & is a owner of views.
Definition ocdoc.h:43
TOcPartCollection & GetParts()
Definition ocdoc.h:51
TOcView * GetActiveView()
Definition ocdoc.h:76
TOcInitHow How
Definition ocobject.h:120
IStorage * Storage
Definition ocobject.h:124
TOcInitWhere Where
Definition ocobject.h:121
owl::TString GetName()
Definition ocpart.h:91
virtual bool Init(TOcInitInfo *initInfo, owl::TRect pos)
Perform common ctor initialization.
Definition ocpart.cpp:128
void UpdateRect()
Set part to the new rect given in logical units.
Definition ocpart.cpp:625
TOcDocument & OcDocument
The OC document we are imbeded in.
Definition ocpart.h:154
owl::uint16 Flags
Is this part Selected/Visible/Active/ALink?
Definition ocpart.h:162
TOcStorage * Storage
The storage we are in.
Definition ocpart.h:155
virtual bool InitObj(TOcInitInfo *initInfo)
Definition ocpart.cpp:154
IBLinkable * BLPartI
Definition ocpart.h:152
HRESULT QueryObject(const IID &iid, void **iface)
Callback from TUnknown's implementation of QueryInterface.
Definition ocpart.cpp:219
bool Activate(bool activate)
Definition ocpart.cpp:642
IBPart * BPartI
Definition ocpart.h:151
IUnknown * BPart
Our corresponding helper object & interfaces.
Definition ocpart.h:150
owl::TSize Size
Definition ocpart.h:159
void SetPos(const owl::TPoint &pos)
Set part to the new position given in logical units.
Definition ocpart.cpp:605
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
owl::TPoint Pos
Definition ocpart.h:158
void Rename()
Rename the embed site for linking.
Definition ocpart.cpp:277
HRESULT _IFUNC QueryInterface(const GUID &iid, void **iface)
Definition ocpart.h:120
IStorage * GetIStorage()
Definition ocstorag.cpp:383
The TOcView partner is a container (viewer) of a given (server/client) document.
Definition ocview.h:136
TOcDocument & OcDocument
Our OC document object.
Definition ocview.h:270
friend class _ICLASS TOcPart
Definition ocview.h:293
HRESULT QueryObject(const IID &iid, void **iface)
Callback from TUnknown's implementation of QueryInterface.
Definition ocview.cpp:190
TOcPart * GetActivePart()
Definition ocview.h:178
bool ActivatePart(TOcPart *part)
Activate a given part.
Definition ocview.cpp:444
HRESULT _IFUNC QueryInterface(const GUID &iid, void **iface)
Definition ocview.h:199
TOcView(TOcDocument &doc, TOcContainerHost *ch, TOcServerHost *sh, owl::TRegList *regList=0, IUnknown *outer=0)
New, interface constructor.
Definition ocview.cpp:85
TOcApp & OcApp
Our OC application object.
Definition ocview.h:269
owl::TResult ForwardEvent(int eventId, const void *param)
Definition ocview.h:744
The TOcxView partner is a container (viewer) of a given (server/client) document.
Definition occtrl.h:273
void SetAmbUserMode(bool Mode)
Definition occtrl.cpp:881
HRESULT QueryObject(const IID &iid, void **iface)
Definition occtrl.cpp:740
void SetUserMode(bool Mode)
Definition occtrl.cpp:794
bool GetUIDead()
Definition occtrl.cpp:977
bool GetUserMode()
Definition occtrl.cpp:970
void SetAmbDisplayName(owl::TString &Name)
Definition occtrl.cpp:917
TOcxView(TOcDocument &doc, owl::TRegList *regList=0, IUnknown *outer=0)
TOcxView Class Implementation.
Definition occtrl.cpp:706
short GetTextAlign()
Definition occtrl.cpp:963
long GetAmbientValue(long AmbientMsg, long Default)
Definition occtrl.cpp:1064
void SetAmbTextAlign(short Align)
Definition occtrl.cpp:875
void SetAmbMessageReflect(bool MsgRef)
Definition occtrl.cpp:869
void SetDisplayAsDefault(bool Disp)
Definition occtrl.cpp:824
void SetMessageReflect(bool MsgRef)
Definition occtrl.cpp:782
void SetScaleUnits(owl::TString &ScaleUnits)
Definition occtrl.cpp:837
void SetAmbShowGrabHandles(bool Handles)
Definition occtrl.cpp:893
bool GetShowGrabHandles()
Definition occtrl.cpp:984
bool GetSupportsMnemonics()
Definition occtrl.cpp:1005
long GetBackColor()
Definition occtrl.cpp:935
void SetBackColor(long Color)
Definition occtrl.cpp:764
void SetAmbForeColor(long Color)
Definition occtrl.cpp:857
TServedObject * pIAmbients
Definition occtrl.h:332
void SetAmbFont(IDispatch *pFontDisp)
Definition occtrl.cpp:929
long GetForeColor()
Definition occtrl.cpp:942
void AmbientChanged(DISPID dispid)
Definition occtrl.cpp:1039
void SetShowGrabHandles(bool Handles)
Definition occtrl.cpp:806
void SetLocaleID(long LocaleId)
Definition occtrl.cpp:776
long GetLocaleID()
Definition occtrl.cpp:949
owl::TString & GetDisplayName()
Definition occtrl.cpp:1012
bool GetMessageReflect()
Definition occtrl.cpp:956
void SetAmbShowHatching(bool Hatch)
Definition occtrl.cpp:905
bool GetShowHatching()
Definition occtrl.cpp:991
void SetAmbSupportsMnemonics(bool Mnem)
Definition occtrl.cpp:899
void SetAmbLocaleID(long LocaleId)
Definition occtrl.cpp:863
void SetAmbUIDead(bool Dead)
Definition occtrl.cpp:887
void SetAmbScaleUnits(owl::TString &ScaleUnits)
Definition occtrl.cpp:923
void SetAmbBackColor(long Color)
Definition occtrl.cpp:851
void SetSupportsMnemonics(bool Mnem)
Definition occtrl.cpp:812
owl::TString & GetScaleUnits()
Definition occtrl.cpp:1020
void SetDisplayName(owl::TString &Name)
Definition occtrl.cpp:830
IDispatch * GetFont()
Definition occtrl.cpp:1028
void SetFont(IDispatch *pFontDisp)
Definition occtrl.cpp:844
void SetAmbDisplayAsDefault(bool Disp)
Definition occtrl.cpp:911
bool GetDisplayAsDefault()
Definition occtrl.cpp:998
owl::TString * pBlankString
Definition occtrl.h:333
void SetTextAlign(short Align)
Definition occtrl.cpp:788
void SetShowHatching(bool Hatch)
Definition occtrl.cpp:818
void SetForeColor(long Color)
Definition occtrl.cpp:770
void SetUIDead(bool Dead)
Definition occtrl.cpp:800
OLE object exposed for automated access of internal object.
Definition autodefs.h:972
owl::ulong _IFUNC AddRef()
Definition autodefs.h:993
HRESULT QueryObject(const IID &iid, void **iface)
Definition autosrv.cpp:84
owl::ulong _IFUNC Release()
Definition autodefs.h:994
TAutoClass * Class
class of which object is an instance
Definition autodefs.h:984
Standard implementation of a controlling IUnknown for an object, to be inherited with other COM inter...
Definition oleutil.h:264
IUnknown * GetOuter()
Definition oleutil.h:269
@ xInternalPartError
Definition except.h:105
static void Check(HRESULT stat, TError err, LPCTSTR msg=0)
Definition ocstorag.cpp:58
TPointF is similar to TPoint, but uses floating variables rather than integers.
Definition geometry.h:181
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TPointL is similar to TPoint, but uses long rather than int variables.
Definition geometry.h:132
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
static auto GetClassesRoot() -> TRegKey &
Special predefined root key used by shell and OLE applications (HKEY_CLASSES_ROOT).
Definition registry.cpp:32
A registration parameter table, composed of a list of TRegItems.
Definition registry.h:531
The tagSIZE struct is defined as.
Definition geometry.h:234
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Definition string.h:67
char TCHAR
Definition cygwin.h:42
#define _tcscpy
Definition cygwin.h:79
#define _MAX_PATH
Definition cygwin.h:97
Include for OC, gets common headers when precompiled headers are enabled.
Object Component Framework (COM encapsulation).
Definition appdesc.h:22
MouseDown
Definition occtrl.cpp:181
HRESULT(PASCAL *) REGPROC()
Definition occtrl.cpp:1258
@ iwNew
Definition ocobject.h:104
EXPOSE_PROPRW_ID(DISPID_AMBIENT_BACKCOLOR, BackColor, TAutoLong, _T("!BackColor"), _T("@BackColor_"), 0) EXPOSE_PROPRW_ID(DISPID_AMBIENT_FORECOLOR
RAYK - help contexts?
TextAlign
Definition occtrl.cpp:127
@ ihLink
Definition ocobject.h:94
MouseMove
Definition occtrl.cpp:191
Height
Definition occtrl.cpp:160
DisplayAsDefault
Definition occtrl.cpp:133
const owl::uint16 tfNormal
Definition autodefs.h:397
DisplayName
Definition occtrl.cpp:135
void * ObjectPtr
Definition autodefs.h:84
bool HRSucceeded(HRESULT hr)
Definition defs.h:131
CustomEvent
Definition occtrl.cpp:210
Click
Definition occtrl.cpp:179
@ asAnyCommand
any command: method, property get/set, build
Definition autodefs.h:298
HRESULT OcRegisterControl(TCHAR *ocxPath)
Definition occtrl.cpp:1286
KeyUp
Definition occtrl.cpp:199
END_AUTOCLASS(TOcxView, tfNormal, _T("TOcxView"), _T("@TOcxView_"), 0) EXPOSE_PROPRO_ID(0x80010008L
Cancel
Definition occtrl.cpp:154
_T("!ForeColor")
UserMode
Definition occtrl.cpp:129
const GUID & iid
Definition appdesc.h:328
ShowGrabHandles
Definition occtrl.cpp:131
Parent
Definition occtrl.cpp:152
TOcPartCollection::Iterator TOcPartCollectionIter
Definition ocpart.h:195
const BCID cidBOleControl
Definition ocbocole.h:125
HRESULT OcUnregisterControl(CLSID ClassId)
Definition occtrl.cpp:1299
EXPOSE_METHOD_ID(DISPID_DBLCLICK, DblClick, TAutoLong, _T("!DblClick"), _T("@DblClick_"), 0) EXPOSE_METHOD_ID(DISPID_MOUSEDOWN
TAppDescriptor * GetAppDescriptor()
Definition appdesc.h:203
ForeColor
Definition occtrl.cpp:125
unsigned long uint32
Definition number.h:34
unsigned int uint
Definition number.h:25
Definition of TOcApp application connection class.
#define MAP_LOGHIM_TO_PIX(hiMetric, pixelsPerInch)
Definition ocbocole.h:182
#define MAP_PIX_TO_LOGHIM(pixel, pixelsPerInch)
Definition ocbocole.h:176
Definition of TOcControl class - Proxy object representing a control in.
interface _ICLASS ITypeInfo
Definition occtrl.h:27
Definition of TOcDocument Class.
#define _OCFFUNC(p)
Definition defs.h:47
#define HR_OK
Definition defs.h:74
#define HR_NOERROR
Definition defs.h:73
#define HR_FALSE
Definition defs.h:75
#define HR_FAIL
Definition defs.h:83
Definition of TOcStorage & TOcStream classes.
Definition of Compound Document TOcView Class.
#define OC_AMBIENT_GETLOCALEID
Definition ocview.h:827
#define OC_AMBIENT_GETFONT
Definition ocview.h:831
#define OC_AMBIENT_GETBACKCOLOR
Definition ocview.h:818
#define OC_AMBIENT_SETBACKCOLOR
Definition ocview.h:835
#define OC_AMBIENT_SETFONT
Definition ocview.h:848
#define OC_AMBIENT_SETSUPPORTSMNEMONICS
Definition ocview.h:839
#define OC_AMBIENT_SETFORECOLOR
Definition ocview.h:836
#define OC_AMBIENT_SETUSERMODE
Definition ocview.h:845
#define OC_CTRLEVENT_DBLCLICK
Definition ocview.h:807
#define OC_CTRLEVENT_MOUSEDOWN
Definition ocview.h:808
#define OC_AMBIENT_SETSHOWHATCHING
Definition ocview.h:840
#define OC_AMBIENT_GETUIDEAD
Definition ocview.h:821
#define OC_CTRLEVENT_PROPERTYREQUESTEDIT
Definition ocview.h:805
#define OC_AMBIENT_SETDISPLAYNAME
Definition ocview.h:846
#define OC_AMBIENT_SETMESSAGEREFLECT
Definition ocview.h:843
#define OC_AMBIENT_GETTEXTALIGN
Definition ocview.h:825
#define OC_AMBIENT_SETSCALEUNITS
Definition ocview.h:847
#define OC_CTRLEVENT_FOCUS
Definition ocview.h:803
#define OC_AMBIENT_SETDISPLAYASDEFAULT
Definition ocview.h:841
#define OC_AMBIENT_SETSHOWGRABHANDLES
Definition ocview.h:837
#define OC_AMBIENT_GETSHOWHATCHING
Definition ocview.h:823
#define OC_AMBIENT_GETSHOWGRABHANDLES
Definition ocview.h:820
#define OC_CTRLEVENT_MOUSEMOVE
Definition ocview.h:809
#define OC_AMBIENT_SETLOCALEID
Definition ocview.h:844
#define OC_AMBIENT_SETUIDEAD
Definition ocview.h:838
#define OC_AMBIENT_GETMESSAGEREFLECT
Definition ocview.h:826
#define OC_AMBIENT_GETUSERMODE
Definition ocview.h:828
#define OC_CTRLEVENT_KEYDOWN
Definition ocview.h:811
#define OC_CTRLEVENT_MOUSEUP
Definition ocview.h:810
#define OC_CTRLEVENT_CLICK
Definition ocview.h:806
#define OC_AMBIENT_SETTEXTALIGN
Definition ocview.h:842
#define OC_AMBIENT_GETDISPLAYNAME
Definition ocview.h:829
#define OC_CTRLEVENT_KEYUP
Definition ocview.h:812
#define OC_AMBIENT_GETDISPLAYASDEFAULT
Definition ocview.h:824
#define OC_CTRLEVENT_CUSTOMEVENT
Definition ocview.h:814
#define OC_VIEWTRANSFORMCOORDS
Definition ocview.h:802
#define OC_AMBIENT_GETSCALEUNITS
Definition ocview.h:830
#define OC_AMBIENT_GETSUPPORTSMNEMONICS
Definition ocview.h:822
#define OC_CTRLEVENT_PROPERTYCHANGE
Definition ocview.h:804
#define OC_AMBIENT_GETFORECOLOR
Definition ocview.h:819
#define OC_CTRLEVENT_ERROREVENT
Definition ocview.h:813
#define _IFUNC
Definition oleutil.h:28
#define OleStr(s)
Definition string.h:128
Symbol table element.
Definition autodefs.h:404
bool TestFlag(owl::uint16 mask) const
Definition autodefs.h:1507
Base struct for all control event messages.
Definition occtrl.h:366