#include "stdafx.h" #include "Common.h" #if defined(JPN) //日本語 #include "rad_msg_jpn.h" #else //英語 #include "rad_msg_eng.h" #endif HRESULT ApplyDialogTexture( HWND ); void ShowControlAdvice(int Control){ if(Control==IDC_TOOL_MOUSE) SetStatusText(""); #if defined(JPN) //日本語 else if(Control==IDC_TOOL_BUTTON) SetStatusText("[ボタン] クリックすることができるボタンです。"); else if(Control==IDC_TOOL_CHECKBOX) SetStatusText("[チェック ボックス] ON/OFFの設定ができるボタンです。"); else if(Control==IDC_TOOL_COMBOBOX) SetStatusText("[コンボ ボックス] ドロップダウン リストの中から項目を選択することができます。"); else if(Control==IDC_TOOL_EDIT) SetStatusText("[エディット ボックス] ユーザーが文字列の編集操作を行うことができます。"); else if(Control==IDC_TOOL_GROUPBOX) SetStatusText("[グループ ボックス] 複数のコントロールを囲むことができます。"); else if(Control==IDC_TOOL_HSCROLLBAR) SetStatusText("[水平スクロールバー] 現在位置を表示、設定します。"); else if(Control==IDC_TOOL_IMAGEBOX) SetStatusText("[イメージ ボックス] 四角形やビットマップ、アイコンを表示します。"); else if(Control==IDC_TOOL_LISTBOX) SetStatusText("[リスト ボックス] 複数の項目を表示、選択できるリストです。"); else if(Control==IDC_TOOL_LISTVIEW) SetStatusText("[リスト ビュー] リスト ボックス内にアイコンやテキストを並べて表示するビューです。"); else if(Control==IDC_TOOL_PROGRESSBAR) SetStatusText("[プログレス バー] 進行状況を表示するバー。"); else if(Control==IDC_TOOL_RADIOBUTTON) SetStatusText("[ラジオ ボタン] 複数の項目から1つを選択するボタンです。"); else if(Control==IDC_TOOL_STATIC) SetStatusText("[スタティック テキスト] テキストを表示します。"); else if(Control==IDC_TOOL_TRACKBAR) SetStatusText("[トラック バー] 目盛が付いた移動バー。"); else if(Control==IDC_TOOL_TREEVIEW) SetStatusText("[ツリー ビュー] リストを階層構造で表示します。"); else if(Control==IDC_TOOL_UPDOWN) SetStatusText("[アップ ダウン コントロール] 上下のボタンで数値を設定します。"); else if(Control==IDC_TOOL_VSCROLLBAR) SetStatusText("[垂直スクロールバー] 現在位置を表示、設定します。"); #else //英語 else if(Control==IDC_TOOL_BUTTON) SetStatusText("[Button] The button which can be clicked"); else if(Control==IDC_TOOL_CHECKBOX) SetStatusText("[CheckBox] The button which can switch on/off"); else if(Control==IDC_TOOL_COMBOBOX) SetStatusText("[ComboBox] Choose an item from drop down lists"); else if(Control==IDC_TOOL_EDIT) SetStatusText("[EditBox] A user can edit a character sequence"); else if(Control==IDC_TOOL_GROUPBOX) SetStatusText("[GroupBox] Two or more control can be packed"); else if(Control==IDC_TOOL_HSCROLLBAR) SetStatusText("[Horizontal Scrollbar] The present position is displayed and setup"); else if(Control==IDC_TOOL_IMAGEBOX) SetStatusText("[ImageBox] A rectangle, a bitmap, and an icon are displayed."); else if(Control==IDC_TOOL_LISTBOX) SetStatusText("[ListBox] The list which can display and choose two or more items"); else if(Control==IDC_TOOL_LISTVIEW) SetStatusText("[ListView] The view which displays an icon and a text in a list box"); else if(Control==IDC_TOOL_PROGRESSBAR) SetStatusText("[Progressbar] The bar which displays an advance situation"); else if(Control==IDC_TOOL_RADIOBUTTON) SetStatusText("[RadioButton] The button which chooses one from two or more items"); else if(Control==IDC_TOOL_STATIC) SetStatusText("[StaticText] Display the text messages"); else if(Control==IDC_TOOL_TRACKBAR) SetStatusText("[Trackbar] The bar to which the scale was attached"); else if(Control==IDC_TOOL_TREEVIEW) SetStatusText("[TreeView] Lists are displayed by the layered structure"); else if(Control==IDC_TOOL_UPDOWN) SetStatusText("[Up/Down Control] A numerical value is set up with a up/down button"); else if(Control==IDC_TOOL_VSCROLLBAR) SetStatusText("[Vertical Scrollbar] The present position is displayed and setup"); #endif } char *GetControlName(DWORD id){ char *pTemp; pTemp=""; #if defined(JPN) //日本語 if(id==IDC_TOOL_MOUSE) pTemp="選択"; else if(id==IDC_TOOL_STATIC) pTemp="スタティック テキスト"; else if(id==IDC_TOOL_EDIT) pTemp="エディット ボックス"; else if(id==IDC_TOOL_GROUPBOX) pTemp="グループ ボックス"; else if(id==IDC_TOOL_COMBOBOX) pTemp="コンボ ボックス"; else if(id==IDC_TOOL_LISTBOX) pTemp="リスト ボックス"; else if(id==IDC_TOOL_BUTTON) pTemp="ボタン"; else if(id==IDC_TOOL_CHECKBOX) pTemp="チェック ボックス"; else if(id==IDC_TOOL_RADIOBUTTON) pTemp="ラジオ ボタン"; else if(id==IDC_TOOL_LISTVIEW) pTemp="リスト ビュー"; else if(id==IDC_TOOL_TREEVIEW) pTemp="ツリー ビュー"; else if(id==IDC_TOOL_HSCROLLBAR) pTemp="水平スクロール バー"; else if(id==IDC_TOOL_VSCROLLBAR) pTemp="垂直スクロール バー"; else if(id==IDC_TOOL_UPDOWN) pTemp="アップ ダウン コントロール"; else if(id==IDC_TOOL_IMAGEBOX) pTemp="イメージ ボックス"; else if(id==IDC_TOOL_TRACKBAR) pTemp="トラック バー"; else if(id==IDC_TOOL_PROGRESSBAR) pTemp="プログレス バー"; #else //英語 if(id==IDC_TOOL_MOUSE) pTemp="Tool"; else if(id==IDC_TOOL_STATIC) pTemp="StaticText"; else if(id==IDC_TOOL_EDIT) pTemp="EditBox"; else if(id==IDC_TOOL_GROUPBOX) pTemp="GroupBox"; else if(id==IDC_TOOL_COMBOBOX) pTemp="ComboBox"; else if(id==IDC_TOOL_LISTBOX) pTemp="ListBox"; else if(id==IDC_TOOL_BUTTON) pTemp="Button"; else if(id==IDC_TOOL_CHECKBOX) pTemp="CheckBox"; else if(id==IDC_TOOL_RADIOBUTTON) pTemp="RadioButton"; else if(id==IDC_TOOL_LISTVIEW) pTemp="ListView"; else if(id==IDC_TOOL_TREEVIEW) pTemp="TreeView"; else if(id==IDC_TOOL_HSCROLLBAR) pTemp="Horizontal Scrollbar"; else if(id==IDC_TOOL_VSCROLLBAR) pTemp="Vertical Scrollbar"; else if(id==IDC_TOOL_UPDOWN) pTemp="Up/Down Control"; else if(id==IDC_TOOL_IMAGEBOX) pTemp="ImageBox"; else if(id==IDC_TOOL_TRACKBAR) pTemp="Trackbar"; else if(id==IDC_TOOL_PROGRESSBAR) pTemp="Progressbar"; #endif return pTemp; } INT_PTR CALLBACK RadToolButtonsProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,WndNum; HWND hParent; HWND hToolBar; RECT rect; TBBUTTON CtrlToolBar[]={ {0,IDC_TOOL_MOUSE,TBSTATE_ENABLED|TBSTATE_WRAP|TBSTATE_CHECKED,TBSTYLE_CHECKGROUP,0,0}, {1,IDC_TOOL_STATIC,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {2,IDC_TOOL_EDIT,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {3,IDC_TOOL_GROUPBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0}, {4,IDC_TOOL_COMBOBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {5,IDC_TOOL_LISTBOX,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0}, {6,IDC_TOOL_BUTTON,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {7,IDC_TOOL_CHECKBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {8,IDC_TOOL_RADIOBUTTON,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0}, {9,IDC_TOOL_LISTVIEW,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {10,IDC_TOOL_TREEVIEW,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0}, {11,IDC_TOOL_HSCROLLBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {12,IDC_TOOL_VSCROLLBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {13,IDC_TOOL_UPDOWN,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0}, {14,IDC_TOOL_IMAGEBOX,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0}, {15,IDC_TOOL_TRACKBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, {16,IDC_TOOL_PROGRESSBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0}, }; TOOLTIPTEXT *pTipText; switch(message){ case WM_INITDIALOG: hToolBar=CreateToolbarEx(hwnd,WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|TBSTYLE_FLAT|TBSTYLE_TOOLTIPS, NULL, BMPNUM_RADTOOLBAR, /*ビットマップの個数*/ hResInst,(unsigned int)MAKEINTRESOURCE(IDR_CONTROL),CtrlToolBar, (BMPNUM_RADTOOLBAR-1)+SEPNUM_RADTOOLBAR, /*アイテムの個数*/ 0,0,16,15,sizeof(TBBUTTON)); //Windows9x系OSでの不具合を防ぐため PostMessage(hwnd,WM_USER+120,0,0); ApplyDialogTexture(hwnd); break; case WM_USER+120: GetClientRect(hwnd,&rect); MoveWindow(hwnd,5,22,rect.right,rect.bottom,1); MoveWindow(GetWindow(hwnd,GW_CHILD),0,0,rect.right,rect.bottom,1); return 1; case WM_COMMAND: switch(LOWORD(wParam)){ case IDC_TOOL_MOUSE: ShowControlAdvice(LOWORD(wParam)); hParent=GetParent(GetParent(hwnd)); BringWindowToTop(hParent); i=GetWndNum(hParent); i2=GetWndInfoNum(MdiInfo[i]->path); MdiInfo[i]->MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE; DrawSelectingRect(MdiInfo[i]->MdiRadInfo->hRad,i,i2,IDC_TOOL_MOUSE); SetFocus(MdiInfo[i]->MdiRadInfo->hRad); return 1; case IDC_TOOL_BUTTON: case IDC_TOOL_CHECKBOX: case IDC_TOOL_COMBOBOX: case IDC_TOOL_EDIT: case IDC_TOOL_GROUPBOX: case IDC_TOOL_HSCROLLBAR: case IDC_TOOL_IMAGEBOX: case IDC_TOOL_LISTBOX: case IDC_TOOL_LISTVIEW: case IDC_TOOL_PROGRESSBAR: case IDC_TOOL_RADIOBUTTON: case IDC_TOOL_STATIC: case IDC_TOOL_TRACKBAR: case IDC_TOOL_TREEVIEW: case IDC_TOOL_UPDOWN: case IDC_TOOL_VSCROLLBAR: ShowControlAdvice(LOWORD(wParam)); hParent=GetParent(GetParent(hwnd)); BringWindowToTop(hParent); WndNum=GetWndNum(hParent); MdiInfo[WndNum]->MdiRadInfo->ButtonSelect=LOWORD(wParam); InvalidateRect(MdiInfo[WndNum]->MdiRadInfo->hRad,NULL,0); return 1; } break; case WM_NOTIFY: pTipText=(TOOLTIPTEXT *)lParam; if(pTipText->hdr.code==TTN_NEEDTEXT){ //ステータスバーに説明文を表示 ShowControlAdvice(pTipText->hdr.idFrom); //コントロール名を取得し、ツールヒントとして表示する pTipText->lpszText=GetControlName(pTipText->hdr.idFrom); } break; } return 0; } LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ extern HFONT hStatusFont; int i; RECT rect; SCROLLINFO ScrollInfo; HDC hdc; PAINTSTRUCT ps; HFONT hOldFont; POINT pos; switch(message){ case WM_CREATE: CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_CTRLBUTTONS),hwnd,(DLGPROC)RadToolButtonsProc); return 0; case WM_VSCROLL: ScrollInfo.cbSize=sizeof(SCROLLINFO); ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE; GetScrollInfo(hwnd,SB_VERT,&ScrollInfo); if(LOWORD(wParam)==SB_LINEUP) i=-20; else if(LOWORD(wParam)==SB_LINEDOWN) i=20; else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage; else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage; else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos; else i=0; GetClientRect(hwnd,&rect); i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos)); if(i!=0){ ScrollInfo.nPos+=i; SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1); ScrollWindow(hwnd,0,-i,NULL,NULL); UpdateWindow(hwnd); } return 0; case WM_SIZE: GetClientRect(GetWindow(hwnd,GW_CHILD),&rect); ScrollInfo.cbSize=sizeof(SCROLLINFO); ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS; //垂直スクロールバーの設定 GetScrollInfo(hwnd,SB_VERT,&ScrollInfo); ScrollInfo.nMin=0; ScrollInfo.nMax=rect.bottom; ScrollInfo.nPage=HIWORD(lParam); SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1); i=ScrollInfo.nPos; ScrollInfo.fMask=SIF_POS; GetScrollInfo(hwnd,SB_VERT,&ScrollInfo); if(i>ScrollInfo.nPos){ ScrollWindow(hwnd,0,i-ScrollInfo.nPos,NULL,NULL); UpdateWindow(hwnd); } return 0; case WM_PAINT: hdc=BeginPaint(hwnd,&ps); hOldFont=(HFONT)SelectObject(hdc,hStatusFont); SetBkMode(hdc,TRANSPARENT); pos.x=30; pos.y=3; CursorPos_GlobalToLocal(hwnd,&pos.x,&pos.y); #if defined(JPN) //日本語 TextOut(hdc,pos.x,pos.y,"- コントロール -",lstrlen("- コントロール -")); #else //英語 TextOut(hdc,pos.x,pos.y,"- Control -",lstrlen("- Control -")); #endif SelectObject(hdc,hOldFont); EndPaint(hwnd,&ps); return 0; } return DefWindowProc(hwnd,message,wParam,lParam); } ///////////////////////// //ウィンドウ プロパティ void RadProperty_Window_Caption_StylingOrder(HWND hwnd,DWORD *style){ if((*style&WS_CAPTION)==WS_CAPTION){ EnableWindow(GetDlgItem(hwnd,IDC_STYLE_SYSMENU),1); if(!(*style&WS_CHILD)){ EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1); } if(SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_GETCURSEL,0,0)==0){ if(*style&WS_THICKFRAME) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,1,0); } } else{ *style&=~(WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX); SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_SYSMENU),0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),0); } } void RadProperty_Window_Border_StylingOrder(HWND hwnd,DWORD *style){ if(*style&(WS_BORDER|WS_THICKFRAME)){ if(*style&(WS_POPUP|WS_CHILD)) EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1); else{ *style|=WS_CAPTION; SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0); } } else{ *style&=~WS_CAPTION; SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0); } RadProperty_Window_Caption_StylingOrder(hwnd,style); } void RadProperty_Window_Window_StylingOrder(HWND hwnd,DWORD *style){ if(*style&WS_POPUP){ EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),1); } else if(*style&WS_CHILD){ EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1); *style&=~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_MINIMIZE|WS_MAXIMIZE); SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),0); } else{ if(*style&WS_BORDER){ *style|=WS_CAPTION; SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),1); } } RadProperty_Window_Border_StylingOrder(hwnd,style); } INT_PTR CALLBACK DlgRadProperty_Window_Rename(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ extern HANDLE hHeap; extern HWND hClient,hOwner; int i,i3; char temporary[MAX_PATH],temp2[MAX_PATH]; switch(message){ case WM_INITDIALOG: { SetPosCenter(hwnd); i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str()); SetDlgItemText(hwnd,IDC_WINDOWHANDLE,( "h" + pWindowInfo->GetName() ).c_str()); SetDlgItemText(hwnd,IDC_WINDOWPROC,( pWindowInfo->GetName() + "Proc" ).c_str()); ApplyDialogTexture(hwnd); break; } case WM_COMMAND: switch(LOWORD(wParam)){ case IDOK: { if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWNAME))==0){ //MsgBox "ウィンドウ識別名を入力して下さい。" MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_WINDOWNAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION); break; } if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWHANDLE))==0){ //MsgBox "ハンドル名を入力して下さい。" MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_HANDLENAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION); break; } if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWPROC))==0){ //MsgBox "プロシージャ名を入力して下さい。" MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_PROCEDURENAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION); break; } i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); RAD_UNDOSTATE_NAME names,NoticeNames; i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWNAME))+1; GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,i3); names.name = temporary; if( names.name == pWindowInfo->GetName() ) { SendMessage(hwnd,WM_COMMAND,IDCANCEL,0); return 1; } //MsgBox "これらのウィンドウ識別名を変更すると、ソースコード内の識別子は手動で変換する必要があります。変更しますか?" if(IDCANCEL==MessageBox(hwnd,STRING_WINDOW_RENAME_CHECK,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) return 1; //変更情報を更新 NoticeNames.name=pWindowInfo->GetName(); Rad_NoticeChanging(i,RAD_UNDO_NAME,SELECT_WINDOW,(DWORD)&NoticeNames); pWindowInfo->SetName( names.name ); MdiInfo[i]->path = names.name; EndDialog(hwnd,1); return 1; } case IDCANCEL: EndDialog(hwnd,0); return 1; case IDC_WINDOWNAME: { GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,MAX_PATH); if(temporary[0]){ sprintf(temp2,"h%s",temporary); SetDlgItemText(hwnd,IDC_WINDOWHANDLE,temp2); sprintf(temp2,"%sProc",temporary); SetDlgItemText(hwnd,IDC_WINDOWPROC,temp2); } else{ SetDlgItemText(hwnd,IDC_WINDOWHANDLE,""); SetDlgItemText(hwnd,IDC_WINDOWPROC,""); } } return 1; } break; } return 0; } INT_PTR CALLBACK DlgRadProperty_Window_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i; switch(message){ case WM_INITDIALOG: { SetPosCenter(hwnd); i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); if(pWindowInfo->GetExStyle()&WS_EX_TOPMOST) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOPMOST,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_ACCEPTFILES) SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_TRANSPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_TOOLWINDOW) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOOLWINDOW,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_CLIENTEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_STATICEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_NOPARENTNOTIFY) SendDlgItemMessage(hwnd,IDC_EXSTYLE_NOPARENTNOTIFY,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_CONTEXTHELP) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTEXTHELP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetExStyle()&WS_EX_CONTROLPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTROLPARENT,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); break; } case WM_COMMAND: switch(LOWORD(wParam)){ case IDOK: { i=GetWndNum(GetWindow(hClient,GW_CHILD)); DWORD style; style=0; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOPMOST,BM_GETCHECK,0,0)) style|=WS_EX_TOPMOST; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_GETCHECK,0,0)) style|=WS_EX_ACCEPTFILES; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_GETCHECK,0,0)) style|=WS_EX_TRANSPARENT; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOOLWINDOW,BM_GETCHECK,0,0)) style|=WS_EX_TOOLWINDOW; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_GETCHECK,0,0)) style|=WS_EX_CLIENTEDGE; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_GETCHECK,0,0)) style|=WS_EX_STATICEDGE; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_NOPARENTNOTIFY,BM_GETCHECK,0,0)) style|=WS_EX_NOPARENTNOTIFY; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTEXTHELP,BM_GETCHECK,0,0)) style|=WS_EX_CONTEXTHELP; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTROLPARENT,BM_GETCHECK,0,0)) style|=WS_EX_CONTROLPARENT; ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); if(style==pWindowInfo->GetExStyle()){ SendMessage(hwnd,WM_COMMAND,IDCANCEL,0); return 1; } //変更情報 Rad_NoticeChanging(i,RAD_UNDO_EXSTYLE,SELECT_WINDOW,pWindowInfo->GetExStyle()); pWindowInfo->SetExStyle( style ); EndDialog(hwnd,1); return 1; } case IDCANCEL: EndDialog(hwnd,0); return 1; } break; } return 0; } INT_PTR CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ extern HANDLE hHeap; int i,i3,i4; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str()); SetDlgItemText(hwnd,IDC_HANDLE,pWindowInfo->GetHandleName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->GetCaption().c_str()); //"3D FACE(標準)" SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_BGCOLOR1); //"色指定" SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_BGCOLOR2); BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.bitmapResources ) { SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(LPARAM)resourceItem.idName.c_str()); } if( pWindowInfo->IsModalDlg() || pWindowInfo->IsModelessDlg() ) { SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0); EnableWindow(GetDlgItem(hwnd,IDC_BGCOLOR),0); } else{ if(pWindowInfo->GetBackgroundColor()==COLOR_3DFACE){ //3DFACE SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0); } else if(pWindowInfo->GetBackgroundColor()<=0){ //色指定 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,1,0); } else if(pWindowInfo->GetBackgroundColor()>=0x1000){ //ビットマップ指定 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,2+pWindowInfo->GetBackgroundColor()-0x1000,0); } } //////////// // メニュー //////////// //"なし" SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_ADDSTRING,0,(LPARAM)STRING_NONE_); for(i3=0,i4=0;i3HasMenu() ) { if(lstrcmpi(projectInfo.pMenuInfo[i3].IdName,pWindowInfo->GetMenuIdName().c_str())==0) i4=i3+1; } SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_ADDSTRING,0,(LPARAM)projectInfo.pMenuInfo[i3].IdName); } if(i4==0&&pWindowInfo->HasMenu()){ //メニューが存在しない場合、無効にする pWindowInfo->SetMenuIdName( "" ); DrawRadWindow(i,pWindowInfo); } SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_SETCURSEL,i4,0); //////////// // アイコン //////////// //"Windowsロゴ(標準)" SendDlgItemMessage(hwnd,IDC_ICONRES,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_ICONDEFAULT); for(i3=0,i4=0;i3(projectInfo.resourceManager.iconResources.size());i3++){ SendDlgItemMessage(hwnd,IDC_ICONRES,CB_ADDSTRING,0,(LPARAM)projectInfo.resourceManager.iconResources[i3].idName.c_str()); if( pWindowInfo->HasIcon() ) { if( projectInfo.resourceManager.iconResources[i3].idName == pWindowInfo->GetIconResourceName() ) { i4=i3+1; } } } if( i4 == 0 && pWindowInfo->HasIcon() ) { //アイコンが存在しない場合、無効にする pWindowInfo->SetIconResourceName( "" ); DrawRadWindow(i,pWindowInfo); } SendDlgItemMessage(hwnd,IDC_ICONRES,CB_SETCURSEL,i4,0); //////////// // スタイル //////////// //"オーバーラップ" SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_STYLE_OVERLAPPED); //"ポップアップ" SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_STYLE_POPUP); //"チャイルド" SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_STYLE_CHILD); if(pWindowInfo->GetStyle()&WS_POPUP) SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,1,0); else if(pWindowInfo->GetStyle()&WS_CHILD) SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,0,0); //"枠なし" SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_STYLE_FRAME_NONE); //"細枠" SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_STYLE_FRAME_THICK); //"サイズ変更枠" SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(LPARAM)STRING_WINDOWPROP_STYLE_FRAME_BORDER); //WS_CAPTION(WS_BORDER含む)を考慮してWS_THICKFRAMEを最初に比較する if(pWindowInfo->GetStyle()&WS_THICKFRAME) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,2,0); else if(pWindowInfo->GetStyle()&WS_BORDER) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,1,0); else SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,0,0); if(pWindowInfo->GetStyle()&WS_CAPTION) SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_SYSMENU) SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_MINIMIZEBOX) SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_MAXIMIZEBOX) SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_MINIMIZE) SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_MAXIMIZE) SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLLBAR,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLLBAR,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_CLIPSIBLINGS) SendDlgItemMessage(hwnd,IDC_STYLE_CLIPSIBLINGS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_CLIPCHILDREN) SendDlgItemMessage(hwnd,IDC_STYLE_CLIPCHILDREN,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); SetDlgItemText(hwnd,IDC_SETFONT,pWindowInfo->LogFont.lfFaceName); DWORD tempStyle = pWindowInfo->GetStyle(); RadProperty_Window_Window_StylingOrder(hwnd,&tempStyle); pWindowInfo->SetStyle( tempStyle ); ////////// //タイプ if( pWindowInfo->IsDefaultWindow() ) { SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_SETCHECK,BST_CHECKED,0); } else if( pWindowInfo->IsModalDlg() ) { SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0); } else if( pWindowInfo->IsModelessDlg() ) { SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_SETCHECK,BST_CHECKED,0); } else { throw; } bInitial=0; ApplyDialogTexture(hwnd); break; } case WM_COMMAND: switch(LOWORD(wParam)){ case IDC_RENAMEWINDOW: { if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW_RENAME),hwnd,DlgRadProperty_Window_Rename)) return 1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str()); SetDlgItemText(hwnd,IDC_HANDLE,pWindowInfo->GetHandleName().c_str()); return 1; } case IDC_RENAMECAPTION: { if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMECAPTION),hwnd,DlgRadProperty_Item_RenameCaption)) return 1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->GetCaption().c_str()); return 1; } case IDC_SETFONT: { i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); LOGFONT lf; lf=pWindowInfo->LogFont; if(!SetFontDialog(hwnd,&pWindowInfo->LogFont,0)) return 1; //変更情報 Rad_NoticeChanging(i,RAD_UNDO_FONT,SELECT_WINDOW,(DWORD)&lf); SetDlgItemText(hwnd,IDC_SETFONT,pWindowInfo->LogFont.lfFaceName); DrawRadWindow(i,pWindowInfo); return 1; } case IDC_BGCOLOR: if(HIWORD(wParam)==CBN_SELCHANGE){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); i3=SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_GETCURSEL,0,0); if(i3==0){ //3DFACE //変更情報 Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,pWindowInfo->GetBackgroundColor()); pWindowInfo->SetBackgroundColor( COLOR_3DFACE ); } else if(i3==1){ //色指定 CHOOSECOLOR cc; COLORREF CusColors[16]={ RGB(255,255,255), RGB(0,0,0), RGB(128,128,128), RGB(192,192,192), RGB(128,0,0), RGB(255,0,0), RGB(128,128,0), RGB(255,255,0), RGB(0,128,0), RGB(0,255,0), RGB(0,128,128), RGB(0,255,255), RGB(0,0,128), RGB(0,0,255), RGB(128,0,128), RGB(255,0,255)}; cc.lStructSize=sizeof(CHOOSECOLOR); cc.hwndOwner=hwnd; if(pWindowInfo->GetBackgroundColor()<=0) cc.rgbResult=-pWindowInfo->GetBackgroundColor(); else cc.rgbResult=RGB(255,255,255); cc.lpCustColors=CusColors; cc.Flags=CC_RGBINIT|CC_FULLOPEN; if(!ChooseColor(&cc)){ //キャンセル動作 if(pWindowInfo->GetBackgroundColor()==COLOR_3DFACE){ //3DFACE SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0); } else if(pWindowInfo->GetBackgroundColor()<=0){ //色指定 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,1,0); } else if(pWindowInfo->GetBackgroundColor()>=0x1000){ //ビットマップ指定 SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,2+pWindowInfo->GetBackgroundColor()-0x1000,0); } return 1; } //変更情報 Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,pWindowInfo->GetBackgroundColor()); pWindowInfo->SetBackgroundColor( -(int)cc.rgbResult ); } else{ //ビットマップ i3-=2; //変更情報 Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,pWindowInfo->GetBackgroundColor()); pWindowInfo->SetBackgroundColor( 0x1000+i3 ); } DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_WINDOWMENU: if(HIWORD(wParam)==CBN_SELCHANGE){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_WINDOWMENU,SELECT_WINDOW,(DWORD)&pWindowInfo->GetMenuIdName()); i3=SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETCURSEL,0,0); if(i3==0) { pWindowInfo->SetMenuIdName( "" ); } else { char temporary[1024]; SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETLBTEXT,i3,(LPARAM)temporary); pWindowInfo->SetMenuIdName( temporary ); } DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ICONRES: if(HIWORD(wParam)==CBN_SELCHANGE){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_ICONRES,SELECT_WINDOW,(DWORD)&pWindowInfo->GetIconResourceName()); i3=SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETCURSEL,0,0); if(i3==0) { pWindowInfo->SetIconResourceName( "" ); } else { char temporary[1024]; SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETLBTEXT,i3,(LPARAM)temporary); pWindowInfo->SetIconResourceName( temporary ); } DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_WINDOWSTYLE: if(HIWORD(wParam)==CBN_SELCHANGE){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_GETCURSEL,0,0); pWindowInfo->SetStyle( pWindowInfo->GetStyle() & 0x3FFFFFFF ); if(i3==1) pWindowInfo->AddStyle( WS_POPUP ); else if(i3==2) pWindowInfo->AddStyle( WS_CHILD ); DWORD tempStyle = pWindowInfo->GetStyle(); RadProperty_Window_Window_StylingOrder(hwnd,&tempStyle); pWindowInfo->SetStyle( tempStyle ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BORDERSTYLE: if(HIWORD(wParam)==CBN_SELCHANGE){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_GETCURSEL,0,0); pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~(WS_BORDER|WS_THICKFRAME) ); if(i3==1) pWindowInfo->AddStyle( WS_BORDER ); else if(i3==2){ pWindowInfo->AddStyle( WS_BORDER ); pWindowInfo->AddStyle( WS_THICKFRAME ); } DWORD tempStyle = pWindowInfo->GetStyle(); RadProperty_Window_Border_StylingOrder(hwnd,&tempStyle); pWindowInfo->SetStyle( tempStyle ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_CAPTION: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_CAPTION ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_CAPTION ); DWORD tempStyle = pWindowInfo->GetStyle(); RadProperty_Window_Caption_StylingOrder(hwnd,&tempStyle); pWindowInfo->SetStyle( tempStyle ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_SYSMENU: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_SYSMENU ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_SYSMENU ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_MINIMIZEBOX: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_MINIMIZEBOX ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_MINIMIZEBOX ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_MAXIMIZEBOX: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_MAXIMIZEBOX ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_MAXIMIZEBOX ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_MINIMIZE: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_MINIMIZE ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_MINIMIZE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_MAXIMIZE: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_MAXIMIZE ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_MAXIMIZE ); DrawRadWindow(i,pWindowInfo); return 1; } case IDC_STYLE_HSCROLLBAR: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLLBAR,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_HSCROLL ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_HSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } case IDC_STYLE_VSCROLLBAR: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLLBAR,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_VSCROLL ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_VSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_DISABLED: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_DISABLED ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_DISABLED ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_CLIPSIBLINGS: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_CLIPSIBLINGS,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_CLIPSIBLINGS ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_CLIPSIBLINGS ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_CLIPCHILDREN: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_CLIPCHILDREN,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_CLIPCHILDREN ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_CLIPCHILDREN ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_VISIBLE: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,pWindowInfo->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_GETCHECK,0,0)) pWindowInfo->AddStyle( WS_VISIBLE ); else pWindowInfo->SetStyle( pWindowInfo->GetStyle() & ~WS_VISIBLE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW_EXSTYLE),hwnd,DlgRadProperty_Window_ExStyle)) return 1; i=GetWndNum(GetParent(GetParent(hwnd))); DrawRadWindow(i,GetWndInfo(MdiInfo[i]->path)); return 1; case IDC_DEFWINDOW: case IDC_MODALDLG: case IDC_MODELESSDLG: if(HIWORD(wParam)==BN_CLICKED){ i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //変更情報 Rad_NoticeChanging(i,RAD_UNDO_TYPE,SELECT_WINDOW,(DWORD)pWindowInfo->GetType()); if(SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_GETCHECK,0,0)) { pWindowInfo->SetType( ActiveBasic::PM::WindowType::Default ); } else if(SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_GETCHECK,0,0)) { pWindowInfo->SetType( ActiveBasic::PM::WindowType::ModalDlg ); } else if(SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_GETCHECK,0,0)) { pWindowInfo->SetType( ActiveBasic::PM::WindowType::ModelessDlg ); } return 1; } break; } break; } return 0; } INT_PTR CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ extern HANDLE hHeap; int i,i3; char *temporary; POINTANDSIZE PointAndSize; switch(message){ case WM_INITDIALOG: { SetPosCenter(hwnd); i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); if(MdiInfo[i]->MdiRadInfo->SelectingItem[0]==SELECT_WINDOW) SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->GetCaption().c_str()); else SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); ApplyDialogTexture(hwnd); break; } case WM_COMMAND: switch(LOWORD(wParam)){ case IDOK: { i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_CAPTION))+1; temporary=(char *)HeapAlloc(hHeap,0,i3); GetDlgItemText(hwnd,IDC_CAPTION,temporary,i3); if(MdiInfo[i]->MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){ if( pWindowInfo->GetCaption() == temporary){ HeapDefaultFree(temporary); SendMessage(hwnd,WM_COMMAND,IDCANCEL,0); return 1; } //変更情報を更新 Rad_NoticeChanging(i,RAD_UNDO_CAPTION,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->GetCaption()); pWindowInfo->SetCaption( temporary ); } else{ if( pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption() == temporary ) { HeapDefaultFree(temporary); SendMessage(hwnd,WM_COMMAND,IDCANCEL,0); return 1; } //変更情報を更新 Rad_NoticeChanging(i,RAD_UNDO_CAPTION,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption()); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetCaption( temporary ); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->Control==CT_STATIC){ //スタティック テキスト //テキストが表示できるようにサイズを拡大する PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->pos; PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size; Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize); HFONT hFont,hOldFont; hFont=CreateFontIndirect(&pWindowInfo->LogFont); hOldFont=(HFONT)SelectObject(MdiInfo[i]->MdiRadInfo->hMemDC,hFont); GetTextExtentPoint32(MdiInfo[i]->MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size); SelectObject(MdiInfo[i]->MdiRadInfo->hMemDC,hOldFont); DeleteObject(hFont); //テキストの終端に余裕を持たせる PointAndSize.size.cx+=5; if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size.cxchildWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size.cx=PointAndSize.size.cx; } if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->Control==CT_CHECKBOX){ //チェック ボックス //テキストが表示できるようにサイズを拡大する PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->pos; PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size; Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize); HFONT hFont,hOldFont; hFont=CreateFontIndirect(&pWindowInfo->LogFont); hOldFont=(HFONT)SelectObject(MdiInfo[i]->MdiRadInfo->hMemDC,hFont); GetTextExtentPoint32(MdiInfo[i]->MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size); SelectObject(MdiInfo[i]->MdiRadInfo->hMemDC,hOldFont); DeleteObject(hFont); //テキストの終端に余裕を持たせる PointAndSize.size.cx+=21; if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size.cxchildWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size.cx=PointAndSize.size.cx; } if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->Control==CT_RADIOBUTTON){ //ラジオ ボックス //テキストが表示できるようにサイズを拡大する PointAndSize.pos=pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->pos; PointAndSize.size=pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size; Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize); HFONT hFont,hOldFont; hFont=CreateFontIndirect(&pWindowInfo->LogFont); hOldFont=(HFONT)SelectObject(MdiInfo[i]->MdiRadInfo->hMemDC,hFont); GetTextExtentPoint32(MdiInfo[i]->MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size); SelectObject(MdiInfo[i]->MdiRadInfo->hMemDC,hOldFont); DeleteObject(hFont); //テキストの終端に余裕を持たせる PointAndSize.size.cx+=20; if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size.cxchildWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->size.cx=PointAndSize.size.cx; } } DrawRadWindow(i,pWindowInfo); EndDialog(hwnd,1); HeapDefaultFree(temporary); return 1; } case IDCANCEL: EndDialog(hwnd,0); return 1; } break; } return 0; } INT_PTR CALLBACK DlgRadProperty_Item_RenameID(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ extern HANDLE hHeap; extern HWND hClient,hOwner; int i,i3; char *temporary; switch(message){ case WM_INITDIALOG: { SetPosCenter(hwnd); i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); ApplyDialogTexture(hwnd); } break; case WM_COMMAND: switch(LOWORD(wParam)){ case IDOK: { i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_IDNAME))+1; if(i3==1){ //MsgBox "ID名を入力して下さい。" MessageBox(hOwner,STRING_ITEM_RENAME_MUST_ID,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION); break; } temporary=(char *)HeapAlloc(hHeap,0,i3); GetDlgItemText(hwnd,IDC_IDNAME,temporary,i3); if( pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName() == temporary ) { HeapDefaultFree(temporary); SendMessage(hwnd,WM_COMMAND,IDCANCEL,0); return 1; } //MsgBox "アイテムのID名を変更すると、ソースコード内のID名は手動で変換する必要があります。変更しますか?" if(IDCANCEL==MessageBox(hwnd,STRING_ITEM_RENAME_CHECK,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) return 1; //変更情報を更新 Rad_NoticeChanging(i,RAD_UNDO_NAME,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName()); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetName( temporary ); EndDialog(hwnd,1); return 1; } case IDCANCEL: EndDialog(hwnd,0); return 1; } break; } return 0; } BOOL DefaultItemStyles(HWND hwnd,int WndNum,int WndInfoNum,WPARAM wParam){ extern HANDLE hHeap; ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum]; switch(LOWORD(wParam)){ case IDC_RENAMEID: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMEID),hwnd,DlgRadProperty_Item_RenameID)) return 1; SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); return 1; case IDC_RENAMECAPTION: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMECAPTION),hwnd,DlgRadProperty_Item_RenameCaption)) return 1; SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); return 1; case IDC_STYLE_DISABLED: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_DISABLED ); else pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_DISABLED ); DrawRadWindow(WndNum,pWindowInfo); return 1; } break; case IDC_STYLE_VISIBLE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_VISIBLE ); else pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_VISIBLE ); return 1; } break; case IDC_STYLE_GROUP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_GROUP ); else pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_GROUP ); return 1; } break; case IDC_STYLE_TABSTOP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_TABSTOP ); else pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_TABSTOP ); return 1; } break; } return 0; } INT_PTR CALLBACK DlgRadProperty_Item_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i; switch(message){ case WM_INITDIALOG: { SetPosCenter(hwnd); i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetExStyle()&WS_EX_ACCEPTFILES) SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetExStyle()&WS_EX_TRANSPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetExStyle()&WS_EX_DLGMODALFRAME) SendDlgItemMessage(hwnd,IDC_EXSTYLE_DLGMODALFRAME,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetExStyle()&WS_EX_CLIENTEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetExStyle()&WS_EX_STATICEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); break; } case WM_COMMAND: switch(LOWORD(wParam)){ case IDOK: { i=GetWndNum(GetWindow(hClient,GW_CHILD)); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); DWORD style; style=0; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_GETCHECK,0,0)) style|=WS_EX_ACCEPTFILES; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_GETCHECK,0,0)) style|=WS_EX_TRANSPARENT; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_DLGMODALFRAME,BM_GETCHECK,0,0)) style|=WS_EX_DLGMODALFRAME; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_GETCHECK,0,0)) style|=WS_EX_CLIENTEDGE; if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_GETCHECK,0,0)) style|=WS_EX_STATICEDGE; if(style==pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetExStyle()){ SendMessage(hwnd,WM_COMMAND,IDCANCEL,0); return 1; } //変更情報 Rad_NoticeChanging(i,RAD_UNDO_EXSTYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetExStyle()); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetExStyle( style ); EndDialog(hwnd,1); return 1; } case IDCANCEL: EndDialog(hwnd,0); return 1; } break; } return 0; } ///////////////////// // BUTTON プロパティ INT_PTR CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); //////////// //スタイル if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_OWNERDRAW)==BS_OWNERDRAW) SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_SETCHECK,BST_CHECKED,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_DEFPUSHBUTTON) SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0); ////////////////// // 水平方向の配置 ////////////////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_DEFAULT); //"左端" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_LEFT); //"右端" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_RIGHT); //"中央" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_CENTER); //ビットを考慮してBS_CENTERを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0); ////////////////// // 垂直方向の配置 ////////////////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_DEFAULT); //"上端" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_TOP); //"下端" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_BOTTOM); //"中央" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LONG_PTR)STRING_CENTER); //ビットを考慮してBS_VCENTERを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0); bInitial=0; ApplyDialogTexture(hwnd); break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[i2]; //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_BS_DEFPUSHBUTTON: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_OWNERDRAW ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_DEFPUSHBUTTON ); SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_DEFPUSHBUTTON ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_OWNERDRAW: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_DEFPUSHBUTTON ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_OWNERDRAW ); SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_OWNERDRAW ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_ICON: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_ICON ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_BITMAP ); SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_ICON ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_BITMAP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_BITMAP ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_ICON ); SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_BITMAP ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_MULTILINE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_MULTILINE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_MULTILINE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_NOTIFY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_NOTIFY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_NOTIFY ); return 1; } break; case IDC_BS_HPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_LEFT|BS_RIGHT|BS_CENTER ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_LEFT ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_RIGHT ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_CENTER ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_VPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_TOP|BS_BOTTOM|BS_VCENTER ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_TOP ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_BOTTOM ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_VCENTER ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } //////////////////////// // CHECKBOX プロパティ INT_PTR CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); //////////// //スタイル if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_AUTOCHECKBOX)==BS_AUTOCHECKBOX) SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_AUTO3STATE)==BS_AUTO3STATE){ SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0); SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_SETCHECK,BST_CHECKED,0); } if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_3STATE)==BS_3STATE) SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_PUSHLIKE) SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_LEFTTEXT) SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0); ////////////////// // 水平方向の配置 ////////////////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_DEFAULT); //"左端" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_LEFT); //"右端" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_RIGHT); //"中央" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_CENTER); //ビットを考慮してBS_CENTERを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0); ////////////////// // 垂直方向の配置 ////////////////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_DEFAULT); //"上端" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_TOP); //"下端" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_BOTTOM); //"中央" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_CENTER); //ビットを考慮してBS_VCENTERを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[i2]; //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_BS_AUTO: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_GETCHECK,0,0)){ if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x04){ //3state pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_AUTO3STATE ); } else{ //2state pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_AUTOCHECKBOX ); } } else{ if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x04){ //3state pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_3STATE ); } else{ //2state pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_CHECKBOX ); } } return 1; } break; case IDC_BS_3STATE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_GETCHECK,0,0)){ if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0F)==BS_CHECKBOX){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_3STATE ); } else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0F)==BS_AUTOCHECKBOX){ //自動チェック pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_AUTO3STATE ); } } else{ if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0F)==BS_3STATE){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_CHECKBOX ); } else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0F)==BS_AUTO3STATE){ //自動チェック pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_AUTOCHECKBOX ); } } return 1; } break; case IDC_BS_PUSHLIKE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_PUSHLIKE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_PUSHLIKE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_LEFTTEXT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_LEFTTEXT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_LEFTTEXT ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_ICON: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_ICON ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_BITMAP ); SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_ICON ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_BITMAP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_BITMAP ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_ICON ); SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_BITMAP ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_MULTILINE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_MULTILINE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_MULTILINE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_NOTIFY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_NOTIFY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_NOTIFY ); return 1; } break; case IDC_BS_HPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_LEFT|BS_RIGHT|BS_CENTER ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_LEFT ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_RIGHT ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_CENTER ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_VPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_TOP|BS_BOTTOM|BS_VCENTER ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_TOP ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_BOTTOM ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_VCENTER ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } } } return 0; } /////////////////////// // COMBOBOX プロパティ void RadProperty_ComboBox_StylingOrder(HWND hwnd,DWORD *style){ if(!(*style&(CBS_OWNERDRAWFIXED|CBS_OWNERDRAWVARIABLE))){ *style&=~(CBS_HASSTRINGS); SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_CBS_HASSTRINGS),0); } else EnableWindow(GetDlgItem(hwnd,IDC_CBS_HASSTRINGS),1); } INT_PTR CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); ///////////////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); //////// // 選択 //////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_DEFAULT); //"ドロップ ダウン" SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_COMBOBOXPROP_STYLE_DROPDOWN); //"ドロップ ダウン リスト" SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_COMBOBOXPROP_STYLE_DROPDOWNLIST); //ビットを考慮してCBS_DROPDOWNLISTを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_DROPDOWNLIST)==CBS_DROPDOWNLIST) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,2,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_SIMPLE) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,0,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_DROPDOWN) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,1,0); //////////////// // オーナー描画 //////////////// //"なし" SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(LPARAM)STRING_NONE_); //"固定" SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(LPARAM)STRING_OWNERDRAW_FIXED); //"可変" SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(LPARAM)STRING_OWNERDRAW_VARIABLE); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_OWNERDRAWFIXED) SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_OWNERDRAWVARIABLE) SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,0,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_HASSTRINGS) SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_SORT) SendDlgItemMessage(hwnd,IDC_CBS_SORT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_NOINTEGRALHEIGHT) SendDlgItemMessage(hwnd,IDC_CBS_NOINTEGRALHEIGHT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_OEMCONVERT) SendDlgItemMessage(hwnd,IDC_CBS_OEMCONVERT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_AUTOHSCROLL) SendDlgItemMessage(hwnd,IDC_CBS_AUTOHSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_DISABLENOSCROLL) SendDlgItemMessage(hwnd,IDC_CBS_DISABLENOSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_UPPERCASE) SendDlgItemMessage(hwnd,IDC_CBS_UPPERCASE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&CBS_LOWERCASE) SendDlgItemMessage(hwnd,IDC_CBS_LOWERCASE,BM_SETCHECK,BST_CHECKED,0); DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_ComboBox_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[i2]; //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_CBS_TYPE: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_GETCURSEL,0,0); //CBS_DROPDOWNLIST=CBS_SIMPLE | CBS_DROPDOWN pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_DROPDOWNLIST ); if(i3==0) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_SIMPLE ); else if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_DROPDOWN ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_DROPDOWNLIST ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_CBS_OWNERDRAW: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_OWNERDRAWFIXED|CBS_OWNERDRAWVARIABLE ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_OWNERDRAWFIXED ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_OWNERDRAWVARIABLE ); DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_ComboBox_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); return 1; } break; case IDC_CBS_HASSTRINGS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_HASSTRINGS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_HASSTRINGS ); return 1; } break; case IDC_CBS_SORT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_SORT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_SORT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_SORT ); return 1; } break; case IDC_CBS_NOINTEGRALHEIGHT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_NOINTEGRALHEIGHT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_NOINTEGRALHEIGHT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_NOINTEGRALHEIGHT ); return 1; } break; case IDC_CBS_OEMCONVERT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_OEMCONVERT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_OEMCONVERT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_OEMCONVERT ); return 1; } break; case IDC_STYLE_VSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_VSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_VSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_CBS_AUTOHSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_AUTOHSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_AUTOHSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_AUTOHSCROLL ); return 1; } break; case IDC_CBS_DISABLENOSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_DISABLENOSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_DISABLENOSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_DISABLENOSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_CBS_UPPERCASE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_UPPERCASE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_UPPERCASE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_UPPERCASE ); return 1; } break; case IDC_CBS_LOWERCASE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_CBS_LOWERCASE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( CBS_LOWERCASE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( CBS_LOWERCASE ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } ///////////////////// // EDIT プロパティ void RadProperty_Edit_StylingOrder(HWND hwnd,DWORD *style){ if(*style&ES_MULTILINE){ EnableWindow(GetDlgItem(hwnd,IDC_STYLE_HSCROLL),1); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_VSCROLL),1); EnableWindow(GetDlgItem(hwnd,IDC_ES_AUTOVSCROLL),1); *style&=~(ES_PASSWORD); SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_ES_PASSWORD),0); } else{ EnableWindow(GetDlgItem(hwnd,IDC_ES_PASSWORD),1); *style&=~(WS_HSCROLL|WS_VSCROLL|ES_AUTOVSCROLL); SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_HSCROLL),0); EnableWindow(GetDlgItem(hwnd,IDC_STYLE_VSCROLL),0); EnableWindow(GetDlgItem(hwnd,IDC_ES_AUTOVSCROLL),0); } } INT_PTR CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); //////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_MULTILINE) SendDlgItemMessage(hwnd,IDC_ES_MULTILINE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_NUMBER) SendDlgItemMessage(hwnd,IDC_ES_NUMBER,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_AUTOHSCROLL) SendDlgItemMessage(hwnd,IDC_ES_AUTOHSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_AUTOVSCROLL) SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_PASSWORD) SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_NOHIDESEL) SendDlgItemMessage(hwnd,IDC_ES_NOHIDESEL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_OEMCONVERT) SendDlgItemMessage(hwnd,IDC_ES_OEMCONVERT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_WANTRETURN) SendDlgItemMessage(hwnd,IDC_ES_WANTRETURN,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_UPPERCASE) SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_LOWERCASE) SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_READONLY) SendDlgItemMessage(hwnd,IDC_ES_READONLY,BM_SETCHECK,BST_CHECKED,0); ////////////////// // テキストの配置 ////////////////// //"左端" SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(LPARAM)STRING_LEFT); //"中央" SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(LPARAM)STRING_CENTER); //"右端" SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(LPARAM)STRING_RIGHT); //ビットを考慮してES_LEFTを最後に検討する if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_CENTER) SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&ES_RIGHT) SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,0,0); DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_Edit_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_ES_MULTILINE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_MULTILINE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_MULTILINE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_MULTILINE ); DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_Edit_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_NUMBER: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_NUMBER,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_NUMBER ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_NUMBER ); return 1; } break; case IDC_STYLE_HSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_HSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_HSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_AUTOHSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_AUTOHSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_AUTOHSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_AUTOHSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_VSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_VSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_VSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_AUTOVSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_AUTOVSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_AUTOVSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_PASSWORD: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_PASSWORD ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_PASSWORD ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_NOHIDESEL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_NOHIDESEL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_NOHIDESEL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_NOHIDESEL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_OEMCONVERT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_OEMCONVERT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_OEMCONVERT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_OEMCONVERT ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_WANTRETURN: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_WANTRETURN,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_WANTRETURN ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_WANTRETURN ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_UPPERCASE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_LOWERCASE ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_UPPERCASE ); SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_UPPERCASE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_LOWERCASE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_UPPERCASE ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_LOWERCASE ); SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_LOWERCASE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_READONLY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_ES_READONLY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_READONLY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_READONLY ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_ES_TEXTPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_GETCURSEL,0,0); //ES_LEFT=0 pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( ES_CENTER|ES_RIGHT ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_CENTER ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( ES_RIGHT ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } //////////////////////// // GROUPBOX プロパティ INT_PTR CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); ///////////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); ////////////////// // 水平方向の配置 ////////////////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_DEFAULT); //"左端" SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_LEFT); //"右端" SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_RIGHT); //"中央" SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_CENTER); //ビットを考慮してBS_CENTERを最初に検討する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,3,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,0,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_BS_POSITION: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_GETCURSEL,0,0); //BS_CENTER=BS_LEFT | BS_RIGHT pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_CENTER ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_LEFT ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_RIGHT ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_CENTER ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_ICON: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_ICON ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_ICON ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_BITMAP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_BITMAP ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_BITMAP ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_NOTIFY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_NOTIFY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_NOTIFY ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } //////////////////////// // IMAGEBOX プロパティ void RadProperty_ImageBox_StylingOrder(HWND hwnd,DWORD *style){ if((*style&0x000F)==SS_ICON|| (*style&0x000F)==SS_BITMAP){ EnableWindow(GetDlgItem(hwnd,IDC_PATH),1); EnableWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),1); EnableWindow(GetDlgItem(hwnd,IDC_SS_CENTERIMAGE),1); EnableWindow(GetDlgItem(hwnd,IDC_SS_RIGHTJUST),1); } else{ EnableWindow(GetDlgItem(hwnd,IDC_PATH),0); EnableWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),0); EnableWindow(GetDlgItem(hwnd,IDC_SS_CENTERIMAGE),0); EnableWindow(GetDlgItem(hwnd,IDC_SS_RIGHTJUST),0); } } INT_PTR CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ extern HANDLE hHeap; int i,i2,i3; char temporary[MAX_PATH]; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); ///////////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); ////////// // タイプ ////////// //"フレーム(黒)" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_FRAME_BLACK); //"フレーム(灰色)" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_FRAME_GRAY); //"フレーム(白)" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_FRAME_WHITE); //"フレーム(縁取り)" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_FRAME_ETCHED); //"四角形(黒)" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_RECT_BLACK); //"四角形(灰色)" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_RECT_GRAY); //"四角形(白)" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_RECT_WHITE); //"アイコン" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_ICON); //"ビットマップ" SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(LPARAM)STRING_IMAGEBOXPROP_STYLE_BITMAP); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BLACKFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,0,0); else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_GRAYFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,1,0); else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_WHITEFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,2,0); else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000001F)==SS_ETCHEDFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,3,0); else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BLACKRECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,4,0); else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_GRAYRECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,5,0); else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_WHITERECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,6,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_ICON|| (pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BITMAP){ if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_ICON) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,7,0); else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BITMAP) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,8,0); //リソース/ファイル スイッチチェックを表示 ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_SHOW); ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_SHOW); //イメージ状態テキストを表示 ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_SHOW); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.IsFile()){ //ファイル指定を表示 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW); ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW); SetDlgItemText(hwnd,IDC_PATH,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path.c_str()); //イメージ状態テキスト //"ファイル指定:" SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE); SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0); } else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.IsResource()){ //リソース指定を表示 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW); //イメージ状態テキスト //"リソース指定:" SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE); SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0); SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_ICON){ //アイコンリソースをコンボボックスに挿入 BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.iconResources ) { SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(LPARAM)resourceItem.idName.c_str()); } } else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BITMAP){ //ビットマップリソースをコンボボックスに挿入 BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.bitmapResources ) { SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(LPARAM)resourceItem.idName.c_str()); } } //リストから選択 i3=SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_FINDSTRING,0,(LPARAM)pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path.c_str()); SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0); } } if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_NOTIFY) SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_CENTERIMAGE) SendDlgItemMessage(hwnd,IDC_SS_CENTERIMAGE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_RIGHTJUST) SendDlgItemMessage(hwnd,IDC_SS_RIGHTJUST,BM_SETCHECK,BST_CHECKED,0); DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_ImageBox_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_IMAGE_TYPE: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( 0x0000001F ); if(i3==0) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_BLACKFRAME ); else if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_GRAYFRAME ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_WHITEFRAME ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_ETCHEDFRAME ); else if(i3==4) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_BLACKRECT ); else if(i3==5) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_GRAYRECT ); else if(i3==6) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_WHITERECT ); else if(i3==7) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_ICON ); else if(i3==8) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_BITMAP ); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_ICON|| (pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BITMAP){ //リソース/ファイル スイッチチェックを表示 ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_SHOW); ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_SHOW); //イメージ状態テキストを表示 ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_SHOW); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.IsFile()){ //ファイル指定を表示 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW); ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW); SetDlgItemText(hwnd,IDC_PATH,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path.c_str()); //イメージ状態テキスト //"ファイル指定:" SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE); SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0); } else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.IsResource()){ //リソース指定を表示 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW); //イメージ状態テキスト //"リソース指定:" SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE); SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0); SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_ICON){ //アイコンリソースをコンボボックスに挿入 for(i3=0;i3(projectInfo.resourceManager.iconResources.size());i3++){ SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str()); if( projectInfo.resourceManager.iconResources[i3].idName == pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path ) { SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0); } } } else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BITMAP){ //ビットマップリソースをコンボボックスに挿入 for(i3=0;i3(projectInfo.resourceManager.bitmapResources.size());i3++){ SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str()); if( projectInfo.resourceManager.bitmapResources[i3].idName == pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path ) { SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0); } } } } } else{ //リソース/ファイル スイッチチェックを非表示 ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_HIDE); ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_HIDE); //イメージ状態テキストを非表示 ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_HIDE); //ファイル指定を非表示 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_HIDE); ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_HIDE); //リソース指定を非表示 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_HIDE); } DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_ImageBox_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_FILE: if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.IsFile()){ //変更無し break; } //変更情報 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.type = ActiveBasic::PM::ImageReferenceType::File; //ファイル指定を表示 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW); ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW); SetDlgItemText(hwnd,IDC_PATH,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path.c_str()); //リソース指定を非表示 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_HIDE); //イメージ状態テキスト //"ファイル指定:" SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE); SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0); break; case IDC_RESOURCE: if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.IsResource()){ //変更無し break; } //変更情報 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.type = ActiveBasic::PM::ImageReferenceType::Resource; //ファイル指定を非表示 ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_HIDE); ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_HIDE); //リソース指定を表示 ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW); //イメージ状態テキスト //"リソース指定:" SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE); SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0); SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_ICON){ //アイコンリソースをコンボボックスに挿入 BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.iconResources ) { SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)resourceItem.idName.c_str()); } } else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x0000000F)==SS_BITMAP){ //ビットマップリソースをコンボボックスに挿入 BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.bitmapResources ) { SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)resourceItem.idName.c_str()); } } break; case IDC_RESCOMBO: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image); i3=SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_GETCURSEL,0,0); SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_GETLBTEXT,i3,(long)temporary); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path = temporary; DrawRadWindow(i,pWindowInfo); } break; case IDC_CHANGEPATH: if(HIWORD(wParam)==BN_CLICKED){ if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.IsFile()){ if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x000F)==SS_ICON){ extern LPSTR IconFileFilter; //"アイコン ファイルを指定して下さい" if(!GetFilePathDialog(hwnd,temporary,IconFileFilter,STRING_IMAGEBOXPROP_GETPATH_ICON,1)) return 1; } else if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&0x000F)==SS_BITMAP){ extern LPSTR BitmapFileFilter; //"ビットマップ ファイルを指定して下さい" if(!GetFilePathDialog(hwnd,temporary,BitmapFileFilter,STRING_IMAGEBOXPROP_GETPATH_BITMAP,1)) return 1; } //変更情報 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image); lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->image.path = temporary; SetDlgItemText(hwnd,IDC_PATH,temporary); DrawRadWindow(i,pWindowInfo); } return 1; } break; case IDC_SS_NOTIFY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_NOTIFY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SS_NOTIFY ); return 1; } break; case IDC_SS_CENTERIMAGE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_SS_CENTERIMAGE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_CENTERIMAGE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SS_CENTERIMAGE ); return 1; } break; case IDC_SS_RIGHTJUST: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_SS_RIGHTJUST,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_RIGHTJUST ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SS_RIGHTJUST ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } //////////////////////// // LISTVIEW プロパティ INT_PTR CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); ///////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); //////// // 表示 //////// //"アイコン" SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(LPARAM)STRING_LISTVIEWPROP_STYLE_ICON); //"小さいアイコン" SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(LPARAM)STRING_LISTVIEWPROP_STYLE_SMALLICON); //"リスト" SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(LPARAM)STRING_LISTVIEWPROP_STYLE_LIST); //"レポート" SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(LPARAM)STRING_LISTVIEWPROP_STYLE_REPORT); //ビットを考慮してLVS_LISTを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_LIST)==LVS_LIST) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,2,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_SMALLICON) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_REPORT) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,3,0); else SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,0,0); //////// // 配置 //////// //"上端" SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_TOP); //"左端" SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_LEFT); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_ALIGNLEFT) SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_SETCURSEL,1,0); else SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_SETCURSEL,0,0); ////////// // ソート ////////// //"なし" SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_ADDSTRING,0,(LPARAM)STRING_NONE_); //"昇順" SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_ADDSTRING,0,(LPARAM)STRING_SORT_ASCENDING); //"降順" SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_ADDSTRING,0,(LPARAM)STRING_SORT_DESCENDING); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_SORTASCENDING) SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_SORTDESCENDING) SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_SETCURSEL,0,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_SINGLESEL) SendDlgItemMessage(hwnd,IDC_LVS_SINGLESEL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_AUTOARRANGE) SendDlgItemMessage(hwnd,IDC_LVS_AUTOARRANGE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_NOLABELWRAP) SendDlgItemMessage(hwnd,IDC_LVS_NOLABELWRAP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_EDITLABELS) SendDlgItemMessage(hwnd,IDC_LVS_EDITLABELS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_NOSCROLL) SendDlgItemMessage(hwnd,IDC_LVS_NOSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_NOCOLUMNHEADER) SendDlgItemMessage(hwnd,IDC_LVS_NOCOLUMNHEADER,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_NOSORTHEADER) SendDlgItemMessage(hwnd,IDC_LVS_NOSORTHEADER,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_SHOWSELALWAYS) SendDlgItemMessage(hwnd,IDC_LVS_SHOWSELALWAYS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_OWNERDRAWFIXED) SendDlgItemMessage(hwnd,IDC_LVS_OWNERDRAWFIXED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LVS_SHAREIMAGELISTS) SendDlgItemMessage(hwnd,IDC_LVS_SHAREIMAGELISTS,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_LVS_VIEW: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_SMALLICON|LVS_LIST|LVS_REPORT ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_SMALLICON ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_LIST ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_REPORT ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_LVS_POSITION: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_ALIGNLEFT ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_ALIGNLEFT ); return 1; } break; case IDC_LVS_SORT: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_SORTASCENDING|LVS_SORTDESCENDING ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_SORTASCENDING ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_SORTDESCENDING ); return 1; } break; case IDC_LVS_SINGLESEL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_SINGLESEL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_SINGLESEL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_SINGLESEL ); return 1; } break; case IDC_LVS_AUTOARRANGE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_AUTOARRANGE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_AUTOARRANGE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_AUTOARRANGE ); return 1; } break; case IDC_LVS_NOLABELWRAP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_NOLABELWRAP,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_NOLABELWRAP ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_NOLABELWRAP ); return 1; } break; case IDC_LVS_EDITLABELS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_EDITLABELS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_EDITLABELS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_EDITLABELS ); return 1; } break; case IDC_LVS_NOSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_NOSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_NOSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_NOSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_LVS_NOCOLUMNHEADER: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_NOCOLUMNHEADER,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_NOCOLUMNHEADER ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_NOCOLUMNHEADER ); return 1; } break; case IDC_LVS_NOSORTHEADER: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_NOSORTHEADER,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_NOSORTHEADER ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_NOSORTHEADER ); return 1; } break; case IDC_LVS_SHOWSELALWAYS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_SHOWSELALWAYS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_SHOWSELALWAYS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_SHOWSELALWAYS ); return 1; } break; case IDC_LVS_OWNERDRAWFIXED: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_OWNERDRAWFIXED,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_OWNERDRAWFIXED ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_OWNERDRAWFIXED ); return 1; } break; case IDC_LVS_SHAREIMAGELISTS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LVS_SHAREIMAGELISTS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LVS_SHAREIMAGELISTS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LVS_SHAREIMAGELISTS ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } /////////////////////// // LISTBOX プロパティ void RadProperty_ListBox_StylingOrder(HWND hwnd,DWORD *style){ if(*style&LBS_OWNERDRAWVARIABLE){ *style&=~(LBS_MULTICOLUMN); SendDlgItemMessage(hwnd,IDC_LBS_MULTICOLUMN,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_LBS_MULTICOLUMN),0); } else EnableWindow(GetDlgItem(hwnd,IDC_LBS_MULTICOLUMN),1); if(!(*style&(LBS_OWNERDRAWFIXED|LBS_OWNERDRAWVARIABLE))){ *style&=~(LBS_HASSTRINGS); SendDlgItemMessage(hwnd,IDC_LBS_HASSTRINGS,BM_SETCHECK,BST_UNCHECKED,0); EnableWindow(GetDlgItem(hwnd,IDC_LBS_HASSTRINGS),0); } else EnableWindow(GetDlgItem(hwnd,IDC_LBS_HASSTRINGS),1); } INT_PTR CALLBACK RadProperty_ListBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); //////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); //////// // 選択 //////// //"シングル" SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(LPARAM)STRING_LISTBOXPROP_STYLE_SEL_SINGLE); //"マルチ" SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(LPARAM)STRING_LISTBOXPROP_STYLE_SEL_MULTI); //"拡張" SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(LPARAM)STRING_LISTBOXPROP_STYLE_SEL_EXTENDED); //"なし" SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(LPARAM)STRING_NONE_); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_MULTIPLESEL) SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_EXTENDEDSEL) SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,2,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_NOSEL) SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,3,0); else SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,0,0); //////////////// // オーナー描画 //////////////// //"なし" SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_ADDSTRING,0,(LPARAM)STRING_NONE_); //"固定" SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_ADDSTRING,0,(LPARAM)STRING_OWNERDRAW_FIXED); //"可変" SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_ADDSTRING,0,(LPARAM)STRING_OWNERDRAW_VARIABLE); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_OWNERDRAWFIXED) SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_OWNERDRAWVARIABLE) SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_SETCURSEL,0,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_HASSTRINGS) SendDlgItemMessage(hwnd,IDC_LBS_HASSTRINGS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_SORT) SendDlgItemMessage(hwnd,IDC_LBS_SORT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_NOTIFY) SendDlgItemMessage(hwnd,IDC_LBS_NOTIFY,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_MULTICOLUMN) SendDlgItemMessage(hwnd,IDC_LBS_MULTICOLUMN,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_DISABLENOSCROLL) SendDlgItemMessage(hwnd,IDC_LBS_DISABLENOSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_NOREDRAW) SendDlgItemMessage(hwnd,IDC_LBS_NOREDRAW,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_USETABSTOPS) SendDlgItemMessage(hwnd,IDC_LBS_USETABSTOPS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&LBS_WANTKEYBOARDINPUT) SendDlgItemMessage(hwnd,IDC_LBS_WANTKEYBOARDINPUT,BM_SETCHECK,BST_CHECKED,0); DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_ListBox_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_LBS_SELECT: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_MULTIPLESEL|LBS_EXTENDEDSEL|LBS_NOSEL ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_MULTIPLESEL ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_EXTENDEDSEL ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_NOSEL ); return 1; } break; case IDC_LBS_OWNERDRAW: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_OWNERDRAWFIXED|LBS_OWNERDRAWVARIABLE ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_OWNERDRAWFIXED ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_OWNERDRAWVARIABLE ); DWORD tempStyle = pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle(); RadProperty_ListBox_StylingOrder(hwnd,&tempStyle); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->SetStyle( tempStyle ); return 1; } break; case IDC_LBS_HASSTRINGS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_HASSTRINGS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_HASSTRINGS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_HASSTRINGS ); return 1; } break; case IDC_LBS_SORT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_SORT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_SORT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_SORT ); return 1; } break; case IDC_LBS_NOTIFY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_NOTIFY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_NOTIFY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_NOTIFY ); return 1; } break; case IDC_LBS_MULTICOLUMN: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_MULTICOLUMN,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_MULTICOLUMN ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_MULTICOLUMN ); return 1; } break; case IDC_STYLE_HSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_HSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_HSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_STYLE_VSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( WS_VSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( WS_VSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_LBS_DISABLENOSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_DISABLENOSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_DISABLENOSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_DISABLENOSCROLL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_LBS_NOREDRAW: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_NOREDRAW,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_NOREDRAW ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_NOREDRAW ); return 1; } break; case IDC_LBS_USETABSTOPS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_USETABSTOPS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_USETABSTOPS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_USETABSTOPS ); return 1; } break; case IDC_LBS_WANTKEYBOARDINPUT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_LBS_WANTKEYBOARDINPUT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( LBS_WANTKEYBOARDINPUT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( LBS_WANTKEYBOARDINPUT ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } /////////////////////////// // PROGRESSBAR プロパティ INT_PTR CALLBACK RadProperty_ProgressBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); //////////// //スタイル if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&PBS_VERTICAL) SendDlgItemMessage(hwnd,IDC_PBS_VERTICAL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&PBS_SMOOTH) SendDlgItemMessage(hwnd,IDC_PBS_SMOOTH,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_PBS_VERTICAL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_PBS_VERTICAL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( PBS_VERTICAL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( PBS_VERTICAL ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_PBS_SMOOTH: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_PBS_SMOOTH,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( PBS_SMOOTH ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( PBS_SMOOTH ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } } } return 0; } /////////////////////////// // RADIOBUTTON プロパティ INT_PTR CALLBACK RadProperty_RadioButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); ///////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_AUTORADIOBUTTON)==BS_AUTORADIOBUTTON) SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_PUSHLIKE) SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_LEFTTEXT) SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0); ////////////////// // 水平方向の配置 ////////////////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_DEFAULT); //"左端" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_LEFT); //"右端" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_RIGHT); //"中央" SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(LPARAM)STRING_CENTER); //ビットを考慮してBS_CENTERを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0); ////////////////// // 垂直方向の配置 ////////////////// //"デフォルト" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_DEFAULT); //"上端" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_TOP); //"下端" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_BOTTOM); //"中央" SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(LPARAM)STRING_CENTER); //ビットを考慮してBS_VCENTERを最初に比較する if((pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_BS_AUTO: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_AUTORADIOBUTTON ); } else{ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AndStyle( 0xFFFFFFF0 ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_RADIOBUTTON ); } return 1; } break; case IDC_BS_PUSHLIKE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_PUSHLIKE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_PUSHLIKE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_LEFTTEXT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_LEFTTEXT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_LEFTTEXT ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_ICON: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_ICON ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_BITMAP ); SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_ICON ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_BITMAP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){ pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_BITMAP ); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_ICON ); SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0); } else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_BITMAP ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_MULTILINE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_MULTILINE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_MULTILINE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_NOTIFY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_NOTIFY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_NOTIFY ); return 1; } break; case IDC_BS_HPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_LEFT|BS_RIGHT|BS_CENTER ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_LEFT ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_RIGHT ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_CENTER ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_BS_VPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( BS_TOP|BS_BOTTOM|BS_VCENTER ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_TOP ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_BOTTOM ); else if(i3==3) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( BS_VCENTER ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } ///////////////////////// // SCROLLBAR プロパティ INT_PTR CALLBACK RadProperty_ScrollBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); //////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); //////// // 配置 //////// //"指定無し" SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_SCROLLBARPROP_STYLE_FREE); //"上/左" SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_SCROLLBARPROP_STYLE_TOPORLEFT); //"下/右" SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_ADDSTRING,0,(LPARAM)STRING_SCROLLBARPROP_STYLE_BOTTOMORRIGHT); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SBS_TOPALIGN) SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SBS_BOTTOMALIGN) SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_SETCURSEL,0,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_SBS_POSITION: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SBS_TOPALIGN|SBS_BOTTOMALIGN ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SBS_TOPALIGN ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SBS_BOTTOMALIGN ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } ////////////////////// // STATIC プロパティ INT_PTR CALLBACK RadProperty_StaticProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); //////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_NOPREFIX) SendDlgItemMessage(hwnd,IDC_SS_NOPREFIX,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_LEFTNOWORDWRAP) SendDlgItemMessage(hwnd,IDC_SS_LEFTNOWORDWRAP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_NOTIFY) SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_SETCHECK,BST_CHECKED,0); ////////////////// // テキストの配置 ////////////////// //"左端" SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_ADDSTRING,0,(LPARAM)STRING_LEFT); //"中央" SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_ADDSTRING,0,(LPARAM)STRING_CENTER); //"右端" SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_ADDSTRING,0,(LPARAM)STRING_RIGHT); //ビットを考慮してSS_LEFTを最後に検討する if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_CENTER) SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&SS_RIGHT) SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_SETCURSEL,0,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_SS_NOPREFIX: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_SS_NOPREFIX,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_NOPREFIX ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SS_NOPREFIX ); return 1; } break; case IDC_SS_LEFTNOWORDWRAP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_SS_LEFTNOWORDWRAP,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_LEFTNOWORDWRAP ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SS_LEFTNOWORDWRAP ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_SS_NOTIFY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_NOTIFY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SS_NOTIFY ); return 1; } break; case IDC_SS_TEXTPOS: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_GETCURSEL,0,0); //SS_LEFT=0 pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( SS_CENTER|SS_RIGHT ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_CENTER ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( SS_RIGHT ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } //////////////////////// // TRACKBAR プロパティ INT_PTR CALLBACK RadProperty_TrackBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); /////////////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); //////// // 表示 //////// //"水平方向" SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_ADDSTRING,0,(LPARAM)STRING_DIRECTION_HORIZONTAL); //"垂直方向" SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_ADDSTRING,0,(LPARAM)STRING_DIRECTION_VERTICAL); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TBS_VERT) SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_SETCURSEL,1,0); else SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_SETCURSEL,0,0); //////////// // ポイント //////////// //"両方" SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_ADDSTRING,0,(LPARAM)STRING_TRACKBARPROP_STYLE_POSITION_BOTH); //"上/左" SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_ADDSTRING,0,(LPARAM)STRING_TRACKBARPROP_STYLE_POSITION_TOPORLEFT); //"下/右" SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_ADDSTRING,0,(LPARAM)STRING_TRACKBARPROP_STYLE_POSITION_BOTTOMORRIGHT); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TBS_BOTH) SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_SETCURSEL,0,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TBS_TOP) SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_SETCURSEL,1,0); else SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_SETCURSEL,2,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TBS_NOTICKS) SendDlgItemMessage(hwnd,IDC_TBS_NOTICKS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TBS_AUTOTICKS) SendDlgItemMessage(hwnd,IDC_TBS_AUTOTICKS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TBS_ENABLESELRANGE) SendDlgItemMessage(hwnd,IDC_TBS_ENABLESELRANGE,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_TBS_SITUATION: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TBS_VERT ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TBS_VERT ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_TBS_POINT: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TBS_BOTH|TBS_TOP ); if(i3==0) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TBS_BOTH ); else if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TBS_TOP ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_TBS_NOTICKS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TBS_NOTICKS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TBS_NOTICKS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TBS_NOTICKS ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_TBS_AUTOTICKS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TBS_AUTOTICKS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TBS_AUTOTICKS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TBS_AUTOTICKS ); return 1; } break; case IDC_TBS_ENABLESELRANGE: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TBS_ENABLESELRANGE,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TBS_ENABLESELRANGE ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TBS_ENABLESELRANGE ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } ////////////////////////// // TREEVIEW プロパティ INT_PTR CALLBACK RadProperty_TreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); //////////// //スタイル if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_HASBUTTONS) SendDlgItemMessage(hwnd,IDC_TVS_HASBUTTONS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_HASLINES) SendDlgItemMessage(hwnd,IDC_TVS_HASLINES,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_LINESATROOT) SendDlgItemMessage(hwnd,IDC_TVS_LINESATROOT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_EDITLABELS) SendDlgItemMessage(hwnd,IDC_TVS_EDITLABELS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_DISABLEDRAGDROP) SendDlgItemMessage(hwnd,IDC_TVS_DISABLEDRAGDROP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_SHOWSELALWAYS) SendDlgItemMessage(hwnd,IDC_TVS_SHOWSELALWAYS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_NOSCROLL) SendDlgItemMessage(hwnd,IDC_TVS_NOSCROLL,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_NOTOOLTIPS) SendDlgItemMessage(hwnd,IDC_TVS_NOTOOLTIPS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_CHECKBOXES) SendDlgItemMessage(hwnd,IDC_TVS_CHECKBOXES,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_FULLROWSELECT) SendDlgItemMessage(hwnd,IDC_TVS_FULLROWSELECT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_TRACKSELECT) SendDlgItemMessage(hwnd,IDC_TVS_TRACKSELECT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&TVS_SINGLEEXPAND) SendDlgItemMessage(hwnd,IDC_TVS_SINGLEEXPAND,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_TVS_HASBUTTONS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_HASBUTTONS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_HASBUTTONS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_HASBUTTONS ); return 1; } break; case IDC_TVS_HASLINES: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_HASLINES,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_HASLINES ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_HASLINES ); return 1; } break; case IDC_TVS_LINESATROOT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_LINESATROOT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_LINESATROOT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_LINESATROOT ); return 1; } break; case IDC_TVS_EDITLABELS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_EDITLABELS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_EDITLABELS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_EDITLABELS ); return 1; } break; case IDC_TVS_DISABLEDRAGDROP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_DISABLEDRAGDROP,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_DISABLEDRAGDROP ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_DISABLEDRAGDROP ); return 1; } break; case IDC_TVS_SHOWSELALWAYS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_SHOWSELALWAYS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_SHOWSELALWAYS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_SHOWSELALWAYS ); return 1; } break; case IDC_TVS_NOSCROLL: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_NOSCROLL,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_NOSCROLL ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_NOSCROLL ); return 1; } break; case IDC_TVS_NOTOOLTIPS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_NOTOOLTIPS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_NOTOOLTIPS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_NOTOOLTIPS ); return 1; } break; case IDC_TVS_CHECKBOXES: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_CHECKBOXES,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_CHECKBOXES ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_CHECKBOXES ); return 1; } break; case IDC_TVS_FULLROWSELECT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_FULLROWSELECT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_FULLROWSELECT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_FULLROWSELECT ); return 1; } break; case IDC_TVS_TRACKSELECT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_TRACKSELECT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_TRACKSELECT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_TRACKSELECT ); return 1; } break; case IDC_TVS_SINGLEEXPAND: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_TVS_SINGLEEXPAND,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( TVS_SINGLEEXPAND ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( TVS_SINGLEEXPAND ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } break; } } return 0; } ////////////////////// // UPDOWN プロパティ INT_PTR CALLBACK RadProperty_UpDownProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i,i2,i3; static BOOL bInitial; switch(message){ case WM_INITDIALOG: { bInitial=1; i=GetWndNum(GetParent(GetParent(hwnd))); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); SetDlgItemText(hwnd,IDC_IDNAME,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetName().c_str()); SetDlgItemText(hwnd,IDC_CAPTION,pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetCaption().c_str()); ////////////////// // スタイル //////////// if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0); //////// // 方向 //////// //"水平方向" SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_ADDSTRING,0,(LPARAM)STRING_DIRECTION_HORIZONTAL); //"垂直方向" SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_ADDSTRING,0,(LPARAM)STRING_DIRECTION_VERTICAL); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_HORZ) SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_SETCURSEL,0,0); else SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_SETCURSEL,1,0); //////////// // アタッチ //////////// //"なし" SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_ADDSTRING,0,(LPARAM)STRING_NONE_); //"左端" SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_ADDSTRING,0,(LPARAM)STRING_LEFT); //"右端" SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_ADDSTRING,0,(LPARAM)STRING_RIGHT); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_ALIGNLEFT) SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_SETCURSEL,1,0); else if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_ALIGNRIGHT) SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_SETCURSEL,2,0); else SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_SETCURSEL,0,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_AUTOBUDDY) SendDlgItemMessage(hwnd,IDC_UDS_AUTOBUDDY,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_SETBUDDYINT) SendDlgItemMessage(hwnd,IDC_UDS_SETBUDDYINT,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_NOTHOUSANDS) SendDlgItemMessage(hwnd,IDC_UDS_NOTHOUSANDS,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_WRAP) SendDlgItemMessage(hwnd,IDC_UDS_WRAP,BM_SETCHECK,BST_CHECKED,0); if(pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()&UDS_ARROWKEYS) SendDlgItemMessage(hwnd,IDC_UDS_ARROWKEYS,BM_SETCHECK,BST_CHECKED,0); ApplyDialogTexture(hwnd); bInitial=0; break; } case WM_COMMAND: { i=GetWndNum(GetParent(GetParent(hwnd))); if(i==-1) return 1; i2=GetWndInfoNum(MdiInfo[i]->path); ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i]->path); //共通スタイル if(bInitial==0){ if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1; } switch(LOWORD(wParam)){ case IDC_UDS_SITUATION: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( UDS_HORZ ); if(i3==0) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_HORZ ); DrawRadWindow(i,pWindowInfo); return 1; } break; case IDC_UDS_ATTACH: if(HIWORD(wParam)==CBN_SELCHANGE){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); i3=SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_GETCURSEL,0,0); pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( UDS_ALIGNLEFT|UDS_ALIGNRIGHT ); if(i3==1) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_ALIGNLEFT ); else if(i3==2) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_ALIGNRIGHT ); return 1; } break; case IDC_UDS_AUTOBUDDY: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_UDS_AUTOBUDDY,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_AUTOBUDDY ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( UDS_AUTOBUDDY ); return 1; } break; case IDC_UDS_SETBUDDYINT: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_UDS_SETBUDDYINT,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_SETBUDDYINT ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( UDS_SETBUDDYINT ); return 1; } break; case IDC_UDS_NOTHOUSANDS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_UDS_NOTHOUSANDS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_NOTHOUSANDS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( UDS_NOTHOUSANDS ); return 1; } break; case IDC_UDS_WRAP: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_UDS_WRAP,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_WRAP ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( UDS_WRAP ); return 1; } break; case IDC_UDS_ARROWKEYS: if(HIWORD(wParam)==BN_CLICKED){ //変更情報 Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i]->MdiRadInfo->SelectingItem[0],pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->GetStyle()); if(SendDlgItemMessage(hwnd,IDC_UDS_ARROWKEYS,BM_GETCHECK,0,0)) pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->AddStyle( UDS_ARROWKEYS ); else pWindowInfo->childWindowInfos[MdiInfo[i]->MdiRadInfo->SelectingItem[0]]->DeleteStyle( UDS_ARROWKEYS ); return 1; } break; case IDC_EXSTYLE: if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1; DrawRadWindow(i,pWindowInfo); return 1; } } } return 0; } LRESULT CALLBACK RadPropertyWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ int i; RECT rect; SCROLLINFO ScrollInfo; switch(message){ case WM_MOUSEACTIVATE: BringWindowToTop(GetParent(hwnd)); return 0; case WM_VSCROLL: ScrollInfo.cbSize=sizeof(SCROLLINFO); ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE; GetScrollInfo(hwnd,SB_VERT,&ScrollInfo); if(LOWORD(wParam)==SB_LINEUP) i=-20; else if(LOWORD(wParam)==SB_LINEDOWN) i=20; else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage; else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage; else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos; else i=0; GetClientRect(hwnd,&rect); i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos)); if(i!=0){ ScrollInfo.nPos+=i; SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1); ScrollWindow(hwnd,0,-i,NULL,NULL); UpdateWindow(hwnd); } return 0; case WM_SIZE: i=GetWndNum(GetParent(hwnd)); if(i==-1) return 0; //ウィンドウが初期状態の場合 ScrollInfo.cbSize=sizeof(SCROLLINFO); ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS; GetScrollInfo(hwnd,SB_VERT,&ScrollInfo); GetClientRect(MdiInfo[i]->MdiRadInfo->hProp_Dlg,&rect); ScrollInfo.nMin=0; ScrollInfo.nMax=rect.bottom; ScrollInfo.nPage=HIWORD(lParam); SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1); i=ScrollInfo.nPos; ScrollInfo.fMask=SIF_POS; GetScrollInfo(hwnd,SB_VERT,&ScrollInfo); if(i>ScrollInfo.nPos){ ScrollWindow(hwnd,0,i-ScrollInfo.nPos,NULL,NULL); UpdateWindow(hwnd); } return 0; } return DefWindowProc(hwnd,message,wParam,lParam); }