CBModelessDialog.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #if !defined(CBMODELESSDIALOG_H)
11 #define CBMODELESSDIALOG_H
12 
13 // CBModelessDialog.h : header file
14 //
15 
16 // Bentley includes
17 #include <Mstn\MdlApi\mdl.h>
18 #include <Mstn\MicroStation.r.h>
20 
21 // Disable warning messages 4266 - no override available for virtual member function from base 'type'; function is hidden
22 #pragma warning( disable : 4266 )
23 
24 class CBModelessFrame;
25 
27 (
28 DialogMessage *dmP
29 );
30 
32 // CBModelessDialog dialog
33 //
34 // CBModelessDialog is the base class for any MicroStation modeless dialog. It should not
35 // be used as the base class for application dialogs. As base classes, use:
36 //
37 // CBFramedModelessDialog - any MicroStation modeless dialog outside of Tool Settings which is not dockable
38 // CBToolSettingsDialog - any MicroStation dialog used within the Tool Settings window
39 // CBDockableDialog - any MicroStation dialog which is dockable
40 // CBHostedDialog - any MicroStation dialog which has a combination of MFC controls and MDL dialog items
41 //
42 
43 
44 class CBModelessDialog : public CDialog
45 {
46 private:
47  UINT m_signature;
48 
49 protected:
51 
52  MSWindowP m_pParent;
54  UINT m_nID;
55 
56 // Construction
57 public:
58  HHOOK m_hHook;
59 
61  (
62  UINT nID,
63  CWnd *pParent = NULL
64  );
65 
66  virtual ~CBModelessDialog();
67 
68  virtual StatusInt Create();
69 
70  virtual void OnEscapeKey(LPMSG);
71 
72  virtual void OnFunctionKey(LPMSG);
73 
74  // Called by the secondary dialog hook
75  virtual BOOL OnDialogResize
76  (
77  DialogMessage *dmP
78  );
79  virtual BOOL Update();
80  virtual BOOL OnDialogUpdate
81  (
82  DialogMessage *dmP
83  );
84  virtual BOOL OnDialogFocusIn
85  (
86  DialogMessage *dmP
87  );
88  virtual BOOL OnDialogFocusOut
89  (
90  DialogMessage *dmP
91  );
92  virtual BOOL OnDialogDestroy
93  (
94  DialogMessage *dmP
95  );
96  virtual BOOL DialogHook
97  (
98  DialogMessage *dmP
99  );
100 
101  /* this is used to get the current winproc and set it later - Japanese IME issue */
102  void SetMsgProcHook (bool bSet);
103  inline HHOOK GetMsgProcHook () { return m_hHook; }
104 
105 
107  {
108  return m_hParent;
109  }
110 
111  MSWindowP GetParentWindow()
112  {
113  return m_pParent;
114  }
115 
116  UINT GetDialogId()
117  {
118  return m_nID;
119  }
120 
122  {
123  return m_signature;
124  }
125 
127  {
128  return m_pModelessFrame;
129  }
130 
131  void SetHelpInfo (UINT helpInfo);
132 
133 // Dialog Data
134  //{{AFX_DATA(CBModelessDialog)
135  // NOTE: the ClassWizard will add data members here
136  //}}AFX_DATA
137 
138 
139 // Overrides
140  // ClassWizard generated virtual function overrides
141  //{{AFX_VIRTUAL(CBModelessDialog)
142  protected:
143  //}}AFX_VIRTUAL
144 
145 // Implementation
146 protected:
147 
148  // Generated message map functions
149  //{{AFX_MSG(CBModelessDialog)
150  afx_msg void OnDestroy();
151  virtual BOOL OnInitDialog();
152  afx_msg int OnMouseActivate( CWnd* pDesktopWnd, UINT nHitTest, UINT message );
153  afx_msg void OnMouseMove( UINT nFlags, CPoint point );
154  afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
155  afx_msg void OnLButtonUp( UINT nFlags, CPoint point );
156  afx_msg void OnRButtonDown( UINT nFlags, CPoint point );
157  afx_msg void OnRButtonUp( UINT nFlags, CPoint point );
158  afx_msg void OnMButtonDown( UINT nFlags, CPoint point );
159  afx_msg void OnMButtonUp( UINT nFlags, CPoint point );
160  //}}AFX_MSG
161  DECLARE_MESSAGE_MAP()
162 };
163 
164 //{{AFX_INSERT_LOCATION}}
165 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
166 
167 #endif // !defined(CBMODELESSDIALOG_H)
CBModelessFrame * m_pModelessFrame
Definition: CBModelessDialog.h:50
virtual BOOL DialogHook(DialogMessage *dmP)
virtual BOOL OnDialogResize(DialogMessage *dmP)
afx_msg void OnDestroy()
HANDLE HWND
Definition: msnativewindow.h:27
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
afx_msg void OnMButtonDown(UINT nFlags, CPoint point)
virtual BOOL OnDialogFocusOut(DialogMessage *dmP)
MSWindowP GetParentWindow()
Definition: CBModelessDialog.h:111
CBModelessFrame * GetModelessFrame()
Definition: CBModelessDialog.h:126
virtual StatusInt Create()
void SetMsgProcHook(bool bSet)
afx_msg void OnRButtonUp(UINT nFlags, CPoint point)
void CBModelessDialog_SecondaryDialogHook(DialogMessage *dmP)
afx_msg void OnRButtonDown(UINT nFlags, CPoint point)
virtual BOOL Update()
afx_msg int OnMouseActivate(CWnd *pDesktopWnd, UINT nHitTest, UINT message)
CBModelessDialog(UINT nID, CWnd *pParent=NULL)
#define NULL
Definition: Bentley.h:157
UINT m_nID
Definition: CBModelessDialog.h:54
void SetHelpInfo(UINT helpInfo)
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
virtual BOOL OnDialogUpdate(DialogMessage *dmP)
MSWindowP m_pParent
Definition: CBModelessDialog.h:52
virtual void OnEscapeKey(LPMSG)
virtual ~CBModelessDialog()
Definition: CBModelessDialog.h:44
HWND GetParentHandle()
Definition: CBModelessDialog.h:106
UINT GetDialogId()
Definition: CBModelessDialog.h:116
int StatusInt
Definition: Bentley.h:222
virtual BOOL OnDialogDestroy(DialogMessage *dmP)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
Dialog Message Structure.
Definition: dlogitem.h:884
afx_msg void OnMButtonUp(UINT nFlags, CPoint point)
HWND m_hParent
Definition: CBModelessDialog.h:53
HHOOK m_hHook
Definition: CBModelessDialog.h:58
virtual BOOL OnInitDialog()
UINT GetSignature()
Definition: CBModelessDialog.h:121
virtual void OnFunctionKey(LPMSG)
Definition: CBModelessFrame.h:32
virtual BOOL OnDialogFocusIn(DialogMessage *dmP)
HHOOK GetMsgProcHook()
Definition: CBModelessDialog.h:103

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.