13 #pragma managed( push, off ) 44 , m_hSizeBarImage(
nullptr )
46 , m_pcElement(
nullptr )
66 else if ( !CreateSizeBarImageControl() ) {
86 if ( 0 == ::IsWindowVisible(
m_hWnd ) ) {
100 if (
nullptr != pcDocumentTab ) {
102 if ( !pcDocumentTab->
IsShow() ) {
104 ::ShowWindow( pcDocumentTab->
GetHandle(), SW_HIDE );
107 pcDocumentTab =
nullptr;
115 if (
nullptr != pcElement ) {
120 if ( !pcElement->
IsShow() ) {
122 ::ShowWindow( pcElement->
GetHandle(), SW_HIDE );
125 ::ShowWindow( hSizeBar, SW_HIDE );
132 if (
nullptr == pcDocumentTab ) {
134 for (
int nIndex2 = ( nIndex + 1 );; ++nIndex2 ) {
136 if ( nCount <= nIndex2 ) {
141 ::ShowWindow( hSizeBar, SW_HIDE );
149 if (
nullptr != pcElement ) {
151 if ( pcElement->
IsShow() ) {
160 int nLeft = sClientRect.left;
161 int nTop = sClientRect.top;
162 int nWidth = ( sClientRect.right - nLeft );
163 int nHeight = ( sClientRect.bottom - nTop );
177 int nMaxWidth = ( nWidth - sMinSize.cx );
178 int nMaxHeight = ( nHeight - sMinSize.cy );
195 if ( nMinWidth > nMaxWidth ) {
197 nMaxWidth = nMinWidth;
201 if ( nMinHeight > nMaxHeight ) {
203 nMaxHeight = nMinHeight;
214 if ( nMinWidth > nWidth ) {
219 else if ( nMaxWidth < nWidth ) {
230 if ( nMinHeight > nHeight ) {
232 nHeight = nMinHeight;
235 else if ( nMaxHeight < nHeight ) {
237 nHeight = nMaxHeight;
246 nLeft = ( sClientRect.right - nWidth );
250 nTop = ( sClientRect.bottom - nHeight );
255 ::SetWindowPos( pcElement->
GetHandle(), HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
256 ::UpdateWindow( pcElement->
GetHandle() );
264 int nLeft = sClientRect.left;
265 int nTop = sClientRect.top;
266 int nWidth = ( sClientRect.right - nLeft );
267 int nHeight = ( sClientRect.bottom - nTop );
284 nLeft = ( sClientRect.right - nWidth );
291 nTop = ( sClientRect.bottom - nHeight );
296 ::SetWindowPos( hSizeBar, HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
297 ::UpdateWindow( hSizeBar );
307 if (
nullptr != pcDocumentTab ) {
309 int nLeft = sClientRect.left;
310 int nTop = sClientRect.top;
311 int nWidth = ( sClientRect.right - nLeft );
312 int nHeight = ( sClientRect.bottom - nTop );
315 ::SetWindowPos( pcDocumentTab->
GetHandle(), HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
316 ::UpdateWindow( pcDocumentTab->
GetHandle() );
331 if (
m_hWnd == ::GetCapture() ) {
338 if (
nullptr != pcDocumentTab ) {
340 if ( pcDocumentTab->
IsShow() ) {
344 ::SetFocus( pcDocumentTab->
GetHandle() );
367 LPDRAWITEMSTRUCT lpDraw =
reinterpret_cast< LPDRAWITEMSTRUCT
>(
m_lParam );
373 if (
nullptr != pcElement ) {
376 if ( hSizeBar == lpDraw->hwndItem ) {
398 HWND hCtrl =
reinterpret_cast< HWND
>(
m_wParam );
404 if (
nullptr != pcElement ) {
407 if ( hCtrl == hSizeBar ) {
414 ::SetCursor( ::LoadCursorW(
nullptr, IDC_SIZEWE ) );
422 ::SetCursor( ::LoadCursorW(
nullptr, IDC_SIZENS ) );
436 if ( TRUE != result ) {
453 HWND hCtrl =
reinterpret_cast< HWND
>(
m_lParam );
459 if (
nullptr != pcElement ) {
462 if ( hCtrl == hSizeBar ) {
484 if (
m_hWnd == ::GetCapture() ) {
507 if (
m_hWnd == ::GetCapture() ) {
509 int nVirtKey =
static_cast< int >(
m_wParam );
510 if ( VK_ESCAPE == nVirtKey ) {
534 if (
m_hWnd == ::GetCapture() ) {
564 if (
nullptr != pcDocumentTab ) {
569 if ( !pcDocumentTab->
InitConfig( rcConfig ) ) {
597 if (
nullptr != pcDocumentTab ) {
630 if (
nullptr != pcDocumentTab ) {
635 if ( !pcDocumentTab->
SaveConfig( rcConfig ) ) {
663 if (
nullptr != pcDocumentTab ) {
665 ++rsChildInfo.m_nCount;
668 if ( pcDocumentTab->
IsShow() ) {
670 ++rsChildInfo.m_nShow;
674 ++rsChildInfo.m_nHide;
680 ++rsChildInfo.m_nHideable;
686 ++rsChildInfo.m_nDeletable;
715 if (
nullptr != pcDocumentTab ) {
741 if (
nullptr == pcPane ) {
744 if (
nullptr == pcDocumentTab ) {
751 if (
nullptr == pcPane ) {
779 if (
nullptr != pcDocumentTab ) {
808 if (
nullptr != pcDocumentTab ) {
832 if (
nullptr != pcDocumentTab ) {
834 if ( pcDocumentTab == pcChild ) {
862 if (
nullptr != pcDocumentTab ) {
890 if ( nCount <= nIndex ) {
893 if (
nullptr != pcDocumentTab ) {
895 if ( 0 != ::IsWindowVisible( pcDocumentTab->
GetHandle() ) ) {
905 rsRect = sClientRect;
914 if (
nullptr != pcElement ) {
916 if ( 0 != ::IsWindowVisible( pcElement->
GetHandle() ) ) {
925 if (
nullptr != hSizeBar ) {
927 if ( 0 != ::IsWindowVisible( hSizeBar ) ) {
994 if (
nullptr != pcDocumentTab ) {
996 HMENU hSubMenu = ::CreatePopupMenu();
997 if (
nullptr == hSubMenu ) {
1004 ::DestroyMenu( hSubMenu );
1011 wchar_t szBuffer[ MAX_PATH ];
1012 ::GetWindowTextW( pcDocumentTab->
GetHandle(), szBuffer, MAX_PATH );
1015 if ( 0 < ::GetMenuItemCount( hMenu ) ) {
1017 ::AppendMenuW( hMenu, MF_SEPARATOR, 0,
nullptr );
1021 ::AppendMenuW( hMenu, MF_POPUP, reinterpret_cast< UINT_PTR >( hSubMenu ), szBuffer );
1024 ::EnableMenuItem( hMenu, ( ::GetMenuItemCount( hMenu ) - 1 ), ( MF_BYPOSITION | MFS_DISABLED ) );
1040 bool result =
false;
1043 if ( 0 == ::GetClientRect(
m_hWnd, &rsRect ) ) {
1060 bool result =
false;
1066 if ( ( 0 > nStart ) || ( nCount < nStart ) ) {
1073 if (
nullptr != pcDocumentTab ) {
1075 if ( !pcDocumentTab->
IsShow() ) {
1077 pcDocumentTab =
nullptr;
1086 int nMinAngleWidth = 0;
1087 int nMinAngleHeight = 0;
1090 if ( 0 == nStart ) {
1097 for (
int nIndex = nStart; nCount > nIndex; ++nIndex ) {
1100 if (
nullptr != pcElement ) {
1102 if ( pcElement->
IsShow() ) {
1111 if (
nullptr == pcDocumentTab ) {
1113 for (
int nIndex2 = ( nIndex + 1 );; ++nIndex2 ) {
1115 if ( nCount <= nIndex2 ) {
1125 if (
nullptr != pcElement2 ) {
1127 if ( pcElement2->
IsShow() ) {
1143 nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1151 nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1155 nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1156 nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1164 if (
nullptr != pcDocumentTab ) {
1170 nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1171 nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1175 rsSize.cx = max( rsSize.cx, nMinAngleWidth );
1176 rsSize.cy = max( rsSize.cy, nMinAngleHeight );
1190 bool result =
false;
1198 if (
nullptr != pcDocumentTab ) {
1200 if ( !pcDocumentTab->
IsShow() ) {
1202 pcDocumentTab =
nullptr;
1207 int nMinAngleWidth = 0;
1208 int nMinAngleHeight = 0;
1211 if ( nCount <= nIndex ) {
1213 if (
nullptr != pcDocumentTab ) {
1219 nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1220 nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1224 rsSize.cx = max( rsSize.cx, nMinAngleWidth );
1225 rsSize.cy = max( rsSize.cy, nMinAngleHeight );
1233 if (
nullptr != pcElement ) {
1235 if ( pcElement->
IsShow() ) {
1240 if (
nullptr == pcDocumentTab ) {
1242 for (
int nIndex2 = ( nIndex + 1 );; ++nIndex2 ) {
1244 if ( nCount <= nIndex2 ) {
1254 if (
nullptr != pcElement ) {
1256 if ( pcElement->
IsShow() ) {
1279 nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1287 nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1291 nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1292 nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1314 if (
nullptr == pcElement ) {
1324 if (
nullptr == pcParent ) {
1366 bool result =
false;
1405 ::ClientToScreen(
m_hWnd, reinterpret_cast< LPPOINT >( &sClientRect.left ) );
1406 ::ClientToScreen(
m_hWnd, reinterpret_cast< LPPOINT >( &sClientRect.right ) );
1438 if ( nCount <= nIndex ) {
1441 if (
nullptr != pcDocumentTab ) {
1443 if ( pcDocumentTab->
IsShow() ) {
1468 else if ( nElement != nIndex ) {
1471 if (
nullptr != pcElement ) {
1473 if ( pcElement->
IsShow() ) {
1482 if ( ePos == ePos2 ) {
1484 if ( nElement < nIndex ) {
1501 else switch ( ePos ) {
1534 ::GetWindowRect( hSizeBar, &sSizeBarRect );
1543 int nLeft = sSizeBarRect.left;
1544 int nTop = sSizeBarRect.top;
1545 int nWidth = ( sSizeBarRect.right - nLeft );
1546 int nHeight = ( sSizeBarRect.bottom - nTop );
1549 ::SetWindowPos(
m_hSizeBarImage, HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
1553 HDC hDc = ::GetDC( hSizeBar );
1555 ::BitBlt( hDc2, 0, 0, nWidth, nHeight, hDc, 0, 0, SRCCOPY );
1578 bool result =
false;
1595 ::SendMessageW(
m_hWnd, WM_SIZE, 0, 0 );
1596 ::UpdateWindow(
m_hWnd );
1620 bool result =
false;
1630 ::GetCursorPos( &sPoint );
1631 int dx = ( sPoint.x -
m_sPoint.x );
1632 int dy = ( sPoint.y -
m_sPoint.y );
1673 ::SendMessageW(
m_hWnd, WM_SIZE, 0, 0 );
1674 ::UpdateWindow(
m_hWnd );
1682 int nLeft = sElementRect.left;
1683 int nTop = sElementRect.top;
1689 nLeft = ( sElementRect.left + nSize );
1693 nTop = ( sElementRect.top + nSize );
1706 ::SetWindowPos(
m_hSizeBarImage, HWND_TOP, nLeft, nTop, 0, 0, ( SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
1722 bool result =
false;
1737 ::GetWindowRect( hSizeBar, &sSizeBarRect );
1757 nSize = ( sSizeBarRect.left - sElementRect.left );
1761 nSize = ( sSizeBarRect.top - sElementRect.top );
1765 nSize = ( sElementRect.right - sSizeBarRect.right );
1769 nSize = ( sElementRect.bottom - sSizeBarRect.bottom );
1777 ::SendMessageW(
m_hWnd, WM_SIZE, 0, 0 );
1778 ::UpdateWindow(
m_hWnd );
1801 bool result =
false;
1804 DWORD dwStyle = ( WS_POPUP | SS_OWNERDRAW );
1805 m_hSizeBarImage = ::CreateWindowExW( WS_EX_LAYERED, WC_STATICW,
nullptr, dwStyle, 0, 0, 0, 0,
m_hWnd,
nullptr, ::GetModuleHandleW(
nullptr ),
nullptr );
1828 bool result =
false;
1834 ::FillRect( lpDraw->hDC, &lpDraw->rcItem, hBrush );
1837 ::DeleteObject( hBrush );
1841 ::SelectObject( lpDraw->hDC, hPen );
1844 int nLeft = lpDraw->rcItem.left;
1845 int nTop = lpDraw->rcItem.top;
1846 int nWidth = ( lpDraw->rcItem.right - nLeft );
1847 int nHeight = ( lpDraw->rcItem.bottom - nTop );
1852 ::MoveToEx( lpDraw->hDC, nLeft, nTop,
nullptr );
1853 ::LineTo( lpDraw->hDC, nLeft, ( nTop + nHeight ) );
1854 nLeft = ( lpDraw->rcItem.right - 1 );
1855 ::MoveToEx( lpDraw->hDC, nLeft, nTop,
nullptr );
1856 ::LineTo( lpDraw->hDC, nLeft, ( nTop + nHeight ) );
1861 ::MoveToEx( lpDraw->hDC, nLeft, nTop,
nullptr );
1862 ::LineTo( lpDraw->hDC, ( nLeft + nWidth ), nTop );
1863 nTop = ( lpDraw->rcItem.bottom - 1 );
1864 ::MoveToEx( lpDraw->hDC, nLeft, nTop,
nullptr );
1865 ::LineTo( lpDraw->hDC, ( nLeft + nWidth ), nTop );
1870 ::DeleteObject( hPen );
1886 HWND result =
nullptr;
1889 DWORD dwStyle = ( WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | SS_NOTIFY | SS_OWNERDRAW );
1890 HWND hSizeBar = ::CreateWindowExW( 0, WC_STATICW,
nullptr, dwStyle, 0, 0, 0, 0, hParent,
nullptr, ::GetModuleHandleW(
nullptr ),
nullptr );
1891 if (
nullptr == hSizeBar ) {
1905 #pragma managed( pop ) virtual HWND GetSizeBar() const noexcept
サイズバーコントロール取得関数
virtual int GetMinWidth() noexcept override
最小水平サイズ取得関数
virtual HWND & GetHandle() noexcept
ウィンドウハンドル取得関数
virtual LRESULT WmMouseMove() noexcept override
virtual bool Create(HWND hParent=nullptr, HMENU hMenu=nullptr) noexcept override
ウィンドウ作成関数
virtual bool InitConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報初期化関数
static BYTE const TRANS_SIZEBAR_IMAGE
サイズバーイメージ透明度
virtual CWndDocumentTab * GetDocumentTab() noexcept
ドキュメントタブウィンドウ取得関数
virtual bool ShowChildAll(bool bShow) noexcept override
全子ウィンドウ表示関数
static HWND CreateSizeBar(HWND hParent) noexcept
サイズバーコントロール作成関数
virtual bool IsShow() noexcept
表示フラグ取得関数
virtual CWndPane * GetOrderPane(int *pnOrder) noexcept override
オーダー番号ペインウィンドウ取得関数
bool m_bFocusElement
エレメントウィンドウフォーカス有効フラグ
virtual int GetMinHeight() noexcept
最小垂直サイズ取得関数
virtual LRESULT WmDrawItem() noexcept override
virtual LRESULT StnClicked() noexcept override
static int const MIN_HEIGHT
最小垂直サイズ
virtual bool GetMinSize(SIZE &rsSizen, int nStart=0) noexcept
最小サイズ取得関数
virtual bool DeleteChildAll() noexcept override
全子ウィンドウ削除関数
virtual bool UpdateClientRectAll() noexcept override
全ウィンドウクライアント領域更新関数
static COLORREF const COLOR_SIZEBAR
サイズバー色
virtual bool EndMoveSizeBar() noexcept
サイズバー移動終了関数
virtual bool ResumeConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報復元関数
virtual bool UpdateClientRectAll() noexcept override
全ウィンドウクライアント領域更新関数
virtual bool AppendDebugMenu(HMENU hMenu) noexcept override
デバッグメニュー追加関数
virtual bool SaveConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報保存関数
virtual bool SetPartitionSize(int nSize) noexcept
パーティションサイズ設定関数
virtual int GetOrderIndex(CWndPane *pcPane=nullptr, int *pnOrder=nullptr) noexcept override
ペインウィンドウオーダー番号取得関数
CWndElement * m_pcElement
エレメントウィンドウポインタ
LIB_WINDOW_API int GetEnableMenuCommandCount(HMENU hMenu) noexcept
メニューコマンド有効数取得関数
virtual bool SubtractChildRect(HWND hChild, RECT &rsRect) noexcept
子ウィンドウ表示領域減算関数
virtual int GetMinWidth() noexcept override
最小水平サイズ取得関数
virtual bool AppendDebugMenu(HMENU hMenu) noexcept override
デバッグメニュー追加関数
virtual LRESULT WmSetCursor() noexcept override
virtual bool InitConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報初期化関数
virtual LRESULT WmKeyDown() noexcept override
virtual bool ResumeConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報復元関数
virtual int GetMinWidth() noexcept
最小水平サイズ取得関数
CWndPartition(CWndElement *(*pfnCreateElement)(), wchar_t const *pszElementName) noexcept
コンストラクタ
virtual LRESULT WmSize() noexcept override
各種メッセージ処理関数
virtual bool CancelMoveSizeBar() noexcept
サイズバー移動中止関数
static int const MIN_WIDTH
最小水平サイズ
static int const SIZEBAR_THICK
サイズバー太さ
static bool s_bResizePartitionRealTime
リアルタイムパーティションサイズ変更フラグ
CWndList m_cElementList
エレメントウィンドウリスト
EPartitionPos
パーティション配置位置種別列挙体
static wchar_t const *const KEY_PARTITION_POS
パーティション配置位置キー文字列
virtual int Find(Type const &rElement) const noexcept
検索関数
virtual LRESULT WmSetFocus() noexcept override
各種メッセージ処理関数
virtual bool BeginMoveSizeBar(CWndElement *pcElement) noexcept
サイズバー移動開始関数
virtual LRESULT WmLButtonUp() noexcept override
virtual int GetMinHeight() noexcept override
最小垂直サイズ取得関数
virtual LRESULT WmKeyDown() noexcept
virtual bool GetMinPartitionSize(SIZE &rsSize) noexcept
最小パーティション表示領域サイズ取得関数
int m_nMaxSize
最大パーティションサイズ
virtual LRESULT WmMouseMove() noexcept
virtual LRESULT WmLButtonUp() noexcept
virtual int GetOrderIndex(CWndPane *pcPane=nullptr, int *pnOrder=nullptr) noexcept override
ペインウィンドウオーダー番号取得関数
virtual bool ShowChildWindow(CWndPane *pcChild, bool bShow) noexcept
子ウィンドウ表示状態設定関数
virtual bool IsPartition() const noexcept
パーティションウィンドウ判別関数
virtual bool MoveSizeBar() noexcept
サイズバー移動関数
int m_nMinSize
最小パーティションサイズ
virtual int GetPartitionSize() const noexcept
パーティションサイズ取得関数
virtual bool GetPaintRect(RECT &rsRect) noexcept override
クライアント描画領域取得関数
virtual bool CreateSizeBarImageControl() noexcept
サイズバーイメージコントロール作成関数
virtual bool CanHideChildWindow(CWndPane *pcChild) noexcept
子ウィンドウ非表示可能状態取得関数
virtual bool CanDeleteChildWindow(CWndPane *pcChild) noexcept
子ウィンドウ削除可能状態取得関数
static wchar_t const *const KEY_PARTITION_SIZE
パーティションサイズキー文字列
virtual CWndPane * GetPaneWindow(HWND hWnd) const noexcept
表示フラグ取得関数
virtual bool GetChildPaneInfo(SChildPaneInfo &rsChildInfo) noexcept override
子ペインウィンドウ情報取得関数
virtual bool GetChildPaneInfo(SChildPaneInfo &rsChildInfo) noexcept override
子ペインウィンドウ情報取得関数
virtual int GetMinHeight() noexcept override
最小垂直サイズ取得関数
virtual LRESULT WmSetFocus() noexcept override
各種メッセージ処理関数
virtual bool Create(HWND hParent=nullptr, HMENU hMenu=nullptr) noexcept override
ウィンドウ作成関数
HWND m_hSizeBarImage
サイズバーイメージコントロールハンドル
virtual wchar_t const * GetSectionName() const noexcept override
セクション名取得関数
virtual CWndPane * GetOrderPane(int *pnOrder) noexcept override
オーダー番号ペインウィンドウ取得関数
static COLORREF const COLOR_SIZEBAR_BORDER
サイズバーボーダー色
virtual bool DrawSizeBar(LPDRAWITEMSTRUCT lpDraw, EPartitionPos ePos) noexcept
サイズバーコントロール描画関数
virtual LRESULT WmSetCursor() noexcept
virtual bool DeleteChildAll() noexcept override
全子ウィンドウ削除関数
virtual bool SaveConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報保存関数
virtual bool GetPartitionClientRect(RECT &rsRect) noexcept
パーティション表示クライアント領域取得関数
JSON構成情報自動セクションブロッククラスヘッダファイル
virtual int GetCount() const noexcept
配列要素数取得関数
virtual bool ShowChildAll(bool bShow) noexcept override
全子ウィンドウ表示関数
virtual bool CanDeleteChildWindow(CWndPane *pcChild) noexcept override
子ウィンドウ削除可能状態取得関数
virtual EPartitionPos GetPartitionPos() const noexcept
パーティション配置位置取得関数