1 | #include "stdafx.h"
|
---|
2 |
|
---|
3 |
|
---|
4 | #include "common.h"
|
---|
5 |
|
---|
6 | void NewRadWindow( const ActiveBasic::PM::WindowInfo &windowInfo )
|
---|
7 | {
|
---|
8 | extern HINSTANCE hInst,hResInst;
|
---|
9 | extern HWND hDocCombo;
|
---|
10 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
11 | int i,i2;
|
---|
12 | HWND hChild;
|
---|
13 | RECT rect;
|
---|
14 | MDICREATESTRUCT mdic;
|
---|
15 |
|
---|
16 | //すでに指定されたファイルが開かれている場合
|
---|
17 | hChild=GetWindow(hClient,GW_CHILD);
|
---|
18 | while(hChild){
|
---|
19 | i=GetWndNum(hChild);
|
---|
20 | if(MdiInfo[i].DocType==WNDTYPE_RAD){
|
---|
21 | if(lstrcmpi(MdiInfo[i].path,windowInfo.GetName().c_str())==0) break;
|
---|
22 | }
|
---|
23 | hChild=GetNextWindow(hChild,GW_HWNDNEXT);
|
---|
24 | }
|
---|
25 | if(hChild){
|
---|
26 | BringWindowToTop(hChild);
|
---|
27 | return;
|
---|
28 | }
|
---|
29 |
|
---|
30 | mdic.szTitle=windowInfo.GetName().c_str();
|
---|
31 | mdic.szClass="MDIClientWindow_Rad";
|
---|
32 | mdic.hOwner=hInst;
|
---|
33 | mdic.x=CW_USEDEFAULT;
|
---|
34 | mdic.y=CW_USEDEFAULT;
|
---|
35 | mdic.cx=CW_USEDEFAULT;
|
---|
36 | mdic.cy=CW_USEDEFAULT;
|
---|
37 |
|
---|
38 | hChild=GetWindow(hClient,GW_CHILD);
|
---|
39 | if(IsWindow(hChild)){
|
---|
40 | if(IsZoomed(hChild)) mdic.style=WS_MAXIMIZE|WS_CLIPCHILDREN;
|
---|
41 | else mdic.style=0;
|
---|
42 | }
|
---|
43 | else{
|
---|
44 | if(pobj_nv->bMDIZoomed) mdic.style=WS_MAXIMIZE|WS_CLIPCHILDREN;
|
---|
45 | else mdic.style=0;
|
---|
46 | }
|
---|
47 |
|
---|
48 | mdic.lParam=0;
|
---|
49 | hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(long)&mdic); //ウィンドウ作成
|
---|
50 |
|
---|
51 |
|
---|
52 | //////////////////////
|
---|
53 | // 子ウィンドウを作成
|
---|
54 | //////////////////////
|
---|
55 |
|
---|
56 | //ツールウィンドウを作成
|
---|
57 | HWND hTools;
|
---|
58 | hTools=CreateWindow("RadToolsWindow",NULL,
|
---|
59 | WS_CHILD|WS_VSCROLL|WS_VISIBLE|WS_CLIPCHILDREN,
|
---|
60 | 0,0,0,0,
|
---|
61 | hChild,NULL,hInst,NULL);
|
---|
62 |
|
---|
63 | //プロパティウィンドウを作成
|
---|
64 | HWND hProperty;
|
---|
65 | hProperty=CreateWindowEx(WS_EX_CLIENTEDGE,"RadPropertyWindow",NULL,
|
---|
66 | WS_CHILD|WS_VSCROLL|WS_VISIBLE|WS_CLIPCHILDREN,
|
---|
67 | 0,0,0,0,
|
---|
68 | hChild,NULL,hInst,NULL);
|
---|
69 |
|
---|
70 | //内部RADウィンドウを作成
|
---|
71 | HWND hRad;
|
---|
72 | hRad=CreateWindowEx(WS_EX_CLIENTEDGE,"RadWindow",NULL,
|
---|
73 | WS_CHILD|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE|WS_CLIPCHILDREN,
|
---|
74 | 0,0,0,0,
|
---|
75 | hChild,NULL,hInst,NULL);
|
---|
76 |
|
---|
77 | //サポートウィンドウを作成
|
---|
78 | HWND hSupport;
|
---|
79 | hSupport=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_SUPPORT),hChild,(DLGPROC)DlgRadSupport);
|
---|
80 |
|
---|
81 | //ウィンドウのID登録
|
---|
82 | HDC hdc;
|
---|
83 | for(i=0;i<MAX_WNDNUM;i++){
|
---|
84 | if(MdiInfo[i].hwnd==0){
|
---|
85 | MdiInfo[i].hwnd=hChild;
|
---|
86 | MdiInfo[i].DocType=WNDTYPE_RAD;
|
---|
87 | MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,windowInfo.GetName().size()+1);
|
---|
88 | lstrcpy(MdiInfo[i].title,windowInfo.GetName().c_str());
|
---|
89 | MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,windowInfo.GetName().size()+1);
|
---|
90 | lstrcpy(MdiInfo[i].path,windowInfo.GetName().c_str());
|
---|
91 |
|
---|
92 |
|
---|
93 | ////////////////////////////
|
---|
94 | // MDIRADINFO構造体をセット
|
---|
95 | ////////////////////////////
|
---|
96 |
|
---|
97 | MdiInfo[i].MdiRadInfo=(MDIRADINFO *)GlobalAlloc(GPTR,sizeof(MDIRADINFO));
|
---|
98 |
|
---|
99 | MdiInfo[i].MdiRadInfo->hTools=hTools;
|
---|
100 | MdiInfo[i].MdiRadInfo->hProperty=hProperty;
|
---|
101 | MdiInfo[i].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),hProperty,(DLGPROC)RadProperty_WindowProc);
|
---|
102 |
|
---|
103 | SCROLLINFO ScrollInfo;
|
---|
104 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
105 | ScrollInfo.fMask=SIF_POS;
|
---|
106 | ScrollInfo.nPos=0;
|
---|
107 | SetScrollInfo(MdiInfo[i].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
|
---|
108 |
|
---|
109 | MdiInfo[i].MdiRadInfo->hRad=hRad;
|
---|
110 |
|
---|
111 | MdiInfo[i].MdiRadInfo->hSupport=hSupport;
|
---|
112 |
|
---|
113 | hdc=GetDC(hRad);
|
---|
114 | MdiInfo[i].MdiRadInfo->hBitmap=CreateCompatibleBitmap(hdc,ScreenX*2,ScreenY*2);
|
---|
115 | MdiInfo[i].MdiRadInfo->hMemDC=CreateCompatibleDC(hdc);
|
---|
116 | MdiInfo[i].MdiRadInfo->hOldBitmap=
|
---|
117 | (HBITMAP)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,MdiInfo[i].MdiRadInfo->hBitmap);
|
---|
118 | ReleaseDC(hRad,hdc);
|
---|
119 |
|
---|
120 | for(i2=0;i2<MAX_RAD_SELITEM;i2++) MdiInfo[i].MdiRadInfo->SelectingItem[i2]=-1;
|
---|
121 | MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
|
---|
122 |
|
---|
123 | //変更情報を初期化
|
---|
124 | MdiInfo[i].MdiRadInfo->undo.NowPos=0;
|
---|
125 | memset(MdiInfo[i].MdiRadInfo->undo.Command,0,sizeof(int)*MAX_UNDONUM);
|
---|
126 |
|
---|
127 |
|
---|
128 | DrawRadWindow(i,&windowInfo);
|
---|
129 |
|
---|
130 | //サポートダイアログの内容をセット
|
---|
131 | SetSupportDlgData(i,windowInfo);
|
---|
132 |
|
---|
133 | break;
|
---|
134 | }
|
---|
135 | }
|
---|
136 |
|
---|
137 | ShowWindow(hSupport,SW_SHOW);
|
---|
138 |
|
---|
139 | //ウィンドウ位置を初期化
|
---|
140 | GetClientRect(hChild,&rect);
|
---|
141 | ResizeToRadToolWindows(i,rect.right,rect.bottom);
|
---|
142 |
|
---|
143 | i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)windowInfo.GetName().c_str()); //Docコンボボックスに追加
|
---|
144 | SendMessage(hDocCombo,CB_SETCURSEL,i,0);
|
---|
145 |
|
---|
146 | //タブに追加
|
---|
147 | pobj_MainTab->InsertItem( windowInfo.GetName().c_str(), true );
|
---|
148 |
|
---|
149 | //メニュー状態を設定
|
---|
150 | ResetState_DocMenu();
|
---|
151 |
|
---|
152 | SetFocus(hRad);
|
---|
153 | }
|
---|
154 |
|
---|
155 | int InsertDlgItem(int WndNum,int WndInfoNum,int ItemNum,POINT *pPos,SIZE *pSize,const char *IdName,const char *caption,DWORD style_or_WndNum,DWORD ExStyle,int Control,ActiveBasic::PM::ImageReferenceType::EnumType ImageType,const char *ImagePath,DWORD dwInsertType){
|
---|
156 | //dwInsertType
|
---|
157 | //0 … 元に戻す、やり直し
|
---|
158 | //1 … 通常の挿入
|
---|
159 | //2 … 貼り付け
|
---|
160 |
|
---|
161 | extern HANDLE hHeap;
|
---|
162 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
163 | int i,i2,NewItemNum;
|
---|
164 | char temporary[MAX_PATH];
|
---|
165 |
|
---|
166 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
167 |
|
---|
168 | ActiveBasic::PM::ChildWindowInfo *pChildInfo = new ActiveBasic::PM::ChildWindowInfo();
|
---|
169 |
|
---|
170 | if(ItemNum==-1)
|
---|
171 | {
|
---|
172 | NewItemNum = pWindowInfo->childWindowInfos.size();
|
---|
173 | pWindowInfo->childWindowInfos.push_back( pChildInfo );
|
---|
174 | }
|
---|
175 | else
|
---|
176 | {
|
---|
177 | ActiveBasic::PM::ChildWindowInfos::iterator it = pWindowInfo->childWindowInfos.begin();
|
---|
178 | for( int i=0; i<ItemNum; i++ )
|
---|
179 | {
|
---|
180 | it++;
|
---|
181 | }
|
---|
182 | pWindowInfo->childWindowInfos.insert( it, pChildInfo );
|
---|
183 |
|
---|
184 | NewItemNum=ItemNum;
|
---|
185 | }
|
---|
186 |
|
---|
187 | //ID
|
---|
188 | if(ItemNum==-1){
|
---|
189 | char temp2[1024];
|
---|
190 | lstrcpy( temp2, IdName );
|
---|
191 | for(i=lstrlen(temp2)-1;i>=0;i--){
|
---|
192 | if(!('0'<=temp2[i]&&temp2[i]<='9')) break;
|
---|
193 | }
|
---|
194 | i++;
|
---|
195 |
|
---|
196 | if(temp2[i]!='\0'){
|
---|
197 | i2=atoi(temp2+i)+1;
|
---|
198 | if(dwInsertType==2) i2--;
|
---|
199 | temp2[i]=0;
|
---|
200 | }
|
---|
201 | else{
|
---|
202 | if(dwInsertType==2) i2=0;
|
---|
203 | else i2=1;
|
---|
204 | }
|
---|
205 |
|
---|
206 | if(i2==0) lstrcpy(temporary,temp2);
|
---|
207 | else sprintf(temporary,"%s%d",temp2,i2);
|
---|
208 | SearchStart:
|
---|
209 | for( i=0; i<static_cast<int>(pWindowInfo->childWindowInfos.size()); i++ )
|
---|
210 | {
|
---|
211 | if( i != NewItemNum )
|
---|
212 | {
|
---|
213 | if( pWindowInfo->childWindowInfos[i]->GetName() == temporary )
|
---|
214 | {
|
---|
215 | i2++;
|
---|
216 | sprintf(temporary,"%s%d",temp2,i2);
|
---|
217 | goto SearchStart;
|
---|
218 | }
|
---|
219 | }
|
---|
220 | }
|
---|
221 | }
|
---|
222 | else lstrcpy(temporary,IdName);
|
---|
223 | pChildInfo->SetName( temporary );
|
---|
224 |
|
---|
225 | //位置
|
---|
226 | pChildInfo->pos=*pPos;
|
---|
227 | pChildInfo->size=*pSize;
|
---|
228 | //小さすぎる場合は、最小の大きさに調整
|
---|
229 | if(pChildInfo->size.cx<MIN_ITEM_X) pChildInfo->size.cx=MIN_ITEM_X;
|
---|
230 | if(pChildInfo->size.cy<MIN_ITEM_Y) pChildInfo->size.cy=MIN_ITEM_Y;
|
---|
231 |
|
---|
232 | //テキスト
|
---|
233 | if(ItemNum==-1){
|
---|
234 | if(dwInsertType==1){
|
---|
235 | if(caption[0]) sprintf(temporary,"%s%d",caption,i2);
|
---|
236 | else temporary[0]=0;
|
---|
237 | }
|
---|
238 | else lstrcpy(temporary,caption);
|
---|
239 | }
|
---|
240 | else lstrcpy(temporary,caption);
|
---|
241 | pChildInfo->SetCaption( temporary );
|
---|
242 |
|
---|
243 | //スタイル
|
---|
244 | pChildInfo->SetStyle( style_or_WndNum );
|
---|
245 |
|
---|
246 | //拡張スタイル
|
---|
247 | pChildInfo->SetExStyle( ExStyle );
|
---|
248 |
|
---|
249 | //クラス名
|
---|
250 | pChildInfo->Control=Control;
|
---|
251 |
|
---|
252 | if(Control==CT_IMAGEBOX){
|
---|
253 | //イメージ ボックスの場合
|
---|
254 | pChildInfo->image.type = ImageType;
|
---|
255 | if(!ImagePath)
|
---|
256 | {
|
---|
257 | pChildInfo->image.path = "";
|
---|
258 | }
|
---|
259 | else{
|
---|
260 | pChildInfo->image.path = ImagePath;
|
---|
261 | }
|
---|
262 | }
|
---|
263 |
|
---|
264 | //変更情報
|
---|
265 | if(dwInsertType!=0)
|
---|
266 | Rad_NoticeChanging(WndNum,RAD_UNDO_INSERTITEM,NewItemNum,(DWORD)pChildInfo);
|
---|
267 |
|
---|
268 | DrawRadWindow(WndNum,pWindowInfo);
|
---|
269 | return NewItemNum;
|
---|
270 | }
|
---|
271 | void DeleteDlgItem(int WndNum,int WndInfoNum,int ItemNum,BOOL bNoticeChanging){
|
---|
272 | extern HANDLE hHeap;
|
---|
273 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
274 |
|
---|
275 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
276 |
|
---|
277 | //変更情報
|
---|
278 | if(bNoticeChanging)
|
---|
279 | Rad_NoticeChanging(WndNum,RAD_UNDO_DELETEITEM,ItemNum,(DWORD)pWindowInfo->childWindowInfos[ItemNum]);
|
---|
280 |
|
---|
281 | //子ウィンドウのメモリを解放
|
---|
282 | delete pWindowInfo->childWindowInfos[ItemNum];
|
---|
283 |
|
---|
284 | ActiveBasic::PM::ChildWindowInfos::iterator it = pWindowInfo->childWindowInfos.begin();
|
---|
285 | for( int i=0; i<ItemNum; i++ )
|
---|
286 | {
|
---|
287 | it++;
|
---|
288 | }
|
---|
289 | pWindowInfo->childWindowInfos.erase( it );
|
---|
290 |
|
---|
291 | DrawRadWindow(WndNum,pWindowInfo);
|
---|
292 |
|
---|
293 |
|
---|
294 | //////////////////////////////
|
---|
295 | //プロパティウィンドウを設定
|
---|
296 | DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hProp_Dlg);
|
---|
297 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_WindowProc);
|
---|
298 |
|
---|
299 | SCROLLINFO ScrollInfo;
|
---|
300 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
301 | ScrollInfo.fMask=SIF_POS;
|
---|
302 | ScrollInfo.nPos=0;
|
---|
303 | SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
|
---|
304 |
|
---|
305 | RECT rect;
|
---|
306 | GetClientRect(MdiInfo[WndNum].MdiRadInfo->hProperty,&rect);
|
---|
307 | SendMessage(MdiInfo[WndNum].MdiRadInfo->hProperty,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
|
---|
308 | }
|
---|
309 |
|
---|
310 | void CursorPos_GlobalToLocal(HWND hwnd,long *x,long *y){
|
---|
311 | SCROLLINFO VertScrollInfo,HorzScrollInfo;
|
---|
312 |
|
---|
313 | VertScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
314 | VertScrollInfo.fMask=SIF_RANGE|SIF_POS;
|
---|
315 | GetScrollInfo(hwnd,SB_VERT,&VertScrollInfo);
|
---|
316 | HorzScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
317 | HorzScrollInfo.fMask=SIF_RANGE|SIF_POS;
|
---|
318 | GetScrollInfo(hwnd,SB_HORZ,&HorzScrollInfo);
|
---|
319 |
|
---|
320 | *x-=HorzScrollInfo.nPos;
|
---|
321 | *y-=VertScrollInfo.nPos;
|
---|
322 | }
|
---|
323 | void CursorPos_LocalToGlobal(HWND hwnd,long *x,long *y){
|
---|
324 | SCROLLINFO VertScrollInfo,HorzScrollInfo;
|
---|
325 |
|
---|
326 | VertScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
327 | VertScrollInfo.fMask=SIF_RANGE|SIF_POS;
|
---|
328 | GetScrollInfo(hwnd,SB_VERT,&VertScrollInfo);
|
---|
329 | HorzScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
330 | HorzScrollInfo.fMask=SIF_RANGE|SIF_POS;
|
---|
331 | GetScrollInfo(hwnd,SB_HORZ,&HorzScrollInfo);
|
---|
332 |
|
---|
333 | *x+=HorzScrollInfo.nPos;
|
---|
334 | *y+=VertScrollInfo.nPos;
|
---|
335 | }
|
---|
336 | void DrawFrame(HWND hwnd,int WndNum,int WndInfoNum,RECT *NewRect,RECT *OldRect,BOOL bLA){
|
---|
337 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
338 | static int swLineStop;
|
---|
339 | int i,sw;
|
---|
340 | int x,y;
|
---|
341 | HDC hdc;
|
---|
342 | HPEN hPen,hOldPen;
|
---|
343 | HBRUSH hOldBrush;
|
---|
344 | RECT rect;
|
---|
345 |
|
---|
346 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
347 |
|
---|
348 | hdc=GetDC(hwnd);
|
---|
349 |
|
---|
350 | sw=0;
|
---|
351 | if(pobj_nv->bLineAdjust&&bLA){
|
---|
352 | for( i=0; i<static_cast<int>(pWindowInfo->childWindowInfos.size()); i++ )
|
---|
353 | {
|
---|
354 | const ActiveBasic::PM::ChildWindowInfo *pChildInfo = pWindowInfo->childWindowInfos[i];
|
---|
355 | if(i==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]) continue;
|
---|
356 | if(pChildInfo->Control !=
|
---|
357 | pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control) continue;
|
---|
358 |
|
---|
359 | if(NewRect->left<OldRect->left){
|
---|
360 | if(pChildInfo->pos.x
|
---|
361 | >
|
---|
362 | NewRect->left - MdiInfo[WndNum].MdiRadInfo->ClientPos.x
|
---|
363 | &&
|
---|
364 | pChildInfo->pos.x-10
|
---|
365 | <
|
---|
366 | NewRect->left - MdiInfo[WndNum].MdiRadInfo->ClientPos.x){
|
---|
367 |
|
---|
368 | //左側をストップする
|
---|
369 | x=NewRect->right-NewRect->left;
|
---|
370 | NewRect->left=pChildInfo->pos.x + MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
|
---|
371 | NewRect->right=NewRect->left+x;
|
---|
372 |
|
---|
373 | hPen=CreatePen(PS_SOLID,0,RGB(100,100,100));
|
---|
374 | hOldPen=(HPEN)SelectObject(hdc,hPen);
|
---|
375 | MoveToEx(hdc,NewRect->left,0,NULL);
|
---|
376 | LineTo(hdc,NewRect->left,ScreenX);
|
---|
377 | SelectObject(hdc,hOldPen);
|
---|
378 | DeleteObject(hPen);
|
---|
379 |
|
---|
380 | swLineStop=1;
|
---|
381 | sw=1;
|
---|
382 | }
|
---|
383 | }
|
---|
384 | if(NewRect->top<OldRect->top){
|
---|
385 | if(pChildInfo->pos.y
|
---|
386 | >
|
---|
387 | NewRect->top - MdiInfo[WndNum].MdiRadInfo->ClientPos.y
|
---|
388 | &&
|
---|
389 | pChildInfo->pos.y-10
|
---|
390 | <
|
---|
391 | NewRect->top - MdiInfo[WndNum].MdiRadInfo->ClientPos.y){
|
---|
392 |
|
---|
393 | //左側をストップする
|
---|
394 | y=NewRect->bottom-NewRect->top;
|
---|
395 | NewRect->top=pChildInfo->pos.y + MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
|
---|
396 | NewRect->bottom=NewRect->top+y;
|
---|
397 |
|
---|
398 | hPen=CreatePen(PS_SOLID,0,RGB(100,100,100));
|
---|
399 | hOldPen=(HPEN)SelectObject(hdc,hPen);
|
---|
400 | MoveToEx(hdc,0,NewRect->top,NULL);
|
---|
401 | LineTo(hdc,ScreenY,NewRect->top);
|
---|
402 | SelectObject(hdc,hOldPen);
|
---|
403 | DeleteObject(hPen);
|
---|
404 |
|
---|
405 | swLineStop=1;
|
---|
406 | sw=1;
|
---|
407 | }
|
---|
408 | }
|
---|
409 | }
|
---|
410 | }
|
---|
411 |
|
---|
412 | //以前の選択フレームを消去
|
---|
413 | RectNaturalFormat(OldRect,&rect);
|
---|
414 | x=rect.left;
|
---|
415 | y=rect.top;
|
---|
416 | CursorPos_GlobalToLocal(hwnd,&rect.left,&rect.top);
|
---|
417 | CursorPos_GlobalToLocal(hwnd,&rect.right,&rect.bottom);
|
---|
418 | if(swLineStop&&sw==0){
|
---|
419 | BitBlt(hdc,0,0,ScreenX*2,ScreenY*2,
|
---|
420 | MdiInfo[WndNum].MdiRadInfo->hMemDC,0,0,SRCCOPY);
|
---|
421 | swLineStop=0;
|
---|
422 | }
|
---|
423 | else{
|
---|
424 | BitBlt(hdc,rect.left-LEVER_THICK, rect.top-LEVER_THICK,
|
---|
425 | rect.right-rect.left+LEVER_THICK*2, rect.bottom-rect.top+LEVER_THICK*2,
|
---|
426 | MdiInfo[WndNum].MdiRadInfo->hMemDC,x-LEVER_THICK,y-LEVER_THICK,SRCCOPY);
|
---|
427 | }
|
---|
428 |
|
---|
429 | //新しい選択フレームを描画
|
---|
430 | RectNaturalFormat(NewRect,&rect);
|
---|
431 | CursorPos_GlobalToLocal(hwnd,&rect.left,&rect.top);
|
---|
432 | CursorPos_GlobalToLocal(hwnd,&rect.right,&rect.bottom);
|
---|
433 |
|
---|
434 | hPen=CreatePen(PS_DOT,0,RGB(0,0,0));
|
---|
435 | SetBkMode(hdc,TRANSPARENT);
|
---|
436 | hOldPen=(HPEN)SelectObject(hdc,hPen);
|
---|
437 | hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
|
---|
438 | Rectangle(hdc,rect.left,rect.top,rect.right,rect.bottom);
|
---|
439 | SelectObject(hdc,hOldBrush);
|
---|
440 | SelectObject(hdc,hOldPen);
|
---|
441 | DeleteObject(hPen);
|
---|
442 |
|
---|
443 | ReleaseDC(hwnd,hdc);
|
---|
444 |
|
---|
445 | *OldRect=*NewRect;
|
---|
446 | }
|
---|
447 | void GetSelectingRect(int WndNum,int WndInfoNum,int num,RECT *rect){
|
---|
448 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
449 |
|
---|
450 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
451 |
|
---|
452 | if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]==SELECT_WINDOW){
|
---|
453 | //ウィンドウ軸を選択
|
---|
454 | rect->left=0;
|
---|
455 | rect->top=0;
|
---|
456 | rect->right=pWindowInfo->size.cx+(LEVER_THICK*2);
|
---|
457 | rect->bottom=pWindowInfo->size.cy+(LEVER_THICK*2);
|
---|
458 | }
|
---|
459 | else{
|
---|
460 | //子ウィンドウを選択
|
---|
461 | rect->left=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]]->pos.x-LEVER_THICK;
|
---|
462 | rect->top=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]]->pos.y-LEVER_THICK;
|
---|
463 | rect->right=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]]->pos.x+pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]]->size.cx+LEVER_THICK;
|
---|
464 | rect->bottom=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]]->pos.y+pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]]->size.cy+LEVER_THICK;
|
---|
465 | }
|
---|
466 | }
|
---|
467 | void DrawSelectingRect(HWND hwnd,int WndNum,int WndInfoNum,int ButtonSelect){
|
---|
468 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
469 | extern RADINFO RadInfo;
|
---|
470 | int i,i2,i3;
|
---|
471 | HDC hdc;
|
---|
472 | HPEN hPen,hOldPen;
|
---|
473 | HBRUSH hOldBrush;
|
---|
474 | COLORREF rgb;
|
---|
475 | RECT rect,tempRect;
|
---|
476 |
|
---|
477 | hdc=GetDC(hwnd);
|
---|
478 | if(ButtonSelect==IDC_TOOL_MOUSE) rgb=RGB(255,60,30);
|
---|
479 | else if(ButtonSelect==NON_TOOL) rgb=RGB(100,100,100);
|
---|
480 | hPen=CreatePen(PS_SOLID,0,rgb);
|
---|
481 | SetBkMode(hdc,TRANSPARENT);
|
---|
482 | hOldPen=(HPEN)SelectObject(hdc,hPen);
|
---|
483 |
|
---|
484 | i=0;
|
---|
485 | while(MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]!=-1||i==0){
|
---|
486 | GetSelectingRect(WndNum,WndInfoNum,i,&tempRect);
|
---|
487 | RectNaturalFormat(&tempRect,&rect);
|
---|
488 | CursorPos_GlobalToLocal(hwnd,&rect.left,&rect.top);
|
---|
489 | CursorPos_GlobalToLocal(hwnd,&rect.right,&rect.bottom);
|
---|
490 |
|
---|
491 | //主線
|
---|
492 | hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
|
---|
493 | Rectangle(hdc,
|
---|
494 | rect.left+2, rect.top+2,
|
---|
495 | rect.right-2, rect.bottom-2);
|
---|
496 | SelectObject(hdc,hOldBrush);
|
---|
497 |
|
---|
498 |
|
---|
499 | hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(WHITE_BRUSH));
|
---|
500 |
|
---|
501 | Rectangle(hdc,
|
---|
502 | rect.left,rect.top,
|
---|
503 | rect.left+5,rect.top+5);
|
---|
504 | Rectangle(hdc,
|
---|
505 | rect.left,rect.bottom-5,
|
---|
506 | rect.left+5,rect.bottom);
|
---|
507 | Rectangle(hdc,
|
---|
508 | rect.right-5,rect.top,
|
---|
509 | rect.right,rect.top+5);
|
---|
510 | Rectangle(hdc,
|
---|
511 | rect.right-5,rect.bottom-5,
|
---|
512 | rect.right,rect.bottom);
|
---|
513 |
|
---|
514 | i2=(rect.right-rect.left)/2;
|
---|
515 | i3=(rect.bottom-rect.top)/2;
|
---|
516 | Rectangle(hdc,
|
---|
517 | rect.left+i2-2,rect.top,
|
---|
518 | rect.left+i2+3,rect.top+5);
|
---|
519 | Rectangle(hdc,
|
---|
520 | rect.left+i2-2,rect.bottom-5,
|
---|
521 | rect.left+i2+3,rect.bottom);
|
---|
522 | Rectangle(hdc,
|
---|
523 | rect.left,rect.top+i3-2,
|
---|
524 | rect.left+5,rect.top+i3+3);
|
---|
525 | Rectangle(hdc,
|
---|
526 | rect.right-5,rect.top+i3-2,
|
---|
527 | rect.right,rect.top+i3+3);
|
---|
528 |
|
---|
529 | SelectObject(hdc,hOldBrush);
|
---|
530 |
|
---|
531 | //移動時の選択フレームの消去用範囲
|
---|
532 | RadInfo.OldDraggingRect[i]=rect;
|
---|
533 |
|
---|
534 | i++;
|
---|
535 | }
|
---|
536 |
|
---|
537 | SelectObject(hdc,hOldPen);
|
---|
538 | DeleteObject(hPen);
|
---|
539 |
|
---|
540 | ReleaseDC(hwnd,hdc);
|
---|
541 | }
|
---|
542 | void ChangePropertyWindow(int WndNum,int WndInfoNum){
|
---|
543 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
544 | RECT rect;
|
---|
545 | SCROLLINFO ScrollInfo;
|
---|
546 |
|
---|
547 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
548 |
|
---|
549 | DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hProp_Dlg);
|
---|
550 | if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
|
---|
551 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_WindowProc);
|
---|
552 |
|
---|
553 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
554 | ScrollInfo.fMask=SIF_POS;
|
---|
555 | ScrollInfo.nPos=0;
|
---|
556 | SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
|
---|
557 |
|
---|
558 | GetClientRect(MdiInfo[WndNum].MdiRadInfo->hProperty,&rect);
|
---|
559 | SendMessage(MdiInfo[WndNum].MdiRadInfo->hProperty,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
|
---|
560 | }
|
---|
561 | else{
|
---|
562 | if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_BUTTON)
|
---|
563 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_BUTTON),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ButtonProc);
|
---|
564 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_CHECKBOX)
|
---|
565 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_CHECKBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_CheckBoxProc);
|
---|
566 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_COMBOBOX)
|
---|
567 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_COMBOBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ComboBoxProc);
|
---|
568 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_EDIT)
|
---|
569 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_EDIT),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_EditProc);
|
---|
570 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_GROUPBOX)
|
---|
571 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_GROUPBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_GroupBoxProc);
|
---|
572 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_HSCROLLBAR)
|
---|
573 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_SCROLLBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ScrollBarProc);
|
---|
574 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_IMAGEBOX)
|
---|
575 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_IMAGEBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ImageBoxProc);
|
---|
576 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_LISTBOX)
|
---|
577 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_LISTBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ListBoxProc);
|
---|
578 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_LISTVIEW)
|
---|
579 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_LISTVIEW),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ListViewProc);
|
---|
580 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_PROGRESSBAR)
|
---|
581 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_PROGRESSBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ProgressBarProc);
|
---|
582 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_RADIOBUTTON)
|
---|
583 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_RADIOBUTTON),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_RadioButtonProc);
|
---|
584 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_STATIC)
|
---|
585 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_STATIC),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_StaticProc);
|
---|
586 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_TRACKBAR)
|
---|
587 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_TRACKBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_TrackBarProc);
|
---|
588 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_TREEVIEW)
|
---|
589 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_TREEVIEW),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_TreeViewProc);
|
---|
590 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_UPDOWN)
|
---|
591 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_UPDOWN),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_UpDownProc);
|
---|
592 | else if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_VSCROLLBAR)
|
---|
593 | MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_SCROLLBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,(DLGPROC)RadProperty_ScrollBarProc);
|
---|
594 |
|
---|
595 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
596 | ScrollInfo.fMask=SIF_POS;
|
---|
597 | ScrollInfo.nPos=0;
|
---|
598 | SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
|
---|
599 |
|
---|
600 | GetClientRect(MdiInfo[WndNum].MdiRadInfo->hProperty,&rect);
|
---|
601 | SendMessage(MdiInfo[WndNum].MdiRadInfo->hProperty,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
|
---|
602 | }
|
---|
603 | }
|
---|
604 | int GetItemNumOnMouse(int WndNum,int WndInfoNum,int x,int y){
|
---|
605 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
606 | int i;
|
---|
607 |
|
---|
608 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
609 |
|
---|
610 | for(i=pWindowInfo->childWindowInfos.size()-1;i>=0;i--){
|
---|
611 | if(pWindowInfo->childWindowInfos[i]->Control==CT_COMBOBOX&&
|
---|
612 | (pWindowInfo->childWindowInfos[i]->GetStyle()&0x000F)!=CBS_SIMPLE){
|
---|
613 | //コンボ ボックスの場合は表示部分をターゲットに選択する(高さ20pixel)
|
---|
614 | if(x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x&&
|
---|
615 | x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x+pWindowInfo->childWindowInfos[i]->size.cx&&
|
---|
616 | y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y&&
|
---|
617 | y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y+20){
|
---|
618 | break;
|
---|
619 | }
|
---|
620 | }
|
---|
621 | else if(pWindowInfo->childWindowInfos[i]->Control==CT_GROUPBOX){
|
---|
622 | //グループ ボックスの場合は中央をあける
|
---|
623 | if((
|
---|
624 | x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x&&
|
---|
625 | x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x+pWindowInfo->childWindowInfos[i]->size.cx&&
|
---|
626 | y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y&&
|
---|
627 | y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y+pWindowInfo->childWindowInfos[i]->size.cy
|
---|
628 | )&&
|
---|
629 | (!(
|
---|
630 | x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x+LEVER_THICK*2&&
|
---|
631 | x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x+pWindowInfo->childWindowInfos[i]->size.cx-LEVER_THICK*2&&
|
---|
632 | y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y+LEVER_THICK*3&&
|
---|
633 | y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y+pWindowInfo->childWindowInfos[i]->size.cy-LEVER_THICK*2
|
---|
634 | ))
|
---|
635 | ){
|
---|
636 | break;
|
---|
637 | }
|
---|
638 | }
|
---|
639 | else if(x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x&&
|
---|
640 | x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[i]->pos.x+pWindowInfo->childWindowInfos[i]->size.cx&&
|
---|
641 | y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y&&
|
---|
642 | y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[i]->pos.y+pWindowInfo->childWindowInfos[i]->size.cy){
|
---|
643 | break;
|
---|
644 | }
|
---|
645 | }
|
---|
646 | return i;
|
---|
647 | }
|
---|
648 | void SelectItemNumOnMouse(int WndNum,int WndInfoNum,int x,int y){
|
---|
649 | //マウス座標をもとにコントロールアイテムを選択
|
---|
650 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
651 | int i;
|
---|
652 |
|
---|
653 | for(i=1;i<MAX_RAD_SELITEM;i++) MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]=-1;
|
---|
654 | i=GetItemNumOnMouse(WndNum,WndInfoNum,x,y);
|
---|
655 |
|
---|
656 | if(i==-1){
|
---|
657 | if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
|
---|
658 | MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]=SELECT_WINDOW;
|
---|
659 | ChangePropertyWindow(WndNum,WndInfoNum);
|
---|
660 | }
|
---|
661 | }
|
---|
662 | else{
|
---|
663 | MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]=i;
|
---|
664 | ChangePropertyWindow(WndNum,WndInfoNum);
|
---|
665 | }
|
---|
666 |
|
---|
667 | SetStatusText(NULL);
|
---|
668 |
|
---|
669 | //サポートダイアログの内容をセット
|
---|
670 | SetSupportDlgData( WndNum, *projectInfo.windowInfos[WndInfoNum] );
|
---|
671 | }
|
---|
672 | void SetItemNumOnFrame(int WndNum,int WndInfoNum,RECT *pRect){
|
---|
673 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
674 | int i,i2,sw;
|
---|
675 | RECT rect;
|
---|
676 |
|
---|
677 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
678 |
|
---|
679 | for(i=1;i<MAX_RAD_SELITEM;i++) MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]=-1;
|
---|
680 | RectNaturalFormat(pRect,&rect);
|
---|
681 | if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW) sw=0;
|
---|
682 | else sw=1;
|
---|
683 | for(i=pWindowInfo->childWindowInfos.size()-1,i2=0;i>=0;i--){
|
---|
684 | if(rect.left <= pWindowInfo->childWindowInfos[i]->pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x&&
|
---|
685 | rect.top <= pWindowInfo->childWindowInfos[i]->pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y&&
|
---|
686 | rect.right >= pWindowInfo->childWindowInfos[i]->pos.x+pWindowInfo->childWindowInfos[i]->size.cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x&&
|
---|
687 | rect.bottom >= pWindowInfo->childWindowInfos[i]->pos.y+pWindowInfo->childWindowInfos[i]->size.cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y){
|
---|
688 | MdiInfo[WndNum].MdiRadInfo->SelectingItem[i2]=i;
|
---|
689 | i2++;
|
---|
690 | }
|
---|
691 | }
|
---|
692 | if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW||
|
---|
693 | (MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW&&sw)){
|
---|
694 | ChangePropertyWindow(WndNum,WndInfoNum);
|
---|
695 | }
|
---|
696 | }
|
---|
697 | int GetStateOfDraggingFrame(int WndNum,int WndInfoNum,int x,int y){
|
---|
698 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
699 | int i;
|
---|
700 | RECT rect;
|
---|
701 |
|
---|
702 | ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
|
---|
703 |
|
---|
704 | if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[1]!=-1){
|
---|
705 | i=0;
|
---|
706 | while(MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]!=-1||i==0){
|
---|
707 | GetSelectingRect(WndNum,WndInfoNum,i,&rect);
|
---|
708 |
|
---|
709 | if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
|
---|
710 | y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK){
|
---|
711 | if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]]->Control==CT_GROUPBOX){
|
---|
712 | //グループボックスの場合は中央をあける
|
---|
713 | if(!(x>=rect.left+LEVER_THICK*2&&x<=rect.right-LEVER_THICK*2&&
|
---|
714 | y>=rect.top+LEVER_THICK*3&&y<=rect.bottom-LEVER_THICK*2)){
|
---|
715 | return FRAME_INSIDE;
|
---|
716 | }
|
---|
717 | }
|
---|
718 | else return FRAME_INSIDE;
|
---|
719 | }
|
---|
720 | i++;
|
---|
721 | }
|
---|
722 | }
|
---|
723 | else{
|
---|
724 | GetSelectingRect(WndNum,WndInfoNum,0,&rect);
|
---|
725 |
|
---|
726 | if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
|
---|
727 | if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
|
---|
728 | y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK){
|
---|
729 | if(pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->Control==CT_GROUPBOX){
|
---|
730 | //グループ ボックスの場合は中央をあける
|
---|
731 | if(!(x>=rect.left+LEVER_THICK*3&&x<=rect.right-LEVER_THICK*3&&
|
---|
732 | y>=rect.top+LEVER_THICK*4&&y<=rect.bottom-LEVER_THICK*3)){
|
---|
733 | return FRAME_INSIDE;
|
---|
734 | }
|
---|
735 | }
|
---|
736 | else return FRAME_INSIDE;
|
---|
737 | }
|
---|
738 | else if(x>=rect.left&&x<=rect.left+LEVER_THICK&&
|
---|
739 | y>=rect.top&&y<=rect.top+LEVER_THICK) return FRAME_UPPER_LEFT;
|
---|
740 | else if(x>=rect.right-LEVER_THICK&&x<=rect.right&&
|
---|
741 | y>=rect.top&&y<=rect.top+LEVER_THICK) return FRAME_UPPER_RIGHT;
|
---|
742 | else if(x>=rect.left&&x<=rect.left+LEVER_THICK&&
|
---|
743 | y>=rect.bottom-LEVER_THICK&&y<=rect.bottom) return FRAME_LOWER_LEFT;
|
---|
744 | else if(x>=rect.left&&x<=rect.left+LEVER_THICK&&
|
---|
745 | y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK)return FRAME_LEFT;
|
---|
746 | else if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
|
---|
747 | y>=rect.top&&y<=rect.top+LEVER_THICK) return FRAME_UPPER;
|
---|
748 | }
|
---|
749 | if(x>=rect.right-LEVER_THICK&&x<=rect.right&&
|
---|
750 | y>=rect.bottom-LEVER_THICK&&y<=rect.bottom) return FRAME_LOWER_RIGHT;
|
---|
751 | else if(x>=rect.right-LEVER_THICK&&x<=rect.right&&
|
---|
752 | y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK) return FRAME_RIGHT;
|
---|
753 | else if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
|
---|
754 | y>=rect.bottom-LEVER_THICK&&y<=rect.bottom) return FRAME_LOWER;
|
---|
755 | }
|
---|
756 | return 0;
|
---|
757 | }
|
---|
758 | void ResetScrollbarOfRadEditor(int WndNum,int weight,int height){
|
---|
759 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
760 | SCROLLINFO ScrollInfo;
|
---|
761 | SIZE NeedSize;
|
---|
762 |
|
---|
763 | ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[WndNum].path);
|
---|
764 |
|
---|
765 | //必要な幅、高さを共に100ピクセル余裕を持たせる
|
---|
766 | NeedSize.cx=pWindowInfo->size.cx+(LEVER_THICK*2)+100;
|
---|
767 | NeedSize.cy=pWindowInfo->size.cy+(LEVER_THICK*2)+100;
|
---|
768 |
|
---|
769 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
770 | ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS|SIF_DISABLENOSCROLL;
|
---|
771 |
|
---|
772 | //垂直スクロールバーの設定
|
---|
773 | GetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_VERT,&ScrollInfo);
|
---|
774 | ScrollInfo.nMin=0;
|
---|
775 | if(height>NeedSize.cy) ScrollInfo.nMax=0;
|
---|
776 | else{
|
---|
777 | ScrollInfo.nMax=NeedSize.cy;
|
---|
778 | ScrollInfo.nPage=height;
|
---|
779 | }
|
---|
780 | SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_VERT,&ScrollInfo,1);
|
---|
781 |
|
---|
782 | //水平スクロールバーの設定
|
---|
783 | GetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_VERT,&ScrollInfo);
|
---|
784 | ScrollInfo.nMin=0;
|
---|
785 | if(weight>NeedSize.cx) ScrollInfo.nMax=0;
|
---|
786 | else{
|
---|
787 | ScrollInfo.nMax=NeedSize.cx;
|
---|
788 | ScrollInfo.nPage=weight;
|
---|
789 | }
|
---|
790 | SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_HORZ,&ScrollInfo,1);
|
---|
791 | }
|
---|
792 | LRESULT CALLBACK RadWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
|
---|
793 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
794 | extern RADINFO RadInfo;
|
---|
795 | int i,i2,i3,i4;
|
---|
796 | char temporary[MAX_PATH],temp2[MAX_PATH];
|
---|
797 | HWND hParent;
|
---|
798 | HDC hdc;
|
---|
799 | RECT rect;
|
---|
800 | POINT mouse,pos;
|
---|
801 | SIZE size;
|
---|
802 | SCROLLINFO ScrollInfo,si2;
|
---|
803 | PAINTSTRUCT ps;
|
---|
804 | POINTANDSIZE PointAndSize;
|
---|
805 |
|
---|
806 | switch(message){
|
---|
807 | case WM_LBUTTONDOWN:
|
---|
808 | {
|
---|
809 | SetCapture(hwnd);
|
---|
810 |
|
---|
811 | SetFocus(hwnd);
|
---|
812 | mouse.x=LOWORD(lParam);
|
---|
813 | mouse.y=HIWORD(lParam);
|
---|
814 | CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
|
---|
815 |
|
---|
816 | i=GetWndNum(GetParent(hwnd));
|
---|
817 | i2 = GetWndInfoNum(MdiInfo[i].path);
|
---|
818 | ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
|
---|
819 |
|
---|
820 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
|
---|
821 | if(((wParam&MK_CONTROL)||(wParam&MK_SHIFT))&&
|
---|
822 | MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
|
---|
823 |
|
---|
824 | //Shiftキー、Ctrlキーによる複数選択
|
---|
825 | for(i3=0;;i3++){
|
---|
826 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1){
|
---|
827 | MdiInfo[i].MdiRadInfo->SelectingItem[i3]=GetItemNumOnMouse(i,i2,mouse.x,mouse.y);
|
---|
828 | InvalidateRect(hwnd,NULL,0);
|
---|
829 |
|
---|
830 | //サポートダイアログの内容をセット
|
---|
831 | SetSupportDlgData( i, *pWindowInfo );
|
---|
832 | break;
|
---|
833 | }
|
---|
834 | }
|
---|
835 | }
|
---|
836 | else{
|
---|
837 | RadInfo.NowDragging=GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y);
|
---|
838 | if(!RadInfo.NowDragging){
|
---|
839 | SelectItemNumOnMouse(i,i2,mouse.x,mouse.y);
|
---|
840 | InvalidateRect(hwnd,NULL,0);
|
---|
841 | RadInfo.NowDragging=GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y);
|
---|
842 | }
|
---|
843 | if(RadInfo.NowDragging){
|
---|
844 | //アイテム選択中。サイズ、位置変更開始
|
---|
845 |
|
---|
846 | if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
|
---|
847 | RadInfo.DraggingRect[0].left=LEVER_THICK;
|
---|
848 | RadInfo.DraggingRect[0].top=LEVER_THICK;
|
---|
849 | RadInfo.DraggingRect[0].right=pWindowInfo->size.cx+LEVER_THICK;
|
---|
850 | RadInfo.DraggingRect[0].bottom=pWindowInfo->size.cy+LEVER_THICK;
|
---|
851 | RadInfo.DragStartRect[0]=RadInfo.DraggingRect[0];
|
---|
852 | }
|
---|
853 | else{
|
---|
854 | i3=0;
|
---|
855 | while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
|
---|
856 | RadInfo.DraggingRect[i3].left=MdiInfo[i].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.x;
|
---|
857 | RadInfo.DraggingRect[i3].top=MdiInfo[i].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.y;
|
---|
858 | RadInfo.DraggingRect[i3].right=MdiInfo[i].MdiRadInfo->ClientPos.x+pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.x+pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size.cx;
|
---|
859 | RadInfo.DraggingRect[i3].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.y+pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size.cy;
|
---|
860 | RadInfo.DragStartRect[i3]=RadInfo.DraggingRect[i3];
|
---|
861 | i3++;
|
---|
862 | }
|
---|
863 | }
|
---|
864 | }
|
---|
865 | else{
|
---|
866 | //範囲選択
|
---|
867 |
|
---|
868 | RadInfo.NowDragging=SELECTING_FRAME;
|
---|
869 | RadInfo.OldDraggingRect[0].left=LEVER_THICK;
|
---|
870 | RadInfo.OldDraggingRect[0].top=LEVER_THICK;
|
---|
871 | RadInfo.OldDraggingRect[0].right=pWindowInfo->size.cx+LEVER_THICK;
|
---|
872 | RadInfo.OldDraggingRect[0].bottom=pWindowInfo->size.cy+LEVER_THICK;
|
---|
873 | }
|
---|
874 | RadInfo.DragStartPos.x=mouse.x;
|
---|
875 | RadInfo.DragStartPos.y=mouse.y;
|
---|
876 | }
|
---|
877 | SetCursorByState(RadInfo.NowDragging);
|
---|
878 | }
|
---|
879 | else{
|
---|
880 | RadInfo.DraggingRect[0].left=mouse.x;
|
---|
881 | RadInfo.DraggingRect[0].top=mouse.y;
|
---|
882 | RadInfo.NowDragging=ITEM_MAKING;
|
---|
883 | }
|
---|
884 | return 0;
|
---|
885 | }
|
---|
886 | case WM_LBUTTONUP:
|
---|
887 | {
|
---|
888 | ReleaseCapture();
|
---|
889 |
|
---|
890 | SetFocus(hwnd);
|
---|
891 | mouse.x=(int)(short)LOWORD(lParam);
|
---|
892 | mouse.y=(int)(short)HIWORD(lParam);
|
---|
893 | CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
|
---|
894 |
|
---|
895 | hParent=GetParent(hwnd);
|
---|
896 | i=GetWndNum(hParent);
|
---|
897 | i2 = GetWndInfoNum(MdiInfo[i].path);
|
---|
898 | ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
|
---|
899 |
|
---|
900 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
|
---|
901 | if(RadInfo.NowDragging){
|
---|
902 | if(RadInfo.DragStartPos.x==mouse.x&&RadInfo.DragStartPos.y==mouse.y){
|
---|
903 | RadInfo.NowDragging=0;
|
---|
904 | InvalidateRect(hwnd,NULL,0);
|
---|
905 | ResetState_EditMenu();
|
---|
906 | return 0;
|
---|
907 | }
|
---|
908 |
|
---|
909 | if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
|
---|
910 | if(RadInfo.NowDragging==SELECTING_FRAME){
|
---|
911 | SetItemNumOnFrame(i,i2,&RadInfo.DraggingRect[0]);
|
---|
912 | InvalidateRect(hwnd,NULL,1);
|
---|
913 | }
|
---|
914 | else{
|
---|
915 | //ウィンドウ枠の調整完了
|
---|
916 | PointAndSize.size=pWindowInfo->size;
|
---|
917 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
|
---|
918 | pWindowInfo->size.cx=RadInfo.DraggingRect[0].right-LEVER_THICK;
|
---|
919 | pWindowInfo->size.cy=RadInfo.DraggingRect[0].bottom-LEVER_THICK;
|
---|
920 | DrawRadWindow(i,pWindowInfo);
|
---|
921 | InvalidateRect(hwnd,NULL,1);
|
---|
922 |
|
---|
923 | GetClientRect(hwnd,&rect);
|
---|
924 | ResetScrollbarOfRadEditor(i,rect.right,rect.bottom);
|
---|
925 | }
|
---|
926 | }
|
---|
927 | else{
|
---|
928 | i3=0;
|
---|
929 | while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
|
---|
930 | //アイテム枠の調整完了
|
---|
931 | PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos;
|
---|
932 | PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size;
|
---|
933 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
|
---|
934 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.x=RadInfo.DraggingRect[i3].left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
935 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.y=RadInfo.DraggingRect[i3].top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
936 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size.cx=RadInfo.DraggingRect[i3].right-RadInfo.DraggingRect[i3].left;
|
---|
937 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size.cy=RadInfo.DraggingRect[i3].bottom-RadInfo.DraggingRect[i3].top;
|
---|
938 | DrawRadWindow(i,pWindowInfo);
|
---|
939 | i3++;
|
---|
940 | }
|
---|
941 | }
|
---|
942 |
|
---|
943 | SetStatusText(NULL);
|
---|
944 |
|
---|
945 | //サポートダイアログの内容をセット
|
---|
946 | SetSupportDlgData( i, *pWindowInfo );
|
---|
947 | }
|
---|
948 | }
|
---|
949 | else if(RadInfo.NowDragging==ITEM_MAKING){
|
---|
950 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_BUTTON){
|
---|
951 | //ボタン コントロール作成
|
---|
952 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
953 | RadInfo.DraggingRect[0].left-=44;
|
---|
954 | RadInfo.DraggingRect[0].right=mouse.x+44;
|
---|
955 | RadInfo.DraggingRect[0].top-=10;
|
---|
956 | RadInfo.DraggingRect[0].bottom=mouse.y+11;
|
---|
957 | }
|
---|
958 | else{
|
---|
959 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
960 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
961 | }
|
---|
962 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
963 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
964 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
965 | size.cx=rect.right-rect.left;
|
---|
966 | size.cy=rect.bottom-rect.top;
|
---|
967 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
968 | i,
|
---|
969 | i2,
|
---|
970 | -1,
|
---|
971 | &pos,
|
---|
972 | &size,
|
---|
973 | "CommandButton",
|
---|
974 | "Button",
|
---|
975 | WS_CHILD|WS_VISIBLE,0,CT_BUTTON,
|
---|
976 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
977 | 0,
|
---|
978 | 1
|
---|
979 | );
|
---|
980 | }
|
---|
981 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_CHECKBOX){
|
---|
982 | //チェック ボックス作成
|
---|
983 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
984 | RadInfo.DraggingRect[0].left-=33;
|
---|
985 | RadInfo.DraggingRect[0].right=mouse.x+34;
|
---|
986 | RadInfo.DraggingRect[0].top-=7;
|
---|
987 | RadInfo.DraggingRect[0].bottom=mouse.y+8;
|
---|
988 | }
|
---|
989 | else{
|
---|
990 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
991 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
992 | }
|
---|
993 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
994 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
995 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
996 | size.cx=rect.right-rect.left;
|
---|
997 | size.cy=rect.bottom-rect.top;
|
---|
998 | MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(
|
---|
999 | i,
|
---|
1000 | i2,
|
---|
1001 | -1,
|
---|
1002 | &pos,
|
---|
1003 | &size,
|
---|
1004 | "CheckBox",
|
---|
1005 | "Check",
|
---|
1006 | WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX,
|
---|
1007 | 0,
|
---|
1008 | CT_CHECKBOX,
|
---|
1009 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1010 | 0,
|
---|
1011 | 1
|
---|
1012 | );
|
---|
1013 | }
|
---|
1014 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_COMBOBOX){
|
---|
1015 | //コンボ ボックス作成
|
---|
1016 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1017 | RadInfo.DraggingRect[0].left-=42;
|
---|
1018 | RadInfo.DraggingRect[0].right=mouse.x+42;
|
---|
1019 | RadInfo.DraggingRect[0].top-=42;
|
---|
1020 | RadInfo.DraggingRect[0].bottom=mouse.y+42;
|
---|
1021 | }
|
---|
1022 | else{
|
---|
1023 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1024 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1025 | }
|
---|
1026 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1027 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1028 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1029 | size.cx=rect.right-rect.left;
|
---|
1030 | size.cy=rect.bottom-rect.top;
|
---|
1031 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1032 | i,
|
---|
1033 | i2,
|
---|
1034 | -1,
|
---|
1035 | &pos,
|
---|
1036 | &size,
|
---|
1037 | "ComboBox",
|
---|
1038 | "",
|
---|
1039 | WS_CHILD|WS_VISIBLE|CBS_DROPDOWN|CBS_SORT|WS_VSCROLL,
|
---|
1040 | 0,
|
---|
1041 | CT_COMBOBOX,
|
---|
1042 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1043 | 0,
|
---|
1044 | 1
|
---|
1045 | );
|
---|
1046 | }
|
---|
1047 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_EDIT){
|
---|
1048 | //エディット コントロール作成
|
---|
1049 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1050 | RadInfo.DraggingRect[0].left-=35;
|
---|
1051 | RadInfo.DraggingRect[0].right=mouse.x+35;
|
---|
1052 | RadInfo.DraggingRect[0].top-=10;
|
---|
1053 | RadInfo.DraggingRect[0].bottom=mouse.y+11;
|
---|
1054 | }
|
---|
1055 | else{
|
---|
1056 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1057 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1058 | }
|
---|
1059 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1060 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1061 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1062 | size.cx=rect.right-rect.left;
|
---|
1063 | size.cy=rect.bottom-rect.top;
|
---|
1064 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1065 | i,
|
---|
1066 | i2,
|
---|
1067 | -1,
|
---|
1068 | &pos,
|
---|
1069 | &size,
|
---|
1070 | "EditBox",
|
---|
1071 | "",
|
---|
1072 | WS_CHILD|WS_VISIBLE,WS_EX_CLIENTEDGE,
|
---|
1073 | CT_EDIT,
|
---|
1074 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1075 | 0,
|
---|
1076 | 1
|
---|
1077 | );
|
---|
1078 | }
|
---|
1079 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_GROUPBOX){
|
---|
1080 | //グループ ボックス作成
|
---|
1081 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1082 | RadInfo.DraggingRect[0].left-=42;
|
---|
1083 | RadInfo.DraggingRect[0].right=mouse.x+42;
|
---|
1084 | RadInfo.DraggingRect[0].top-=30;
|
---|
1085 | RadInfo.DraggingRect[0].bottom=mouse.y+30;
|
---|
1086 | }
|
---|
1087 | else{
|
---|
1088 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1089 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1090 | }
|
---|
1091 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1092 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1093 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1094 | size.cx=rect.right-rect.left;
|
---|
1095 | size.cy=rect.bottom-rect.top;
|
---|
1096 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1097 | i,
|
---|
1098 | i2,
|
---|
1099 | -1,
|
---|
1100 | &pos,
|
---|
1101 | &size,
|
---|
1102 | "GroupBox",
|
---|
1103 | "Group",
|
---|
1104 | WS_CHILD|WS_VISIBLE|BS_GROUPBOX,
|
---|
1105 | 0,
|
---|
1106 | CT_GROUPBOX,
|
---|
1107 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1108 | 0,
|
---|
1109 | 1
|
---|
1110 | );
|
---|
1111 | }
|
---|
1112 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_HSCROLLBAR){
|
---|
1113 | //水平スクロールバー作成
|
---|
1114 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1115 | RadInfo.DraggingRect[0].left-=35;
|
---|
1116 | RadInfo.DraggingRect[0].right=mouse.x+35;
|
---|
1117 | RadInfo.DraggingRect[0].top-=8;
|
---|
1118 | RadInfo.DraggingRect[0].bottom=mouse.y+9;
|
---|
1119 | }
|
---|
1120 | else{
|
---|
1121 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1122 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1123 | }
|
---|
1124 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1125 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1126 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1127 | size.cx=rect.right-rect.left;
|
---|
1128 | size.cy=rect.bottom-rect.top;
|
---|
1129 | MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(
|
---|
1130 | i,
|
---|
1131 | i2,
|
---|
1132 | -1,
|
---|
1133 | &pos,
|
---|
1134 | &size,
|
---|
1135 | "HScrollBar",
|
---|
1136 | "",
|
---|
1137 | WS_CHILD|WS_VISIBLE|SBS_HORZ,
|
---|
1138 | 0,
|
---|
1139 | CT_HSCROLLBAR,
|
---|
1140 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1141 | 0,
|
---|
1142 | 1
|
---|
1143 | );
|
---|
1144 | }
|
---|
1145 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_IMAGEBOX){
|
---|
1146 | //イメージ ボックス作成
|
---|
1147 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1148 | RadInfo.DraggingRect[0].left-=16;
|
---|
1149 | RadInfo.DraggingRect[0].right=mouse.x+16;
|
---|
1150 | RadInfo.DraggingRect[0].top-=16;
|
---|
1151 | RadInfo.DraggingRect[0].bottom=mouse.y+16;
|
---|
1152 | }
|
---|
1153 | else{
|
---|
1154 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1155 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1156 | }
|
---|
1157 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1158 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1159 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1160 | size.cx=rect.right-rect.left;
|
---|
1161 | size.cy=rect.bottom-rect.top;
|
---|
1162 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1163 | i,
|
---|
1164 | i2,
|
---|
1165 | -1,
|
---|
1166 | &pos,
|
---|
1167 | &size,
|
---|
1168 | "ImageBox",
|
---|
1169 | "",
|
---|
1170 | WS_CHILD|WS_VISIBLE|SS_BLACKFRAME,0,CT_IMAGEBOX,
|
---|
1171 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1172 | 0,
|
---|
1173 | 1
|
---|
1174 | );
|
---|
1175 | }
|
---|
1176 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_LISTBOX){
|
---|
1177 | //リスト ボックス作成
|
---|
1178 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1179 | RadInfo.DraggingRect[0].left-=42;
|
---|
1180 | RadInfo.DraggingRect[0].right=mouse.x+42;
|
---|
1181 | RadInfo.DraggingRect[0].top-=30;
|
---|
1182 | RadInfo.DraggingRect[0].bottom=mouse.y+30;
|
---|
1183 | }
|
---|
1184 | else{
|
---|
1185 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1186 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1187 | }
|
---|
1188 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1189 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1190 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1191 | size.cx=rect.right-rect.left;
|
---|
1192 | size.cy=rect.bottom-rect.top;
|
---|
1193 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1194 | i,
|
---|
1195 | i2,
|
---|
1196 | -1,
|
---|
1197 | &pos,
|
---|
1198 | &size,
|
---|
1199 | "ListBox",
|
---|
1200 | "",
|
---|
1201 | WS_CHILD|WS_VISIBLE|WS_VSCROLL|LBS_SORT|LBS_NOTIFY,WS_EX_CLIENTEDGE,
|
---|
1202 | CT_LISTBOX,
|
---|
1203 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1204 | 0,
|
---|
1205 | 1
|
---|
1206 | );
|
---|
1207 | }
|
---|
1208 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_LISTVIEW){
|
---|
1209 | //リスト ビュー作成
|
---|
1210 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1211 | RadInfo.DraggingRect[0].left-=52;
|
---|
1212 | RadInfo.DraggingRect[0].right=mouse.x+53;
|
---|
1213 | RadInfo.DraggingRect[0].top-=37;
|
---|
1214 | RadInfo.DraggingRect[0].bottom=mouse.y+38;
|
---|
1215 | }
|
---|
1216 | else{
|
---|
1217 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1218 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1219 | }
|
---|
1220 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1221 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1222 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1223 | size.cx=rect.right-rect.left;
|
---|
1224 | size.cy=rect.bottom-rect.top;
|
---|
1225 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1226 | i,
|
---|
1227 | i2,
|
---|
1228 | -1,
|
---|
1229 | &pos,
|
---|
1230 | &size,
|
---|
1231 | "ListView",
|
---|
1232 | "",
|
---|
1233 | WS_CHILD|WS_VISIBLE,WS_EX_CLIENTEDGE,
|
---|
1234 | CT_LISTVIEW,
|
---|
1235 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1236 | 0,
|
---|
1237 | 1
|
---|
1238 | );
|
---|
1239 | }
|
---|
1240 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_PROGRESSBAR){
|
---|
1241 | //プロバレス バー作成
|
---|
1242 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1243 | RadInfo.DraggingRect[0].left-=70;
|
---|
1244 | RadInfo.DraggingRect[0].right=mouse.x+70;
|
---|
1245 | RadInfo.DraggingRect[0].top-=10;
|
---|
1246 | RadInfo.DraggingRect[0].bottom=mouse.y+11;
|
---|
1247 | }
|
---|
1248 | else{
|
---|
1249 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1250 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1251 | }
|
---|
1252 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1253 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1254 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1255 | size.cx=rect.right-rect.left;
|
---|
1256 | size.cy=rect.bottom-rect.top;
|
---|
1257 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1258 | i,
|
---|
1259 | i2,
|
---|
1260 | -1,
|
---|
1261 | &pos,
|
---|
1262 | &size,
|
---|
1263 | "ProgressBar",
|
---|
1264 | "",
|
---|
1265 | WS_CHILD|WS_VISIBLE,WS_EX_STATICEDGE,
|
---|
1266 | CT_PROGRESSBAR,
|
---|
1267 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1268 | 0,
|
---|
1269 | 1
|
---|
1270 | );
|
---|
1271 | }
|
---|
1272 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_RADIOBUTTON){
|
---|
1273 | //ラジオ ボタン作成
|
---|
1274 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1275 | RadInfo.DraggingRect[0].left-=31;
|
---|
1276 | RadInfo.DraggingRect[0].right=mouse.x+32;
|
---|
1277 | RadInfo.DraggingRect[0].top-=7;
|
---|
1278 | RadInfo.DraggingRect[0].bottom=mouse.y+8;
|
---|
1279 | }
|
---|
1280 | else{
|
---|
1281 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1282 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1283 | }
|
---|
1284 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1285 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1286 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1287 | size.cx=rect.right-rect.left;
|
---|
1288 | size.cy=rect.bottom-rect.top;
|
---|
1289 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1290 | i,
|
---|
1291 | i2,
|
---|
1292 | -1,
|
---|
1293 | &pos,
|
---|
1294 | &size,
|
---|
1295 | "RadioButton",
|
---|
1296 | "radio",
|
---|
1297 | WS_CHILD|WS_VISIBLE|BS_AUTORADIOBUTTON,
|
---|
1298 | 0,
|
---|
1299 | CT_RADIOBUTTON,
|
---|
1300 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1301 | 0,
|
---|
1302 | 1
|
---|
1303 | );
|
---|
1304 | }
|
---|
1305 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_STATIC){
|
---|
1306 | //スタティック コントロール作成
|
---|
1307 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1308 | RadInfo.DraggingRect[0].left-=25;
|
---|
1309 | RadInfo.DraggingRect[0].right=mouse.x+25;
|
---|
1310 | RadInfo.DraggingRect[0].top-=6;
|
---|
1311 | RadInfo.DraggingRect[0].bottom=mouse.y+6;
|
---|
1312 | }
|
---|
1313 | else{
|
---|
1314 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1315 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1316 | }
|
---|
1317 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1318 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1319 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1320 | size.cx=rect.right-rect.left;
|
---|
1321 | size.cy=rect.bottom-rect.top;
|
---|
1322 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1323 | i,
|
---|
1324 | i2,
|
---|
1325 | -1,
|
---|
1326 | &pos,
|
---|
1327 | &size,
|
---|
1328 | "Static",
|
---|
1329 | "Text",
|
---|
1330 | WS_CHILD|WS_VISIBLE,
|
---|
1331 | 0,
|
---|
1332 | CT_STATIC,
|
---|
1333 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1334 | 0,
|
---|
1335 | 1
|
---|
1336 | );
|
---|
1337 | }
|
---|
1338 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_TRACKBAR){
|
---|
1339 | //トラック バー作成
|
---|
1340 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1341 | RadInfo.DraggingRect[0].left-=87;
|
---|
1342 | RadInfo.DraggingRect[0].right=mouse.x+88;
|
---|
1343 | RadInfo.DraggingRect[0].top-=11;
|
---|
1344 | RadInfo.DraggingRect[0].bottom=mouse.y+12;
|
---|
1345 | }
|
---|
1346 | else{
|
---|
1347 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1348 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1349 | }
|
---|
1350 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1351 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1352 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1353 | size.cx=rect.right-rect.left;
|
---|
1354 | size.cy=rect.bottom-rect.top;
|
---|
1355 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1356 | i,
|
---|
1357 | i2,
|
---|
1358 | -1,
|
---|
1359 | &pos,
|
---|
1360 | &size,
|
---|
1361 | "TrackBar",
|
---|
1362 | "",
|
---|
1363 | WS_CHILD|WS_VISIBLE|TBS_BOTH|TBS_NOTICKS,
|
---|
1364 | 0,
|
---|
1365 | CT_TRACKBAR,
|
---|
1366 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1367 | 0,
|
---|
1368 | 1
|
---|
1369 | );
|
---|
1370 | }
|
---|
1371 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_TREEVIEW){
|
---|
1372 | //ツリー ビュー作成
|
---|
1373 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1374 | RadInfo.DraggingRect[0].left-=52;
|
---|
1375 | RadInfo.DraggingRect[0].right=mouse.x+53;
|
---|
1376 | RadInfo.DraggingRect[0].top-=37;
|
---|
1377 | RadInfo.DraggingRect[0].bottom=mouse.y+38;
|
---|
1378 | }
|
---|
1379 | else{
|
---|
1380 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1381 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1382 | }
|
---|
1383 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1384 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1385 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1386 | size.cx=rect.right-rect.left;
|
---|
1387 | size.cy=rect.bottom-rect.top;
|
---|
1388 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1389 | i,
|
---|
1390 | i2,
|
---|
1391 | -1,
|
---|
1392 | &pos,
|
---|
1393 | &size,
|
---|
1394 | "TreeView",
|
---|
1395 | "",
|
---|
1396 | WS_CHILD|WS_VISIBLE,
|
---|
1397 | WS_EX_CLIENTEDGE,
|
---|
1398 | CT_TREEVIEW,
|
---|
1399 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1400 | 0,
|
---|
1401 | 1
|
---|
1402 | );
|
---|
1403 | }
|
---|
1404 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_UPDOWN){
|
---|
1405 | //アップ ダウン コントロール作成
|
---|
1406 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1407 | RadInfo.DraggingRect[0].left-=8;
|
---|
1408 | RadInfo.DraggingRect[0].right=mouse.x+8;
|
---|
1409 | RadInfo.DraggingRect[0].top-=10;
|
---|
1410 | RadInfo.DraggingRect[0].bottom=mouse.y+11;
|
---|
1411 | }
|
---|
1412 | else{
|
---|
1413 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1414 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1415 | }
|
---|
1416 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1417 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1418 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1419 | size.cx=rect.right-rect.left;
|
---|
1420 | size.cy=rect.bottom-rect.top;
|
---|
1421 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1422 | i,
|
---|
1423 | i2,
|
---|
1424 | -1,
|
---|
1425 | &pos,
|
---|
1426 | &size,
|
---|
1427 | "UpDown",
|
---|
1428 | "",
|
---|
1429 | WS_CHILD|WS_VISIBLE,
|
---|
1430 | 0,
|
---|
1431 | CT_UPDOWN,
|
---|
1432 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1433 | 0,
|
---|
1434 | 1
|
---|
1435 | );
|
---|
1436 | }
|
---|
1437 | else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_VSCROLLBAR){
|
---|
1438 | //垂直スクロールバー作成
|
---|
1439 | if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
|
---|
1440 | RadInfo.DraggingRect[0].left-=9;
|
---|
1441 | RadInfo.DraggingRect[0].right=mouse.x+9;
|
---|
1442 | RadInfo.DraggingRect[0].top-=30;
|
---|
1443 | RadInfo.DraggingRect[0].bottom=mouse.y+30;
|
---|
1444 | }
|
---|
1445 | else{
|
---|
1446 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1447 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1448 | }
|
---|
1449 | RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
|
---|
1450 | pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1451 | pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1452 | size.cx=rect.right-rect.left;
|
---|
1453 | size.cy=rect.bottom-rect.top;
|
---|
1454 | MdiInfo[i].MdiRadInfo->SelectingItem[0] = InsertDlgItem(
|
---|
1455 | i,
|
---|
1456 | i2,
|
---|
1457 | -1,
|
---|
1458 | &pos,
|
---|
1459 | &size,
|
---|
1460 | "VScrollBar",
|
---|
1461 | "",
|
---|
1462 | WS_CHILD|WS_VISIBLE|SBS_VERT,
|
---|
1463 | 0,
|
---|
1464 | CT_VSCROLLBAR,
|
---|
1465 | ActiveBasic::PM::ImageReferenceType::File,
|
---|
1466 | 0,
|
---|
1467 | 1
|
---|
1468 | );
|
---|
1469 | }
|
---|
1470 | SendMessage(GetWindow(MdiInfo[i].MdiRadInfo->hTools,GW_CHILD),WM_COMMAND,IDC_TOOL_MOUSE,0);
|
---|
1471 | SendMessage(GetWindow(GetWindow(MdiInfo[i].MdiRadInfo->hTools,GW_CHILD),GW_CHILD),TB_CHECKBUTTON,IDC_TOOL_MOUSE,TRUE);
|
---|
1472 | ChangePropertyWindow(i,i2);
|
---|
1473 |
|
---|
1474 | //複数選択を解除
|
---|
1475 | MdiInfo[i].MdiRadInfo->SelectingItem[1]=-1;
|
---|
1476 | }
|
---|
1477 |
|
---|
1478 | RadInfo.NowDragging=0;
|
---|
1479 |
|
---|
1480 | ResetState_EditMenu();
|
---|
1481 | return 0;
|
---|
1482 | }
|
---|
1483 | case WM_MOUSEMOVE:
|
---|
1484 | {
|
---|
1485 | mouse.x=(int)(short)LOWORD(lParam);
|
---|
1486 | mouse.y=(int)(short)HIWORD(lParam);
|
---|
1487 | CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
|
---|
1488 |
|
---|
1489 | hParent=GetParent(hwnd);
|
---|
1490 | i=GetWndNum(hParent);
|
---|
1491 | i2 = GetWndInfoNum(MdiInfo[i].path);
|
---|
1492 | ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
|
---|
1493 |
|
---|
1494 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
|
---|
1495 | if(wParam&MK_LBUTTON&&RadInfo.NowDragging){
|
---|
1496 | ////////////////////////////////////////////////
|
---|
1497 | // ドラッグ中の場合(コントロールのサイズ変更)
|
---|
1498 |
|
---|
1499 | if(RadInfo.NowDragging==FRAME_UPPER_LEFT){
|
---|
1500 | if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
|
---|
1501 | RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
|
---|
1502 | else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
|
---|
1503 | RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1504 | else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
|
---|
1505 |
|
---|
1506 | if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
|
---|
1507 | RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
|
---|
1508 | else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
|
---|
1509 | RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1510 | else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
|
---|
1511 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1512 | }
|
---|
1513 | else if(RadInfo.NowDragging==FRAME_UPPER_RIGHT){
|
---|
1514 | if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
|
---|
1515 | RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
|
---|
1516 | else if(mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)
|
---|
1517 | RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
|
---|
1518 | else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
|
---|
1519 |
|
---|
1520 | if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK)) RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
|
---|
1521 | else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
|
---|
1522 | RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1523 | else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
|
---|
1524 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1525 | }
|
---|
1526 | else if(RadInfo.NowDragging==FRAME_LOWER_LEFT){
|
---|
1527 | if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
|
---|
1528 | RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
|
---|
1529 | else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
|
---|
1530 | RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1531 | else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
|
---|
1532 |
|
---|
1533 | if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
|
---|
1534 | RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
|
---|
1535 | else if(mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)
|
---|
1536 | RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
|
---|
1537 | else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
|
---|
1538 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1539 | }
|
---|
1540 | else if(RadInfo.NowDragging==FRAME_LOWER_RIGHT){
|
---|
1541 | if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
|
---|
1542 | RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
|
---|
1543 | else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
|
---|
1544 | RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
|
---|
1545 | else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
|
---|
1546 |
|
---|
1547 | if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
|
---|
1548 | RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
|
---|
1549 | else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
|
---|
1550 | RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
|
---|
1551 | else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
|
---|
1552 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1553 | }
|
---|
1554 | else if(RadInfo.NowDragging==FRAME_LEFT){
|
---|
1555 | if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
|
---|
1556 | RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
|
---|
1557 | else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
|
---|
1558 | RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1559 | else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
|
---|
1560 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1561 | }
|
---|
1562 | else if(RadInfo.NowDragging==FRAME_RIGHT){
|
---|
1563 | if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
|
---|
1564 | RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
|
---|
1565 | else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
|
---|
1566 | RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
|
---|
1567 | else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
|
---|
1568 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1569 | }
|
---|
1570 | else if(RadInfo.NowDragging==FRAME_UPPER){
|
---|
1571 | if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
|
---|
1572 | RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
|
---|
1573 | else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
|
---|
1574 | RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1575 | else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
|
---|
1576 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1577 | }
|
---|
1578 | else if(RadInfo.NowDragging==FRAME_LOWER){
|
---|
1579 | if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
|
---|
1580 | RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
|
---|
1581 | else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
|
---|
1582 | RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
|
---|
1583 | else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
|
---|
1584 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1585 | }
|
---|
1586 | else if(RadInfo.NowDragging==FRAME_INSIDE){
|
---|
1587 | i3=0;
|
---|
1588 | while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
|
---|
1589 | i4=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x;
|
---|
1590 |
|
---|
1591 | if(i4>MdiInfo[i].MdiRadInfo->ClientPos.x){
|
---|
1592 | i4=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x;
|
---|
1593 | if(i4<MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx) i4=0;
|
---|
1594 | else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
|
---|
1595 | }
|
---|
1596 | else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x;
|
---|
1597 | //i4は枠外に出たときのポインタと壁にあたったコントロールとの差
|
---|
1598 | RadInfo.DraggingRect[i3].left=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x-i4;
|
---|
1599 | RadInfo.DraggingRect[i3].right=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x-i4;
|
---|
1600 |
|
---|
1601 | i4=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y;
|
---|
1602 | if(i4>MdiInfo[i].MdiRadInfo->ClientPos.y){
|
---|
1603 | i4=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y;
|
---|
1604 | if(i4<MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy) i4=0;
|
---|
1605 | else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
|
---|
1606 | }
|
---|
1607 | else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y;
|
---|
1608 | RadInfo.DraggingRect[i3].top=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y-i4;
|
---|
1609 | RadInfo.DraggingRect[i3].bottom=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y-i4;
|
---|
1610 |
|
---|
1611 | if(MdiInfo[i].MdiRadInfo->SelectingItem[1]==-1) i4=1;
|
---|
1612 | else i4=0;
|
---|
1613 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[i3],&RadInfo.OldDraggingRect[i3],i4);
|
---|
1614 | i3++;
|
---|
1615 | }
|
---|
1616 | }
|
---|
1617 | else if(RadInfo.NowDragging==SELECTING_FRAME){
|
---|
1618 | RadInfo.DraggingRect[0].left=RadInfo.DragStartPos.x;
|
---|
1619 | RadInfo.DraggingRect[0].top=RadInfo.DragStartPos.y;
|
---|
1620 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1621 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1622 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1623 | }
|
---|
1624 | SetCursorByState(RadInfo.NowDragging);
|
---|
1625 |
|
---|
1626 | SetStatusText(NULL);
|
---|
1627 |
|
---|
1628 | //サポートダイアログの内容をセット
|
---|
1629 | SetSupportDlgData( i, *pWindowInfo );
|
---|
1630 | }
|
---|
1631 | else{
|
---|
1632 | //ドラッグ中でないとき
|
---|
1633 | SetCursorByState(GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y));
|
---|
1634 | }
|
---|
1635 | }
|
---|
1636 | else{
|
---|
1637 | //アイテム(子ウィンドウ作成中)
|
---|
1638 | if(wParam&MK_LBUTTON&&RadInfo.NowDragging==ITEM_MAKING){
|
---|
1639 | //ドラッグ中の場合
|
---|
1640 |
|
---|
1641 | RadInfo.DraggingRect[0].right=mouse.x;
|
---|
1642 | RadInfo.DraggingRect[0].bottom=mouse.y;
|
---|
1643 | DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
|
---|
1644 | }
|
---|
1645 | }
|
---|
1646 | return 0;
|
---|
1647 | }
|
---|
1648 | case WM_LBUTTONDBLCLK:
|
---|
1649 | {
|
---|
1650 | mouse.x=LOWORD(lParam);
|
---|
1651 | mouse.y=HIWORD(lParam);
|
---|
1652 | CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
|
---|
1653 |
|
---|
1654 | hParent=GetParent(hwnd);
|
---|
1655 | i=GetWndNum(hParent);
|
---|
1656 | i2=GetWndInfoNum(MdiInfo[i].path);
|
---|
1657 | ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
|
---|
1658 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
|
---|
1659 | if(MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
|
---|
1660 | temp2[0]=0;
|
---|
1661 | if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_BUTTON||
|
---|
1662 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_CHECKBOX||
|
---|
1663 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_IMAGEBOX||
|
---|
1664 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_RADIOBUTTON||
|
---|
1665 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_STATIC)
|
---|
1666 | {
|
---|
1667 | sprintf(temporary,"%s_%s_Click",
|
---|
1668 | pWindowInfo->GetName().c_str(),
|
---|
1669 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->GetName().c_str()
|
---|
1670 | );
|
---|
1671 | }
|
---|
1672 | else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_COMBOBOX)
|
---|
1673 | {
|
---|
1674 | sprintf(temporary,"%s_%s_EditChange",
|
---|
1675 | pWindowInfo->GetName().c_str(),
|
---|
1676 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->GetName().c_str());
|
---|
1677 | }
|
---|
1678 | else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_EDIT)
|
---|
1679 | {
|
---|
1680 | sprintf(temporary,"%s_%s_Change",
|
---|
1681 | pWindowInfo->GetName().c_str(),
|
---|
1682 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->GetName().c_str());
|
---|
1683 | }
|
---|
1684 | else if(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->Control==CT_LISTBOX)
|
---|
1685 | {
|
---|
1686 | sprintf(temporary,"%s_%s_SelChange",
|
---|
1687 | pWindowInfo->GetName().c_str(),
|
---|
1688 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->GetName().c_str());
|
---|
1689 | }
|
---|
1690 | else temporary[0]=0;
|
---|
1691 | if(temporary[0]) SelectProcedureOfMessageCall(i2,temporary,temp2);
|
---|
1692 | }
|
---|
1693 | }
|
---|
1694 | return 0;
|
---|
1695 | }
|
---|
1696 | case WM_KEYDOWN:
|
---|
1697 | {
|
---|
1698 | hParent=GetParent(hwnd);
|
---|
1699 | i=GetWndNum(hParent);
|
---|
1700 | ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
|
---|
1701 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
|
---|
1702 | if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
|
---|
1703 | PointAndSize.pos=pWindowInfo->pos;
|
---|
1704 | PointAndSize.size=pWindowInfo->size;
|
---|
1705 | if(GetKeyState(VK_SHIFT)&0x8000){
|
---|
1706 | if(wParam==VK_RIGHT||wParam==VK_LEFT||wParam==VK_DOWN||wParam==VK_UP)
|
---|
1707 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
|
---|
1708 |
|
---|
1709 | if(wParam==VK_RIGHT)
|
---|
1710 | pWindowInfo->size.cx++;
|
---|
1711 | else if(wParam==VK_LEFT)
|
---|
1712 | pWindowInfo->size.cx--;
|
---|
1713 | else if(wParam==VK_DOWN)
|
---|
1714 | pWindowInfo->size.cy++;
|
---|
1715 | else if(wParam==VK_UP)
|
---|
1716 | pWindowInfo->size.cy--;
|
---|
1717 |
|
---|
1718 | if(wParam==VK_RIGHT||wParam==VK_LEFT||wParam==VK_DOWN||wParam==VK_UP){
|
---|
1719 | DrawRadWindow(i,pWindowInfo);
|
---|
1720 |
|
---|
1721 | SetStatusText(NULL);
|
---|
1722 |
|
---|
1723 | //サポートダイアログの内容をセット
|
---|
1724 | SetSupportDlgData( i, *pWindowInfo );
|
---|
1725 | }
|
---|
1726 | }
|
---|
1727 | }
|
---|
1728 | else{
|
---|
1729 | PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->pos;
|
---|
1730 | PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size;
|
---|
1731 | if(wParam==VK_RIGHT){
|
---|
1732 | if(GetKeyState(VK_SHIFT)&0x8000){
|
---|
1733 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
|
---|
1734 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx++;
|
---|
1735 | }
|
---|
1736 | else{
|
---|
1737 | for(i3=0;;i3++){
|
---|
1738 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
|
---|
1739 | PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos;
|
---|
1740 | PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size;
|
---|
1741 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
|
---|
1742 |
|
---|
1743 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.x++;
|
---|
1744 | }
|
---|
1745 | }
|
---|
1746 | DrawRadWindow(i,pWindowInfo);
|
---|
1747 | SetStatusText(NULL);
|
---|
1748 |
|
---|
1749 | //サポートダイアログの内容をセット
|
---|
1750 | SetSupportDlgData( i, *pWindowInfo );
|
---|
1751 | }
|
---|
1752 | else if(wParam==VK_LEFT){
|
---|
1753 | if(GetKeyState(VK_SHIFT)&0x8000){
|
---|
1754 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
|
---|
1755 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cx--;
|
---|
1756 | }
|
---|
1757 | else{
|
---|
1758 | for(i3=0;;i3++){
|
---|
1759 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
|
---|
1760 | PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos;
|
---|
1761 | PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size;
|
---|
1762 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
|
---|
1763 |
|
---|
1764 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.x--;
|
---|
1765 | }
|
---|
1766 | }
|
---|
1767 | DrawRadWindow(i,pWindowInfo);
|
---|
1768 | SetStatusText(NULL);
|
---|
1769 |
|
---|
1770 | //サポートダイアログの内容をセット
|
---|
1771 | SetSupportDlgData( i, *pWindowInfo );
|
---|
1772 | }
|
---|
1773 | else if(wParam==VK_UP){
|
---|
1774 | if(GetKeyState(VK_SHIFT)&0x8000){
|
---|
1775 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
|
---|
1776 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cy--;
|
---|
1777 | }
|
---|
1778 | else{
|
---|
1779 | for(i3=0;;i3++){
|
---|
1780 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
|
---|
1781 | PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos;
|
---|
1782 | PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size;
|
---|
1783 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
|
---|
1784 |
|
---|
1785 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.y--;
|
---|
1786 | }
|
---|
1787 | }
|
---|
1788 | DrawRadWindow(i,pWindowInfo);
|
---|
1789 | SetStatusText(NULL);
|
---|
1790 |
|
---|
1791 | //サポートダイアログの内容をセット
|
---|
1792 | SetSupportDlgData( i, *pWindowInfo );
|
---|
1793 | }
|
---|
1794 | else if(wParam==VK_DOWN){
|
---|
1795 | if(GetKeyState(VK_SHIFT)&0x8000){
|
---|
1796 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
|
---|
1797 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->size.cy++;
|
---|
1798 | }
|
---|
1799 | else{
|
---|
1800 | for(i3=0;;i3++){
|
---|
1801 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
|
---|
1802 | PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos;
|
---|
1803 | PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->size;
|
---|
1804 | Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
|
---|
1805 |
|
---|
1806 | pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[i3]]->pos.y++;
|
---|
1807 | }
|
---|
1808 | }
|
---|
1809 | DrawRadWindow(i,pWindowInfo);
|
---|
1810 | SetStatusText(NULL);
|
---|
1811 |
|
---|
1812 | //サポートダイアログの内容をセット
|
---|
1813 | SetSupportDlgData( i, *pWindowInfo );
|
---|
1814 | }
|
---|
1815 | else if(wParam==VK_DELETE)
|
---|
1816 | SendMessage(hwnd,WM_COMMAND,IDM_RAD_ITEM_DELETE,0);
|
---|
1817 | }
|
---|
1818 | }
|
---|
1819 | return 0;
|
---|
1820 | }
|
---|
1821 | case WM_SETFOCUS:
|
---|
1822 | i=GetWndNum(GetParent(hwnd));
|
---|
1823 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==NON_TOOL)
|
---|
1824 | MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
|
---|
1825 | InvalidateRect(hwnd,NULL,0);
|
---|
1826 | return 0;
|
---|
1827 | case WM_KILLFOCUS:
|
---|
1828 | i=GetWndNum(GetParent(hwnd));
|
---|
1829 | if(i==-1) return 0; //ウィンドウが破棄された場合
|
---|
1830 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE)
|
---|
1831 | MdiInfo[i].MdiRadInfo->ButtonSelect=NON_TOOL;
|
---|
1832 | InvalidateRect(hwnd,NULL,0);
|
---|
1833 | return 0;
|
---|
1834 | case WM_PAINT:
|
---|
1835 | i=GetWndNum(GetParent(hwnd));
|
---|
1836 | if(i==-1) return 0; //ウィンドウが初期状態の場合
|
---|
1837 | i2=GetWndInfoNum(MdiInfo[i].path);
|
---|
1838 |
|
---|
1839 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
1840 | ScrollInfo.fMask=SIF_RANGE|SIF_POS;
|
---|
1841 | GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
|
---|
1842 | si2.cbSize=sizeof(SCROLLINFO);
|
---|
1843 | si2.fMask=SIF_RANGE|SIF_POS;
|
---|
1844 | GetScrollInfo(hwnd,SB_HORZ,&si2);
|
---|
1845 |
|
---|
1846 | hdc=BeginPaint(hwnd,&ps);
|
---|
1847 | BitBlt(hdc,0,0,ScreenX*2,ScreenY*2,
|
---|
1848 | MdiInfo[i].MdiRadInfo->hMemDC,si2.nPos,ScrollInfo.nPos,SRCCOPY);
|
---|
1849 | EndPaint(hwnd,&ps);
|
---|
1850 |
|
---|
1851 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE||MdiInfo[i].MdiRadInfo->ButtonSelect==NON_TOOL)
|
---|
1852 | DrawSelectingRect(hwnd,i,i2,MdiInfo[i].MdiRadInfo->ButtonSelect);
|
---|
1853 | return 0;
|
---|
1854 | case WM_CONTEXTMENU:
|
---|
1855 | if(RadInfo.NowDragging) return 0;
|
---|
1856 |
|
---|
1857 | hParent=GetParent(hwnd);
|
---|
1858 | BringWindowToTop(hParent);
|
---|
1859 | SetFocus(hwnd);
|
---|
1860 | i=GetWndNum(hParent);
|
---|
1861 | i2=GetWndInfoNum(MdiInfo[i].path);
|
---|
1862 |
|
---|
1863 | if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
|
---|
1864 | mouse.x=LOWORD(lParam);
|
---|
1865 | mouse.y=HIWORD(lParam);
|
---|
1866 | ScreenToClient(hwnd,&mouse);
|
---|
1867 | CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
|
---|
1868 | SelectItemNumOnMouse(i,i2,mouse.x,mouse.y);
|
---|
1869 | InvalidateRect(hwnd,NULL,0);
|
---|
1870 | extern HMENU hRadMenuBase;
|
---|
1871 | if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
|
---|
1872 | TrackPopupMenu(GetSubMenu(hRadMenuBase,0),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
|
---|
1873 | else TrackPopupMenu(GetSubMenu(hRadMenuBase,1),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
|
---|
1874 | }
|
---|
1875 | return 0;
|
---|
1876 | case WM_COMMAND:
|
---|
1877 | switch(LOWORD(wParam)){
|
---|
1878 | case IDM_RAD_WINDOW_EVENTCODE:
|
---|
1879 | i=GetWndNum(GetParent(hwnd));
|
---|
1880 | DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_RAD_EVENTCODE),hwnd,(DLGPROC)DlgEventCode,0);
|
---|
1881 | break;
|
---|
1882 | case IDM_RAD_WINDOW_MENUEVENTCODE:
|
---|
1883 | i=GetWndNum(GetParent(hwnd));
|
---|
1884 | DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_RAD_EVENTCODE),hwnd,(DLGPROC)DlgEventCode,1);
|
---|
1885 | break;
|
---|
1886 | case IDM_RAD_ITEM_DELETE:
|
---|
1887 | hParent=GetParent(hwnd);
|
---|
1888 | i=GetWndNum(hParent);
|
---|
1889 | i2=GetWndInfoNum(MdiInfo[i].path);
|
---|
1890 |
|
---|
1891 | //削除順序を考慮しなければならないので、バブルソートを行う
|
---|
1892 | int i5,i6;
|
---|
1893 | for(i5=0;;i5++){
|
---|
1894 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i5]==-1) break;
|
---|
1895 | }
|
---|
1896 | for(i3=0;i3<i5-1;i3++){
|
---|
1897 | for(i4=i5-1;i4>i3;i4--){
|
---|
1898 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i4] >
|
---|
1899 | MdiInfo[i].MdiRadInfo->SelectingItem[i4-1]){
|
---|
1900 | i6=MdiInfo[i].MdiRadInfo->SelectingItem[i4];
|
---|
1901 | MdiInfo[i].MdiRadInfo->SelectingItem[i4]=
|
---|
1902 | MdiInfo[i].MdiRadInfo->SelectingItem[i4-1];
|
---|
1903 | MdiInfo[i].MdiRadInfo->SelectingItem[i4-1]=i6;
|
---|
1904 | }
|
---|
1905 | }
|
---|
1906 | }
|
---|
1907 |
|
---|
1908 |
|
---|
1909 | for(i3=0;;i3++){
|
---|
1910 | if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
|
---|
1911 | DeleteDlgItem(i,i2,MdiInfo[i].MdiRadInfo->SelectingItem[i3],1);
|
---|
1912 | }
|
---|
1913 | for(i3=0;i3<MAX_RAD_SELITEM;i3++) MdiInfo[i].MdiRadInfo->SelectingItem[i3]=-1;
|
---|
1914 |
|
---|
1915 | ResetState_EditMenu();
|
---|
1916 | break;
|
---|
1917 | }
|
---|
1918 | return 0;
|
---|
1919 | case WM_VSCROLL:
|
---|
1920 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
1921 | ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
|
---|
1922 | GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
|
---|
1923 | if(LOWORD(wParam)==SB_LINEUP) i=-20;
|
---|
1924 | else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
|
---|
1925 | else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
|
---|
1926 | else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
|
---|
1927 | else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
|
---|
1928 | else i=0;
|
---|
1929 | GetClientRect(hwnd,&rect);
|
---|
1930 | i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos));
|
---|
1931 | if(i!=0){
|
---|
1932 | ScrollInfo.nPos+=i;
|
---|
1933 | SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
|
---|
1934 | ScrollWindow(hwnd,0,-i,NULL,NULL);
|
---|
1935 | UpdateWindow(hwnd);
|
---|
1936 | }
|
---|
1937 | return 0;
|
---|
1938 | case WM_HSCROLL:
|
---|
1939 | ScrollInfo.cbSize=sizeof(SCROLLINFO);
|
---|
1940 | ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
|
---|
1941 | GetScrollInfo(hwnd,SB_HORZ,&ScrollInfo);
|
---|
1942 | if(LOWORD(wParam)==SB_LINEUP) i=-20;
|
---|
1943 | else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
|
---|
1944 | else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
|
---|
1945 | else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
|
---|
1946 | else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
|
---|
1947 | else i=0;
|
---|
1948 | GetClientRect(hwnd,&rect);
|
---|
1949 | i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.right-ScrollInfo.nPos));
|
---|
1950 | if(i!=0){
|
---|
1951 | ScrollInfo.nPos+=i;
|
---|
1952 | SetScrollInfo(hwnd,SB_HORZ,&ScrollInfo,1);
|
---|
1953 | ScrollWindow(hwnd,-i,0,NULL,NULL);
|
---|
1954 | UpdateWindow(hwnd);
|
---|
1955 | }
|
---|
1956 | return 0;
|
---|
1957 | case WM_SIZE:
|
---|
1958 | i=GetWndNum(GetParent(hwnd));
|
---|
1959 | if(i==-1) break; //ウィンドウが初期状態の場合
|
---|
1960 | ResetScrollbarOfRadEditor(i,LOWORD(lParam),HIWORD(lParam));
|
---|
1961 | return 0;
|
---|
1962 | }
|
---|
1963 | return DefWindowProc(hwnd,message,wParam,lParam);
|
---|
1964 | }
|
---|
1965 | void ResizeToRadToolWindows(int WndNum,int weight,int height){
|
---|
1966 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
1967 | int i,i2;
|
---|
1968 | RECT rect;
|
---|
1969 |
|
---|
1970 | if(height<200){
|
---|
1971 | i=100;
|
---|
1972 | i2=100;
|
---|
1973 | }
|
---|
1974 | else{
|
---|
1975 | //ツールボタンウィンドウ(長さ、i)
|
---|
1976 | GetClientRect(GetWindow(MdiInfo[WndNum].MdiRadInfo->hTools,GW_CHILD),&rect);
|
---|
1977 | if(height>rect.bottom+1) i=rect.bottom+1;
|
---|
1978 | else i=height;
|
---|
1979 |
|
---|
1980 | //プロパティウィンドウ(長さ、i2)
|
---|
1981 | GetClientRect(GetWindow(MdiInfo[WndNum].MdiRadInfo->hProperty,GW_CHILD),&rect);
|
---|
1982 | i2=height-i;
|
---|
1983 |
|
---|
1984 | if(i2<100){
|
---|
1985 | i=height-100;
|
---|
1986 | i2=100;
|
---|
1987 | }
|
---|
1988 | }
|
---|
1989 | MoveWindow(MdiInfo[WndNum].MdiRadInfo->hTools,weight-172,0,172,i,1);
|
---|
1990 | MoveWindow(MdiInfo[WndNum].MdiRadInfo->hProperty,weight-172,i,172,i2,1);
|
---|
1991 |
|
---|
1992 | GetWindowRect(MdiInfo[WndNum].MdiRadInfo->hSupport,&rect);
|
---|
1993 | rect.right-=rect.left;
|
---|
1994 | rect.bottom-=rect.top;
|
---|
1995 |
|
---|
1996 | //RADウィンドウ
|
---|
1997 | MoveWindow(MdiInfo[WndNum].MdiRadInfo->hRad,0,0,weight-172,height-rect.bottom,1);
|
---|
1998 |
|
---|
1999 | //サポートウィンドウ
|
---|
2000 | MoveWindow(MdiInfo[WndNum].MdiRadInfo->hSupport,0,height-rect.bottom,weight-172,rect.bottom,1);
|
---|
2001 | }
|
---|
2002 | LRESULT CALLBACK MDIClientWindow_Rad(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
|
---|
2003 | extern HWND hDocCombo;
|
---|
2004 | extern MDIINFO MdiInfo[MAX_WNDNUM];
|
---|
2005 | int i,WndNum;
|
---|
2006 |
|
---|
2007 | switch(message){
|
---|
2008 | case WM_CREATE:
|
---|
2009 | extern HICON hWindowDocumentIcon;
|
---|
2010 | SendMessage(hwnd,WM_SETICON,ICON_SMALL,(long)hWindowDocumentIcon);
|
---|
2011 | break;
|
---|
2012 | case WM_MDIACTIVATE:
|
---|
2013 | if(!lParam) return 0;
|
---|
2014 | i=GetWndNum((HWND)lParam);
|
---|
2015 | if(i==-1) return 0; //ウィンドウが初期状態の場合
|
---|
2016 |
|
---|
2017 | i=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i].title);
|
---|
2018 | SendMessage(hDocCombo,CB_SETCURSEL,i,0);
|
---|
2019 | SetStatusText(NULL);
|
---|
2020 | ResetState_EditMenu();
|
---|
2021 | return 0;
|
---|
2022 | case WM_SIZE:
|
---|
2023 | WndNum=GetWndNum(hwnd);
|
---|
2024 | if(WndNum==-1) break;
|
---|
2025 | ResizeToRadToolWindows(WndNum,LOWORD(lParam),HIWORD(lParam));
|
---|
2026 | break;
|
---|
2027 | case WM_CLOSE:
|
---|
2028 | CloseDocWindow(GetWndNum(hwnd));
|
---|
2029 | pobj_nv->bMDIZoomed=IsZoomed(hwnd);
|
---|
2030 | i=DefMDIChildProc(hwnd,message,wParam,lParam);
|
---|
2031 |
|
---|
2032 | //メニュー状態を設定
|
---|
2033 | ResetState_DocMenu();
|
---|
2034 |
|
---|
2035 | return i;
|
---|
2036 | }
|
---|
2037 | return DefMDIChildProc(hwnd,message,wParam,lParam);
|
---|
2038 | }
|
---|