- 论坛徽章:
- 0
|
C++圣战
- //
- // Insert an OLE object into the view
- //
- void TOleWindow::CmEditInsertObject()
- {
- 001 PRECONDITION(OcView);
- 002 TOcInitInfo initInfo(OcView);
- 003 if (OcApp->;Browse(initInfo)) {
- 004 TRect rect;
- 005 GetInsertPosition(rect);
- 006 SetSelection(new TOcPart(*GetOcDoc(), initInfo, rect));
- 007 OcView->;Rename();
- 008 InvalidatePart(invView);
- }
- }
- 程式1 OWL的TOleWindow支援OLE插入物件之成員函數
- //
- // Handle left double-click message
- //
- void TOleWindow::EvLButtonDblClk(uint modKeys, TPoint& point)
- {
- PRECONDITION(GetOcDoc() && GetOcView());
- TOleClientDC dc(*this);
- dc.DPtoLP(&point);
- TOcPart* p = GetOcDoc()->;GetParts().Locate(point);
- if (modKeys & MK_CONTROL) {
- if (p)
- p->;Open(true); // Ctrl key forces open editing
- }
- else {
- SetSelection(p);
- if (p && p == GetOcView()->;GetActivePart()) { // resync the active flag
- p->;Activate(false);
- }
- GetOcView()->;ActivatePart(p); // In-place activation
- }
- }
- 程式2 OWL的TOleWindow支援左鍵雙擊之成員函數
复制代码
雖然Borland及時的在OWL 2.5中加入了OLE的支援,無奈Microsoft隨後又在OLE中加入了許多其他的功能,因此讓OCF並無法完整的支援OLE所有的功能,Borland又無法不斷的延後Borland C/C++的推出,因此在1994年未,Borland終於推出了決戰的4.5版本。 |
|