source: dev/trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp@ 623

Last change on this file since 623 was 623, checked in by dai_9181, 16 years ago

Projectクラスをリファクタリング

File size: 214.2 KB
Line 
1#include "stdafx.h"
2
3#include "Common.h"
4
5#if defined(JPN)
6//日本語
7#include "rad_msg_jpn.h"
8#else
9//英語
10#include "rad_msg_eng.h"
11#endif
12
13void ShowControlAdvice(int Control){
14 if(Control==IDC_TOOL_MOUSE) SetStatusText("");
15
16#if defined(JPN)
17 //日本語
18 else if(Control==IDC_TOOL_BUTTON) SetStatusText("[ボタン] クリックすることができるボタンです。");
19 else if(Control==IDC_TOOL_CHECKBOX) SetStatusText("[チェック ボックス] ON/OFFの設定ができるボタンです。");
20 else if(Control==IDC_TOOL_COMBOBOX) SetStatusText("[コンボ ボックス] ドロップダウン リストの中から項目を選択することができます。");
21 else if(Control==IDC_TOOL_EDIT) SetStatusText("[エディット ボックス] ユーザーが文字列の編集操作を行うことができます。");
22 else if(Control==IDC_TOOL_GROUPBOX) SetStatusText("[グループ ボックス] 複数のコントロールを囲むことができます。");
23 else if(Control==IDC_TOOL_HSCROLLBAR) SetStatusText("[水平スクロールバー] 現在位置を表示、設定します。");
24 else if(Control==IDC_TOOL_IMAGEBOX) SetStatusText("[イメージ ボックス] 四角形やビットマップ、アイコンを表示します。");
25 else if(Control==IDC_TOOL_LISTBOX) SetStatusText("[リスト ボックス] 複数の項目を表示、選択できるリストです。");
26 else if(Control==IDC_TOOL_LISTVIEW) SetStatusText("[リスト ビュー] リスト ボックス内にアイコンやテキストを並べて表示するビューです。");
27 else if(Control==IDC_TOOL_PROGRESSBAR) SetStatusText("[プログレス バー] 進行状況を表示するバー。");
28 else if(Control==IDC_TOOL_RADIOBUTTON) SetStatusText("[ラジオ ボタン] 複数の項目から1つを選択するボタンです。");
29 else if(Control==IDC_TOOL_STATIC) SetStatusText("[スタティック テキスト] テキストを表示します。");
30 else if(Control==IDC_TOOL_TRACKBAR) SetStatusText("[トラック バー] 目盛が付いた移動バー。");
31 else if(Control==IDC_TOOL_TREEVIEW) SetStatusText("[ツリー ビュー] リストを階層構造で表示します。");
32 else if(Control==IDC_TOOL_UPDOWN) SetStatusText("[アップ ダウン コントロール] 上下のボタンで数値を設定します。");
33 else if(Control==IDC_TOOL_VSCROLLBAR) SetStatusText("[垂直スクロールバー] 現在位置を表示、設定します。");
34#else
35 //英語
36 else if(Control==IDC_TOOL_BUTTON) SetStatusText("[Button] The button which can be clicked");
37 else if(Control==IDC_TOOL_CHECKBOX) SetStatusText("[CheckBox] The button which can switch on/off");
38 else if(Control==IDC_TOOL_COMBOBOX) SetStatusText("[ComboBox] Choose an item from drop down lists");
39 else if(Control==IDC_TOOL_EDIT) SetStatusText("[EditBox] A user can edit a character sequence");
40 else if(Control==IDC_TOOL_GROUPBOX) SetStatusText("[GroupBox] Two or more control can be packed");
41 else if(Control==IDC_TOOL_HSCROLLBAR) SetStatusText("[Horizontal Scrollbar] The present position is displayed and setup");
42 else if(Control==IDC_TOOL_IMAGEBOX) SetStatusText("[ImageBox] A rectangle, a bitmap, and an icon are displayed.");
43 else if(Control==IDC_TOOL_LISTBOX) SetStatusText("[ListBox] The list which can display and choose two or more items");
44 else if(Control==IDC_TOOL_LISTVIEW) SetStatusText("[ListView] The view which displays an icon and a text in a list box");
45 else if(Control==IDC_TOOL_PROGRESSBAR) SetStatusText("[Progressbar] The bar which displays an advance situation");
46 else if(Control==IDC_TOOL_RADIOBUTTON) SetStatusText("[RadioButton] The button which chooses one from two or more items");
47 else if(Control==IDC_TOOL_STATIC) SetStatusText("[StaticText] Display the text messages");
48 else if(Control==IDC_TOOL_TRACKBAR) SetStatusText("[Trackbar] The bar to which the scale was attached");
49 else if(Control==IDC_TOOL_TREEVIEW) SetStatusText("[TreeView] Lists are displayed by the layered structure");
50 else if(Control==IDC_TOOL_UPDOWN) SetStatusText("[Up/Down Control] A numerical value is set up with a up/down button");
51 else if(Control==IDC_TOOL_VSCROLLBAR) SetStatusText("[Vertical Scrollbar] The present position is displayed and setup");
52#endif
53}
54
55char *GetControlName(DWORD id){
56 char *pTemp;
57 pTemp="";
58
59#if defined(JPN)
60 //日本語
61 if(id==IDC_TOOL_MOUSE) pTemp="選択";
62 else if(id==IDC_TOOL_STATIC) pTemp="スタティック テキスト";
63 else if(id==IDC_TOOL_EDIT) pTemp="エディット ボックス";
64 else if(id==IDC_TOOL_GROUPBOX) pTemp="グループ ボックス";
65 else if(id==IDC_TOOL_COMBOBOX) pTemp="コンボ ボックス";
66 else if(id==IDC_TOOL_LISTBOX) pTemp="リスト ボックス";
67 else if(id==IDC_TOOL_BUTTON) pTemp="ボタン";
68 else if(id==IDC_TOOL_CHECKBOX) pTemp="チェック ボックス";
69 else if(id==IDC_TOOL_RADIOBUTTON) pTemp="ラジオ ボタン";
70 else if(id==IDC_TOOL_LISTVIEW) pTemp="リスト ビュー";
71 else if(id==IDC_TOOL_TREEVIEW) pTemp="ツリー ビュー";
72 else if(id==IDC_TOOL_HSCROLLBAR) pTemp="水平スクロール バー";
73 else if(id==IDC_TOOL_VSCROLLBAR) pTemp="垂直スクロール バー";
74 else if(id==IDC_TOOL_UPDOWN) pTemp="アップ ダウン コントロール";
75 else if(id==IDC_TOOL_IMAGEBOX) pTemp="イメージ ボックス";
76 else if(id==IDC_TOOL_TRACKBAR) pTemp="トラック バー";
77 else if(id==IDC_TOOL_PROGRESSBAR) pTemp="プログレス バー";
78#else
79 //英語
80 if(id==IDC_TOOL_MOUSE) pTemp="Tool";
81 else if(id==IDC_TOOL_STATIC) pTemp="StaticText";
82 else if(id==IDC_TOOL_EDIT) pTemp="EditBox";
83 else if(id==IDC_TOOL_GROUPBOX) pTemp="GroupBox";
84 else if(id==IDC_TOOL_COMBOBOX) pTemp="ComboBox";
85 else if(id==IDC_TOOL_LISTBOX) pTemp="ListBox";
86 else if(id==IDC_TOOL_BUTTON) pTemp="Button";
87 else if(id==IDC_TOOL_CHECKBOX) pTemp="CheckBox";
88 else if(id==IDC_TOOL_RADIOBUTTON) pTemp="RadioButton";
89 else if(id==IDC_TOOL_LISTVIEW) pTemp="ListView";
90 else if(id==IDC_TOOL_TREEVIEW) pTemp="TreeView";
91 else if(id==IDC_TOOL_HSCROLLBAR) pTemp="Horizontal Scrollbar";
92 else if(id==IDC_TOOL_VSCROLLBAR) pTemp="Vertical Scrollbar";
93 else if(id==IDC_TOOL_UPDOWN) pTemp="Up/Down Control";
94 else if(id==IDC_TOOL_IMAGEBOX) pTemp="ImageBox";
95 else if(id==IDC_TOOL_TRACKBAR) pTemp="Trackbar";
96 else if(id==IDC_TOOL_PROGRESSBAR) pTemp="Progressbar";
97#endif
98
99 return pTemp;
100}
101BOOL CALLBACK RadToolButtonsProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
102 extern MDIINFO MdiInfo[MAX_WNDNUM];
103 int i,i2,WndNum;
104 HWND hParent;
105 HWND hToolBar;
106 RECT rect;
107 TBBUTTON CtrlToolBar[]={
108 {0,IDC_TOOL_MOUSE,TBSTATE_ENABLED|TBSTATE_WRAP|TBSTATE_CHECKED,TBSTYLE_CHECKGROUP,0,0},
109 {1,IDC_TOOL_STATIC,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
110 {2,IDC_TOOL_EDIT,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
111 {3,IDC_TOOL_GROUPBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
112 {BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0},
113 {4,IDC_TOOL_COMBOBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
114 {5,IDC_TOOL_LISTBOX,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
115 {6,IDC_TOOL_BUTTON,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
116 {7,IDC_TOOL_CHECKBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
117 {8,IDC_TOOL_RADIOBUTTON,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
118 {BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0},
119 {9,IDC_TOOL_LISTVIEW,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
120 {10,IDC_TOOL_TREEVIEW,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
121 {11,IDC_TOOL_HSCROLLBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
122 {12,IDC_TOOL_VSCROLLBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
123 {13,IDC_TOOL_UPDOWN,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
124 {BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0},
125 {14,IDC_TOOL_IMAGEBOX,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
126 {15,IDC_TOOL_TRACKBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
127 {16,IDC_TOOL_PROGRESSBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
128 };
129 TOOLTIPTEXT *pTipText;
130
131 switch(message){
132 case WM_INITDIALOG:
133 hToolBar=CreateToolbarEx(hwnd,WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|TBSTYLE_FLAT|TBSTYLE_TOOLTIPS,
134 NULL,
135 BMPNUM_RADTOOLBAR, /*ビットマップの個数*/
136 hResInst,(unsigned int)MAKEINTRESOURCE(IDR_CONTROL),CtrlToolBar,
137 (BMPNUM_RADTOOLBAR-1)+SEPNUM_RADTOOLBAR, /*アイテムの個数*/
138 0,0,16,15,sizeof(TBBUTTON));
139
140 //Windows9x系OSでの不具合を防ぐため
141 PostMessage(hwnd,WM_USER+120,0,0);
142
143 break;
144 case WM_USER+120:
145 GetClientRect(hwnd,&rect);
146 MoveWindow(hwnd,5,22,rect.right,rect.bottom,1);
147 MoveWindow(GetWindow(hwnd,GW_CHILD),0,0,rect.right,rect.bottom,1);
148 return 1;
149 case WM_COMMAND:
150 switch(LOWORD(wParam)){
151 case IDC_TOOL_MOUSE:
152 ShowControlAdvice(LOWORD(wParam));
153 hParent=GetParent(GetParent(hwnd));
154 BringWindowToTop(hParent);
155 i=GetWndNum(hParent);
156 i2=GetWndInfoNum(MdiInfo[i].path);
157 MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
158 DrawSelectingRect(MdiInfo[i].MdiRadInfo->hRad,i,i2,IDC_TOOL_MOUSE);
159 SetFocus(MdiInfo[i].MdiRadInfo->hRad);
160 return 1;
161 case IDC_TOOL_BUTTON:
162 case IDC_TOOL_CHECKBOX:
163 case IDC_TOOL_COMBOBOX:
164 case IDC_TOOL_EDIT:
165 case IDC_TOOL_GROUPBOX:
166 case IDC_TOOL_HSCROLLBAR:
167 case IDC_TOOL_IMAGEBOX:
168 case IDC_TOOL_LISTBOX:
169 case IDC_TOOL_LISTVIEW:
170 case IDC_TOOL_PROGRESSBAR:
171 case IDC_TOOL_RADIOBUTTON:
172 case IDC_TOOL_STATIC:
173 case IDC_TOOL_TRACKBAR:
174 case IDC_TOOL_TREEVIEW:
175 case IDC_TOOL_UPDOWN:
176 case IDC_TOOL_VSCROLLBAR:
177 ShowControlAdvice(LOWORD(wParam));
178 hParent=GetParent(GetParent(hwnd));
179 BringWindowToTop(hParent);
180 WndNum=GetWndNum(hParent);
181 MdiInfo[WndNum].MdiRadInfo->ButtonSelect=LOWORD(wParam);
182 InvalidateRect(MdiInfo[WndNum].MdiRadInfo->hRad,NULL,0);
183 return 1;
184 }
185 break;
186 case WM_NOTIFY:
187 pTipText=(TOOLTIPTEXT *)lParam;
188 if(pTipText->hdr.code==TTN_NEEDTEXT){
189 //ステータスバーに説明文を表示
190 ShowControlAdvice(pTipText->hdr.idFrom);
191
192 //コントロール名を取得し、ツールヒントとして表示する
193 pTipText->lpszText=GetControlName(pTipText->hdr.idFrom);
194 }
195 break;
196 }
197 return 0;
198}
199LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
200 extern MDIINFO MdiInfo[MAX_WNDNUM];
201 extern HFONT hStatusFont;
202 int i;
203 RECT rect;
204 SCROLLINFO ScrollInfo;
205 HDC hdc;
206 PAINTSTRUCT ps;
207 HFONT hOldFont;
208 POINT pos;
209
210 switch(message){
211 case WM_CREATE:
212 CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_CTRLBUTTONS),hwnd,(DLGPROC)RadToolButtonsProc);
213 return 0;
214 case WM_VSCROLL:
215 ScrollInfo.cbSize=sizeof(SCROLLINFO);
216 ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
217 GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
218 if(LOWORD(wParam)==SB_LINEUP) i=-20;
219 else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
220 else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
221 else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
222 else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
223 else i=0;
224 GetClientRect(hwnd,&rect);
225 i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos));
226 if(i!=0){
227 ScrollInfo.nPos+=i;
228 SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
229 ScrollWindow(hwnd,0,-i,NULL,NULL);
230 UpdateWindow(hwnd);
231 }
232 return 0;
233 case WM_SIZE:
234 GetClientRect(GetWindow(hwnd,GW_CHILD),&rect);
235 ScrollInfo.cbSize=sizeof(SCROLLINFO);
236 ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS;
237
238 //垂直スクロールバーの設定
239 GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
240 ScrollInfo.nMin=0;
241 ScrollInfo.nMax=rect.bottom;
242 ScrollInfo.nPage=HIWORD(lParam);
243 SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
244
245 i=ScrollInfo.nPos;
246 ScrollInfo.fMask=SIF_POS;
247 GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
248 if(i>ScrollInfo.nPos){
249 ScrollWindow(hwnd,0,i-ScrollInfo.nPos,NULL,NULL);
250 UpdateWindow(hwnd);
251 }
252 return 0;
253 case WM_PAINT:
254 hdc=BeginPaint(hwnd,&ps);
255 hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
256 SetBkMode(hdc,TRANSPARENT);
257 pos.x=30;
258 pos.y=3;
259 CursorPos_GlobalToLocal(hwnd,&pos.x,&pos.y);
260#if defined(JPN)
261 //日本語
262 TextOut(hdc,pos.x,pos.y,"- コントロール -",lstrlen("- コントロール -"));
263#else
264 //英語
265 TextOut(hdc,pos.x,pos.y,"- Control -",lstrlen("- Control -"));
266#endif
267 SelectObject(hdc,hOldFont);
268 EndPaint(hwnd,&ps);
269 return 0;
270 }
271 return DefWindowProc(hwnd,message,wParam,lParam);
272}
273
274
275/////////////////////////
276//ウィンドウ プロパティ
277
278void RadProperty_Window_Caption_StylingOrder(HWND hwnd,DWORD *style){
279 if((*style&WS_CAPTION)==WS_CAPTION){
280 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_SYSMENU),1);
281 if(!(*style&WS_CHILD)){
282 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1);
283 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1);
284 }
285 if(SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_GETCURSEL,0,0)==0){
286 if(*style&WS_THICKFRAME) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,2,0);
287 else SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,1,0);
288 }
289 }
290 else{
291 *style&=~(WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
292 SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_SETCHECK,BST_UNCHECKED,0);
293 SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
294 SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
295 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_SYSMENU),0);
296 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),0);
297 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),0);
298 }
299}
300void RadProperty_Window_Border_StylingOrder(HWND hwnd,DWORD *style){
301 if(*style&(WS_BORDER|WS_THICKFRAME)){
302 if(*style&(WS_POPUP|WS_CHILD)) EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1);
303 else{
304 *style|=WS_CAPTION;
305 SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0);
306 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0);
307 }
308 }
309 else{
310 *style&=~WS_CAPTION;
311 SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_UNCHECKED,0);
312 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0);
313 }
314 RadProperty_Window_Caption_StylingOrder(hwnd,style);
315}
316void RadProperty_Window_Window_StylingOrder(HWND hwnd,DWORD *style){
317 if(*style&WS_POPUP){
318 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1);
319 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1);
320 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1);
321 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),1);
322 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),1);
323 }
324 else if(*style&WS_CHILD){
325 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1);
326
327 *style&=~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_MINIMIZE|WS_MAXIMIZE);
328 SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
329 SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
330 SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_SETCHECK,BST_UNCHECKED,0);
331 SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_SETCHECK,BST_UNCHECKED,0);
332 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),0);
333 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),0);
334 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),0);
335 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),0);
336 }
337 else{
338 if(*style&WS_BORDER){
339 *style|=WS_CAPTION;
340 SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0);
341 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0);
342
343 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1);
344 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1);
345 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),1);
346 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),1);
347 }
348 }
349 RadProperty_Window_Border_StylingOrder(hwnd,style);
350}
351BOOL CALLBACK DlgRadProperty_Window_Rename(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
352 extern HANDLE hHeap;
353 extern HWND hClient,hOwner;
354 extern MDIINFO MdiInfo[MAX_WNDNUM];
355 int i,i3;
356 char temporary[MAX_PATH],temp2[MAX_PATH];
357 switch(message){
358 case WM_INITDIALOG:
359 {
360 SetPosCenter(hwnd);
361 i=GetWndNum(GetWindow(hClient,GW_CHILD));
362 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
363 sprintf(temporary,"h%s",pWindowInfo->GetName().c_str());
364 sprintf(temp2,"%sProc",pWindowInfo->GetName().c_str());
365 if( pWindowInfo->GetHandleName() == temporary &&
366 lstrcmp(temp2,pWindowInfo->CallBackName)==0){
367 SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_SETCHECK,BST_CHECKED,0);
368 SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
369 }
370 SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str());
371 SetDlgItemText(hwnd,IDC_WINDOWHANDLE,pWindowInfo->GetHandleName().c_str());
372 SetDlgItemText(hwnd,IDC_WINDOWPROC,pWindowInfo->CallBackName);
373 break;
374 }
375 case WM_COMMAND:
376 switch(LOWORD(wParam)){
377 case IDOK:
378 {
379 if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWNAME))==0){
380 //MsgBox "ウィンドウ識別名を入力して下さい。"
381 MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_WINDOWNAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
382 break;
383 }
384 if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWHANDLE))==0){
385 //MsgBox "ハンドル名を入力して下さい。"
386 MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_HANDLENAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
387 break;
388 }
389 if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWPROC))==0){
390 //MsgBox "プロシージャ名を入力して下さい。"
391 MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_PROCEDURENAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
392 break;
393 }
394
395 i=GetWndNum(GetWindow(hClient,GW_CHILD));
396 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
397
398 RAD_UNDOSTATE_NAME names,NoticeNames;
399
400 i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWNAME))+1;
401 GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,i3);
402 names.name = temporary;
403
404 i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWHANDLE))+1;
405 GetDlgItemText(hwnd,IDC_WINDOWHANDLE,temporary,i3);
406 names.HandleName = temporary;
407
408 i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWPROC))+1;
409 names.CallBackName=(char *)HeapAlloc(hHeap,0,i3);
410 GetDlgItemText(hwnd,IDC_WINDOWPROC,names.CallBackName,i3);
411
412 if( names.name == pWindowInfo->GetName() &&
413 pWindowInfo->GetHandleName() == names.HandleName &&
414 lstrcmp(names.CallBackName,pWindowInfo->CallBackName)==0){
415 HeapDefaultFree(names.CallBackName);
416 SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
417 return 1;
418 }
419
420 //MsgBox "これらのウィンドウ識別名を変更すると、ソースコード内の識別子は手動で変換する必要があります。変更しますか?"
421 if(IDCANCEL==MessageBox(hwnd,STRING_WINDOW_RENAME_CHECK,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) return 1;
422
423 //変更情報を更新
424 NoticeNames.name=pWindowInfo->GetName();
425 NoticeNames.HandleName=pWindowInfo->GetHandleName();
426 NoticeNames.CallBackName=pWindowInfo->CallBackName;
427 Rad_NoticeChanging(i,RAD_UNDO_NAME,SELECT_WINDOW,(DWORD)&NoticeNames);
428
429 pWindowInfo->SetName( names.name );
430 GlobalFree(MdiInfo[i].path);
431 MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,names.name.size()+1);
432 lstrcpy(MdiInfo[i].path,names.name.c_str());
433
434 pWindowInfo->SetHandleName( names.HandleName );
435
436 HeapDefaultFree(pWindowInfo->CallBackName);
437 pWindowInfo->CallBackName=names.CallBackName;
438
439 EndDialog(hwnd,1);
440 return 1;
441 }
442 case IDCANCEL:
443 EndDialog(hwnd,0);
444 return 1;
445 case IDC_WINDOWNAME:
446 if(HIWORD(wParam)==EN_CHANGE) SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
447 return 1;
448 case IDC_AUTOSET:
449 if(SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_GETCHECK,0,0)){
450 SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,1,0);
451 SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,1,0);
452 GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,MAX_PATH);
453 if(temporary[0]){
454 sprintf(temp2,"h%s",temporary);
455 SetDlgItemText(hwnd,IDC_WINDOWHANDLE,temp2);
456 sprintf(temp2,"%sProc",temporary);
457 SetDlgItemText(hwnd,IDC_WINDOWPROC,temp2);
458 }
459 else{
460 SetDlgItemText(hwnd,IDC_WINDOWHANDLE,"");
461 SetDlgItemText(hwnd,IDC_WINDOWPROC,"");
462 }
463 }
464 else{
465 SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,0,0);
466 SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,0,0);
467 }
468 return 1;
469 }
470 break;
471 }
472 return 0;
473}
474BOOL CALLBACK DlgRadProperty_Window_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
475 extern MDIINFO MdiInfo[MAX_WNDNUM];
476 int i;
477
478 switch(message){
479 case WM_INITDIALOG:
480 {
481 SetPosCenter(hwnd);
482 i=GetWndNum(GetWindow(hClient,GW_CHILD));
483 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
484 if(pWindowInfo->ExStyle&WS_EX_TOPMOST) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOPMOST,BM_SETCHECK,BST_CHECKED,0);
485 if(pWindowInfo->ExStyle&WS_EX_ACCEPTFILES) SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_SETCHECK,BST_CHECKED,0);
486 if(pWindowInfo->ExStyle&WS_EX_TRANSPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_SETCHECK,BST_CHECKED,0);
487 if(pWindowInfo->ExStyle&WS_EX_TOOLWINDOW) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOOLWINDOW,BM_SETCHECK,BST_CHECKED,0);
488 if(pWindowInfo->ExStyle&WS_EX_CLIENTEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_SETCHECK,BST_CHECKED,0);
489 if(pWindowInfo->ExStyle&WS_EX_STATICEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_SETCHECK,BST_CHECKED,0);
490 if(pWindowInfo->ExStyle&WS_EX_NOPARENTNOTIFY) SendDlgItemMessage(hwnd,IDC_EXSTYLE_NOPARENTNOTIFY,BM_SETCHECK,BST_CHECKED,0);
491 if(pWindowInfo->ExStyle&WS_EX_CONTEXTHELP) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTEXTHELP,BM_SETCHECK,BST_CHECKED,0);
492 if(pWindowInfo->ExStyle&WS_EX_CONTROLPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTROLPARENT,BM_SETCHECK,BST_CHECKED,0);
493 break;
494 }
495 case WM_COMMAND:
496 switch(LOWORD(wParam)){
497 case IDOK:
498 {
499 i=GetWndNum(GetWindow(hClient,GW_CHILD));
500
501 DWORD style;
502 style=0;
503 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOPMOST,BM_GETCHECK,0,0))
504 style|=WS_EX_TOPMOST;
505 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_GETCHECK,0,0))
506 style|=WS_EX_ACCEPTFILES;
507 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_GETCHECK,0,0))
508 style|=WS_EX_TRANSPARENT;
509 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOOLWINDOW,BM_GETCHECK,0,0))
510 style|=WS_EX_TOOLWINDOW;
511 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_GETCHECK,0,0))
512 style|=WS_EX_CLIENTEDGE;
513 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_GETCHECK,0,0))
514 style|=WS_EX_STATICEDGE;
515 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_NOPARENTNOTIFY,BM_GETCHECK,0,0))
516 style|=WS_EX_NOPARENTNOTIFY;
517 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTEXTHELP,BM_GETCHECK,0,0))
518 style|=WS_EX_CONTEXTHELP;
519 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTROLPARENT,BM_GETCHECK,0,0))
520 style|=WS_EX_CONTROLPARENT;
521
522 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
523
524 if(style==pWindowInfo->ExStyle){
525 SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
526 return 1;
527 }
528
529 //変更情報
530 Rad_NoticeChanging(i,RAD_UNDO_EXSTYLE,SELECT_WINDOW,pWindowInfo->ExStyle);
531
532 pWindowInfo->ExStyle=style;
533 EndDialog(hwnd,1);
534 return 1;
535 }
536 case IDCANCEL:
537 EndDialog(hwnd,0);
538 return 1;
539 }
540 break;
541 }
542 return 0;
543}
544BOOL CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
545 extern HANDLE hHeap;
546 extern MDIINFO MdiInfo[MAX_WNDNUM];
547 int i,i3,i4;
548 static BOOL bInitial;
549
550 switch(message){
551 case WM_INITDIALOG:
552 {
553 bInitial=1;
554 i=GetWndNum(GetParent(GetParent(hwnd)));
555 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
556
557 SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str());
558 SetDlgItemText(hwnd,IDC_HANDLE,pWindowInfo->GetHandleName().c_str());
559 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->caption);
560
561 //"3D FACE(標準)"
562 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_BGCOLOR1);
563 //"色指定"
564 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_BGCOLOR2);
565
566 for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++)
567 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
568 if(pWindowInfo->type==WNDTYPE_MODALDLG||
569 pWindowInfo->type==WNDTYPE_MODELESSDLG){
570 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
571 EnableWindow(GetDlgItem(hwnd,IDC_BGCOLOR),0);
572 }
573 else{
574 if(pWindowInfo->bgColor==COLOR_3DFACE){
575 //3DFACE
576 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
577 }
578 else if(pWindowInfo->bgColor<=0){
579 //色指定
580 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,1,0);
581 }
582 else if(pWindowInfo->bgColor>=0x1000){
583 //ビットマップ指定
584 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,2+pWindowInfo->bgColor-0x1000,0);
585 }
586 }
587
588
589 ////////////
590 // メニュー
591 ////////////
592
593 //"なし"
594 SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_ADDSTRING,0,(long)STRING_NONE_);
595
596 for(i3=0,i4=0;i3<projectInfo.NumberOfMenu;i3++){
597 if(pWindowInfo->MenuID){
598 if(lstrcmpi(projectInfo.pMenuInfo[i3].IdName,pWindowInfo->MenuID)==0)
599 i4=i3+1;
600 }
601 SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_ADDSTRING,0,(long)projectInfo.pMenuInfo[i3].IdName);
602 }
603 if(i4==0&&pWindowInfo->MenuID){
604 //メニューが存在しない場合、無効にする
605 HeapDefaultFree(pWindowInfo->MenuID);
606 pWindowInfo->MenuID=0;
607 DrawRadWindow(i,pWindowInfo);
608 }
609 SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_SETCURSEL,i4,0);
610
611
612 ////////////
613 // アイコン
614 ////////////
615
616 //"Windowsロゴ(標準)"
617 SendDlgItemMessage(hwnd,IDC_ICONRES,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_ICONDEFAULT);
618
619 for(i3=0,i4=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
620 SendDlgItemMessage(hwnd,IDC_ICONRES,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
621
622 if( pWindowInfo->IconResName )
623 {
624 if( projectInfo.resourceManager.iconResources[i3].idName == pWindowInfo->IconResName )
625 {
626 i4=i3+1;
627 }
628 }
629 }
630 if(i4==0&&pWindowInfo->IconResName){
631 //アイコンが存在しない場合、無効にする
632 HeapDefaultFree(pWindowInfo->IconResName);
633 pWindowInfo->IconResName=0;
634 DrawRadWindow(i,pWindowInfo);
635 }
636 SendDlgItemMessage(hwnd,IDC_ICONRES,CB_SETCURSEL,i4,0);
637
638
639 ////////////
640 // スタイル
641 ////////////
642
643 //"オーバーラップ"
644 SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_OVERLAPPED);
645 //"ポップアップ"
646 SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_POPUP);
647 //"チャイルド"
648 SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_CHILD);
649
650 if(pWindowInfo->style&WS_POPUP) SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,1,0);
651 else if(pWindowInfo->style&WS_CHILD) SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,2,0);
652 else SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,0,0);
653
654 //"枠なし"
655 SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_FRAME_NONE);
656 //"細枠"
657 SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_FRAME_THICK);
658 //"サイズ変更枠"
659 SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_FRAME_BORDER);
660
661 //WS_CAPTION(WS_BORDER含む)を考慮してWS_THICKFRAMEを最初に比較する
662 if(pWindowInfo->style&WS_THICKFRAME) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,2,0);
663 else if(pWindowInfo->style&WS_BORDER) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,1,0);
664 else SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,0,0);
665
666 if(pWindowInfo->style&WS_CAPTION) SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0);
667 if(pWindowInfo->style&WS_SYSMENU) SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_SETCHECK,BST_CHECKED,0);
668 if(pWindowInfo->style&WS_MINIMIZEBOX) SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_CHECKED,0);
669 if(pWindowInfo->style&WS_MAXIMIZEBOX) SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_CHECKED,0);
670 if(pWindowInfo->style&WS_MINIMIZE) SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_SETCHECK,BST_CHECKED,0);
671 if(pWindowInfo->style&WS_MAXIMIZE) SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_SETCHECK,BST_CHECKED,0);
672 if(pWindowInfo->style&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLLBAR,BM_SETCHECK,BST_CHECKED,0);
673 if(pWindowInfo->style&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLLBAR,BM_SETCHECK,BST_CHECKED,0);
674 if(pWindowInfo->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
675 if(pWindowInfo->style&WS_CLIPSIBLINGS) SendDlgItemMessage(hwnd,IDC_STYLE_CLIPSIBLINGS,BM_SETCHECK,BST_CHECKED,0);
676 if(pWindowInfo->style&WS_CLIPCHILDREN) SendDlgItemMessage(hwnd,IDC_STYLE_CLIPCHILDREN,BM_SETCHECK,BST_CHECKED,0);
677 if(pWindowInfo->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
678
679 SetDlgItemText(hwnd,IDC_SETFONT,pWindowInfo->LogFont.lfFaceName);
680
681 RadProperty_Window_Window_StylingOrder(hwnd,&pWindowInfo->style);
682
683
684 //////////
685 //タイプ
686 switch(pWindowInfo->type){
687 case WNDTYPE_DEFAULT:
688 SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_SETCHECK,BST_CHECKED,0);
689 break;
690 case WNDTYPE_MODALDLG:
691 SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
692 break;
693 case WNDTYPE_MODELESSDLG:
694 SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_SETCHECK,BST_CHECKED,0);
695 break;
696 }
697
698
699 bInitial=0;
700 break;
701 }
702 case WM_COMMAND:
703 switch(LOWORD(wParam)){
704 case IDC_RENAMEWINDOW:
705 {
706 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW_RENAME),hwnd,(DLGPROC)DlgRadProperty_Window_Rename)) return 1;
707 i=GetWndNum(GetParent(GetParent(hwnd)));
708 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
709 SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str());
710 SetDlgItemText(hwnd,IDC_HANDLE,pWindowInfo->GetHandleName().c_str());
711 return 1;
712 }
713 case IDC_RENAMECAPTION:
714 {
715 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMECAPTION),hwnd,(DLGPROC)DlgRadProperty_Item_RenameCaption)) return 1;
716 i=GetWndNum(GetParent(GetParent(hwnd)));
717 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
718 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->caption);
719 return 1;
720 }
721 case IDC_SETFONT:
722 {
723 i=GetWndNum(GetParent(GetParent(hwnd)));
724 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
725 LOGFONT lf;
726 lf=pWindowInfo->LogFont;
727 if(!SetFontDialog(hwnd,&pWindowInfo->LogFont,0)) return 1;
728
729 //変更情報
730 Rad_NoticeChanging(i,RAD_UNDO_FONT,SELECT_WINDOW,(DWORD)&lf);
731
732 SetDlgItemText(hwnd,IDC_SETFONT,pWindowInfo->LogFont.lfFaceName);
733 DrawRadWindow(i,pWindowInfo);
734 return 1;
735 }
736 case IDC_BGCOLOR:
737 if(HIWORD(wParam)==CBN_SELCHANGE){
738 i=GetWndNum(GetParent(GetParent(hwnd)));
739 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
740
741 i3=SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_GETCURSEL,0,0);
742 if(i3==0){
743 //3DFACE
744
745 //変更情報
746 Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,pWindowInfo->bgColor);
747
748 pWindowInfo->bgColor=COLOR_3DFACE;
749 }
750 else if(i3==1){
751 //色指定
752 CHOOSECOLOR cc;
753 COLORREF CusColors[16]={
754 RGB(255,255,255),
755 RGB(0,0,0),
756 RGB(128,128,128),
757 RGB(192,192,192),
758 RGB(128,0,0),
759 RGB(255,0,0),
760 RGB(128,128,0),
761 RGB(255,255,0),
762 RGB(0,128,0),
763 RGB(0,255,0),
764 RGB(0,128,128),
765 RGB(0,255,255),
766 RGB(0,0,128),
767 RGB(0,0,255),
768 RGB(128,0,128),
769 RGB(255,0,255)};
770 cc.lStructSize=sizeof(CHOOSECOLOR);
771 cc.hwndOwner=hwnd;
772 if(pWindowInfo->bgColor<=0)
773 cc.rgbResult=-pWindowInfo->bgColor;
774 else cc.rgbResult=RGB(255,255,255);
775 cc.lpCustColors=CusColors;
776 cc.Flags=CC_RGBINIT|CC_FULLOPEN;
777 if(!ChooseColor(&cc)){
778 //キャンセル動作
779 if(pWindowInfo->bgColor==COLOR_3DFACE){
780 //3DFACE
781 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
782 }
783 else if(pWindowInfo->bgColor<=0){
784 //色指定
785 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,1,0);
786 }
787 else if(pWindowInfo->bgColor>=0x1000){
788 //ビットマップ指定
789 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,2+pWindowInfo->bgColor-0x1000,0);
790 }
791 return 1;
792 }
793
794 //変更情報
795 Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,pWindowInfo->bgColor);
796
797 pWindowInfo->bgColor=-(int)cc.rgbResult;
798 }
799 else{
800 //ビットマップ
801 i3-=2;
802
803 //変更情報
804 Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,pWindowInfo->bgColor);
805
806 pWindowInfo->bgColor=0x1000+i3;
807 }
808 DrawRadWindow(i,pWindowInfo);
809 return 1;
810 }
811 break;
812 case IDC_WINDOWMENU:
813 if(HIWORD(wParam)==CBN_SELCHANGE){
814 i=GetWndNum(GetParent(GetParent(hwnd)));
815 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
816
817 //変更情報
818 Rad_NoticeChanging(i,RAD_UNDO_WINDOWMENU,SELECT_WINDOW,(long)pWindowInfo->MenuID);
819
820 i3=SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETCURSEL,0,0);
821 if(pWindowInfo->MenuID)
822 HeapDefaultFree(pWindowInfo->MenuID);
823 if(i3==0) pWindowInfo->MenuID=0;
824 else{
825 pWindowInfo->MenuID=(char *)HeapAlloc(hHeap,0,SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETLBTEXTLEN,i3,0)+1);
826 SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETLBTEXT,i3,(long)pWindowInfo->MenuID);
827 }
828 DrawRadWindow(i,pWindowInfo);
829 return 1;
830 }
831 break;
832 case IDC_ICONRES:
833 if(HIWORD(wParam)==CBN_SELCHANGE){
834 i=GetWndNum(GetParent(GetParent(hwnd)));
835 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
836
837 //変更情報
838 Rad_NoticeChanging(i,RAD_UNDO_ICONRES,SELECT_WINDOW,(long)pWindowInfo->IconResName);
839
840 i3=SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETCURSEL,0,0);
841 if(pWindowInfo->IconResName)
842 HeapDefaultFree(pWindowInfo->IconResName);
843 if(i3==0) pWindowInfo->IconResName=0;
844 else{
845 pWindowInfo->IconResName=(char *)HeapAlloc(hHeap,0,SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETLBTEXTLEN,i3,0)+1);
846 SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETLBTEXT,i3,(long)pWindowInfo->IconResName);
847 }
848 DrawRadWindow(i,pWindowInfo);
849 return 1;
850 }
851 break;
852
853 case IDC_WINDOWSTYLE:
854 if(HIWORD(wParam)==CBN_SELCHANGE){
855 i=GetWndNum(GetParent(GetParent(hwnd)));
856 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
857
858 //変更情報
859 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
860
861 i3=SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_GETCURSEL,0,0);
862 pWindowInfo->style&=0x3FFFFFFF;
863 if(i3==1) pWindowInfo->style|=WS_POPUP;
864 else if(i3==2) pWindowInfo->style|=WS_CHILD;
865 RadProperty_Window_Window_StylingOrder(hwnd,&pWindowInfo->style);
866 DrawRadWindow(i,pWindowInfo);
867 return 1;
868 }
869 break;
870 case IDC_BORDERSTYLE:
871 if(HIWORD(wParam)==CBN_SELCHANGE){
872 i=GetWndNum(GetParent(GetParent(hwnd)));
873 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
874
875 //変更情報
876 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
877
878 i3=SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_GETCURSEL,0,0);
879 pWindowInfo->style&=~(WS_BORDER|WS_THICKFRAME);
880 if(i3==1) pWindowInfo->style|=WS_BORDER;
881 else if(i3==2){
882 pWindowInfo->style|=WS_BORDER;
883 pWindowInfo->style|=WS_THICKFRAME;
884 }
885 RadProperty_Window_Border_StylingOrder(hwnd,&pWindowInfo->style);
886 DrawRadWindow(i,pWindowInfo);
887 return 1;
888 }
889 break;
890
891 case IDC_STYLE_CAPTION:
892 if(HIWORD(wParam)==BN_CLICKED){
893 i=GetWndNum(GetParent(GetParent(hwnd)));
894 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
895
896 //変更情報
897 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
898
899 if(SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_GETCHECK,0,0))
900 pWindowInfo->style|=WS_CAPTION;
901 else
902 pWindowInfo->style&=~WS_CAPTION;
903 RadProperty_Window_Caption_StylingOrder(hwnd,&pWindowInfo->style);
904 DrawRadWindow(i,pWindowInfo);
905 return 1;
906 }
907 break;
908 case IDC_STYLE_SYSMENU:
909 if(HIWORD(wParam)==BN_CLICKED){
910 i=GetWndNum(GetParent(GetParent(hwnd)));
911 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
912
913 //変更情報
914 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
915
916 if(SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_GETCHECK,0,0))
917 pWindowInfo->style|=WS_SYSMENU;
918 else
919 pWindowInfo->style&=~WS_SYSMENU;
920 DrawRadWindow(i,pWindowInfo);
921 return 1;
922 }
923 break;
924 case IDC_STYLE_MINIMIZEBOX:
925 if(HIWORD(wParam)==BN_CLICKED){
926 i=GetWndNum(GetParent(GetParent(hwnd)));
927 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
928
929 //変更情報
930 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
931
932 if(SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_GETCHECK,0,0))
933 pWindowInfo->style|=WS_MINIMIZEBOX;
934 else
935 pWindowInfo->style&=~WS_MINIMIZEBOX;
936 DrawRadWindow(i,pWindowInfo);
937 return 1;
938 }
939 break;
940 case IDC_STYLE_MAXIMIZEBOX:
941 if(HIWORD(wParam)==BN_CLICKED){
942 i=GetWndNum(GetParent(GetParent(hwnd)));
943 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
944
945 //変更情報
946 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
947
948 if(SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_GETCHECK,0,0))
949 pWindowInfo->style|=WS_MAXIMIZEBOX;
950 else
951 pWindowInfo->style&=~WS_MAXIMIZEBOX;
952 DrawRadWindow(i,pWindowInfo);
953 return 1;
954 }
955 break;
956 case IDC_STYLE_MINIMIZE:
957 if(HIWORD(wParam)==BN_CLICKED){
958 i=GetWndNum(GetParent(GetParent(hwnd)));
959 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
960
961 //変更情報
962 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
963
964 if(SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_GETCHECK,0,0))
965 pWindowInfo->style|=WS_MINIMIZE;
966 else
967 pWindowInfo->style&=~WS_MINIMIZE;
968 DrawRadWindow(i,pWindowInfo);
969 return 1;
970 }
971 break;
972 case IDC_STYLE_MAXIMIZE:
973 if(HIWORD(wParam)==BN_CLICKED){
974 i=GetWndNum(GetParent(GetParent(hwnd)));
975 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
976
977 //変更情報
978 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
979
980 if(SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_GETCHECK,0,0))
981 pWindowInfo->style|=WS_MAXIMIZE;
982 else
983 pWindowInfo->style&=~WS_MAXIMIZE;
984 DrawRadWindow(i,pWindowInfo);
985 return 1;
986 }
987 case IDC_STYLE_HSCROLLBAR:
988 if(HIWORD(wParam)==BN_CLICKED){
989 i=GetWndNum(GetParent(GetParent(hwnd)));
990 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
991
992 //変更情報
993 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
994
995 if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLLBAR,BM_GETCHECK,0,0))
996 pWindowInfo->style|=WS_HSCROLL;
997 else
998 pWindowInfo->style&=~WS_HSCROLL;
999 DrawRadWindow(i,pWindowInfo);
1000 return 1;
1001 }
1002 case IDC_STYLE_VSCROLLBAR:
1003 if(HIWORD(wParam)==BN_CLICKED){
1004 i=GetWndNum(GetParent(GetParent(hwnd)));
1005 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1006
1007 //変更情報
1008 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
1009
1010 if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLLBAR,BM_GETCHECK,0,0))
1011 pWindowInfo->style|=WS_VSCROLL;
1012 else
1013 pWindowInfo->style&=~WS_VSCROLL;
1014 DrawRadWindow(i,pWindowInfo);
1015 return 1;
1016 }
1017 break;
1018 case IDC_STYLE_DISABLED:
1019 if(HIWORD(wParam)==BN_CLICKED){
1020 i=GetWndNum(GetParent(GetParent(hwnd)));
1021 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1022
1023 //変更情報
1024 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
1025
1026 if(SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_GETCHECK,0,0))
1027 pWindowInfo->style|=WS_DISABLED;
1028 else
1029 pWindowInfo->style&=~WS_DISABLED;
1030 DrawRadWindow(i,pWindowInfo);
1031 return 1;
1032 }
1033 break;
1034 case IDC_STYLE_CLIPSIBLINGS:
1035 if(HIWORD(wParam)==BN_CLICKED){
1036 i=GetWndNum(GetParent(GetParent(hwnd)));
1037 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1038
1039 //変更情報
1040 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
1041
1042 if(SendDlgItemMessage(hwnd,IDC_STYLE_CLIPSIBLINGS,BM_GETCHECK,0,0))
1043 pWindowInfo->style|=WS_CLIPSIBLINGS;
1044 else
1045 pWindowInfo->style&=~WS_CLIPSIBLINGS;
1046 DrawRadWindow(i,pWindowInfo);
1047 return 1;
1048 }
1049 break;
1050 case IDC_STYLE_CLIPCHILDREN:
1051 if(HIWORD(wParam)==BN_CLICKED){
1052 i=GetWndNum(GetParent(GetParent(hwnd)));
1053 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1054
1055 //変更情報
1056 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
1057
1058 if(SendDlgItemMessage(hwnd,IDC_STYLE_CLIPCHILDREN,BM_GETCHECK,0,0))
1059 pWindowInfo->style|=WS_CLIPCHILDREN;
1060 else
1061 pWindowInfo->style&=~WS_CLIPCHILDREN;
1062 DrawRadWindow(i,pWindowInfo);
1063 return 1;
1064 }
1065 break;
1066 case IDC_STYLE_VISIBLE:
1067 if(HIWORD(wParam)==BN_CLICKED){
1068 i=GetWndNum(GetParent(GetParent(hwnd)));
1069 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1070
1071 //変更情報
1072 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->style);
1073
1074 if(SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_GETCHECK,0,0))
1075 pWindowInfo->style|=WS_VISIBLE;
1076 else
1077 pWindowInfo->style&=~WS_VISIBLE;
1078 DrawRadWindow(i,pWindowInfo);
1079 return 1;
1080 }
1081 break;
1082
1083 case IDC_EXSTYLE:
1084 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW_EXSTYLE),hwnd,(DLGPROC)DlgRadProperty_Window_ExStyle)) return 1;
1085 i=GetWndNum(GetParent(GetParent(hwnd)));
1086 DrawRadWindow(i,GetWndInfo(MdiInfo[i].path));
1087 return 1;
1088
1089 case IDC_DEFWINDOW:
1090 case IDC_MODALDLG:
1091 case IDC_MODELESSDLG:
1092 if(HIWORD(wParam)==BN_CLICKED){
1093 i=GetWndNum(GetParent(GetParent(hwnd)));
1094 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1095
1096 //変更情報
1097 Rad_NoticeChanging(i,RAD_UNDO_TYPE,SELECT_WINDOW,pWindowInfo->type);
1098
1099 if(SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_GETCHECK,0,0))
1100 pWindowInfo->type=WNDTYPE_DEFAULT;
1101 else if(SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_GETCHECK,0,0))
1102 pWindowInfo->type=WNDTYPE_MODALDLG;
1103 else if(SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_GETCHECK,0,0))
1104 pWindowInfo->type=WNDTYPE_MODELESSDLG;
1105 return 1;
1106 }
1107 break;
1108 }
1109 break;
1110 }
1111 return 0;
1112}
1113
1114BOOL CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
1115 extern HANDLE hHeap;
1116 extern MDIINFO MdiInfo[MAX_WNDNUM];
1117 int i,i3;
1118 char *temporary;
1119 POINTANDSIZE PointAndSize;
1120
1121 switch(message){
1122 case WM_INITDIALOG:
1123 {
1124 SetPosCenter(hwnd);
1125 i=GetWndNum(GetWindow(hClient,GW_CHILD));
1126 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1127 if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
1128 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->caption);
1129 else
1130 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption);
1131 break;
1132 }
1133 case WM_COMMAND:
1134 switch(LOWORD(wParam)){
1135 case IDOK:
1136 {
1137 i=GetWndNum(GetWindow(hClient,GW_CHILD));
1138 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1139
1140 i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_CAPTION))+1;
1141 temporary=(char *)HeapAlloc(hHeap,0,i3);
1142 GetDlgItemText(hwnd,IDC_CAPTION,temporary,i3);
1143 if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
1144 if(lstrcmp(temporary,pWindowInfo->caption)==0){
1145 HeapDefaultFree(temporary);
1146 SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
1147 return 1;
1148 }
1149
1150 //変更情報を更新
1151 Rad_NoticeChanging(i,RAD_UNDO_CAPTION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)pWindowInfo->caption);
1152
1153 HeapDefaultFree(pWindowInfo->caption);
1154 pWindowInfo->caption=temporary;
1155 }
1156 else{
1157 if(lstrcmp(temporary,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption)==0){
1158 HeapDefaultFree(temporary);
1159 SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
1160 return 1;
1161 }
1162
1163 //変更情報を更新
1164 Rad_NoticeChanging(i,RAD_UNDO_CAPTION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption);
1165
1166 HeapDefaultFree(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption);
1167 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption=temporary;
1168
1169 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_STATIC){
1170 //スタティック テキスト
1171 //テキストが表示できるようにサイズを拡大する
1172
1173 PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->pos;
1174 PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size;
1175 Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
1176
1177 HFONT hFont,hOldFont;
1178 hFont=CreateFontIndirect(&pWindowInfo->LogFont);
1179 hOldFont=(HFONT)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hFont);
1180 GetTextExtentPoint32(MdiInfo[i].MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size);
1181 SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hOldFont);
1182 DeleteObject(hFont);
1183
1184 //テキストの終端に余裕を持たせる
1185 PointAndSize.size.cx+=5;
1186
1187 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx<PointAndSize.size.cx)
1188 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx=PointAndSize.size.cx;
1189 }
1190 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_CHECKBOX){
1191 //チェック ボックス
1192 //テキストが表示できるようにサイズを拡大する
1193
1194 PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->pos;
1195 PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size;
1196 Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
1197
1198 HFONT hFont,hOldFont;
1199 hFont=CreateFontIndirect(&pWindowInfo->LogFont);
1200 hOldFont=(HFONT)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hFont);
1201 GetTextExtentPoint32(MdiInfo[i].MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size);
1202 SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hOldFont);
1203 DeleteObject(hFont);
1204
1205 //テキストの終端に余裕を持たせる
1206 PointAndSize.size.cx+=21;
1207
1208 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx<PointAndSize.size.cx)
1209 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx=PointAndSize.size.cx;
1210 }
1211 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_RADIOBUTTON){
1212 //ラジオ ボックス
1213 //テキストが表示できるようにサイズを拡大する
1214
1215 PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->pos;
1216 PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size;
1217 Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
1218
1219 HFONT hFont,hOldFont;
1220 hFont=CreateFontIndirect(&pWindowInfo->LogFont);
1221 hOldFont=(HFONT)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hFont);
1222 GetTextExtentPoint32(MdiInfo[i].MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size);
1223 SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hOldFont);
1224 DeleteObject(hFont);
1225
1226 //テキストの終端に余裕を持たせる
1227 PointAndSize.size.cx+=20;
1228
1229 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx<PointAndSize.size.cx)
1230 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx=PointAndSize.size.cx;
1231 }
1232 }
1233 DrawRadWindow(i,pWindowInfo);
1234 EndDialog(hwnd,1);
1235 return 1;
1236 }
1237 case IDCANCEL:
1238 EndDialog(hwnd,0);
1239 return 1;
1240 }
1241 break;
1242 }
1243 return 0;
1244}
1245BOOL CALLBACK DlgRadProperty_Item_RenameID(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
1246 extern HANDLE hHeap;
1247 extern HWND hClient,hOwner;
1248 extern MDIINFO MdiInfo[MAX_WNDNUM];
1249 int i,i3;
1250 char *temporary;
1251
1252 switch(message){
1253 case WM_INITDIALOG:
1254 {
1255 SetPosCenter(hwnd);
1256 i=GetWndNum(GetWindow(hClient,GW_CHILD));
1257 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1258 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
1259 }
1260 break;
1261 case WM_COMMAND:
1262 switch(LOWORD(wParam)){
1263 case IDOK:
1264 {
1265 i=GetWndNum(GetWindow(hClient,GW_CHILD));
1266 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1267
1268 i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_IDNAME))+1;
1269 if(i3==1){
1270 //MsgBox "ID名を入力して下さい。"
1271 MessageBox(hOwner,STRING_ITEM_RENAME_MUST_ID,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
1272 break;
1273 }
1274 temporary=(char *)HeapAlloc(hHeap,0,i3);
1275 GetDlgItemText(hwnd,IDC_IDNAME,temporary,i3);
1276 if(lstrcmp(temporary,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName)==0){
1277 HeapDefaultFree(temporary);
1278 SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
1279 return 1;
1280 }
1281
1282 //MsgBox "アイテムのID名を変更すると、ソースコード内のID名は手動で変換する必要があります。変更しますか?"
1283 if(IDCANCEL==MessageBox(hwnd,STRING_ITEM_RENAME_CHECK,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) return 1;
1284
1285 //変更情報を更新
1286 Rad_NoticeChanging(i,RAD_UNDO_NAME,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
1287
1288 HeapDefaultFree(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
1289 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName=temporary;
1290
1291 EndDialog(hwnd,1);
1292 return 1;
1293 }
1294 case IDCANCEL:
1295 EndDialog(hwnd,0);
1296 return 1;
1297 }
1298 break;
1299 }
1300 return 0;
1301}
1302BOOL DefaultItemStyles(HWND hwnd,int WndNum,int WndInfoNum,WPARAM wParam){
1303 extern HANDLE hHeap;
1304 extern MDIINFO MdiInfo[MAX_WNDNUM];
1305
1306 WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
1307
1308 switch(LOWORD(wParam)){
1309 case IDC_RENAMEID:
1310 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMEID),hwnd,(DLGPROC)DlgRadProperty_Item_RenameID)) return 1;
1311 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->IdName);
1312 return 1;
1313 case IDC_RENAMECAPTION:
1314 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMECAPTION),hwnd,(DLGPROC)DlgRadProperty_Item_RenameCaption)) return 1;
1315 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->caption);
1316 return 1;
1317 case IDC_STYLE_DISABLED:
1318 if(HIWORD(wParam)==BN_CLICKED){
1319 //変更情報
1320 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style);
1321
1322 if(SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_GETCHECK,0,0))
1323 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style|=WS_DISABLED;
1324 else
1325 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style&=~WS_DISABLED;
1326 DrawRadWindow(WndNum,pWindowInfo);
1327 return 1;
1328 }
1329 break;
1330 case IDC_STYLE_VISIBLE:
1331 if(HIWORD(wParam)==BN_CLICKED){
1332 //変更情報
1333 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style);
1334
1335 if(SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_GETCHECK,0,0))
1336 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style|=WS_VISIBLE;
1337 else
1338 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style&=~WS_VISIBLE;
1339 return 1;
1340 }
1341 break;
1342 case IDC_STYLE_GROUP:
1343 if(HIWORD(wParam)==BN_CLICKED){
1344 //変更情報
1345 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style);
1346
1347 if(SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_GETCHECK,0,0))
1348 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style|=WS_GROUP;
1349 else
1350 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style&=~WS_GROUP;
1351 return 1;
1352 }
1353 break;
1354 case IDC_STYLE_TABSTOP:
1355 if(HIWORD(wParam)==BN_CLICKED){
1356 //変更情報
1357 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style);
1358
1359 if(SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_GETCHECK,0,0))
1360 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style|=WS_TABSTOP;
1361 else
1362 pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->style&=~WS_TABSTOP;
1363 return 1;
1364 }
1365 break;
1366 }
1367 return 0;
1368}
1369BOOL CALLBACK DlgRadProperty_Item_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
1370 extern MDIINFO MdiInfo[MAX_WNDNUM];
1371 int i;
1372
1373 switch(message){
1374 case WM_INITDIALOG:
1375 {
1376 SetPosCenter(hwnd);
1377 i=GetWndNum(GetWindow(hClient,GW_CHILD));
1378 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1379 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle&WS_EX_ACCEPTFILES) SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_SETCHECK,BST_CHECKED,0);
1380 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle&WS_EX_TRANSPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_SETCHECK,BST_CHECKED,0);
1381 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle&WS_EX_DLGMODALFRAME) SendDlgItemMessage(hwnd,IDC_EXSTYLE_DLGMODALFRAME,BM_SETCHECK,BST_CHECKED,0);
1382 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle&WS_EX_CLIENTEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_SETCHECK,BST_CHECKED,0);
1383 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle&WS_EX_STATICEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_SETCHECK,BST_CHECKED,0);
1384 break;
1385 }
1386 case WM_COMMAND:
1387 switch(LOWORD(wParam)){
1388 case IDOK:
1389 {
1390 i=GetWndNum(GetWindow(hClient,GW_CHILD));
1391 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1392
1393 DWORD style;
1394 style=0;
1395 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_GETCHECK,0,0))
1396 style|=WS_EX_ACCEPTFILES;
1397 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_GETCHECK,0,0))
1398 style|=WS_EX_TRANSPARENT;
1399 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_DLGMODALFRAME,BM_GETCHECK,0,0))
1400 style|=WS_EX_DLGMODALFRAME;
1401 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_GETCHECK,0,0))
1402 style|=WS_EX_CLIENTEDGE;
1403 if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_GETCHECK,0,0))
1404 style|=WS_EX_STATICEDGE;
1405
1406 if(style==pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle){
1407 SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
1408 return 1;
1409 }
1410
1411 //変更情報
1412 Rad_NoticeChanging(i,RAD_UNDO_EXSTYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle);
1413
1414 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ExStyle=style;
1415 EndDialog(hwnd,1);
1416 return 1;
1417 }
1418 case IDCANCEL:
1419 EndDialog(hwnd,0);
1420 return 1;
1421 }
1422 break;
1423 }
1424 return 0;
1425}
1426
1427
1428/////////////////////
1429// BUTTON プロパティ
1430
1431BOOL CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
1432 extern MDIINFO MdiInfo[MAX_WNDNUM];
1433 int i,i2,i3;
1434 static BOOL bInitial;
1435
1436 switch(message){
1437 case WM_INITDIALOG:
1438 {
1439 bInitial=1;
1440 i=GetWndNum(GetParent(GetParent(hwnd)));
1441 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1442
1443 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
1444 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption);
1445
1446
1447 ////////////
1448 //スタイル
1449
1450 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
1451 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
1452 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
1453 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
1454
1455 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_OWNERDRAW)==BS_OWNERDRAW) SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_SETCHECK,BST_CHECKED,0);
1456 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_DEFPUSHBUTTON) SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_SETCHECK,BST_CHECKED,0);
1457
1458 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0);
1459 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0);
1460 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0);
1461 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
1462
1463
1464 //////////////////
1465 // 水平方向の配置
1466 //////////////////
1467
1468 //"デフォルト"
1469 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
1470 //"左端"
1471 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
1472 //"右端"
1473 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
1474 //"中央"
1475 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
1476
1477 //ビットを考慮してBS_CENTERを最初に比較する
1478 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0);
1479 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0);
1480 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0);
1481 else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0);
1482
1483
1484 //////////////////
1485 // 垂直方向の配置
1486 //////////////////
1487
1488 //"デフォルト"
1489 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
1490 //"上端"
1491 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_TOP);
1492 //"下端"
1493 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_BOTTOM);
1494 //"中央"
1495 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
1496
1497 //ビットを考慮してBS_VCENTERを最初に比較する
1498 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0);
1499 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0);
1500 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0);
1501 else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0);
1502
1503
1504 bInitial=0;
1505 break;
1506 }
1507 case WM_COMMAND:
1508 {
1509 i=GetWndNum(GetParent(GetParent(hwnd)));
1510 if(i==-1) return 1;
1511 i2=GetWndInfoNum(MdiInfo[i].path);
1512 WindowInfo *pWindowInfo = projectInfo.windowInfos[i2];
1513
1514 //共通スタイル
1515 if(bInitial==0){
1516 if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
1517 }
1518
1519 switch(LOWORD(wParam)){
1520 case IDC_BS_DEFPUSHBUTTON:
1521 if(HIWORD(wParam)==BN_CLICKED){
1522 //変更情報
1523 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1524
1525 if(SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_GETCHECK,0,0)){
1526 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_OWNERDRAW;
1527 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_DEFPUSHBUTTON;
1528 SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_SETCHECK,BST_UNCHECKED,0);
1529 }
1530 else
1531 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_DEFPUSHBUTTON;
1532 DrawRadWindow(i,pWindowInfo);
1533 return 1;
1534 }
1535 break;
1536 case IDC_BS_OWNERDRAW:
1537 if(HIWORD(wParam)==BN_CLICKED){
1538 //変更情報
1539 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1540
1541 if(SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_GETCHECK,0,0)){
1542 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_DEFPUSHBUTTON;
1543 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_OWNERDRAW;
1544 SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_SETCHECK,BST_UNCHECKED,0);
1545 }
1546 else
1547 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_OWNERDRAW;
1548 DrawRadWindow(i,pWindowInfo);
1549 return 1;
1550 }
1551 break;
1552 case IDC_BS_ICON:
1553 if(HIWORD(wParam)==BN_CLICKED){
1554 //変更情報
1555 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1556
1557 if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){
1558 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_ICON;
1559 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_BITMAP;
1560 SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0);
1561 }
1562 else
1563 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_ICON;
1564 DrawRadWindow(i,pWindowInfo);
1565 return 1;
1566 }
1567 break;
1568 case IDC_BS_BITMAP:
1569 if(HIWORD(wParam)==BN_CLICKED){
1570 //変更情報
1571 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1572
1573 if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){
1574 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_BITMAP;
1575 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_ICON;
1576 SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0);
1577 }
1578 else
1579 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_BITMAP;
1580 DrawRadWindow(i,pWindowInfo);
1581 return 1;
1582 }
1583 break;
1584 case IDC_BS_MULTILINE:
1585 if(HIWORD(wParam)==BN_CLICKED){
1586 //変更情報
1587 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1588
1589 if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0))
1590 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_MULTILINE;
1591 else
1592 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_MULTILINE;
1593 DrawRadWindow(i,pWindowInfo);
1594 return 1;
1595 }
1596 break;
1597 case IDC_BS_NOTIFY:
1598 if(HIWORD(wParam)==BN_CLICKED){
1599 //変更情報
1600 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1601
1602 if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0))
1603 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_NOTIFY;
1604 else
1605 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_NOTIFY;
1606 return 1;
1607 }
1608 break;
1609
1610 case IDC_BS_HPOS:
1611 if(HIWORD(wParam)==CBN_SELCHANGE){
1612 //変更情報
1613 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1614
1615 i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0);
1616 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(BS_LEFT|BS_RIGHT|BS_CENTER);
1617 if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_LEFT;
1618 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_RIGHT;
1619 else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_CENTER;
1620 DrawRadWindow(i,pWindowInfo);
1621 return 1;
1622 }
1623 break;
1624 case IDC_BS_VPOS:
1625 if(HIWORD(wParam)==CBN_SELCHANGE){
1626 //変更情報
1627 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1628
1629 i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0);
1630 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(BS_TOP|BS_BOTTOM|BS_VCENTER);
1631 if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_TOP;
1632 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_BOTTOM;
1633 else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_VCENTER;
1634 DrawRadWindow(i,pWindowInfo);
1635 return 1;
1636 }
1637 break;
1638
1639 case IDC_EXSTYLE:
1640 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,(DLGPROC)DlgRadProperty_Item_ExStyle)) return 1;
1641 DrawRadWindow(i,pWindowInfo);
1642 return 1;
1643 }
1644 break;
1645 }
1646 }
1647 return 0;
1648}
1649
1650
1651////////////////////////
1652// CHECKBOX プロパティ
1653BOOL CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
1654 extern MDIINFO MdiInfo[MAX_WNDNUM];
1655 int i,i2,i3;
1656 static BOOL bInitial;
1657
1658 switch(message){
1659 case WM_INITDIALOG:
1660 {
1661 bInitial=1;
1662 i=GetWndNum(GetParent(GetParent(hwnd)));
1663 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1664
1665 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
1666 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption);
1667
1668
1669 ////////////
1670 //スタイル
1671
1672 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
1673 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
1674 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
1675 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
1676
1677 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_AUTOCHECKBOX)==BS_AUTOCHECKBOX) SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0);
1678 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_AUTO3STATE)==BS_AUTO3STATE){
1679 SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0);
1680 SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_SETCHECK,BST_CHECKED,0);
1681 }
1682 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_3STATE)==BS_3STATE) SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_SETCHECK,BST_CHECKED,0);
1683 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_PUSHLIKE) SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_SETCHECK,BST_CHECKED,0);
1684 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_LEFTTEXT) SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_SETCHECK,BST_CHECKED,0);
1685 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0);
1686 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0);
1687 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0);
1688 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
1689
1690
1691 //////////////////
1692 // 水平方向の配置
1693 //////////////////
1694
1695 //"デフォルト"
1696 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
1697 //"左端"
1698 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
1699 //"右端"
1700 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
1701 //"中央"
1702 SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
1703
1704 //ビットを考慮してBS_CENTERを最初に比較する
1705 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0);
1706 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0);
1707 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0);
1708 else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0);
1709
1710
1711 //////////////////
1712 // 垂直方向の配置
1713 //////////////////
1714
1715 //"デフォルト"
1716 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
1717 //"上端"
1718 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_TOP);
1719 //"下端"
1720 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_BOTTOM);
1721 //"中央"
1722 SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
1723
1724 //ビットを考慮してBS_VCENTERを最初に比較する
1725 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0);
1726 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0);
1727 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0);
1728 else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0);
1729
1730
1731 bInitial=0;
1732 break;
1733 }
1734 case WM_COMMAND:
1735 {
1736 i=GetWndNum(GetParent(GetParent(hwnd)));
1737 if(i==-1) return 1;
1738 i2=GetWndInfoNum(MdiInfo[i].path);
1739 WindowInfo *pWindowInfo = projectInfo.windowInfos[i2];
1740
1741 //共通スタイル
1742 if(bInitial==0){
1743 if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
1744 }
1745
1746 switch(LOWORD(wParam)){
1747 case IDC_BS_AUTO:
1748 if(HIWORD(wParam)==BN_CLICKED){
1749 //変更情報
1750 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1751
1752 if(SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_GETCHECK,0,0)){
1753 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x04){
1754 //3state
1755 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1756 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_AUTO3STATE;
1757 }
1758 else{
1759 //2state
1760 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1761 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_AUTOCHECKBOX;
1762 }
1763 }
1764 else{
1765 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x04){
1766 //3state
1767 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1768 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_3STATE;
1769 }
1770 else{
1771 //2state
1772 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1773 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_CHECKBOX;
1774 }
1775 }
1776 return 1;
1777 }
1778 break;
1779 case IDC_BS_3STATE:
1780 if(HIWORD(wParam)==BN_CLICKED){
1781 //変更情報
1782 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1783
1784 if(SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_GETCHECK,0,0)){
1785 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0F)==BS_CHECKBOX){
1786 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1787 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_3STATE;
1788 }
1789 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0F)==BS_AUTOCHECKBOX){
1790 //自動チェック
1791 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1792 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_AUTO3STATE;
1793 }
1794 }
1795 else{
1796 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0F)==BS_3STATE){
1797 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1798 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_CHECKBOX;
1799 }
1800 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0F)==BS_AUTO3STATE){
1801 //自動チェック
1802 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=0xFFFFFFF0;
1803 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_AUTOCHECKBOX;
1804 }
1805 }
1806 return 1;
1807 }
1808 break;
1809 case IDC_BS_PUSHLIKE:
1810 if(HIWORD(wParam)==BN_CLICKED){
1811 //変更情報
1812 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1813
1814 if(SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_GETCHECK,0,0))
1815 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_PUSHLIKE;
1816 else
1817 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_PUSHLIKE;
1818 DrawRadWindow(i,pWindowInfo);
1819 return 1;
1820 }
1821 break;
1822 case IDC_BS_LEFTTEXT:
1823 if(HIWORD(wParam)==BN_CLICKED){
1824 //変更情報
1825 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1826
1827 if(SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_GETCHECK,0,0))
1828 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_LEFTTEXT;
1829 else
1830 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_LEFTTEXT;
1831 DrawRadWindow(i,pWindowInfo);
1832 return 1;
1833 }
1834 break;
1835 case IDC_BS_ICON:
1836 if(HIWORD(wParam)==BN_CLICKED){
1837 //変更情報
1838 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1839
1840 if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){
1841 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_ICON;
1842 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_BITMAP;
1843 SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0);
1844 }
1845 else
1846 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_ICON;
1847 DrawRadWindow(i,pWindowInfo);
1848 return 1;
1849 }
1850 break;
1851 case IDC_BS_BITMAP:
1852 if(HIWORD(wParam)==BN_CLICKED){
1853 //変更情報
1854 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1855
1856 if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){
1857 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_BITMAP;
1858 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_ICON;
1859 SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0);
1860 }
1861 else
1862 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_BITMAP;
1863 DrawRadWindow(i,pWindowInfo);
1864 return 1;
1865 }
1866 break;
1867 case IDC_BS_MULTILINE:
1868 if(HIWORD(wParam)==BN_CLICKED){
1869 //変更情報
1870 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1871
1872 if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0))
1873 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_MULTILINE;
1874 else
1875 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_MULTILINE;
1876 DrawRadWindow(i,pWindowInfo);
1877 return 1;
1878 }
1879 break;
1880 case IDC_BS_NOTIFY:
1881 if(HIWORD(wParam)==BN_CLICKED){
1882 //変更情報
1883 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1884
1885 if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0))
1886 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_NOTIFY;
1887 else
1888 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_NOTIFY;
1889 return 1;
1890 }
1891 break;
1892
1893 case IDC_BS_HPOS:
1894 if(HIWORD(wParam)==CBN_SELCHANGE){
1895 //変更情報
1896 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1897
1898 i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0);
1899 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(BS_LEFT|BS_RIGHT|BS_CENTER);
1900 if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_LEFT;
1901 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_RIGHT;
1902 else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_CENTER;
1903 DrawRadWindow(i,pWindowInfo);
1904 return 1;
1905 }
1906 break;
1907 case IDC_BS_VPOS:
1908 if(HIWORD(wParam)==CBN_SELCHANGE){
1909 //変更情報
1910 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
1911
1912 i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0);
1913 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(BS_TOP|BS_BOTTOM|BS_VCENTER);
1914 if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_TOP;
1915 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_BOTTOM;
1916 else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_VCENTER;
1917 DrawRadWindow(i,pWindowInfo);
1918 return 1;
1919 }
1920 break;
1921
1922 case IDC_EXSTYLE:
1923 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,(DLGPROC)DlgRadProperty_Item_ExStyle)) return 1;
1924 DrawRadWindow(i,pWindowInfo);
1925 return 1;
1926 }
1927 }
1928 }
1929 return 0;
1930}
1931
1932
1933///////////////////////
1934// COMBOBOX プロパティ
1935
1936void RadProperty_ComboBox_StylingOrder(HWND hwnd,DWORD *style){
1937 if(!(*style&(CBS_OWNERDRAWFIXED|CBS_OWNERDRAWVARIABLE))){
1938 *style&=~(CBS_HASSTRINGS);
1939 SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_SETCHECK,BST_UNCHECKED,0);
1940 EnableWindow(GetDlgItem(hwnd,IDC_CBS_HASSTRINGS),0);
1941 }
1942 else EnableWindow(GetDlgItem(hwnd,IDC_CBS_HASSTRINGS),1);
1943}
1944BOOL CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
1945 extern MDIINFO MdiInfo[MAX_WNDNUM];
1946 int i,i2,i3;
1947 static BOOL bInitial;
1948
1949 switch(message){
1950 case WM_INITDIALOG:
1951 {
1952 bInitial=1;
1953 i=GetWndNum(GetParent(GetParent(hwnd)));
1954 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
1955
1956 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
1957
1958
1959 /////////////////////////////////
1960 // スタイル
1961 ////////////
1962
1963 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
1964 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
1965 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
1966 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
1967
1968 ////////
1969 // 選択
1970 ////////
1971
1972 //"デフォルト"
1973 SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(long)STRING_DEFAULT);
1974 //"ドロップ ダウン"
1975 SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(long)STRING_COMBOBOXPROP_STYLE_DROPDOWN);
1976 //"ドロップ ダウン リスト"
1977 SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(long)STRING_COMBOBOXPROP_STYLE_DROPDOWNLIST);
1978
1979 //ビットを考慮してCBS_DROPDOWNLISTを最初に比較する
1980 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_DROPDOWNLIST)==CBS_DROPDOWNLIST) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,2,0);
1981 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_SIMPLE) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,0,0);
1982 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_DROPDOWN) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,1,0);
1983
1984
1985 ////////////////
1986 // オーナー描画
1987 ////////////////
1988
1989 //"なし"
1990 SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_NONE_);
1991 //"固定"
1992 SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_OWNERDRAW_FIXED);
1993 //"可変"
1994 SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_OWNERDRAW_VARIABLE);
1995
1996 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_OWNERDRAWFIXED) SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,1,0);
1997 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_OWNERDRAWVARIABLE) SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,2,0);
1998 else SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,0,0);
1999
2000 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_HASSTRINGS) SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_SETCHECK,BST_CHECKED,0);
2001 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_SORT) SendDlgItemMessage(hwnd,IDC_CBS_SORT,BM_SETCHECK,BST_CHECKED,0);
2002 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_NOINTEGRALHEIGHT) SendDlgItemMessage(hwnd,IDC_CBS_NOINTEGRALHEIGHT,BM_SETCHECK,BST_CHECKED,0);
2003 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_OEMCONVERT) SendDlgItemMessage(hwnd,IDC_CBS_OEMCONVERT,BM_SETCHECK,BST_CHECKED,0);
2004 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0);
2005 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_AUTOHSCROLL) SendDlgItemMessage(hwnd,IDC_CBS_AUTOHSCROLL,BM_SETCHECK,BST_CHECKED,0);
2006 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_DISABLENOSCROLL) SendDlgItemMessage(hwnd,IDC_CBS_DISABLENOSCROLL,BM_SETCHECK,BST_CHECKED,0);
2007 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_UPPERCASE) SendDlgItemMessage(hwnd,IDC_CBS_UPPERCASE,BM_SETCHECK,BST_CHECKED,0);
2008 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&CBS_LOWERCASE) SendDlgItemMessage(hwnd,IDC_CBS_LOWERCASE,BM_SETCHECK,BST_CHECKED,0);
2009
2010 RadProperty_ComboBox_StylingOrder(hwnd,&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2011
2012
2013 bInitial=0;
2014 break;
2015 }
2016 case WM_COMMAND:
2017 {
2018 i=GetWndNum(GetParent(GetParent(hwnd)));
2019 if(i==-1) return 1;
2020 i2=GetWndInfoNum(MdiInfo[i].path);
2021 WindowInfo *pWindowInfo = projectInfo.windowInfos[i2];
2022
2023 //共通スタイル
2024 if(bInitial==0){
2025 if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
2026 }
2027
2028 switch(LOWORD(wParam)){
2029 case IDC_CBS_TYPE:
2030 if(HIWORD(wParam)==CBN_SELCHANGE){
2031 //変更情報
2032 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2033
2034 i3=SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_GETCURSEL,0,0);
2035 //CBS_DROPDOWNLIST=CBS_SIMPLE | CBS_DROPDOWN
2036 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(CBS_DROPDOWNLIST);
2037 if(i3==0) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_SIMPLE;
2038 else if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_DROPDOWN;
2039 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_DROPDOWNLIST;
2040
2041 DrawRadWindow(i,pWindowInfo);
2042 return 1;
2043 }
2044 break;
2045 case IDC_CBS_OWNERDRAW:
2046 if(HIWORD(wParam)==CBN_SELCHANGE){
2047 //変更情報
2048 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2049
2050 i3=SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_GETCURSEL,0,0);
2051 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(CBS_OWNERDRAWFIXED|CBS_OWNERDRAWVARIABLE);
2052 if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_OWNERDRAWFIXED;
2053 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_OWNERDRAWVARIABLE;
2054
2055 RadProperty_ComboBox_StylingOrder(hwnd,&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2056 return 1;
2057 }
2058 break;
2059
2060 case IDC_CBS_HASSTRINGS:
2061 if(HIWORD(wParam)==BN_CLICKED){
2062 //変更情報
2063 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2064
2065 if(SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_GETCHECK,0,0))
2066 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_HASSTRINGS;
2067 else
2068 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_HASSTRINGS;
2069 return 1;
2070 }
2071 break;
2072 case IDC_CBS_SORT:
2073 if(HIWORD(wParam)==BN_CLICKED){
2074 //変更情報
2075 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2076
2077 if(SendDlgItemMessage(hwnd,IDC_CBS_SORT,BM_GETCHECK,0,0))
2078 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_SORT;
2079 else
2080 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_SORT;
2081 return 1;
2082 }
2083 break;
2084 case IDC_CBS_NOINTEGRALHEIGHT:
2085 if(HIWORD(wParam)==BN_CLICKED){
2086 //変更情報
2087 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2088
2089 if(SendDlgItemMessage(hwnd,IDC_CBS_NOINTEGRALHEIGHT,BM_GETCHECK,0,0))
2090 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_NOINTEGRALHEIGHT;
2091 else
2092 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_NOINTEGRALHEIGHT;
2093 return 1;
2094 }
2095 break;
2096 case IDC_CBS_OEMCONVERT:
2097 if(HIWORD(wParam)==BN_CLICKED){
2098 //変更情報
2099 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2100
2101 if(SendDlgItemMessage(hwnd,IDC_CBS_OEMCONVERT,BM_GETCHECK,0,0))
2102 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_OEMCONVERT;
2103 else
2104 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_OEMCONVERT;
2105 return 1;
2106 }
2107 break;
2108 case IDC_STYLE_VSCROLL:
2109 if(HIWORD(wParam)==BN_CLICKED){
2110 //変更情報
2111 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2112
2113 if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0))
2114 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=WS_VSCROLL;
2115 else
2116 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~WS_VSCROLL;
2117 DrawRadWindow(i,pWindowInfo);
2118 return 1;
2119 }
2120 break;
2121 case IDC_CBS_AUTOHSCROLL:
2122 if(HIWORD(wParam)==BN_CLICKED){
2123 //変更情報
2124 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2125
2126 if(SendDlgItemMessage(hwnd,IDC_CBS_AUTOHSCROLL,BM_GETCHECK,0,0))
2127 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_AUTOHSCROLL;
2128 else
2129 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_AUTOHSCROLL;
2130 return 1;
2131 }
2132 break;
2133 case IDC_CBS_DISABLENOSCROLL:
2134 if(HIWORD(wParam)==BN_CLICKED){
2135 //変更情報
2136 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2137
2138 if(SendDlgItemMessage(hwnd,IDC_CBS_DISABLENOSCROLL,BM_GETCHECK,0,0))
2139 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_DISABLENOSCROLL;
2140 else
2141 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_DISABLENOSCROLL;
2142 DrawRadWindow(i,pWindowInfo);
2143 return 1;
2144 }
2145 break;
2146 case IDC_CBS_UPPERCASE:
2147 if(HIWORD(wParam)==BN_CLICKED){
2148 //変更情報
2149 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2150
2151 if(SendDlgItemMessage(hwnd,IDC_CBS_UPPERCASE,BM_GETCHECK,0,0))
2152 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_UPPERCASE;
2153 else
2154 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_UPPERCASE;
2155 return 1;
2156 }
2157 break;
2158 case IDC_CBS_LOWERCASE:
2159 if(HIWORD(wParam)==BN_CLICKED){
2160 //変更情報
2161 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2162
2163 if(SendDlgItemMessage(hwnd,IDC_CBS_LOWERCASE,BM_GETCHECK,0,0))
2164 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=CBS_LOWERCASE;
2165 else
2166 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~CBS_LOWERCASE;
2167 return 1;
2168 }
2169 break;
2170
2171 case IDC_EXSTYLE:
2172 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,(DLGPROC)DlgRadProperty_Item_ExStyle)) return 1;
2173 DrawRadWindow(i,pWindowInfo);
2174 return 1;
2175 }
2176 break;
2177 }
2178 }
2179 return 0;
2180}
2181
2182
2183/////////////////////
2184// EDIT プロパティ
2185
2186void RadProperty_Edit_StylingOrder(HWND hwnd,DWORD *style){
2187 if(*style&ES_MULTILINE){
2188 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_HSCROLL),1);
2189 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_VSCROLL),1);
2190 EnableWindow(GetDlgItem(hwnd,IDC_ES_AUTOVSCROLL),1);
2191
2192 *style&=~(ES_PASSWORD);
2193 SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_SETCHECK,BST_UNCHECKED,0);
2194 EnableWindow(GetDlgItem(hwnd,IDC_ES_PASSWORD),0);
2195 }
2196 else{
2197 EnableWindow(GetDlgItem(hwnd,IDC_ES_PASSWORD),1);
2198
2199 *style&=~(WS_HSCROLL|WS_VSCROLL|ES_AUTOVSCROLL);
2200 SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_UNCHECKED,0);
2201 SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_UNCHECKED,0);
2202 SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_SETCHECK,BST_UNCHECKED,0);
2203 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_HSCROLL),0);
2204 EnableWindow(GetDlgItem(hwnd,IDC_STYLE_VSCROLL),0);
2205 EnableWindow(GetDlgItem(hwnd,IDC_ES_AUTOVSCROLL),0);
2206 }
2207}
2208BOOL CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
2209 extern MDIINFO MdiInfo[MAX_WNDNUM];
2210 int i,i2,i3;
2211 static BOOL bInitial;
2212
2213 switch(message){
2214 case WM_INITDIALOG:
2215 {
2216 bInitial=1;
2217 i=GetWndNum(GetParent(GetParent(hwnd)));
2218 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
2219
2220 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
2221 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption);
2222
2223
2224 ////////////
2225 // スタイル
2226 ////////////
2227
2228 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
2229 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
2230 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
2231 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
2232
2233 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_MULTILINE) SendDlgItemMessage(hwnd,IDC_ES_MULTILINE,BM_SETCHECK,BST_CHECKED,0);
2234 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_NUMBER) SendDlgItemMessage(hwnd,IDC_ES_NUMBER,BM_SETCHECK,BST_CHECKED,0);
2235 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_CHECKED,0);
2236 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_AUTOHSCROLL) SendDlgItemMessage(hwnd,IDC_ES_AUTOHSCROLL,BM_SETCHECK,BST_CHECKED,0);
2237 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0);
2238 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_AUTOVSCROLL) SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_SETCHECK,BST_CHECKED,0);
2239 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_PASSWORD) SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_SETCHECK,BST_CHECKED,0);
2240 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_NOHIDESEL) SendDlgItemMessage(hwnd,IDC_ES_NOHIDESEL,BM_SETCHECK,BST_CHECKED,0);
2241 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_OEMCONVERT) SendDlgItemMessage(hwnd,IDC_ES_OEMCONVERT,BM_SETCHECK,BST_CHECKED,0);
2242 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_WANTRETURN) SendDlgItemMessage(hwnd,IDC_ES_WANTRETURN,BM_SETCHECK,BST_CHECKED,0);
2243 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_UPPERCASE) SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_SETCHECK,BST_CHECKED,0);
2244 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_LOWERCASE) SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_SETCHECK,BST_CHECKED,0);
2245 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_READONLY) SendDlgItemMessage(hwnd,IDC_ES_READONLY,BM_SETCHECK,BST_CHECKED,0);
2246
2247
2248 //////////////////
2249 // テキストの配置
2250 //////////////////
2251
2252 //"左端"
2253 SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
2254 //"中央"
2255 SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
2256 //"右端"
2257 SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
2258
2259 //ビットを考慮してES_LEFTを最後に検討する
2260 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_CENTER) SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,1,0);
2261 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&ES_RIGHT) SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,2,0);
2262 else SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,0,0);
2263
2264 RadProperty_Edit_StylingOrder(hwnd,&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2265
2266
2267 bInitial=0;
2268 break;
2269 }
2270 case WM_COMMAND:
2271 {
2272 i=GetWndNum(GetParent(GetParent(hwnd)));
2273 if(i==-1) return 1;
2274 i2=GetWndInfoNum(MdiInfo[i].path);
2275 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
2276
2277 //共通スタイル
2278 if(bInitial==0){
2279 if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
2280 }
2281
2282 switch(LOWORD(wParam)){
2283 case IDC_ES_MULTILINE:
2284 if(HIWORD(wParam)==BN_CLICKED){
2285 //変更情報
2286 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2287
2288 if(SendDlgItemMessage(hwnd,IDC_ES_MULTILINE,BM_GETCHECK,0,0))
2289 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_MULTILINE;
2290 else
2291 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_MULTILINE;
2292 RadProperty_Edit_StylingOrder(hwnd,&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2293 DrawRadWindow(i,pWindowInfo);
2294 return 1;
2295 }
2296 break;
2297 case IDC_ES_NUMBER:
2298 if(HIWORD(wParam)==BN_CLICKED){
2299 //変更情報
2300 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2301
2302 if(SendDlgItemMessage(hwnd,IDC_ES_NUMBER,BM_GETCHECK,0,0))
2303 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_NUMBER;
2304 else
2305 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_NUMBER;
2306 return 1;
2307 }
2308 break;
2309 case IDC_STYLE_HSCROLL:
2310 if(HIWORD(wParam)==BN_CLICKED){
2311 //変更情報
2312 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2313
2314 if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_GETCHECK,0,0))
2315 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=WS_HSCROLL;
2316 else
2317 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~WS_HSCROLL;
2318 DrawRadWindow(i,pWindowInfo);
2319 return 1;
2320 }
2321 break;
2322 case IDC_ES_AUTOHSCROLL:
2323 if(HIWORD(wParam)==BN_CLICKED){
2324 //変更情報
2325 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2326
2327 if(SendDlgItemMessage(hwnd,IDC_ES_AUTOHSCROLL,BM_GETCHECK,0,0))
2328 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_AUTOHSCROLL;
2329 else
2330 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_AUTOHSCROLL;
2331 DrawRadWindow(i,pWindowInfo);
2332 return 1;
2333 }
2334 break;
2335 case IDC_STYLE_VSCROLL:
2336 if(HIWORD(wParam)==BN_CLICKED){
2337 //変更情報
2338 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2339
2340 if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0))
2341 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=WS_VSCROLL;
2342 else
2343 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~WS_VSCROLL;
2344 DrawRadWindow(i,pWindowInfo);
2345 return 1;
2346 }
2347 break;
2348 case IDC_ES_AUTOVSCROLL:
2349 if(HIWORD(wParam)==BN_CLICKED){
2350 //変更情報
2351 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2352
2353 if(SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_GETCHECK,0,0))
2354 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_AUTOVSCROLL;
2355 else
2356 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_AUTOVSCROLL;
2357 DrawRadWindow(i,pWindowInfo);
2358 return 1;
2359 }
2360 break;
2361 case IDC_ES_PASSWORD:
2362 if(HIWORD(wParam)==BN_CLICKED){
2363 //変更情報
2364 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2365
2366 if(SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_GETCHECK,0,0))
2367 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_PASSWORD;
2368 else
2369 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_PASSWORD;
2370 DrawRadWindow(i,pWindowInfo);
2371 return 1;
2372 }
2373 break;
2374 case IDC_ES_NOHIDESEL:
2375 if(HIWORD(wParam)==BN_CLICKED){
2376 //変更情報
2377 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2378
2379 if(SendDlgItemMessage(hwnd,IDC_ES_NOHIDESEL,BM_GETCHECK,0,0))
2380 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_NOHIDESEL;
2381 else
2382 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_NOHIDESEL;
2383 DrawRadWindow(i,pWindowInfo);
2384 return 1;
2385 }
2386 break;
2387 case IDC_ES_OEMCONVERT:
2388 if(HIWORD(wParam)==BN_CLICKED){
2389 //変更情報
2390 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2391
2392 if(SendDlgItemMessage(hwnd,IDC_ES_OEMCONVERT,BM_GETCHECK,0,0))
2393 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_OEMCONVERT;
2394 else
2395 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_OEMCONVERT;
2396 DrawRadWindow(i,pWindowInfo);
2397 return 1;
2398 }
2399 break;
2400 case IDC_ES_WANTRETURN:
2401 if(HIWORD(wParam)==BN_CLICKED){
2402 //変更情報
2403 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2404
2405 if(SendDlgItemMessage(hwnd,IDC_ES_WANTRETURN,BM_GETCHECK,0,0))
2406 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_WANTRETURN;
2407 else
2408 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_WANTRETURN;
2409 DrawRadWindow(i,pWindowInfo);
2410 return 1;
2411 }
2412 break;
2413 case IDC_ES_UPPERCASE:
2414 if(HIWORD(wParam)==BN_CLICKED){
2415 //変更情報
2416 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2417
2418 if(SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_GETCHECK,0,0)){
2419 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_LOWERCASE;
2420 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_UPPERCASE;
2421 SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_SETCHECK,BST_UNCHECKED,0);
2422 }
2423 else
2424 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_UPPERCASE;
2425 DrawRadWindow(i,pWindowInfo);
2426 return 1;
2427 }
2428 break;
2429 case IDC_ES_LOWERCASE:
2430 if(HIWORD(wParam)==BN_CLICKED){
2431 //変更情報
2432 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2433
2434 if(SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_GETCHECK,0,0)){
2435 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_UPPERCASE;
2436 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_LOWERCASE;
2437 SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_SETCHECK,BST_UNCHECKED,0);
2438 }
2439 else
2440 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_LOWERCASE;
2441 DrawRadWindow(i,pWindowInfo);
2442 return 1;
2443 }
2444 break;
2445 case IDC_ES_READONLY:
2446 if(HIWORD(wParam)==BN_CLICKED){
2447 //変更情報
2448 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2449
2450 if(SendDlgItemMessage(hwnd,IDC_ES_READONLY,BM_GETCHECK,0,0))
2451 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_READONLY;
2452 else
2453 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~ES_READONLY;
2454 DrawRadWindow(i,pWindowInfo);
2455 return 1;
2456 }
2457 break;
2458
2459 case IDC_ES_TEXTPOS:
2460 if(HIWORD(wParam)==CBN_SELCHANGE){
2461 //変更情報
2462 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2463
2464 i3=SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_GETCURSEL,0,0);
2465 //ES_LEFT=0
2466 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(ES_CENTER|ES_RIGHT);
2467 if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_CENTER;
2468 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=ES_RIGHT;
2469 DrawRadWindow(i,pWindowInfo);
2470 return 1;
2471 }
2472 break;
2473
2474 case IDC_EXSTYLE:
2475 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,(DLGPROC)DlgRadProperty_Item_ExStyle)) return 1;
2476 DrawRadWindow(i,pWindowInfo);
2477 return 1;
2478 }
2479 break;
2480 }
2481 }
2482 return 0;
2483}
2484
2485
2486////////////////////////
2487// GROUPBOX プロパティ
2488
2489BOOL CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
2490 extern MDIINFO MdiInfo[MAX_WNDNUM];
2491 int i,i2,i3;
2492 static BOOL bInitial;
2493
2494 switch(message){
2495 case WM_INITDIALOG:
2496 {
2497 bInitial=1;
2498 i=GetWndNum(GetParent(GetParent(hwnd)));
2499 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
2500
2501 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
2502 SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->caption);
2503
2504
2505 /////////////////////////////
2506 // スタイル
2507 ////////////
2508
2509 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
2510 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
2511 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
2512 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
2513
2514
2515 //////////////////
2516 // 水平方向の配置
2517 //////////////////
2518
2519 //"デフォルト"
2520 SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_DEFAULT);
2521 //"左端"
2522 SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_LEFT);
2523 //"右端"
2524 SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_RIGHT);
2525 //"中央"
2526 SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_CENTER);
2527
2528 //ビットを考慮してBS_CENTERを最初に検討する
2529 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,3,0);
2530 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,1,0);
2531 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,2,0);
2532 else SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,0,0);
2533
2534 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0);
2535 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0);
2536 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
2537
2538
2539 bInitial=0;
2540 break;
2541 }
2542 case WM_COMMAND:
2543 {
2544 i=GetWndNum(GetParent(GetParent(hwnd)));
2545 if(i==-1) return 1;
2546 i2=GetWndInfoNum(MdiInfo[i].path);
2547 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
2548
2549 //共通スタイル
2550 if(bInitial==0){
2551 if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
2552 }
2553
2554 switch(LOWORD(wParam)){
2555 case IDC_BS_POSITION:
2556 if(HIWORD(wParam)==CBN_SELCHANGE){
2557 //変更情報
2558 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2559
2560 i3=SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_GETCURSEL,0,0);
2561 //BS_CENTER=BS_LEFT | BS_RIGHT
2562 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(BS_CENTER);
2563 if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_LEFT;
2564 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_RIGHT;
2565 else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_CENTER;
2566 DrawRadWindow(i,pWindowInfo);
2567 return 1;
2568 }
2569 break;
2570
2571 case IDC_BS_ICON:
2572 if(HIWORD(wParam)==BN_CLICKED){
2573 //変更情報
2574 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2575
2576 if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0))
2577 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_ICON;
2578 else
2579 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_ICON;
2580 DrawRadWindow(i,pWindowInfo);
2581 return 1;
2582 }
2583 break;
2584 case IDC_BS_BITMAP:
2585 if(HIWORD(wParam)==BN_CLICKED){
2586 //変更情報
2587 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2588
2589 if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0))
2590 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_BITMAP;
2591 else
2592 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_BITMAP;
2593 DrawRadWindow(i,pWindowInfo);
2594 return 1;
2595 }
2596 break;
2597 case IDC_BS_NOTIFY:
2598 if(HIWORD(wParam)==BN_CLICKED){
2599 //変更情報
2600 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2601
2602 if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0))
2603 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=BS_NOTIFY;
2604 else
2605 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~BS_NOTIFY;
2606 return 1;
2607 }
2608 break;
2609
2610 case IDC_EXSTYLE:
2611 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,(DLGPROC)DlgRadProperty_Item_ExStyle)) return 1;
2612 DrawRadWindow(i,pWindowInfo);
2613 return 1;
2614 }
2615 break;
2616 }
2617 }
2618 return 0;
2619}
2620
2621
2622////////////////////////
2623// IMAGEBOX プロパティ
2624
2625void RadProperty_ImageBox_StylingOrder(HWND hwnd,DWORD *style){
2626 if((*style&0x000F)==SS_ICON||
2627 (*style&0x000F)==SS_BITMAP){
2628 EnableWindow(GetDlgItem(hwnd,IDC_PATH),1);
2629 EnableWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),1);
2630 EnableWindow(GetDlgItem(hwnd,IDC_SS_CENTERIMAGE),1);
2631 EnableWindow(GetDlgItem(hwnd,IDC_SS_RIGHTJUST),1);
2632 }
2633 else{
2634 EnableWindow(GetDlgItem(hwnd,IDC_PATH),0);
2635 EnableWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),0);
2636 EnableWindow(GetDlgItem(hwnd,IDC_SS_CENTERIMAGE),0);
2637 EnableWindow(GetDlgItem(hwnd,IDC_SS_RIGHTJUST),0);
2638 }
2639}
2640BOOL CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
2641 extern HANDLE hHeap;
2642 extern MDIINFO MdiInfo[MAX_WNDNUM];
2643 int i,i2,i3;
2644 char temporary[MAX_PATH];
2645 static BOOL bInitial;
2646
2647 switch(message){
2648 case WM_INITDIALOG:
2649 {
2650 bInitial=1;
2651 i=GetWndNum(GetParent(GetParent(hwnd)));
2652 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
2653
2654 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
2655
2656
2657 /////////////////////////////
2658 // スタイル
2659 ////////////
2660
2661 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
2662 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
2663 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
2664 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
2665
2666 //////////
2667 // タイプ
2668 //////////
2669
2670 //"フレーム(黒)"
2671 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_BLACK);
2672 //"フレーム(灰色)"
2673 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_GRAY);
2674 //"フレーム(白)"
2675 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_WHITE);
2676 //"フレーム(縁取り)"
2677 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_ETCHED);
2678 //"四角形(黒)"
2679 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_RECT_BLACK);
2680 //"四角形(灰色)"
2681 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_RECT_GRAY);
2682 //"四角形(白)"
2683 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_RECT_WHITE);
2684 //"アイコン"
2685 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_ICON);
2686 //"ビットマップ"
2687 SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_BITMAP);
2688
2689 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BLACKFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,0,0);
2690 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_GRAYFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,1,0);
2691 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_WHITEFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,2,0);
2692 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000001F)==SS_ETCHEDFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,3,0);
2693 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BLACKRECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,4,0);
2694 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_GRAYRECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,5,0);
2695 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_WHITERECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,6,0);
2696 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON||
2697 (pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
2698 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,7,0);
2699 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,8,0);
2700
2701 //リソース/ファイル スイッチチェックを表示
2702 ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_SHOW);
2703 ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_SHOW);
2704
2705 //イメージ状態テキストを表示
2706 ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_SHOW);
2707
2708 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type==IMGTYPE_FILE){
2709 //ファイル指定を表示
2710 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW);
2711 ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW);
2712 SetDlgItemText(hwnd,IDC_PATH,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path);
2713
2714 //イメージ状態テキスト
2715 //"ファイル指定:"
2716 SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE);
2717
2718 SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0);
2719 }
2720 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type==IMGTYPE_RES){
2721 //リソース指定を表示
2722 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW);
2723
2724 //イメージ状態テキスト
2725 //"リソース指定:"
2726 SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE);
2727
2728 SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0);
2729
2730 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0);
2731
2732 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON){
2733 //アイコンリソースをコンボボックスに挿入
2734 for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++)
2735 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
2736 }
2737 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
2738 //ビットマップリソースをコンボボックスに挿入
2739 for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++)
2740 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
2741 }
2742
2743 //リストから選択
2744 i3=SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_FINDSTRING,0,(long)pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path);
2745 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
2746 }
2747 }
2748
2749 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&SS_NOTIFY) SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
2750 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&SS_CENTERIMAGE) SendDlgItemMessage(hwnd,IDC_SS_CENTERIMAGE,BM_SETCHECK,BST_CHECKED,0);
2751 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&SS_RIGHTJUST) SendDlgItemMessage(hwnd,IDC_SS_RIGHTJUST,BM_SETCHECK,BST_CHECKED,0);
2752
2753 RadProperty_ImageBox_StylingOrder(hwnd,&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2754
2755 bInitial=0;
2756 break;
2757 }
2758 case WM_COMMAND:
2759 {
2760 i=GetWndNum(GetParent(GetParent(hwnd)));
2761 if(i==-1) return 1;
2762 i2=GetWndInfoNum(MdiInfo[i].path);
2763 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
2764
2765 //共通スタイル
2766 if(bInitial==0){
2767 if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
2768 }
2769
2770 switch(LOWORD(wParam)){
2771 case IDC_IMAGE_TYPE:
2772 if(HIWORD(wParam)==CBN_SELCHANGE){
2773 //変更情報
2774 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2775
2776 i3=SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_GETCURSEL,0,0);
2777 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~(0x0000001F);
2778 if(i3==0) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_BLACKFRAME;
2779 else if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_GRAYFRAME;
2780 else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_WHITEFRAME;
2781 else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_ETCHEDFRAME;
2782 else if(i3==4) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_BLACKRECT;
2783 else if(i3==5) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_GRAYRECT;
2784 else if(i3==6) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_WHITERECT;
2785 else if(i3==7) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_ICON;
2786 else if(i3==8) pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_BITMAP;
2787
2788 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON||
2789 (pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
2790 //リソース/ファイル スイッチチェックを表示
2791 ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_SHOW);
2792 ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_SHOW);
2793
2794 //イメージ状態テキストを表示
2795 ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_SHOW);
2796
2797 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type==IMGTYPE_FILE){
2798 //ファイル指定を表示
2799 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW);
2800 ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW);
2801 SetDlgItemText(hwnd,IDC_PATH,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path);
2802
2803 //イメージ状態テキスト
2804 //"ファイル指定:"
2805 SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE);
2806
2807 SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0);
2808 }
2809 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type==IMGTYPE_RES){
2810 //リソース指定を表示
2811 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW);
2812
2813 //イメージ状態テキスト
2814 //"リソース指定:"
2815 SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE);
2816
2817 SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0);
2818
2819 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0);
2820
2821 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON){
2822 //アイコンリソースをコンボボックスに挿入
2823 for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
2824 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
2825
2826 if( projectInfo.resourceManager.iconResources[i3].idName == pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path )
2827 {
2828 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
2829 }
2830 }
2831 }
2832 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
2833 //ビットマップリソースをコンボボックスに挿入
2834 for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++){
2835 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
2836
2837 if( projectInfo.resourceManager.bitmapResources[i3].idName == pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path )
2838 {
2839 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
2840 }
2841 }
2842 }
2843 }
2844 }
2845 else{
2846 //リソース/ファイル スイッチチェックを非表示
2847 ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_HIDE);
2848 ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_HIDE);
2849
2850 //イメージ状態テキストを非表示
2851 ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_HIDE);
2852
2853 //ファイル指定を非表示
2854 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_HIDE);
2855 ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_HIDE);
2856
2857 //リソース指定を非表示
2858 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_HIDE);
2859 }
2860
2861 RadProperty_ImageBox_StylingOrder(hwnd,&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2862 DrawRadWindow(i,pWindowInfo);
2863 return 1;
2864 }
2865 break;
2866
2867 case IDC_FILE:
2868 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type==IMGTYPE_FILE){
2869 //変更無し
2870 break;
2871 }
2872
2873 //変更情報
2874 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo);
2875
2876 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type=IMGTYPE_FILE;
2877
2878 //ファイル指定を表示
2879 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW);
2880 ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW);
2881 SetDlgItemText(hwnd,IDC_PATH,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path);
2882
2883 //リソース指定を非表示
2884 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_HIDE);
2885
2886 //イメージ状態テキスト
2887 //"ファイル指定:"
2888 SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE);
2889
2890 SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0);
2891 break;
2892
2893 case IDC_RESOURCE:
2894 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type==IMGTYPE_RES){
2895 //変更無し
2896 break;
2897 }
2898
2899 //変更情報
2900 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo);
2901
2902 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type=IMGTYPE_RES;
2903
2904 //ファイル指定を非表示
2905 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_HIDE);
2906 ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_HIDE);
2907
2908 //リソース指定を表示
2909 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW);
2910
2911 //イメージ状態テキスト
2912 //"リソース指定:"
2913 SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE);
2914
2915 SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0);
2916
2917 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0);
2918
2919 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON){
2920 //アイコンリソースをコンボボックスに挿入
2921 for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++)
2922 {
2923 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
2924 }
2925 }
2926 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
2927 //ビットマップリソースをコンボボックスに挿入
2928 for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++)
2929 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
2930 }
2931 break;
2932
2933 case IDC_RESCOMBO:
2934 if(HIWORD(wParam)==CBN_SELCHANGE){
2935 //変更情報
2936 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo);
2937
2938 i3=SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_GETCURSEL,0,0);
2939 SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_GETLBTEXT,i3,(long)temporary);
2940
2941 HeapDefaultFree(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path);
2942 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
2943 lstrcpy(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path,temporary);
2944
2945 DrawRadWindow(i,pWindowInfo);
2946 }
2947 break;
2948
2949 case IDC_CHANGEPATH:
2950 if(HIWORD(wParam)==BN_CLICKED){
2951 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.type==IMGTYPE_FILE){
2952 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x000F)==SS_ICON){
2953 extern LPSTR IconFileFilter;
2954 //"アイコン ファイルを指定して下さい"
2955 if(!GetFilePathDialog(hwnd,temporary,IconFileFilter,STRING_IMAGEBOXPROP_GETPATH_ICON,1)) return 1;
2956 }
2957 else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x000F)==SS_BITMAP){
2958 extern LPSTR BitmapFileFilter;
2959 //"ビットマップ ファイルを指定して下さい"
2960 if(!GetFilePathDialog(hwnd,temporary,BitmapFileFilter,STRING_IMAGEBOXPROP_GETPATH_BITMAP,1)) return 1;
2961 }
2962
2963 //変更情報
2964 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo);
2965
2966 lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() );
2967 HeapDefaultFree(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path);
2968 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
2969 lstrcpy(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path,temporary);
2970
2971 SetDlgItemText(hwnd,IDC_PATH,temporary);
2972 DrawRadWindow(i,pWindowInfo);
2973 }
2974 return 1;
2975 }
2976 break;
2977
2978 case IDC_SS_NOTIFY:
2979 if(HIWORD(wParam)==BN_CLICKED){
2980 //変更情報
2981 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2982
2983 if(SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_GETCHECK,0,0))
2984 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_NOTIFY;
2985 else
2986 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~SS_NOTIFY;
2987 return 1;
2988 }
2989 break;
2990 case IDC_SS_CENTERIMAGE:
2991 if(HIWORD(wParam)==BN_CLICKED){
2992 //変更情報
2993 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
2994
2995 if(SendDlgItemMessage(hwnd,IDC_SS_CENTERIMAGE,BM_GETCHECK,0,0))
2996 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_CENTERIMAGE;
2997 else
2998 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~SS_CENTERIMAGE;
2999 return 1;
3000 }
3001 break;
3002 case IDC_SS_RIGHTJUST:
3003 if(HIWORD(wParam)==BN_CLICKED){
3004 //変更情報
3005 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style);
3006
3007 if(SendDlgItemMessage(hwnd,IDC_SS_RIGHTJUST,BM_GETCHECK,0,0))
3008 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style|=SS_RIGHTJUST;
3009 else
3010 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&=~SS_RIGHTJUST;
3011 return 1;
3012 }
3013 break;
3014
3015 case IDC_EXSTYLE:
3016 if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,(DLGPROC)DlgRadProperty_Item_ExStyle)) return 1;
3017 DrawRadWindow(i,pWindowInfo);
3018 return 1;
3019 }
3020 break;
3021 }
3022 }
3023 return 0;
3024}
3025
3026
3027////////////////////////
3028// LISTVIEW プロパティ
3029BOOL CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
3030 extern MDIINFO MdiInfo[MAX_WNDNUM];
3031 int i,i2,i3;
3032 static BOOL bInitial;
3033
3034 switch(message){
3035 case WM_INITDIALOG:
3036 {
3037 bInitial=1;
3038 i=GetWndNum(GetParent(GetParent(hwnd)));
3039 WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
3040
3041 SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->IdName);
3042
3043
3044 /////////////////////////
3045 // スタイル
3046 ////////////
3047
3048 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
3049 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
3050 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
3051 if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
3052
3053 ////////
3054 // 表示
3055 ////////
3056
3057 //"アイコン"
3058 SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_ICON);
3059 //"小さいアイコン"
3060 SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_SMALLICON);
3061 //"リスト"
3062 SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_LIST);
3063 //"レポート"
3064 SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_REPORT);
3065
3066 //ビットを考慮してLVS_LISTを最初に比較する
3067 if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&LVS_LIST)==LVS_LIST) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,2,0);
3068 else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&LVS_SMALLICON) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,1,0);
3069