diff --git a/sakura_core/dlg/CDialog.cpp b/sakura_core/dlg/CDialog.cpp index 37944d8236..db4d05a0ba 100644 --- a/sakura_core/dlg/CDialog.cpp +++ b/sakura_core/dlg/CDialog.cpp @@ -22,6 +22,8 @@ #include "StdAfx.h" #include #include +#include + #include "dlg/CDialog.h" #include "CEditApp.h" #include "env/CShareData.h" @@ -358,6 +360,11 @@ BOOL CDialog::OnSize( WPARAM wParam, LPARAM lParam ) return FALSE; } +BOOL CDialog::OnSizing(WPARAM wParam, LPARAM lParam) +{ + return FALSE; +} + BOOL CDialog::OnMove( WPARAM wParam, LPARAM lParam ) { /* ダイアログの位置の記憶 */ @@ -376,6 +383,11 @@ BOOL CDialog::OnMove( WPARAM wParam, LPARAM lParam ) return TRUE; } +int CDialog::OnNcHitTest(WPARAM wParam, LPARAM lParam) +{ + return ::DefWindowProc(m_hWnd, WM_NCHITTEST, wParam, lParam); +} + void CDialog::CreateSizeBox( void ) { /* サイズボックス */ @@ -408,6 +420,7 @@ INT_PTR CDialog::DispatchEvent( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case WM_SIZE: m_hWnd = hwndDlg; return OnSize( wParam, lParam ); + case WM_SIZING: return OnSizing( wParam, lParam ); case WM_MOVE: m_hWnd = hwndDlg; return OnMove( wParam, lParam ); @@ -420,6 +433,10 @@ INT_PTR CDialog::DispatchEvent( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case WM_CHARTOITEM: return OnCharToItem( wParam, lParam ); case WM_HELP: return OnPopupHelp( wParam, lParam ); //@@@ 2002.01.18 add case WM_CONTEXTMENU:return OnContextMenu( wParam, lParam ); //@@@ 2002.01.18 add + case WM_NCHITTEST: + m_hWnd = hwndDlg; + SetWindowLongPtr(m_hWnd, DWLP_MSGRESULT, OnNcHitTest(wParam, lParam)); + return TRUE; } return FALSE; } diff --git a/sakura_core/dlg/CDialog.h b/sakura_core/dlg/CDialog.h index fee57884b3..6d52bdcacb 100644 --- a/sakura_core/dlg/CDialog.h +++ b/sakura_core/dlg/CDialog.h @@ -90,8 +90,10 @@ class CDialog{ virtual BOOL OnDestroy( void ); virtual BOOL OnNotify(NMHDR* pNMHDR){return FALSE;} BOOL OnSize(); - virtual BOOL OnSize( WPARAM wParam, LPARAM lParam ); + virtual BOOL OnSize(WPARAM wParam, LPARAM lParam); + virtual BOOL OnSizing( WPARAM wParam, LPARAM lParam ); virtual BOOL OnMove( WPARAM wParam, LPARAM lParam ); + virtual int OnNcHitTest(WPARAM wParam, LPARAM lParam); virtual BOOL OnDrawItem( WPARAM wParam, LPARAM lParam ){return TRUE;} virtual BOOL OnTimer( WPARAM wParam ){return TRUE;} virtual BOOL OnKeyDown( WPARAM wParam, LPARAM lParam ){return TRUE;} diff --git a/sakura_core/dlg/CDlgFind.cpp b/sakura_core/dlg/CDlgFind.cpp index 5b0e96c482..2fb93e143e 100644 --- a/sakura_core/dlg/CDlgFind.cpp +++ b/sakura_core/dlg/CDlgFind.cpp @@ -49,6 +49,15 @@ const DWORD p_helpids[] = { //11800 0, 0 }; //@@@ 2002.01.07 add end MIK +static const SAnchorList anchorList[] = { + IDC_BUTTON_SEARCHPREV, ANCHOR_RIGHT, + IDC_BUTTON_SEARCHNEXT, ANCHOR_RIGHT, + IDC_BUTTON_SETMARK, ANCHOR_RIGHT, + IDCANCEL, ANCHOR_RIGHT, + IDC_BUTTON_HELP, ANCHOR_RIGHT, + IDC_COMBO_TEXT, ANCHOR_LEFT_RIGHT, +}; + CDlgFind::CDlgFind() { m_sSearchOption.Reset(); @@ -101,6 +110,21 @@ BOOL CDlgFind::OnInitDialog( HWND hwnd, WPARAM wParam, LPARAM lParam ) HFONT hFontOld = (HFONT)::SendMessageAny( GetItemHwnd( IDC_COMBO_TEXT ), WM_GETFONT, 0, 0 ); HFONT hFont = SetMainFont( GetItemHwnd( IDC_COMBO_TEXT ) ); m_cFontText.SetFont( hFontOld, hFont, GetItemHwnd( IDC_COMBO_TEXT ) ); + + RECT rc; + ::GetClientRect(hwnd, &rc); + m_ptDefaultSizeClient.x = rc.right; + m_ptDefaultSizeClient.y = rc.bottom; + + ::GetWindowRect(hwnd, &rc); + m_ptDefaultSizeScreen.x = rc.right - rc.left; + m_ptDefaultSizeScreen.y = rc.bottom - rc.top; + + m_rcItems.resize(_countof(anchorList)); + for (int i = 0; i < _countof(anchorList); i++) { + GetItemClientRect(anchorList[i].id, m_rcItems[i]); + } + return bRet; } @@ -397,6 +421,75 @@ BOOL CDlgFind::OnActivate( WPARAM wParam, LPARAM lParam ) return CDialog::OnActivate(wParam, lParam); } +BOOL CDlgFind::OnSize(WPARAM wParam, LPARAM lParam) +{ + CDialog::OnSize(wParam, lParam); + + POINT ptNew; + ptNew.x = LOWORD(lParam); + ptNew.y = HIWORD(lParam); + + for (int i = 0; i < _countof(anchorList); i++) { + ResizeItem(GetItemHwnd(anchorList[i].id), m_ptDefaultSizeClient, ptNew, m_rcItems[i], anchorList[i].anchor); + } + return TRUE; +} + +BOOL CDlgFind::OnSizing(WPARAM wParam, LPARAM lParam) +{ + RECT& rc = *(RECT*)lParam; + + switch (wParam) { + case WMSZ_BOTTOMRIGHT: + case WMSZ_RIGHT: + case WMSZ_TOPRIGHT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.right = rc.left + m_ptDefaultSizeScreen.x; + } + break; + case WMSZ_BOTTOMLEFT: + case WMSZ_LEFT: + case WMSZ_TOPLEFT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.left = rc.right - m_ptDefaultSizeScreen.x; + } + break; + } + + switch (wParam) { + case WMSZ_BOTTOM: + case WMSZ_BOTTOMLEFT: + case WMSZ_BOTTOMRIGHT: + rc.bottom = rc.top + m_ptDefaultSizeScreen.y; + break; + case WMSZ_TOP: + case WMSZ_TOPLEFT: + case WMSZ_TOPRIGHT: + rc.top = rc.bottom - m_ptDefaultSizeScreen.y; + break; + } + + return TRUE; +} + +int CDlgFind::OnNcHitTest(WPARAM wParam, LPARAM lParam) +{ + int ret = CDialog::OnNcHitTest(wParam, lParam); + switch (ret) { + case HTTOPLEFT: + case HTBOTTOMLEFT: + return HTLEFT; + case HTTOPRIGHT: + case HTBOTTOMRIGHT: + return HTRIGHT; + case HTBOTTOM: + case HTTOP: + return HTBORDER; + default: + return ret; + } +} + //@@@ 2002.01.18 add start LPVOID CDlgFind::GetHelpIdTable(void) { diff --git a/sakura_core/dlg/CDlgFind.h b/sakura_core/dlg/CDlgFind.h index 088c04af11..2c42530e7c 100644 --- a/sakura_core/dlg/CDlgFind.h +++ b/sakura_core/dlg/CDlgFind.h @@ -59,8 +59,15 @@ class CDlgFind final : public CDialog BOOL OnDestroy() override; BOOL OnBnClicked(int wID) override; BOOL OnActivate( WPARAM wParam, LPARAM lParam ) override; // 2009.11.29 ryoji + BOOL OnSize( WPARAM wParam, LPARAM lParam ) override; + BOOL OnSizing(WPARAM wParam, LPARAM lParam) override; + int OnNcHitTest(WPARAM wParam, LPARAM lParam) override; // BOOL OnKeyDown( WPARAM wParam, LPARAM lParam ) override; LPVOID GetHelpIdTable(void) override; //@@@ 2002.01.18 add + + POINT m_ptDefaultSizeScreen; + POINT m_ptDefaultSizeClient; + std::vector m_rcItems; }; #endif /* SAKURA_CDLGFIND_AF260AA4_6075_4B87_9F03_2CEEDAD64094_H_ */ diff --git a/sakura_core/dlg/CDlgGrep.cpp b/sakura_core/dlg/CDlgGrep.cpp index eb910cbdb4..01f8995707 100644 --- a/sakura_core/dlg/CDlgGrep.cpp +++ b/sakura_core/dlg/CDlgGrep.cpp @@ -71,6 +71,20 @@ const DWORD p_helpids[] = { //12000 0, 0 }; //@@@ 2002.01.07 add end MIK +static const SAnchorList anchorList[] = { + IDC_COMBO_TEXT, ANCHOR_LEFT_RIGHT, + IDC_COMBO_FOLDER, ANCHOR_LEFT_RIGHT, + IDC_BUTTON_FOLDER, ANCHOR_RIGHT, + IDC_BUTTON_FOLDER_UP, ANCHOR_RIGHT, + IDC_BUTTON_CURRENTFOLDER, ANCHOR_RIGHT, + IDC_COMBO_FILE, ANCHOR_LEFT_RIGHT, + IDC_COMBO_EXCLUDE_FILE, ANCHOR_LEFT_RIGHT, + IDC_COMBO_EXCLUDE_FOLDER, ANCHOR_LEFT_RIGHT, + IDOK, ANCHOR_RIGHT, + IDCANCEL, ANCHOR_RIGHT, + IDC_BUTTON_HELP, ANCHOR_RIGHT, +}; + static void SetGrepFolder( HWND hwndCtrl, LPCWSTR folder ); CDlgGrep::CDlgGrep() @@ -359,6 +373,20 @@ BOOL CDlgGrep::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam ) m_cFontDeleters[i].SetFont( hFontOld, hFont, hwndItem ); } + RECT rc; + ::GetClientRect(hwndDlg, &rc); + m_ptDefaultSizeClient.x = rc.right; + m_ptDefaultSizeClient.y = rc.bottom; + + ::GetWindowRect(hwndDlg, &rc); + m_ptDefaultSizeScreen.x = rc.right - rc.left; + m_ptDefaultSizeScreen.y = rc.bottom - rc.top; + + m_rcItems.resize(_countof(anchorList)); + for (int i = 0; i < _countof(anchorList); i++) { + GetItemClientRect(anchorList[i].id, m_rcItems[i]); + } + return bRet; } @@ -581,6 +609,75 @@ BOOL CDlgGrep::OnBnClicked( int wID ) return CDialog::OnBnClicked( wID ); } +BOOL CDlgGrep::OnSize(WPARAM wParam, LPARAM lParam) +{ + CDialog::OnSize(wParam, lParam); + + POINT ptNew; + ptNew.x = LOWORD(lParam); + ptNew.y = HIWORD(lParam); + + for (int i = 0; i < _countof(anchorList); i++) { + ResizeItem(GetItemHwnd(anchorList[i].id), m_ptDefaultSizeClient, ptNew, m_rcItems[i], anchorList[i].anchor); + } + return TRUE; +} + +BOOL CDlgGrep::OnSizing(WPARAM wParam, LPARAM lParam) +{ + RECT& rc = *(RECT*)lParam; + + switch (wParam) { + case WMSZ_BOTTOMRIGHT: + case WMSZ_RIGHT: + case WMSZ_TOPRIGHT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.right = rc.left + m_ptDefaultSizeScreen.x; + } + break; + case WMSZ_BOTTOMLEFT: + case WMSZ_LEFT: + case WMSZ_TOPLEFT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.left = rc.right - m_ptDefaultSizeScreen.x; + } + break; + } + + switch (wParam) { + case WMSZ_BOTTOM: + case WMSZ_BOTTOMLEFT: + case WMSZ_BOTTOMRIGHT: + rc.bottom = rc.top + m_ptDefaultSizeScreen.y; + break; + case WMSZ_TOP: + case WMSZ_TOPLEFT: + case WMSZ_TOPRIGHT: + rc.top = rc.bottom - m_ptDefaultSizeScreen.y; + break; + } + + return TRUE; +} + +int CDlgGrep::OnNcHitTest(WPARAM wParam, LPARAM lParam) +{ + int ret = CDialog::OnNcHitTest(wParam, lParam); + switch (ret) { + case HTTOPLEFT: + case HTBOTTOMLEFT: + return HTLEFT; + case HTTOPRIGHT: + case HTBOTTOMRIGHT: + return HTRIGHT; + case HTBOTTOM: + case HTTOP: + return HTBORDER; + default: + return ret; + } +} + /* ダイアログデータの設定 */ void CDlgGrep::SetData( void ) { diff --git a/sakura_core/dlg/CDlgGrep.h b/sakura_core/dlg/CDlgGrep.h index cb67490d40..0ffbafad71 100644 --- a/sakura_core/dlg/CDlgGrep.h +++ b/sakura_core/dlg/CDlgGrep.h @@ -76,12 +76,19 @@ class CDlgGrep : public CDialog std::vector m_cFontDeleters; + POINT m_ptDefaultSizeScreen; + POINT m_ptDefaultSizeClient; + std::vector m_rcItems; + /* || 実装ヘルパ関数 */ BOOL OnInitDialog(HWND hwndDlg, WPARAM wParam, LPARAM lParam) override; BOOL OnDestroy() override; BOOL OnBnClicked(int wID) override; + BOOL OnSize(WPARAM wParam, LPARAM lParam) override; + BOOL OnSizing(WPARAM wParam, LPARAM lParam) override; + int OnNcHitTest(WPARAM wParam, LPARAM lParam) override; LPVOID GetHelpIdTable(void) override; //@@@ 2002.01.18 add void SetData( void ) override; /* ダイアログデータの設定 */ diff --git a/sakura_core/dlg/CDlgGrepReplace.cpp b/sakura_core/dlg/CDlgGrepReplace.cpp index 8891d7cf3f..7c79f6b480 100644 --- a/sakura_core/dlg/CDlgGrepReplace.cpp +++ b/sakura_core/dlg/CDlgGrepReplace.cpp @@ -66,6 +66,21 @@ const DWORD p_helpids[] = { 0, 0 }; +static const SAnchorList anchorList[] = { + IDC_COMBO_TEXT, ANCHOR_LEFT_RIGHT, + IDC_COMBO_TEXT2, ANCHOR_LEFT_RIGHT, + IDC_COMBO_FOLDER, ANCHOR_LEFT_RIGHT, + IDC_BUTTON_FOLDER, ANCHOR_RIGHT, + IDC_BUTTON_FOLDER_UP, ANCHOR_RIGHT, + IDC_BUTTON_CURRENTFOLDER, ANCHOR_RIGHT, + IDC_COMBO_FILE, ANCHOR_LEFT_RIGHT, + IDC_COMBO_EXCLUDE_FILE, ANCHOR_LEFT_RIGHT, + IDC_COMBO_EXCLUDE_FOLDER, ANCHOR_LEFT_RIGHT, + IDOK, ANCHOR_RIGHT, + IDCANCEL, ANCHOR_RIGHT, + IDC_BUTTON_HELP, ANCHOR_RIGHT, +}; + CDlgGrepReplace::CDlgGrepReplace() { if( 0 < m_pShareData->m_sSearchKeywords.m_aReplaceKeys.size() ){ @@ -143,6 +158,20 @@ BOOL CDlgGrepReplace::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam ) HFONT hFont = SetMainFont( GetItemHwnd( IDC_COMBO_TEXT2 ) ); m_cFontText2.SetFont( hFontOld, hFont, GetItemHwnd( IDC_COMBO_TEXT2 ) ); + RECT rc; + ::GetClientRect(hwndDlg, &rc); + m_ptDefaultSizeClient.x = rc.right; + m_ptDefaultSizeClient.y = rc.bottom; + + ::GetWindowRect(hwndDlg, &rc); + m_ptDefaultSizeScreen.x = rc.right - rc.left; + m_ptDefaultSizeScreen.y = rc.bottom - rc.top; + + m_rcItems.resize(_countof(anchorList)); + for (int i = 0; i < _countof(anchorList); i++) { + GetItemClientRect(anchorList[i].id, m_rcItems[i]); + } + return bRet; } @@ -179,6 +208,75 @@ BOOL CDlgGrepReplace::OnBnClicked( int wID ) return CDlgGrep::OnBnClicked( wID ); } +BOOL CDlgGrepReplace::OnSize(WPARAM wParam, LPARAM lParam) +{ + CDialog::OnSize(wParam, lParam); + + POINT ptNew; + ptNew.x = LOWORD(lParam); + ptNew.y = HIWORD(lParam); + + for (int i = 0; i < _countof(anchorList); i++) { + ResizeItem(GetItemHwnd(anchorList[i].id), m_ptDefaultSizeClient, ptNew, m_rcItems[i], anchorList[i].anchor); + } + return TRUE; +} + +BOOL CDlgGrepReplace::OnSizing(WPARAM wParam, LPARAM lParam) +{ + RECT& rc = *(RECT*)lParam; + + switch (wParam) { + case WMSZ_BOTTOMRIGHT: + case WMSZ_RIGHT: + case WMSZ_TOPRIGHT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.right = rc.left + m_ptDefaultSizeScreen.x; + } + break; + case WMSZ_BOTTOMLEFT: + case WMSZ_LEFT: + case WMSZ_TOPLEFT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.left = rc.right - m_ptDefaultSizeScreen.x; + } + break; + } + + switch (wParam) { + case WMSZ_BOTTOM: + case WMSZ_BOTTOMLEFT: + case WMSZ_BOTTOMRIGHT: + rc.bottom = rc.top + m_ptDefaultSizeScreen.y; + break; + case WMSZ_TOP: + case WMSZ_TOPLEFT: + case WMSZ_TOPRIGHT: + rc.top = rc.bottom - m_ptDefaultSizeScreen.y; + break; + } + + return TRUE; +} + +int CDlgGrepReplace::OnNcHitTest(WPARAM wParam, LPARAM lParam) +{ + int ret = CDialog::OnNcHitTest(wParam, lParam); + switch (ret) { + case HTTOPLEFT: + case HTBOTTOMLEFT: + return HTLEFT; + case HTTOPRIGHT: + case HTBOTTOMRIGHT: + return HTRIGHT; + case HTBOTTOM: + case HTTOP: + return HTBORDER; + default: + return ret; + } +} + /* ダイアログデータの設定 */ void CDlgGrepReplace::SetData( void ) { diff --git a/sakura_core/dlg/CDlgGrepReplace.h b/sakura_core/dlg/CDlgGrepReplace.h index e9659783e2..46f457616f 100644 --- a/sakura_core/dlg/CDlgGrepReplace.h +++ b/sakura_core/dlg/CDlgGrepReplace.h @@ -45,6 +45,9 @@ class CDlgGrepReplace final : public CDlgGrep protected: CRecentReplace m_cRecentReplace; CFontAutoDeleter m_cFontText2; + POINT m_ptDefaultSizeScreen; + POINT m_ptDefaultSizeClient; + std::vector m_rcItems; /* || 実装ヘルパ関数 @@ -52,6 +55,9 @@ class CDlgGrepReplace final : public CDlgGrep BOOL OnInitDialog(HWND hwndDlg, WPARAM wParam, LPARAM lParam) override; BOOL OnDestroy() override; BOOL OnBnClicked(int wID) override; + BOOL OnSize(WPARAM wParam, LPARAM lParam) override; + BOOL OnSizing(WPARAM wParam, LPARAM lParam) override; + int OnNcHitTest(WPARAM wParam, LPARAM lParam) override; LPVOID GetHelpIdTable(void) override; //@@@ 2002.01.18 add void SetData( void ) override; /* ダイアログデータの設定 */ diff --git a/sakura_core/dlg/CDlgReplace.cpp b/sakura_core/dlg/CDlgReplace.cpp index aac234b14a..0fdb4d7d62 100644 --- a/sakura_core/dlg/CDlgReplace.cpp +++ b/sakura_core/dlg/CDlgReplace.cpp @@ -59,6 +59,18 @@ const DWORD p_helpids[] = { //11900 0, 0 }; //@@@ 2002.01.07 add end MIK +static const SAnchorList anchorList[] = { + IDC_BUTTON_SEARCHPREV, ANCHOR_RIGHT, + IDC_BUTTON_SEARCHNEXT, ANCHOR_RIGHT, + IDC_BUTTON_SETMARK, ANCHOR_RIGHT, + IDC_BUTTON_REPALCE, ANCHOR_RIGHT, + IDC_BUTTON_REPALCEALL, ANCHOR_RIGHT, + IDCANCEL, ANCHOR_RIGHT, + IDC_BUTTON_HELP, ANCHOR_RIGHT, + IDC_COMBO_TEXT, ANCHOR_LEFT_RIGHT, + IDC_COMBO_TEXT2, ANCHOR_LEFT_RIGHT, +}; + CDlgReplace::CDlgReplace() { m_sSearchOption.Reset(); // 検索オプション @@ -363,6 +375,20 @@ BOOL CDlgReplace::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam ) hFont = SetMainFont( GetItemHwnd( IDC_COMBO_TEXT2 ) ); m_cFontText2.SetFont( hFontOld, hFont, GetItemHwnd( IDC_COMBO_TEXT2 ) ); + RECT rc; + ::GetClientRect(hwndDlg, &rc); + m_ptDefaultSizeClient.x = rc.right; + m_ptDefaultSizeClient.y = rc.bottom; + + ::GetWindowRect(hwndDlg, &rc); + m_ptDefaultSizeScreen.x = rc.right - rc.left; + m_ptDefaultSizeScreen.y = rc.bottom - rc.top; + + m_rcItems.resize(_countof(anchorList)); + for (int i = 0; i < _countof(anchorList); i++) { + GetItemClientRect(anchorList[i].id, m_rcItems[i]); + } + return bRet; } @@ -607,6 +633,75 @@ BOOL CDlgReplace::OnActivate( WPARAM wParam, LPARAM lParam ) return CDialog::OnActivate(wParam, lParam); } +BOOL CDlgReplace::OnSize(WPARAM wParam, LPARAM lParam) +{ + CDialog::OnSize(wParam, lParam); + + POINT ptNew; + ptNew.x = LOWORD(lParam); + ptNew.y = HIWORD(lParam); + + for (int i = 0; i < _countof(anchorList); i++) { + ResizeItem(GetItemHwnd(anchorList[i].id), m_ptDefaultSizeClient, ptNew, m_rcItems[i], anchorList[i].anchor); + } + return TRUE; +} + +BOOL CDlgReplace::OnSizing(WPARAM wParam, LPARAM lParam) +{ + RECT& rc = *(RECT*)lParam; + + switch (wParam) { + case WMSZ_BOTTOMRIGHT: + case WMSZ_RIGHT: + case WMSZ_TOPRIGHT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.right = rc.left + m_ptDefaultSizeScreen.x; + } + break; + case WMSZ_BOTTOMLEFT: + case WMSZ_LEFT: + case WMSZ_TOPLEFT: + if (rc.right - rc.left < m_ptDefaultSizeScreen.x) { + rc.left = rc.right - m_ptDefaultSizeScreen.x; + } + break; + } + + switch (wParam) { + case WMSZ_BOTTOM: + case WMSZ_BOTTOMLEFT: + case WMSZ_BOTTOMRIGHT: + rc.bottom = rc.top + m_ptDefaultSizeScreen.y; + break; + case WMSZ_TOP: + case WMSZ_TOPLEFT: + case WMSZ_TOPRIGHT: + rc.top = rc.bottom - m_ptDefaultSizeScreen.y; + break; + } + + return TRUE; +} + +int CDlgReplace::OnNcHitTest(WPARAM wParam, LPARAM lParam) +{ + int ret = CDialog::OnNcHitTest(wParam, lParam); + switch (ret) { + case HTTOPLEFT: + case HTBOTTOMLEFT: + return HTLEFT; + case HTTOPRIGHT: + case HTBOTTOMRIGHT: + return HTRIGHT; + case HTBOTTOM: + case HTTOP: + return HTBORDER; + default: + return ret; + } +} + //@@@ 2002.01.18 add start LPVOID CDlgReplace::GetHelpIdTable(void) { diff --git a/sakura_core/dlg/CDlgReplace.h b/sakura_core/dlg/CDlgReplace.h index 37c7491ab4..218807fc83 100644 --- a/sakura_core/dlg/CDlgReplace.h +++ b/sakura_core/dlg/CDlgReplace.h @@ -73,10 +73,17 @@ class CDlgReplace final : public CDialog BOOL OnDestroy() override; BOOL OnBnClicked(int wID) override; BOOL OnActivate( WPARAM wParam, LPARAM lParam ) override; // 2009.11.29 ryoji + BOOL OnSize(WPARAM wParam, LPARAM lParam) override; + BOOL OnSizing(WPARAM wParam, LPARAM lParam) override; + int OnNcHitTest(WPARAM wParam, LPARAM lParam) override; LPVOID GetHelpIdTable(void) override; //@@@ 2002.01.18 add void SetData( void ) override; /* ダイアログデータの設定 */ void SetCombosList( void ); /* 検索文字列/置換後文字列リストの設定 */ int GetData( void ) override; /* ダイアログデータの取得 */ + + POINT m_ptDefaultSizeScreen; + POINT m_ptDefaultSizeClient; + std::vector m_rcItems; }; #endif /* SAKURA_CDLGREPLACE_37D62C07_5DAB_4CAC_A8B2_83C75329F8B7_H_ */ diff --git a/sakura_core/sakura_rc.rc b/sakura_core/sakura_rc.rc index 79e4d6f6c7..b308114d82 100644 --- a/sakura_core/sakura_rc.rc +++ b/sakura_core/sakura_rc.rc @@ -62,7 +62,7 @@ END // IDD_FIND DIALOGEX 30, 0, 284, 93 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_CONTEXTHELP CAPTION "検索" FONT 9, "MS Pゴシック", 0, 0, 0x1 @@ -129,7 +129,7 @@ BEGIN END IDD_GREP DIALOGEX 0, 0, 390, 188 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_CONTEXTHELP CAPTION "Grep" FONT 9, "Yu Gothic UI", 0, 0, 0x1 @@ -175,7 +175,7 @@ BEGIN END IDD_GREP_REPLACE DIALOGEX 0, 0, 390, 202 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_CONTEXTHELP CAPTION "Grep置換" FONT 9, "Yu Gothic UI", 0, 0, 0x1 @@ -240,7 +240,7 @@ BEGIN END IDD_REPLACE DIALOGEX 30, 0, 298, 149 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_CONTEXTHELP CAPTION "置換" FONT 9, "MS Pゴシック", 0, 0, 0x1