Stroika Library 3.0d20
 
Loading...
Searching...
No Matches
LedItInPlaceFrame.cpp
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5#include "Stroika/Foundation/StroikaPreComp.h"
6
7#if defined(WIN32)
8#include <afxwin.h>
9#endif
10
11#include "LedItInPlaceFrame.h"
12#include "LedItResources.h"
13
14using namespace Stroika::Foundation;
15using namespace Stroika::Frameworks::Led;
16
17/*
18 ********************************************************************************
19 ******************************* LedItInPlaceFrame ******************************
20 ********************************************************************************
21 */
22IMPLEMENT_DYNCREATE (LedItInPlaceFrame, COleIPFrameWnd)
23
24BEGIN_MESSAGE_MAP (LedItInPlaceFrame, COleIPFrameWnd)
25ON_WM_CREATE ()
26ON_COMMAND (ID_HELP_FINDER, OnHelpFinder)
27ON_COMMAND (ID_HELP, OnHelp)
28ON_COMMAND (ID_DEFAULT_HELP, OnHelpFinder)
29ON_COMMAND (ID_CONTEXT_HELP, OnContextHelp)
30END_MESSAGE_MAP ()
31
32LedItInPlaceFrame::LedItInPlaceFrame ()
33 : COleIPFrameWnd ()
34{
35}
36
37LedItInPlaceFrame::~LedItInPlaceFrame ()
38{
39}
40
41int LedItInPlaceFrame::OnCreate (LPCREATESTRUCT lpCreateStruct)
42{
43 if (COleIPFrameWnd::OnCreate (lpCreateStruct) == -1)
44 return -1;
45
46 // CResizeBar implements in-place resizing.
47 if (!m_wndResizeBar.Create (this)) {
48 TRACE0 ("Failed to create resize bar\n");
49 return -1; // fail to create
50 }
51
52 // By default, it is a good idea to register a drop-target that does
53 // nothing with your frame window. This prevents drops from
54 // "falling through" to a container that supports drag-drop.
55 m_dropTarget.Register (this);
56
57 return 0;
58}
59
60// OnCreateControlBars is called by the framework to create control bars on the
61// container application's windows. pWndFrame is the top level frame window of
62// the container and is always non-NULL. pWndDoc is the doc level frame window
63// and will be NULL when the container is an SDI application. A server
64// application can place MFC control bars on either window.
65BOOL LedItInPlaceFrame::OnCreateControlBars (CFrameWnd* pWndFrame, CFrameWnd* /*pWndDoc*/)
66{
67 // Set owner to this window, so messages are delivered to correct app
68 m_wndToolBar.SetOwner (this);
69
70 // Create toolbar on client's frame window
71 if (!m_wndToolBar.Create (pWndFrame) || !m_wndToolBar.LoadToolBar (IDR_SRVR_INPLACE)) {
72 TRACE0 ("Failed to create toolbar\n");
73 return FALSE;
74 }
75
76 // TODO: Remove this if you don't want tool tips or a resizeable toolbar
77 m_wndToolBar.SetBarStyle (m_wndToolBar.GetBarStyle () | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
78
79 // TODO: Delete these three lines if you don't want the toolbar to
80 // be dockable
81 m_wndToolBar.EnableDocking (CBRS_ALIGN_ANY);
82 pWndFrame->EnableDocking (CBRS_ALIGN_ANY);
83 pWndFrame->DockControlBar (&m_wndToolBar);
84
85 return TRUE;
86}
87
88BOOL LedItInPlaceFrame::PreCreateWindow (CREATESTRUCT& cs)
89{
90 // TODO: Modify the Window class or styles here by modifying
91 // the CREATESTRUCT cs
92
93 return COleIPFrameWnd::PreCreateWindow (cs);
94}
95
96#ifdef _DEBUG
97void LedItInPlaceFrame::AssertValid () const
98{
99 COleIPFrameWnd::AssertValid ();
100}
101
102void LedItInPlaceFrame::Dump (CDumpContext& dc) const
103{
104 COleIPFrameWnd::Dump (dc);
105}
106#endif //_DEBUG