Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / tools / leveldesign / georges_dll / base_dialog.h
blob65acc9f003164c593520e7f2a698649c15eb844f
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #if !defined(AFX_BASE_DIALOG_H__C9035AC0_2958_4540_9FFD_D1DD434CFF9F__INCLUDED_)
21 #define AFX_BASE_DIALOG_H__C9035AC0_2958_4540_9FFD_D1DD434CFF9F__INCLUDED_
23 #include "nel/misc/types_nl.h"
25 #if _MSC_VER > 1000
26 #pragma once
27 #endif // _MSC_VER > 1000
28 // base_dialog.h : header file
31 class CGeorgesEditView;
33 /////////////////////////////////////////////////////////////////////////////
34 // CBaseDialog dialog
36 class CBaseDialog;
38 class CDoomyControl : public CStatic
40 public:
41 CBaseDialog *Dlg;
42 uint Index;
43 void OnSetFocus( CWnd* pOldWnd );
44 DECLARE_MESSAGE_MAP()
47 class CBaseDialog : public CDialog
49 // Construction
50 public:
51 CBaseDialog(int accelResource); // standard constructor
53 // Dialog Data
54 //{{AFX_DATA(CBaseDialog)
55 enum { IDD = IDD_BASE_DIALOG };
56 // NOTE: the ClassWizard will add data members here
57 //}}AFX_DATA
59 CGeorgesEditView *View;
61 enum
63 MinViewWidth = 400,
64 MinViewHeight = 400,
65 StaticHeight = 15,
66 MaxWidgetWidth = 350,
67 BigEditHeight = 40,
70 enum
72 WidgetSpaceWidth = 20,
73 WidgetSpaceHeight = 15,
75 LabelSpaceHeight = 2,
77 EditHeight = 20,
79 ListHeight = 200,
81 ComboHeight = 25,
82 ComboDropDownHeight = 100,
84 ButtonHeight = 20,
86 SpinWidth = 13,
87 SpinHeight = 20,
89 BrowseWidth = 30,
90 BrowseHeight = 20,
92 ResetColorWidth = 40,
94 ColorHeight = 20,
95 IconHeight = 40,
98 void resizeWidgets (uint virtualWidth, uint evaluatedHeight);
100 void initWidget (CWnd &wnd);
102 void getFirstItemPos (RECT &rect);
103 void getNextPos (RECT &rect);
104 void getNextPosLabel (RECT &rect);
105 void getNextColumn (RECT &rect);
106 void getFirstColumn (RECT &rect);
107 void getNextSpinPos (RECT &rect);
108 void getNextBrowsePos (RECT &rect);
109 void getNextColorPos (RECT &rect);
111 void setComboSize (RECT &rect, uint width, uint height=ComboHeight);
112 void setComboSpinSize (RECT &rect);
113 void setComboBrowseSize (RECT &rect);
114 void adjusteComboSize (RECT &rect);
115 void setButtonSize (RECT &rect, uint width, uint height=ButtonHeight);
116 void setStaticSize (RECT &rect);
117 void setEditSize (RECT &rect, uint width, uint height=EditHeight);
118 void setColorSize (RECT &rect, uint width, uint height=ColorHeight);
119 void setBigEditSize (RECT &rect, uint width, uint height=BigEditHeight);
120 void setEditSpinSize (RECT &rect, uint width, uint height=EditHeight);
121 void setListSize (RECT &rect, uint width, uint height=ListHeight);
122 void setSpinSize (RECT &rect, uint width=SpinWidth, uint height=SpinHeight);
123 void setBrowseSize (RECT &rect, uint width=BrowseWidth, uint height=BrowseHeight);
124 void setResetColorSize (RECT &rect, uint width=ResetColorWidth, uint height=ColorHeight);
126 virtual void onFirstFocus ()=0;
127 virtual void onLastFocus ()=0;
129 void registerLastControl ();
130 void unRegisterLastControl ();
132 static void setEditTextMultiLine (CEdit &edit, const char *text);
134 virtual void onOpenSelected ();
135 virtual void setFocusLastWidget ();
137 virtual void OnOK ();
138 virtual void OnCancel ();
140 HACCEL Accelerator;
142 CDoomyControl DummyStatic0;
143 CDoomyControl DummyStatic1;
145 uint Width, SmallWidget, SmallWidgetNotLimited, AdjusteHeight;
147 // Overrides
148 // ClassWizard generated virtual function overrides
149 //{{AFX_VIRTUAL(CBaseDialog)
150 public:
151 virtual BOOL PreTranslateMessage(MSG* pMsg);
152 protected:
153 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
154 //}}AFX_VIRTUAL
156 // Implementation
157 protected:
159 // Generated message map functions
160 //{{AFX_MSG(CBaseDialog)
161 virtual BOOL OnInitDialog();
162 afx_msg void OnSize(UINT nType, int cx, int cy);
163 //}}AFX_MSG
164 DECLARE_MESSAGE_MAP()
167 //{{AFX_INSERT_LOCATION}}
168 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
170 #endif // !defined(AFX_BASE_DIALOG_H__C9035AC0_2958_4540_9FFD_D1DD434CFF9F__INCLUDED_)