Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
SimpleLed.cpp
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#include "Stroika/Frameworks/StroikaPreComp.h"
5
6#include <stdlib.h>
7#include <string.h>
8
9#include "SimpleLed.h"
10
11using namespace Stroika::Foundation;
12using namespace Stroika::Frameworks;
13using namespace Stroika::Frameworks::Led;
14
15/*
16 ********************************************************************************
17 ***************************** SimpleLedWordProcessor ***************************
18 ********************************************************************************
19 */
20SimpleLedWordProcessor::SimpleLedWordProcessor ()
21 : inherited ()
22 , fCommandHandler (kMaxUndoLevels)
23 , fTextStore ()
24{
25#if !qCannotSafelyCallLotsOfComplexVirtMethodCallsInsideCTORDTOR
26 SpecifyTextStore (&fTextStore);
27 SetCommandHandler (&fCommandHandler);
28#endif
29}
30
31SimpleLedWordProcessor::~SimpleLedWordProcessor ()
32{
33#if !qCannotSafelyCallLotsOfComplexVirtMethodCallsInsideCTORDTOR
34 SetCommandHandler (NULL);
35 SpecifyTextStore (NULL);
36#endif
37}
38
39#if qCannotSafelyCallLotsOfComplexVirtMethodCallsInsideCTORDTOR
40#if defined(_MFC_VER)
41void SimpleLedWordProcessor::OnInitialUpdate ()
42{
43 SpecifyTextStore (&fTextStore);
44 SetCommandHandler (&fCommandHandler);
45 inherited::OnInitialUpdate ();
46}
47
48void SimpleLedWordProcessor::PostNcDestroy ()
49{
50 SetCommandHandler (NULL);
51 SpecifyTextStore (NULL);
52 inherited::PostNcDestroy ();
53}
54#elif defined(_WIN32)
55LRESULT SimpleLedWordProcessor::OnCreate_Msg (LPCREATESTRUCT createStruct)
56{
57 SpecifyTextStore (&fTextStore);
58 SetCommandHandler (&fCommandHandler);
59 return inherited::OnCreate_Msg (createStruct);
60}
61
62void SimpleLedWordProcessor::OnNCDestroy_Msg ()
63{
64 SetCommandHandler (NULL);
65 SpecifyTextStore (NULL);
66 inherited::OnNCDestroy_Msg ();
67}
68#endif
69#endif
70
71#if defined(_MFC_VER)
72IMPLEMENT_DYNCREATE (SimpleLedWordProcessor, CView)
73BEGIN_MESSAGE_MAP (SimpleLedWordProcessor, SimpleLedWordProcessor::inherited)
74END_MESSAGE_MAP ()
75#endif
76
77/*
78 ********************************************************************************
79 ******************************** SimpleLedLineEditor ***************************
80 ********************************************************************************
81 */
82SimpleLedLineEditor::SimpleLedLineEditor ()
83 : inherited ()
84 , fCommandHandler (kMaxUndoLevels)
85 , fTextStore ()
86{
87#if !qCannotSafelyCallLotsOfComplexVirtMethodCallsInsideCTORDTOR
88 SpecifyTextStore (&fTextStore);
89 SetCommandHandler (&fCommandHandler);
90 SetScrollBarType (h, eScrollBarAlways);
91 SetScrollBarType (v, eScrollBarAlways);
92#endif
93}
94
95SimpleLedLineEditor::~SimpleLedLineEditor ()
96{
97#if !qCannotSafelyCallLotsOfComplexVirtMethodCallsInsideCTORDTOR
98 SpecifyTextStore (NULL);
99#endif
100}
101
102#if qCannotSafelyCallLotsOfComplexVirtMethodCallsInsideCTORDTOR
103#if defined(_MFC_VER)
104void SimpleLedLineEditor::OnInitialUpdate ()
105{
106 SpecifyTextStore (&fTextStore);
107 SetCommandHandler (&fCommandHandler);
108 inherited::OnInitialUpdate ();
109}
110
111void SimpleLedLineEditor::PostNcDestroy ()
112{
113 SetCommandHandler (NULL);
114 SpecifyTextStore (NULL);
115 inherited::PostNcDestroy ();
116}
117#elif defined(_WIN32)
118LRESULT SimpleLedLineEditor::OnCreate_Msg (LPCREATESTRUCT createStruct)
119{
120 SpecifyTextStore (&fTextStore);
121 SetCommandHandler (&fCommandHandler);
122 return inherited::OnCreate_Msg (createStruct);
123}
124
125void SimpleLedLineEditor::OnNCDestroy_Msg ()
126{
127 SetCommandHandler (NULL);
128 SpecifyTextStore (NULL);
129 inherited::OnNCDestroy_Msg ();
130}
131#endif
132#endif
133
134#if defined(_MFC_VER)
135IMPLEMENT_DYNCREATE (SimpleLedLineEditor, CView)
136BEGIN_MESSAGE_MAP (SimpleLedLineEditor, SimpleLedLineEditor::inherited)
137END_MESSAGE_MAP ()
138#endif
139
140/*
141 ********************************************************************************
142 ********************************* LedDialogText ********************************
143 ********************************************************************************
144 */
145
146LedDialogText::LedDialogText ()
147 : inherited ()
148{
149}
150
151#if qStroika_Foundation_Common_Platform_Windows && defined(_MFC_VER)
152void LedDialogText::PostNcDestroy ()
153{
154 // Don't auto-delete ourselves!
155 CWnd::PostNcDestroy ();
156}
157int LedDialogText::OnMouseActivate (CWnd* pDesktopWnd, UINT nHitTest, UINT message)
158{
159 // Don't do CView::OnMouseActiveate() cuz that assumes our parent is a frame window,
160 // and tries to make us the current view in the document...
161 int nResult = CWnd::OnMouseActivate (pDesktopWnd, nHitTest, message);
162 return nResult;
163}
164#endif
165
166#if qStroika_Foundation_Common_Platform_Windows && defined(_MFC_VER)
167IMPLEMENT_DYNCREATE (LedDialogText, CView)
168BEGIN_MESSAGE_MAP (LedDialogText, LedDialogText::inherited)
169ON_WM_MOUSEACTIVATE ()
170END_MESSAGE_MAP ()
171#endif