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

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

MDIINFO構造体をリファクタリング。

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