Solution46
CWndPartition.cpp
[詳解]
1 //=============================================================================
2 /// @file
3 /// パーティションウィンドウクラス実装ファイル
4 ///
5 /// パーティションウィンドウクラス実装ファイルです。
6 ///
7 /// $Id: CWndPartition.cpp 245 2019-03-20 15:03:41Z admin $
8 /// $Date: 2019-03-21 00:03:41 +0900 (2019/03/21 (木)) $
9 /// $Author: admin $
10 ///
11 /// @attention なし
12 
13 #pragma managed( push, off )
14 
15 //=============================================================================
16 // インクルードファイル
17 #include <CWndPartition.h>
18 #include <CJsonConfigAuto.h>
19 #include <LibWindowUtility.h>
20 #include <commctrl.h>
21 
22 //=============================================================================
23 // インクルード実装ファイル
24 #include <CArray.hpp>
25 
26 //=============================================================================
27 // ウィンドウライブラリ名前空間
28 namespace LibWindow {
29  //=========================================================================
30  // パーティションウィンドウクラス
31  //=========================================================================
32  // 静的公開文字列定数
33  wchar_t const* const CWndPartition::KEY_PARTITION_POS = L"パーティション配置位置";
34  wchar_t const* const CWndPartition::KEY_PARTITION_SIZE = L"パーティションサイズ";
35 
36  //=========================================================================
37  // 構築子と解体子
38  //-------------------------------------------------------------------------
39  // コンストラクタ
40  CWndPartition::CWndPartition( CWndElement* ( *pfnCreateElement )(), wchar_t const* pszElementName ) noexcept
41  // 基底クラスコンストラクタ
42  : CWndContainer( pfnCreateElement, pszElementName )
43  // メンバ変数初期化
44  , m_hSizeBarImage( nullptr )
45  , m_sPoint()
46  , m_pcElement( nullptr )
47  , m_nSize( 0 )
48  , m_nMinSize( 0 )
49  , m_nMaxSize( 0 )
50  {}
51 
52  //=========================================================================
53  // 公開関数
54  //-------------------------------------------------------------------------
55  // ウィンドウ作成関数
56  bool CWndPartition::Create( HWND hParent, HMENU hMenu ) noexcept {
57  // 処理ブロック
58  bool result = false;
59  do {
60  // 基底クラスの関数を実行する
61  if ( !CWndContainer::Create( hParent, hMenu ) ) {
62  // 失敗!
63  break;
64  }
65  // サイズバーイメージコントロールを作成する
66  else if ( !CreateSizeBarImageControl() ) {
67  // 失敗!
68  break;
69  }
70 
71  // 成功!
72  result = true;
73  } while ( false );
74 
75  // 実行結果を返す
76  return result;
77  }
78 
79  //-------------------------------------------------------------------------
80  // WM_SIZEメッセージ処理関数
81  LRESULT CWndPartition::WmSize() noexcept {
82  // 処理ブロック
83  LRESULT result = 0;
84  do {
85  // ウィンドウ表示状態を調べる
86  if ( 0 == ::IsWindowVisible( m_hWnd ) ) {
87  // 終了!
88  break;
89  }
90 
91  // パーティション表示クライアント領域を取得する
92  RECT sClientRect;
93  if ( !GetPartitionClientRect( sClientRect ) || ( 0 != ::IsRectEmpty( &sClientRect ) ) ) {
94  // 終了!
95  break;
96  }
97 
98  // ドキュメントタブウィンドウを取得する
99  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
100  if ( nullptr != pcDocumentTab ) {
101  // ウィンドウ表示フラグを調べる
102  if ( !pcDocumentTab->IsShow() ) {
103  // ドキュメントタブウィンドウを隠す
104  ::ShowWindow( pcDocumentTab->GetHandle(), SW_HIDE );
105 
106  // ドキュメントタブウィンドウポインタをクリアする
107  pcDocumentTab = nullptr;
108  }
109  }
110 
111  // 巡回する
112  for ( int nIndex = 0, nCount = m_cElementList.GetCount(); nCount > nIndex; ++nIndex ) {
113  // エレメントウィンドウを取得する
114  CWndElement* pcElement = m_cElementList[ nIndex ];
115  if ( nullptr != pcElement ) {
116  // サイズバーコントロールを取得する
117  HWND hSizeBar = pcElement->GetSizeBar();
118 
119  // ウィンドウ表示フラグを調べる
120  if ( !pcElement->IsShow() ) {
121  // エレメントウィンドウを隠す
122  ::ShowWindow( pcElement->GetHandle(), SW_HIDE );
123 
124  // サイズバーコントロールを隠す
125  ::ShowWindow( hSizeBar, SW_HIDE );
126  }
127  else {
128  // パーティション配置位置を取得する
129  EPartitionPos ePos = GetPartitionPos( pcElement );
130 
131  // ドキュメントタブウィンドウポインタを調べる
132  if ( nullptr == pcDocumentTab ) {
133  // 巡回する
134  for ( int nIndex2 = ( nIndex + 1 );; ++nIndex2 ) {
135  // インデックスを調べる
136  if ( nCount <= nIndex2 ) {
137  // パーティション配置位置を無効化する
138  ePos = EPartitionPos::Invalid;
139 
140  // サイズバーコントロールを隠す
141  ::ShowWindow( hSizeBar, SW_HIDE );
142 
143  // 終了!
144  break;
145  }
146 
147  // エレメントウィンドウを取得する
148  CWndElement* pcElement = m_cElementList[ nIndex2 ];
149  if ( nullptr != pcElement ) {
150  // ウィンドウ表示フラグを調べる
151  if ( pcElement->IsShow() ) {
152  // 終了!
153  break;
154  }
155  }
156  }
157  }
158 
159  // ウィンドウ表示位置を取得する
160  int nLeft = sClientRect.left;
161  int nTop = sClientRect.top;
162  int nWidth = ( sClientRect.right - nLeft );
163  int nHeight = ( sClientRect.bottom - nTop );
164 
165  // パーティションサイズを取得する
166  int nSize = pcElement->GetPartitionSize();
167 
168  // 最小サイズを取得する
169  int nMinWidth = pcElement->GetMinWidth();
170  int nMinHeight = pcElement->GetMinHeight();
171 
172  // 残り必要最小サイズを取得する
173  SIZE sMinSize = {};
174  GetMinSize( sMinSize, ( nIndex + 1 ) );
175 
176  // 最大サイズを取得する
177  int nMaxWidth = ( nWidth - sMinSize.cx );
178  int nMaxHeight = ( nHeight - sMinSize.cy );
179 
180  // パーティション配置位置を調べる
181  switch ( ePos ) {
182  case EPartitionPos::Left: // 左側
183  case EPartitionPos::Right: // 右側
184  // 最大水平サイズを更新する
185  nMaxWidth -= SIZEBAR_THICK;
186  break;
187  case EPartitionPos::Top: // 上側
188  case EPartitionPos::Bottom: // 下側
189  // 最大垂直サイズを更新する
190  nMaxHeight -= SIZEBAR_THICK;
191  break;
192  }
193 
194  // 最大水平サイズを調べる
195  if ( nMinWidth > nMaxWidth ) {
196  // 最大水平サイズを更新する
197  nMaxWidth = nMinWidth;
198  }
199 
200  // 最大垂直サイズを調べる
201  if ( nMinHeight > nMaxHeight ) {
202  // 最大垂直サイズを更新する
203  nMaxHeight = nMinHeight;
204  }
205 
206  // パーティション配置位置を調べる
207  switch ( ePos ) {
208  case EPartitionPos::Left: // 左側
209  case EPartitionPos::Right: // 右側
210  // 水平サイズを取得する
211  nWidth = nSize;
212 
213  // 最小水平サイズを調べる
214  if ( nMinWidth > nWidth ) {
215  // 水平サイズを更新する
216  nWidth = nMinWidth;
217  }
218  // 最大水平サイズを調べる
219  else if ( nMaxWidth < nWidth ) {
220  // 水平サイズを更新する
221  nWidth = nMaxWidth;
222  }
223  break;
224  case EPartitionPos::Top: // 上側
225  case EPartitionPos::Bottom: // 下側
226  // 垂直サイズを取得する
227  nHeight = nSize;
228 
229  // 最小垂直サイズを調べる
230  if ( nMinHeight > nHeight ) {
231  // 垂直サイズを更新する
232  nHeight = nMinHeight;
233  }
234  // 最大垂直サイズを調べる
235  else if ( nMaxHeight < nHeight ) {
236  // 垂直サイズを更新する
237  nHeight = nMaxHeight;
238  }
239  break;
240  }
241 
242  // パーティション配置位置を調べる
243  switch ( ePos ) {
244  case EPartitionPos::Right: // 右側
245  // 水平座標を取得する
246  nLeft = ( sClientRect.right - nWidth );
247  break;
248  case EPartitionPos::Bottom: // 下側
249  // 垂直座標を取得する
250  nTop = ( sClientRect.bottom - nHeight );
251  break;
252  }
253 
254  // エレメントウィンドウを表示する
255  ::SetWindowPos( pcElement->GetHandle(), HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
256  ::UpdateWindow( pcElement->GetHandle() );
257 
258  // クライアント描画領域から減算する
259  SubtractChildRect( pcElement->GetHandle(), sClientRect );
260 
261  // パーティション配置位置を調べる
262  if ( EPartitionPos::Invalid != ePos ) {
263  // ウィンドウ表示位置を取得する
264  int nLeft = sClientRect.left;
265  int nTop = sClientRect.top;
266  int nWidth = ( sClientRect.right - nLeft );
267  int nHeight = ( sClientRect.bottom - nTop );
268 
269  // パーティション配置位置を調べる
270  switch ( ePos ) {
271  case EPartitionPos::Left: // 左側
272  // 水平サイズを取得する
273  nWidth = SIZEBAR_THICK;
274  break;
275  case EPartitionPos::Top: // 上側
276  // 垂直サイズを取得する
277  nHeight = SIZEBAR_THICK;
278  break;
279  case EPartitionPos::Right: // 右側
280  // 水平サイズを取得する
281  nWidth = SIZEBAR_THICK;
282 
283  // 水平座標を取得する
284  nLeft = ( sClientRect.right - nWidth );
285  break;
286  case EPartitionPos::Bottom: // 下側
287  // 垂直サイズを取得する
288  nHeight = SIZEBAR_THICK;
289 
290  // 垂直座標を取得する
291  nTop = ( sClientRect.bottom - nHeight );
292  break;
293  }
294 
295  // サイズバーコントロールを表示する
296  ::SetWindowPos( hSizeBar, HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
297  ::UpdateWindow( hSizeBar );
298 
299  // クライアント描画領域から減算する
300  SubtractChildRect( hSizeBar, sClientRect );
301  }
302  }
303  }
304  }
305 
306  // ドキュメントタブウィンドウポインタを調べる
307  if ( nullptr != pcDocumentTab ) {
308  // ウィンドウ表示位置を取得する
309  int nLeft = sClientRect.left;
310  int nTop = sClientRect.top;
311  int nWidth = ( sClientRect.right - nLeft );
312  int nHeight = ( sClientRect.bottom - nTop );
313 
314  // ドキュメントタブウィンドウを表示する
315  ::SetWindowPos( pcDocumentTab->GetHandle(), HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
316  ::UpdateWindow( pcDocumentTab->GetHandle() );
317  }
318  } while ( false );
319 
320  // 実行結果を返す
321  return result;
322  }
323 
324  //-------------------------------------------------------------------------
325  // WM_SETFOCUSメッセージ処理関数
326  LRESULT CWndPartition::WmSetFocus() noexcept {
327  // 処理ブロック
328  LRESULT result = 0;
329  do {
330  // キャプチャウィンドウを調べる
331  if ( m_hWnd == ::GetCapture() ) {
332  // 終了!
333  break;
334  }
335 
336  // ドキュメントタブウィンドウを取得する
337  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
338  if ( nullptr != pcDocumentTab ) {
339  // ウィンドウ表示フラグを調べる
340  if ( pcDocumentTab->IsShow() ) {
341  // エレメントウィンドウフォーカス有効状態を調べる
342  if ( !m_bFocusElement ) {
343  // フォーカスウィンドウを設定する
344  ::SetFocus( pcDocumentTab->GetHandle() );
345 
346  // 終了!
347  break;
348  }
349  }
350  }
351 
352  // 基底クラスの関数を実行する
353  result = CWndContainer::WmSetFocus();
354  } while ( false );
355 
356  // 実行結果を返す
357  return result;
358  }
359 
360  //-------------------------------------------------------------------------
361  // WM_DRAWITEMメッセージ処理関数
362  LRESULT CWndPartition::WmDrawItem() noexcept {
363  // 処理ブロック
364  LRESULT result = 0;
365  do {
366  // 描画アイテム構造体を取得する
367  LPDRAWITEMSTRUCT lpDraw = reinterpret_cast< LPDRAWITEMSTRUCT >( m_lParam );
368 
369  // 巡回する
370  for ( int nIndex = 0, nCount = m_cElementList.GetCount(); nCount > nIndex; ++nIndex ) {
371  // エレメントウィンドウを取得する
372  CWndElement* pcElement = m_cElementList[ nIndex ];
373  if ( nullptr != pcElement ) {
374  // サイズバーコントロールを取得する
375  HWND hSizeBar = pcElement->GetSizeBar();
376  if ( hSizeBar == lpDraw->hwndItem ) {
377  // サイズバーコントロールを描画する
378  DrawSizeBar( lpDraw, GetPartitionPos( pcElement ) );
379 
380  // 終了!
381  break;
382  }
383  }
384  }
385  } while ( false );
386 
387  // 実行結果を返す
388  return result;
389  }
390 
391  //-------------------------------------------------------------------------
392  // WM_SETCURSORメッセージ処理関数
393  LRESULT CWndPartition::WmSetCursor() noexcept {
394  // 処理ブロック
395  LRESULT result = 0;
396  do {
397  // コントロールハンドルを取得する
398  HWND hCtrl = reinterpret_cast< HWND >( m_wParam );
399 
400  // 巡回する
401  for ( int nIndex = 0, nCount = m_cElementList.GetCount(); nCount > nIndex; ++nIndex ) {
402  // エレメントウィンドウを取得する
403  CWndElement* pcElement = m_cElementList[ nIndex ];
404  if ( nullptr != pcElement ) {
405  // コントロールハンドルを調べる
406  HWND hSizeBar = pcElement->GetSizeBar();
407  if ( hCtrl == hSizeBar ) {
408  // パーティション配置位置種別を調べる
409  EPartitionPos ePos = GetPartitionPos( pcElement );
410  switch ( ePos ) {
411  case EPartitionPos::Left: // 左端
412  case EPartitionPos::Right: // 右端
413  // 左右サイズ変更カーソル形状にする
414  ::SetCursor( ::LoadCursorW( nullptr, IDC_SIZEWE ) );
415 
416  // 成功!
417  result = TRUE;
418  break;
419  case EPartitionPos::Top: // 上端
420  case EPartitionPos::Bottom: // 下端
421  // 上下サイズ変更カーソル形状にする
422  ::SetCursor( ::LoadCursorW( nullptr, IDC_SIZENS ) );
423 
424  // 成功!
425  result = TRUE;
426  break;
427  }
428 
429  // 終了!
430  break;
431  }
432  }
433  }
434 
435  // 実行結果を調べる
436  if ( TRUE != result ) {
437  // 基底クラスの関数を実行する
438  result = CWndContainer::WmSetCursor();
439  }
440  } while ( false );
441 
442  // 実行結果を返す
443  return result;
444  }
445 
446  //-------------------------------------------------------------------------
447  // STN_CLICKEDメッセージ処理関数
448  LRESULT CWndPartition::StnClicked() noexcept {
449  // 処理ブロック
450  LRESULT result = 0;
451  do {
452  // コントロールハンドルを取得する
453  HWND hCtrl = reinterpret_cast< HWND >( m_lParam );
454 
455  // 巡回する
456  for ( int nIndex = 0, nCount = m_cElementList.GetCount(); nCount > nIndex; ++nIndex ) {
457  // エレメントウィンドウを取得する
458  CWndElement* pcElement = m_cElementList[ nIndex ];
459  if ( nullptr != pcElement ) {
460  // コントロールハンドルを調べる
461  HWND hSizeBar = pcElement->GetSizeBar();
462  if ( hCtrl == hSizeBar ) {
463  // サイズバー移動を開始する
464  BeginMoveSizeBar( pcElement );
465 
466  // 終了!
467  break;
468  }
469  }
470  }
471  } while ( false );
472 
473  // 実行結果を返す
474  return result;
475  }
476 
477  //-------------------------------------------------------------------------
478  // WM_LBUTTONUPメッセージ処理関数
479  LRESULT CWndPartition::WmLButtonUp() noexcept {
480  // 処理ブロック
481  LRESULT result = 0;
482  do {
483  // キャプチャウィンドウを調べる
484  if ( m_hWnd == ::GetCapture() ) {
485  // サイズバー移動を終了する
486  EndMoveSizeBar();
487 
488  // 終了!
489  break;
490  }
491 
492  // 基底クラスの関数を実行する
493  result = CWndContainer::WmLButtonUp();
494  } while ( false );
495 
496  // 実行結果を返す
497  return result;
498  }
499 
500  //-------------------------------------------------------------------------
501  // WM_KEYDOWNメッセージ処理関数
502  LRESULT CWndPartition::WmKeyDown() noexcept {
503  // 処理ブロック
504  LRESULT result = 0;
505  do {
506  // キャプチャウィンドウを調べる
507  if ( m_hWnd == ::GetCapture() ) {
508  // 仮想キーコードを調べる
509  int nVirtKey = static_cast< int >( m_wParam );
510  if ( VK_ESCAPE == nVirtKey ) {
511  // サイズバー移動を中止する
513 
514  // 終了!
515  break;
516  }
517  }
518 
519  // 基底クラスの関数を実行する
520  result = CWndContainer::WmKeyDown();
521  } while ( false );
522 
523  // 実行結果を返す
524  return result;
525  }
526 
527  //-------------------------------------------------------------------------
528  // WM_MOUSEMOVEメッセージ処理関数
529  LRESULT CWndPartition::WmMouseMove() noexcept {
530  // 処理ブロック
531  LRESULT result = 0;
532  do {
533  // キャプチャウィンドウを調べる
534  if ( m_hWnd == ::GetCapture() ) {
535  // サイズバーを移動する
536  MoveSizeBar();
537 
538  // 終了!
539  break;
540  }
541 
542  // 基底クラスの関数を実行する
543  result = CWndContainer::WmMouseMove();
544  } while ( false );
545 
546  // 実行結果を返す
547  return result;
548  }
549 
550  //-------------------------------------------------------------------------
551  // ウィンドウ構成情報初期化関数
552  bool CWndPartition::InitConfig( CJsonConfig& rcConfig ) noexcept {
553  // 処理ブロック
554  bool result = false;
555  do {
556  // 基底クラスの関数を実行する
557  if ( !CWndContainer::InitConfig( rcConfig ) ) {
558  // 失敗!
559  break;
560  }
561 
562  // ドキュメントタブウィンドウを取得する
563  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
564  if ( nullptr != pcDocumentTab ) {
565  // ドキュメントタブウィンドウセクションブロック
566  CJsonConfigAuto cConfigAuto( rcConfig, pcDocumentTab->GetSectionName() );
567 
568  // ドキュメントタブウィンドウ構成情報を初期化する
569  if ( !pcDocumentTab->InitConfig( rcConfig ) ) {
570  // 失敗!
571  break;
572  }
573  }
574 
575  // 成功!
576  result = true;
577  } while ( false );
578 
579  // 実行結果を返す
580  return result;
581  }
582 
583  //-------------------------------------------------------------------------
584  // ウィンドウ構成情報復元関数
585  bool CWndPartition::ResumeConfig( CJsonConfig& rcConfig ) noexcept {
586  // 処理ブロック
587  bool result = false;
588  do {
589  // 基底クラスの関数を実行する
590  if ( !CWndContainer::ResumeConfig( rcConfig ) ) {
591  // 失敗!
592  break;
593  }
594 
595  // ドキュメントタブウィンドウを取得する
596  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
597  if ( nullptr != pcDocumentTab ) {
598  // ドキュメントタブウィンドウセクションブロック
599  CJsonConfigAuto cConfigAuto( rcConfig, pcDocumentTab->GetSectionName() );
600 
601  // ドキュメントタブウィンドウ構成情報を復元する
602  if ( !pcDocumentTab->ResumeConfig( rcConfig ) ) {
603  // 失敗!
604  break;
605  }
606  }
607 
608  // 成功!
609  result = true;
610  } while ( false );
611 
612  // 実行結果を返す
613  return result;
614  }
615 
616  //-------------------------------------------------------------------------
617  // ウィンドウ構成情報保存関数
618  bool CWndPartition::SaveConfig( CJsonConfig& rcConfig ) noexcept {
619  // 処理ブロック
620  bool result = false;
621  do {
622  // 基底クラスの関数を実行する
623  if ( !CWndContainer::SaveConfig( rcConfig ) ) {
624  // 失敗!
625  break;
626  }
627 
628  // ドキュメントタブウィンドウを取得する
629  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
630  if ( nullptr != pcDocumentTab ) {
631  // ドキュメントタブウィンドウセクションブロック
632  CJsonConfigAuto cConfigAuto( rcConfig, pcDocumentTab->GetSectionName(), true );
633 
634  // ドキュメントタブウィンドウ構成情報を保存する
635  if ( !pcDocumentTab->SaveConfig( rcConfig ) ) {
636  // 失敗!
637  break;
638  }
639  }
640 
641  // 成功!
642  result = true;
643  } while ( false );
644 
645  // 実行結果を返す
646  return result;
647  }
648 
649  //-------------------------------------------------------------------------
650  // 子ペインウィンドウ情報取得関数
651  bool CWndPartition::GetChildPaneInfo( SChildPaneInfo& rsChildInfo ) noexcept {
652  // 処理ブロック
653  bool result = false;
654  do {
655  // 基底クラスの関数を実行する
656  if ( !CWndContainer::GetChildPaneInfo( rsChildInfo ) ) {
657  // 失敗!
658  break;
659  }
660 
661  // ドキュメントタブウィンドウを取得する
662  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
663  if ( nullptr != pcDocumentTab ) {
664  // 子ウィンドウ数をインクリメントする
665  ++rsChildInfo.m_nCount;
666 
667  // 表示フラグを調べる
668  if ( pcDocumentTab->IsShow() ) {
669  // 表示状態子ウィンドウ数をインクリメントする
670  ++rsChildInfo.m_nShow;
671  }
672  else {
673  // 非表示状態子ウィンドウ数をインクリメントする
674  ++rsChildInfo.m_nHide;
675  }
676 
677  // 非表示可能状態を調べる
678  if ( CanHideChildWindow( pcDocumentTab ) ) {
679  // 非表示可能状態子ウィンドウ数をインクリメントする
680  ++rsChildInfo.m_nHideable;
681  }
682 
683  // 削除可能状態を調べる
684  if ( CanDeleteChildWindow( pcDocumentTab ) ) {
685  // 削除可能状態子ウィンドウ数をインクリメントする
686  ++rsChildInfo.m_nDeletable;
687  }
688 
689  // 子ペインウィンドウ情報を取得する
690  if ( !pcDocumentTab->GetChildPaneInfo( rsChildInfo ) ) {
691  // 失敗!
692  break;
693  }
694  }
695 
696  // 成功!
697  result = true;
698  } while ( false );
699 
700  // 実行結果を返す
701  return result;
702  }
703 
704  //-------------------------------------------------------------------------
705  // ペインウィンドウオーダー番号取得関数
706  int CWndPartition::GetOrderIndex( CWndPane* pcPane, int* pnOrder ) noexcept {
707  // 処理ブロック
708  int result = -1;
709  do {
710  // 基底クラスの関数を実行する
711  int nOrder = CWndContainer::GetOrderIndex( pcPane, pnOrder );
712  if ( 0 > nOrder ) {
713  // ドキュメントタブウィンドウを取得する
714  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
715  if ( nullptr != pcDocumentTab ) {
716  // ドキュメントタブウィンドウのオーダー番号を取得する
717  nOrder = pcDocumentTab->GetOrderIndex( pcPane, pnOrder );
718  if ( 0 > nOrder ) {
719  // 失敗!
720  break;
721  }
722  }
723  }
724 
725  // 成功!
726  result = nOrder;
727  } while ( false );
728 
729  // 実行結果を返す
730  return result;
731  }
732 
733  //-------------------------------------------------------------------------
734  // オーダー番号ペインウィンドウ取得関数
735  CWndPane* CWndPartition::GetOrderPane( int* pnOrder ) noexcept {
736  // 処理ブロック
737  CWndPane* result = nullptr;
738  do {
739  // 基底クラスの関数を実行する
740  CWndPane* pcPane = CWndContainer::GetOrderPane( pnOrder );
741  if ( nullptr == pcPane ) {
742  // ドキュメントタブウィンドウを取得する
743  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
744  if ( nullptr == pcDocumentTab ) {
745  // 失敗!
746  break;
747  }
748 
749  // ドキュメントタブウィンドウのオーダー番号ペインウィンドウを取得する
750  pcPane = pcDocumentTab->GetOrderPane( pnOrder );
751  if ( nullptr == pcPane ) {
752  // 失敗!
753  break;
754  }
755  }
756 
757  // 成功!
758  result = pcPane;
759  } while ( false );
760 
761  // 実行結果を返す
762  return result;
763  }
764 
765  //-------------------------------------------------------------------------
766  // 全子ウィンドウ表示関数
767  bool CWndPartition::ShowChildAll( bool bShow ) noexcept {
768  // 処理ブロック
769  bool result = false;
770  do {
771  // 基底クラスの関数を実行する
772  if ( !CWndContainer::ShowChildAll( bShow ) ) {
773  // 失敗!
774  break;
775  }
776 
777  // ドキュメントタブウィンドウを取得する
778  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
779  if ( nullptr != pcDocumentTab ) {
780  // ドキュメントタブウィンドウを表示する
781  if ( !ShowChildWindow( pcDocumentTab, bShow ) ) {
782  // 失敗!
783  break;
784  }
785  // ドキュメントタブウィンドウの全子ウィンドウを表示する
786  else if ( !pcDocumentTab->ShowChildAll( bShow ) ) {
787  // 失敗!
788  break;
789  }
790  }
791 
792  // 成功!
793  result = true;
794  } while ( false );
795 
796  // 実行結果を返す
797  return result;
798  }
799 
800  //-------------------------------------------------------------------------
801  // 全子ウィンドウ削除関数
803  // 処理ブロック
804  bool result = false;
805  do {
806  // ドキュメントタブウィンドウを取得する
807  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
808  if ( nullptr != pcDocumentTab ) {
809  // ドキュメントタブウィンドウの全子ウィンドウを削除する
810  if ( !pcDocumentTab->DeleteChildAll() ) {
811  // 失敗!
812  break;
813  }
814  }
815 
816  // 基底クラスの関数を実行する
818  } while ( false );
819 
820  // 実行結果を返す
821  return result;
822  }
823 
824  //-------------------------------------------------------------------------
825  // 子ウィンドウ削除可能状態取得関数
826  bool CWndPartition::CanDeleteChildWindow( CWndPane* pcChild ) noexcept {
827  // 処理ブロック
828  bool result = false;
829  do {
830  // ドキュメントタブウィンドウを取得する
831  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
832  if ( nullptr != pcDocumentTab ) {
833  // 子ペインウィンドウポインタを調べる
834  if ( pcDocumentTab == pcChild ) {
835  // 失敗!
836  break;
837  }
838  }
839 
840  // 基底クラスの関数を実行する
841  result = CWndContainer::CanDeleteChildWindow( pcChild );
842  } while ( false );
843 
844  // 実行結果を返す
845  return result;
846  }
847 
848  //-------------------------------------------------------------------------
849  // 全ウィンドウクライアント領域更新関数
851  // 処理ブロック
852  bool result = false;
853  do {
854  // 基底クラスの関数を実行する
856  // 失敗!
857  break;
858  }
859 
860  // ドキュメントタブウィンドウを取得する
861  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
862  if ( nullptr != pcDocumentTab ) {
863  // 全ウィンドウクライアント領域を更新する
864  pcDocumentTab->UpdateClientRectAll();
865  }
866 
867  // 成功!
868  result = true;
869  } while ( false );
870 
871  // 実行結果を返す
872  return result;
873  }
874 
875  //-------------------------------------------------------------------------
876  // クライアント描画領域取得関数
877  bool CWndPartition::GetPaintRect( RECT& rsRect ) noexcept {
878  // 処理ブロック
879  bool result = false;
880  do {
881  // パーティション表示クライアント領域を取得する
882  RECT sClientRect;
883  if ( !GetPartitionClientRect( sClientRect ) ) {
884  // 失敗!
885  break;
886  }
887  // 巡回する
888  else for ( int nIndex = 0, nCount = m_cElementList.GetCount();; ++nIndex ) {
889  // インデックスを調べる
890  if ( nCount <= nIndex ) {
891  // ドキュメントタブウィンドウを取得する
892  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
893  if ( nullptr != pcDocumentTab ) {
894  // ドキュメントタブウィンドウ表示状態を調べる
895  if ( 0 != ::IsWindowVisible( pcDocumentTab->GetHandle() ) ) {
896  // ウィンドウ表示領域を減算する
897  if ( !SubtractChildRect( pcDocumentTab->GetHandle(), sClientRect ) ) {
898  // 失敗!
899  break;
900  }
901  }
902  }
903 
904  // クライアント描画領域を取得する
905  rsRect = sClientRect;
906 
907  // 成功!
908  result = true;
909  break;
910  }
911 
912  // エレメントウィンドウを取得する
913  CWndElement* pcElement = m_cElementList[ nIndex ];
914  if ( nullptr != pcElement ) {
915  // ウィンドウ表示状態を調べる
916  if ( 0 != ::IsWindowVisible( pcElement->GetHandle() ) ) {
917  // ウィンドウ表示領域を減算する
918  if ( !SubtractChildRect( pcElement->GetHandle(), sClientRect ) ) {
919  // 失敗!
920  break;
921  }
922 
923  // サイズバーコントロールを取得する
924  HWND hSizeBar = pcElement->GetSizeBar();
925  if ( nullptr != hSizeBar ) {
926  // ウィンドウ表示状態を調べる
927  if ( 0 != ::IsWindowVisible( hSizeBar ) ) {
928  // ウィンドウ表示領域を減算する
929  if ( !SubtractChildRect( hSizeBar, sClientRect ) ) {
930  // 失敗!
931  break;
932  }
933  }
934  }
935  }
936  }
937  }
938  } while ( false );
939 
940  // 実行結果を返す
941  return result;
942  }
943 
944  //-------------------------------------------------------------------------
945  // 最小水平サイズ取得関数
946  int CWndPartition::GetMinWidth() noexcept {
947  // 処理ブロック
948  int result = CWndContainer::GetMinWidth();
949  do {
950  // 最小サイズを取得する
951  SIZE sSize;
952  if ( GetMinSize( sSize ) ) {
953  // 最小水平サイズを取得する
954  result = sSize.cx;
955  }
956  } while ( false );
957 
958  // 実行結果を返す
959  return result;
960  }
961 
962  //-------------------------------------------------------------------------
963  // 最小垂直サイズ取得関数
965  // 処理ブロック
966  int result = CWndContainer::GetMinHeight();
967  do {
968  // 最小サイズを取得する
969  SIZE sSize;
970  if ( GetMinSize( sSize ) ) {
971  // 最小垂直サイズを取得する
972  result = sSize.cy;
973  }
974  } while ( false );
975 
976  // 実行結果を返す
977  return result;
978  }
979 
980  //-------------------------------------------------------------------------
981  // デバッグメニュー追加関数
982  bool CWndPartition::AppendDebugMenu( HMENU hMenu ) noexcept {
983  // 処理ブロック
984  bool result = false;
985  do {
986  // 基底クラスの関数を実行する
987  if ( !CWndContainer::AppendDebugMenu( hMenu ) ) {
988  // 失敗!
989  break;
990  }
991 
992  // ドキュメントタブウィンドウを取得する
993  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
994  if ( nullptr != pcDocumentTab ) {
995  // サブメニューを作成する
996  HMENU hSubMenu = ::CreatePopupMenu();
997  if ( nullptr == hSubMenu ) {
998  // 失敗!
999  break;
1000  }
1001  // ドキュメントタブウィンドウのデバッグメニューを追加する
1002  else if ( !pcDocumentTab->AppendDebugMenu( hSubMenu ) ) {
1003  // サブメニューを削除する
1004  ::DestroyMenu( hSubMenu );
1005 
1006  // 失敗!
1007  break;
1008  }
1009 
1010  // ウィンドウタイトルを取得する
1011  wchar_t szBuffer[ MAX_PATH ];
1012  ::GetWindowTextW( pcDocumentTab->GetHandle(), szBuffer, MAX_PATH );
1013 
1014  // メニュー項目数を調べる
1015  if ( 0 < ::GetMenuItemCount( hMenu ) ) {
1016  // セパレータを追加する
1017  ::AppendMenuW( hMenu, MF_SEPARATOR, 0, nullptr );
1018  }
1019 
1020  // サブメニューを追加する
1021  ::AppendMenuW( hMenu, MF_POPUP, reinterpret_cast< UINT_PTR >( hSubMenu ), szBuffer );
1022  if ( 0 >= GetEnableMenuCommandCount( hSubMenu ) ) {
1023  // サブメニュー項目を無効化する
1024  ::EnableMenuItem( hMenu, ( ::GetMenuItemCount( hMenu ) - 1 ), ( MF_BYPOSITION | MFS_DISABLED ) );
1025  }
1026  }
1027 
1028  // 成功!
1029  result = true;
1030  } while ( false );
1031 
1032  // 実行結果を返す
1033  return result;
1034  }
1035 
1036  //-------------------------------------------------------------------------
1037  // パーティション表示クライアント領域取得関数
1038  bool CWndPartition::GetPartitionClientRect( RECT& rsRect ) noexcept {
1039  // 処理ブロック
1040  bool result = false;
1041  do {
1042  // クライアント領域を取得する
1043  if ( 0 == ::GetClientRect( m_hWnd, &rsRect ) ) {
1044  // 失敗!
1045  break;
1046  }
1047 
1048  // 成功!
1049  result = true;
1050  } while ( false );
1051 
1052  // 実行結果を返す
1053  return result;
1054  }
1055 
1056  //-------------------------------------------------------------------------
1057  // 最小サイズ取得関数
1058  bool CWndPartition::GetMinSize( SIZE& rsSize, int nStart ) noexcept {
1059  // 処理ブロック
1060  bool result = false;
1061  do {
1062  // エレメントウィンドウ数を取得する
1063  int nCount = m_cElementList.GetCount();
1064 
1065  // 開始インデックスを調べる
1066  if ( ( 0 > nStart ) || ( nCount < nStart ) ) {
1067  // 失敗!
1068  break;
1069  }
1070 
1071  // ドキュメントタブウィンドウを取得する
1072  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
1073  if ( nullptr != pcDocumentTab ) {
1074  // ウィンドウ表示フラグを調べる
1075  if ( !pcDocumentTab->IsShow() ) {
1076  // ドキュメントタブウィンドウポインタをクリアする
1077  pcDocumentTab = nullptr;
1078  }
1079  }
1080 
1081  // 最小サイズをクリアする
1082  rsSize.cx = 0;
1083  rsSize.cy = 0;
1084 
1085  // パーティション直角配置位置最小サイズを初期化する
1086  int nMinAngleWidth = 0;
1087  int nMinAngleHeight = 0;
1088 
1089  // 開始インデックスを調べる
1090  if ( 0 == nStart ) {
1091  // パーティション直角配置位置最小サイズを設定する
1092  nMinAngleWidth = MIN_WIDTH;
1093  nMinAngleHeight = MIN_HEIGHT;
1094  }
1095 
1096  // 巡回する
1097  for ( int nIndex = nStart; nCount > nIndex; ++nIndex ) {
1098  // エレメントウィンドウを取得する
1099  CWndPane* pcElement = m_cElementList[ nIndex ];
1100  if ( nullptr != pcElement ) {
1101  // ウィンドウ表示フラグを調べる
1102  if ( pcElement->IsShow() ) {
1103  // 最小サイズを取得する
1104  int nMinWidth = pcElement->GetMinWidth();
1105  int nMinHeight = pcElement->GetMinHeight();
1106 
1107  // パーティション配置位置を取得する
1108  EPartitionPos ePos = GetPartitionPos( pcElement );
1109 
1110  // ドキュメントタブウィンドウポインタを調べる
1111  if ( nullptr == pcDocumentTab ) {
1112  // 巡回する
1113  for ( int nIndex2 = ( nIndex + 1 );; ++nIndex2 ) {
1114  // インデックスを調べる
1115  if ( nCount <= nIndex2 ) {
1116  // パーティション配置位置を無効化する
1117  ePos = EPartitionPos::Invalid;
1118 
1119  // 終了!
1120  break;
1121  }
1122 
1123  // エレメントウィンドウを取得する
1124  CWndPane* pcElement2 = m_cElementList[ nIndex2 ];
1125  if ( nullptr != pcElement2 ) {
1126  // ウィンドウ表示フラグを調べる
1127  if ( pcElement2->IsShow() ) {
1128  // 終了!
1129  break;
1130  }
1131  }
1132  }
1133  }
1134 
1135  // パーティション配置位置を調べる
1136  switch ( ePos ) {
1137  case EPartitionPos::Left: // 左側
1138  case EPartitionPos::Right: // 右側
1139  // 最小水平サイズを更新する
1140  rsSize.cx += ( nMinWidth + SIZEBAR_THICK );
1141 
1142  // パーティション直角配置位置最小垂直サイズを更新する
1143  nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1144  break;
1145  case EPartitionPos::Top: // 上側
1146  case EPartitionPos::Bottom: // 下側
1147  // 最小垂直サイズを更新する
1148  rsSize.cy += ( nMinHeight + SIZEBAR_THICK );
1149 
1150  // パーティション直角配置位置最小水平サイズを更新する
1151  nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1152  break;
1153  default:
1154  // パーティション直角配置位置最小サイズを更新する
1155  nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1156  nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1157  break;
1158  }
1159  }
1160  }
1161  }
1162 
1163  // ドキュメントタブウィンドウポインタを調べる
1164  if ( nullptr != pcDocumentTab ) {
1165  // 最小サイズを取得する
1166  int nMinWidth = pcDocumentTab->GetMinWidth();
1167  int nMinHeight = pcDocumentTab->GetMinHeight();
1168 
1169  // パーティション直角配置位置最小サイズを更新する
1170  nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1171  nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1172  }
1173 
1174  // 最小サイズを更新する
1175  rsSize.cx = max( rsSize.cx, nMinAngleWidth );
1176  rsSize.cy = max( rsSize.cy, nMinAngleHeight );
1177 
1178  // 成功!
1179  result = true;
1180  } while ( false );
1181 
1182  // 実行結果を返す
1183  return result;
1184  }
1185 
1186  //-------------------------------------------------------------------------
1187  // 最小パーティション表示領域サイズ取得関数
1188  bool CWndPartition::GetMinPartitionSize( SIZE& rsSize ) noexcept {
1189  // 処理ブロック
1190  bool result = false;
1191  do {
1192  // サイズをクリアする
1193  rsSize.cx = 0;
1194  rsSize.cy = 0;
1195 
1196  // ドキュメントタブウィンドウを取得する
1197  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
1198  if ( nullptr != pcDocumentTab ) {
1199  // ウィンドウ表示フラグを調べる
1200  if ( !pcDocumentTab->IsShow() ) {
1201  // ドキュメントタブウィンドウポインタをクリアする
1202  pcDocumentTab = nullptr;
1203  }
1204  }
1205 
1206  // 巡回する
1207  int nMinAngleWidth = 0;
1208  int nMinAngleHeight = 0;
1209  for ( int nIndex = 0, nCount = m_cElementList.GetCount();; ++nIndex ) {
1210  // インデックスを調べる
1211  if ( nCount <= nIndex ) {
1212  // ドキュメントタブウィンドウポインタを調べる
1213  if ( nullptr != pcDocumentTab ) {
1214  // 最小サイズを取得する
1215  int nMinWidth = pcDocumentTab->GetMinWidth();
1216  int nMinHeight = pcDocumentTab->GetMinHeight();
1217 
1218  // 最小直角サイズを更新する
1219  nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1220  nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1221  }
1222 
1223  // 最小パーティション表示領域サイズを更新する
1224  rsSize.cx = max( rsSize.cx, nMinAngleWidth );
1225  rsSize.cy = max( rsSize.cy, nMinAngleHeight );
1226 
1227  // 終了!
1228  break;
1229  }
1230 
1231  // エレメントウィンドウを取得する
1232  CWndElement* pcElement = m_cElementList[ nIndex ];
1233  if ( nullptr != pcElement ) {
1234  // ウィンドウ表示フラグを調べる
1235  if ( pcElement->IsShow() ) {
1236  // パーティション配置位置を取得する
1237  EPartitionPos ePos = GetPartitionPos( pcElement );
1238 
1239  // ドキュメントタブウィンドウポインタを調べる
1240  if ( nullptr == pcDocumentTab ) {
1241  // 巡回する
1242  for ( int nIndex2 = ( nIndex + 1 );; ++nIndex2 ) {
1243  // インデックスを調べる
1244  if ( nCount <= nIndex2 ) {
1245  // パーティション配置位置を無効化する
1246  ePos = EPartitionPos::Invalid;
1247 
1248  // 終了!
1249  break;
1250  }
1251 
1252  // エレメントウィンドウを取得する
1253  CWndElement* pcElement = m_cElementList[ nIndex2 ];
1254  if ( nullptr != pcElement ) {
1255  // ウィンドウ表示フラグを調べる
1256  if ( pcElement->IsShow() ) {
1257  // 終了!
1258  break;
1259  }
1260  }
1261  }
1262  }
1263 
1264  // 最小サイズを取得する
1265  int nMinWidth = pcElement->GetMinWidth();
1266  int nMinHeight = pcElement->GetMinHeight();
1267 
1268  // パーティションサイズを取得する
1269  int nSize = pcElement->GetPartitionSize();
1270 
1271  // パーティション配置位置を調べる
1272  switch ( ePos ) {
1273  case EPartitionPos::Left: // 左側
1274  case EPartitionPos::Right: // 右側
1275  // 最小水平サイズを更新する
1276  rsSize.cx += ( nSize + SIZEBAR_THICK );
1277 
1278  // 最小直角垂直サイズを更新する
1279  nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1280  break;
1281  case EPartitionPos::Top: // 上側
1282  case EPartitionPos::Bottom: // 下側
1283  // 最小垂直サイズを更新する
1284  rsSize.cy += ( nSize + SIZEBAR_THICK );
1285 
1286  // 最小直角水平サイズを更新する
1287  nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1288  break;
1289  default:
1290  // 最小直角サイズを更新する
1291  nMinAngleWidth = max( nMinAngleWidth, ( rsSize.cx + nMinWidth ) );
1292  nMinAngleHeight = max( nMinAngleHeight, ( rsSize.cy + nMinHeight ) );
1293  break;
1294  }
1295  }
1296  }
1297  }
1298 
1299  // 成功!
1300  result = true;
1301  } while ( false );
1302 
1303  // 実行結果を返す
1304  return result;
1305  }
1306 
1307  //-------------------------------------------------------------------------
1308  // パーティション配置位置取得関数
1310  // 処理ブロック
1312  do {
1313  // エレメントウィンドウポインタを調べる
1314  if ( nullptr == pcElement ) {
1315  // 失敗!
1316  break;
1317  }
1318 
1319  // パーティション配置位置を取得する
1320  EPartitionPos ePos = pcElement->GetPartitionPos();
1321  if ( EPartitionPos::Invalid == ePos ) {
1322  // 親ペインウィンドウを取得する
1323  CWndPane* pcParent = GetPaneWindow( ::GetParent( pcElement->GetHandle() ) );
1324  if ( nullptr == pcParent ) {
1325  // 失敗!
1326  break;
1327  }
1328  // パーティションウィンドウか調べる
1329  else if ( !pcParent->IsPartition() ) {
1330  // 失敗!
1331  break;
1332  }
1333  // パーティション配置位置を調べる
1334  else switch ( pcParent->GetPartitionPos() ) {
1335  case EPartitionPos::Left: // 左側
1336  case EPartitionPos::Right: // 右側
1337  // パーティション配置位置を設定する
1338  ePos = EPartitionPos::Top;
1339  break;
1340  case EPartitionPos::Top: // 上側
1341  case EPartitionPos::Bottom: // 下側
1342  // パーティション配置位置を設定する
1343  ePos = EPartitionPos::Left;
1344  break;
1345  }
1346 
1347  // パーティション配置位置を調べる
1348  if ( EPartitionPos::Invalid == ePos ) {
1349  // 失敗!
1350  break;
1351  }
1352  }
1353 
1354  // 成功!
1355  result = ePos;
1356  } while ( false );
1357 
1358  // 実行結果を返す
1359  return result;
1360  }
1361 
1362  //-------------------------------------------------------------------------
1363  // サイズバー移動開始関数
1364  bool CWndPartition::BeginMoveSizeBar( CWndElement* pcElement ) noexcept {
1365  // 処理ブロック
1366  bool result = false;
1367  do {
1368  // エレメントウィンドウポインタを調べる
1369  m_pcElement = pcElement;
1370  if ( nullptr == m_pcElement ) {
1371  // 失敗!
1372  break;
1373  }
1374 
1375  // パーティションサイズを保存する
1377 
1378  // 最小最大パーティションサイズを初期化する
1379  m_nMinSize = 0;
1380  m_nMaxSize = 0;
1381 
1382  // エレメントウィンドウ最小サイズを取得する
1383  int nMinWidth = m_pcElement->GetMinWidth();
1384  int nMinHeight = m_pcElement->GetMinHeight();
1385 
1386  // パーティション配置位置を調べる
1388  switch ( ePos ) {
1389  case EPartitionPos::Left: // 左側
1390  case EPartitionPos::Right: // 右側
1391  // パーティション最小サイズを更新する
1392  m_nMinSize = nMinWidth;
1393  break;
1394  case EPartitionPos::Top: // 上側
1395  case EPartitionPos::Bottom: // 下側
1396  // パーティション最小サイズを更新する
1397  m_nMinSize = nMinHeight;
1398  break;
1399  }
1400 
1401  // パーティション表示クライアント領域を取得する
1402  RECT sClientRect;
1403  if ( GetPartitionClientRect( sClientRect ) ) {
1404  // スクリーン座標系に変換する
1405  ::ClientToScreen( m_hWnd, reinterpret_cast< LPPOINT >( &sClientRect.left ) );
1406  ::ClientToScreen( m_hWnd, reinterpret_cast< LPPOINT >( &sClientRect.right ) );
1407 
1408  // エレメントウィンドウ表示領域を取得する
1409  RECT sElementRect;
1410  ::GetWindowRect( m_pcElement->GetHandle(), &sElementRect );
1411 
1412  // パーティション配置位置を調べる
1413  switch ( ePos ) {
1414  case EPartitionPos::Left: // 左側
1415  // パーティション最大サイズを取得する
1416  m_nMaxSize = ( sClientRect.right - sElementRect.left - SIZEBAR_THICK );
1417  break;
1418  case EPartitionPos::Top: // 上側
1419  // パーティション最大サイズを取得する
1420  m_nMaxSize = ( sClientRect.bottom - sElementRect.top - SIZEBAR_THICK );
1421  break;
1422  case EPartitionPos::Right: // 右側
1423  // パーティション最大サイズを取得する
1424  m_nMaxSize = ( sElementRect.right - sClientRect.left - SIZEBAR_THICK );
1425  break;
1426  case EPartitionPos::Bottom: // 下側
1427  // パーティション最大サイズを取得する
1428  m_nMaxSize = ( sElementRect.bottom - sClientRect.top - SIZEBAR_THICK );
1429  break;
1430  }
1431 
1432  // エレメントウィンドウインデックスを取得する
1433  int nElement = m_cElementList.Find( m_pcElement );
1434 
1435  // 巡回する
1436  for ( int nIndex = 0, nCount = m_cElementList.GetCount();; ++nIndex ) {
1437  // インデックスを調べる
1438  if ( nCount <= nIndex ) {
1439  // ドキュメントタブウィンドウを取得する
1440  CWndDocumentTab* pcDocumentTab = GetDocumentTab();
1441  if ( nullptr != pcDocumentTab ) {
1442  // ウィンドウ表示フラグを調べる
1443  if ( pcDocumentTab->IsShow() ) {
1444  // 最小サイズを取得する
1445  int nMinWidth = pcDocumentTab->GetMinWidth();
1446  int nMinHeight = pcDocumentTab->GetMinHeight();
1447 
1448  // パーティション配置位置を調べる
1449  switch ( ePos ) {
1450  case EPartitionPos::Left: // 左側
1451  case EPartitionPos::Right: // 右側
1452  // 最大サイズを更新する
1453  m_nMaxSize -= nMinWidth;
1454  break;
1455  case EPartitionPos::Top: // 上側
1456  case EPartitionPos::Bottom: // 下側
1457  // 最大サイズを更新する
1458  m_nMaxSize -= nMinHeight;
1459  break;
1460  }
1461  }
1462  }
1463 
1464  // 終了!
1465  break;
1466  }
1467  // インデックスを調べる
1468  else if ( nElement != nIndex ) {
1469  // エレメントウィンドウを取得する
1470  CWndElement* pcElement = m_cElementList[ nIndex ];
1471  if ( nullptr != pcElement ) {
1472  // ウィンドウ表示フラグを調べる
1473  if ( pcElement->IsShow() ) {
1474  // パーティション配置位置を取得する
1475  EPartitionPos ePos2 = GetPartitionPos( pcElement );
1476 
1477  // 最小サイズを取得する
1478  int nMinWidth = pcElement->GetMinWidth();
1479  int nMinHeight = pcElement->GetMinHeight();
1480 
1481  // パーティション配置位置を調べる
1482  if ( ePos == ePos2 ) {
1483  // インデックスを調べる
1484  if ( nElement < nIndex ) {
1485  // パーティション配置位置を調べる
1486  switch ( ePos ) {
1487  case EPartitionPos::Left: // 左側
1488  case EPartitionPos::Right: // 右側
1489  // 最大サイズを更新する
1490  m_nMaxSize -= nMinWidth;
1491  break;
1492  case EPartitionPos::Top: // 上側
1493  case EPartitionPos::Bottom: // 下側
1494  // 最大サイズを更新する
1495  m_nMaxSize -= nMinHeight;
1496  break;
1497  }
1498  }
1499  }
1500  // パーティション配置位置を調べる
1501  else switch ( ePos ) {
1502  case EPartitionPos::Left: // 左側
1503  case EPartitionPos::Right: // 右側
1504  switch ( ePos2 ) {
1505  case EPartitionPos::Left: // 左側
1506  case EPartitionPos::Right: // 右側
1507  // 最大サイズを更新する
1508  m_nMaxSize -= nMinWidth;
1509  break;
1510  }
1511  break;
1512  case EPartitionPos::Top: // 上側
1513  case EPartitionPos::Bottom: // 下側
1514  switch ( ePos2 ) {
1515  case EPartitionPos::Top: // 上側
1516  case EPartitionPos::Bottom: // 下側
1517  // 最大サイズを更新する
1518  m_nMaxSize -= nMinHeight;
1519  break;
1520  }
1521  break;
1522  }
1523  }
1524  }
1525  }
1526  }
1527  }
1528 
1529  // サイズバーコントロールを取得する
1530  HWND hSizeBar = m_pcElement->GetSizeBar();
1531 
1532  // サイズバーコントロール表示位置を取得する
1533  RECT sSizeBarRect;
1534  ::GetWindowRect( hSizeBar, &sSizeBarRect );
1535 
1536  // カーソル座標としてサイズバー表示位置を取得する
1537  m_sPoint.x = sSizeBarRect.left;
1538  m_sPoint.y = sSizeBarRect.top;
1539 
1540  // リアルタイムパーティションサイズ変更フラグを調べる
1541  if ( !s_bResizePartitionRealTime ) {
1542  // サイズバーイメージコントロール表示位置を取得する
1543  int nLeft = sSizeBarRect.left;
1544  int nTop = sSizeBarRect.top;
1545  int nWidth = ( sSizeBarRect.right - nLeft );
1546  int nHeight = ( sSizeBarRect.bottom - nTop );
1547 
1548  // サイズバーイメージコントロールを表示する
1549  ::SetWindowPos( m_hSizeBarImage, HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
1550  ::UpdateWindow( m_hSizeBarImage );
1551 
1552  // サイズバーイメージコントロールを描画する
1553  HDC hDc = ::GetDC( hSizeBar );
1554  HDC hDc2 = ::GetDC( m_hSizeBarImage );
1555  ::BitBlt( hDc2, 0, 0, nWidth, nHeight, hDc, 0, 0, SRCCOPY );
1556  ::ReleaseDC( m_hSizeBarImage, hDc2 );
1557  ::ReleaseDC( m_hSizeBarImage, hDc );
1558  }
1559 
1560  // フォーカスウィンドウを設定する
1561  ::SetFocus( m_pcElement->GetHandle() );
1562 
1563  // マウスをキャプチャする
1564  ::SetCapture( m_hWnd );
1565 
1566  // 成功!
1567  result = true;
1568  } while ( false );
1569 
1570  // 実行結果を返す
1571  return result;
1572  }
1573 
1574  //-------------------------------------------------------------------------
1575  // サイズバー移動中止関数
1577  // 処理ブロック
1578  bool result = false;
1579  do {
1580  // エレメントウィンドウポインタを調べる
1581  if ( nullptr == m_pcElement ) {
1582  // 失敗!
1583  break;
1584  }
1585 
1586  // リアルタイムパーティションサイズ変更フラグを調べる
1588  // サイズバーイメージコントロールを隠す
1589  ::ShowWindow( m_hSizeBarImage, SW_HIDE );
1590 
1591  // パーティションサイズを復元する
1593 
1594  // WM_SIZEメッセージを送信する
1595  ::SendMessageW( m_hWnd, WM_SIZE, 0, 0 );
1596  ::UpdateWindow( m_hWnd );
1597  }
1598 
1599  // エレメントウィンドウポインタをクリアする
1600  m_pcElement = nullptr;
1601 
1602  // 保存パーティションサイズをクリアする
1603  m_nSize = 0;
1604 
1605  // マウスキャプチャを解放する
1606  ::ReleaseCapture();
1607 
1608  // 成功!
1609  result = true;
1610  } while ( false );
1611 
1612  // 実行結果を返す
1613  return result;
1614  }
1615 
1616  //-------------------------------------------------------------------------
1617  // サイズバー移動関数
1618  bool CWndPartition::MoveSizeBar() noexcept {
1619  // 処理ブロック
1620  bool result = false;
1621  do {
1622  // エレメントウィンドウポインタを調べる
1623  if ( nullptr == m_pcElement ) {
1624  // 失敗!
1625  break;
1626  }
1627 
1628  // カーソル移動量を取得する
1629  POINT sPoint;
1630  ::GetCursorPos( &sPoint );
1631  int dx = ( sPoint.x - m_sPoint.x );
1632  int dy = ( sPoint.y - m_sPoint.y );
1633 
1634  // パーティション配置位置を調べる
1636  int nSize = 0;
1637  switch ( ePos ) {
1638  case EPartitionPos::Left: // 左側
1639  // パーティションサイズを取得する
1640  nSize = ( m_nSize + dx );
1641  break;
1642  case EPartitionPos::Top: // 上側
1643  // パーティションサイズを取得する
1644  nSize = ( m_nSize + dy );
1645  break;
1646  case EPartitionPos::Right: // 右側
1647  // パーティションサイズを取得する
1648  nSize = ( m_nSize - dx );
1649  break;
1650  case EPartitionPos::Bottom: // 下側
1651  // パーティションサイズを取得する
1652  nSize = ( m_nSize -dy );
1653  break;
1654  }
1655 
1656  // 最小パーティションサイズを調べる
1657  if ( m_nMinSize > nSize ) {
1658  // パーティションサイズを更新する
1659  nSize = m_nMinSize;
1660  }
1661  // 最大パーティションサイズを調べる
1662  else if ( m_nMaxSize < nSize ) {
1663  // パーティションサイズを更新する
1664  nSize = m_nMaxSize;
1665  }
1666 
1667  // リアルタイムパーティションサイズ変更フラグを調べる
1669  // パーティションサイズを設定する
1670  m_pcElement->SetPartitionSize( nSize );
1671 
1672  // WM_SIZEメッセージを送信する
1673  ::SendMessageW( m_hWnd, WM_SIZE, 0, 0 );
1674  ::UpdateWindow( m_hWnd );
1675  }
1676  else {
1677  // エレメントウィンドウ表示領域を取得する
1678  RECT sElementRect;
1679  ::GetWindowRect( m_pcElement->GetHandle(), &sElementRect );
1680 
1681  // サイズバーイメージコントロール表示位置を初期化する
1682  int nLeft = sElementRect.left;
1683  int nTop = sElementRect.top;
1684 
1685  // パーティション配置位置を調べる
1686  switch ( ePos ) {
1687  case EPartitionPos::Left: // 左側
1688  // サイズバーイメージコントロール表示水平座標を取得する
1689  nLeft = ( sElementRect.left + nSize );
1690  break;
1691  case EPartitionPos::Top: // 上側
1692  // サイズバーイメージコントロール表示垂直座標を取得する
1693  nTop = ( sElementRect.top + nSize );
1694  break;
1695  case EPartitionPos::Right: // 右側
1696  // サイズバーイメージコントロール表示水平座標を取得する
1697  nLeft = ( sElementRect.right - nSize - SIZEBAR_THICK );
1698  break;
1699  case EPartitionPos::Bottom: // 下側
1700  // サイズバーイメージコントロール表示垂直座標を取得する
1701  nTop = ( sElementRect.bottom - nSize - SIZEBAR_THICK );
1702  break;
1703  }
1704 
1705  // サイズバーイメージコントロールを移動する
1706  ::SetWindowPos( m_hSizeBarImage, HWND_TOP, nLeft, nTop, 0, 0, ( SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
1707  ::UpdateWindow( m_hSizeBarImage );
1708  }
1709 
1710  // 成功!
1711  result = true;
1712  } while ( false );
1713 
1714  // 実行結果を返す
1715  return result;
1716  }
1717 
1718  //-------------------------------------------------------------------------
1719  // サイズバー移動終了関数
1721  // 処理ブロック
1722  bool result = false;
1723  do {
1724  // エレメントウィンドウポインタを調べる
1725  if ( nullptr == m_pcElement ) {
1726  // 失敗!
1727  break;
1728  }
1729 
1730  // リアルタイムパーティションサイズ変更フラグを調べる
1731  RECT sSizeBarRect;
1733  // サイズバーコントロールを取得する
1734  HWND hSizeBar = m_pcElement->GetSizeBar();
1735 
1736  // サイズバーコントロール表示位置を取得する
1737  ::GetWindowRect( hSizeBar, &sSizeBarRect );
1738  }
1739  else {
1740  // サイズバーイメージコントロール表示領域を取得する
1741  ::GetWindowRect( m_hSizeBarImage, &sSizeBarRect );
1742 
1743  // サイズバーイメージコントロールを隠す
1744  ::ShowWindow( m_hSizeBarImage, SW_HIDE );
1745  }
1746 
1747  // エレメントウィンドウ表示領域を取得する
1748  RECT sElementRect;
1749  ::GetWindowRect( m_pcElement->GetHandle(), &sElementRect );
1750 
1751  // パーティション配置位置を調べる
1753  int nSize = 0;
1754  switch ( ePos ) {
1755  case EPartitionPos::Left: // 左側
1756  // パーティションサイズを取得する
1757  nSize = ( sSizeBarRect.left - sElementRect.left );
1758  break;
1759  case EPartitionPos::Top: // 上側
1760  // パーティションサイズを取得する
1761  nSize = ( sSizeBarRect.top - sElementRect.top );
1762  break;
1763  case EPartitionPos::Right: // 右側
1764  // パーティションサイズを取得する
1765  nSize = ( sElementRect.right - sSizeBarRect.right );
1766  break;
1767  case EPartitionPos::Bottom: // 下側
1768  // パーティションサイズを取得する
1769  nSize = ( sElementRect.bottom - sSizeBarRect.bottom );
1770  break;
1771  }
1772 
1773  // パーティションサイズを設定する
1774  m_pcElement->SetPartitionSize( nSize );
1775 
1776  // WM_SIZEメッセージを送信する
1777  ::SendMessageW( m_hWnd, WM_SIZE, 0, 0 );
1778  ::UpdateWindow( m_hWnd );
1779 
1780  // エレメントウィンドウポインタをクリアする
1781  m_pcElement = nullptr;
1782 
1783  // 保存パーティションサイズをクリアする
1784  m_nSize = 0;
1785 
1786  // マウスキャプチャを解放する
1787  ::ReleaseCapture();
1788 
1789  // 成功!
1790  result = true;
1791  } while ( false );
1792 
1793  // 実行結果を返す
1794  return result;
1795  }
1796 
1797  //-------------------------------------------------------------------------
1798  // サイズバーイメージコントロール作成関数
1800  // 処理ブロック
1801  bool result = false;
1802  do {
1803  // サイズバーイメージコントロールを作成する
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 );
1806  if ( nullptr == m_hSizeBarImage ) {
1807  // 失敗!
1808  break;
1809  }
1810  // 透明度を設定する
1811  else if ( 0 == ::SetLayeredWindowAttributes( m_hSizeBarImage, 0, TRANS_SIZEBAR_IMAGE, LWA_ALPHA ) ) {
1812  // 失敗!
1813  break;
1814  }
1815 
1816  // 成功!
1817  result = true;
1818  } while ( false );
1819 
1820  // 実行結果を返す
1821  return result;
1822  }
1823 
1824  //-------------------------------------------------------------------------
1825  // サイズバーコントロール描画関数
1826  bool CWndPartition::DrawSizeBar( LPDRAWITEMSTRUCT lpDraw, EPartitionPos ePos ) noexcept {
1827  // 処理ブロック
1828  bool result = false;
1829  do {
1830  // ブラシを作成する
1831  HBRUSH hBrush = ::CreateSolidBrush( COLOR_SIZEBAR );
1832 
1833  // 塗りつぶす
1834  ::FillRect( lpDraw->hDC, &lpDraw->rcItem, hBrush );
1835 
1836  // ブラシを削除する
1837  ::DeleteObject( hBrush );
1838 
1839  // ペンを作成する
1840  HPEN hPen = ::CreatePen( PS_SOLID, 1, COLOR_SIZEBAR_BORDER );
1841  ::SelectObject( lpDraw->hDC, hPen );
1842 
1843  // パーティション配置位置を調べる
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 );
1848  switch ( ePos ) {
1849  case EPartitionPos::Left: // 左側
1850  case EPartitionPos::Right: // 右側
1851  // 上下ラインを描画する
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 ) );
1857  break;
1858  case EPartitionPos::Top: // 上側
1859  case EPartitionPos::Bottom: // 下側
1860  // 左右ラインを描画する
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 );
1866  break;
1867  }
1868 
1869  // ペンを削除する
1870  ::DeleteObject( hPen );
1871 
1872  // 成功!
1873  result = true;
1874  } while ( false );
1875 
1876  // 実行結果を返す
1877  return result;
1878  }
1879 
1880  //=========================================================================
1881  // 静的公開関数
1882  //-------------------------------------------------------------------------
1883  // サイズバーコントロール作成関数
1884  HWND CWndPartition::CreateSizeBar( HWND hParent ) noexcept {
1885  // 処理ブロック
1886  HWND result = nullptr;
1887  do {
1888  // サイズバーコントロールを作成する
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 ) {
1892  // 失敗!
1893  break;
1894  }
1895 
1896  // 成功!
1897  result = hSizeBar;
1898  } while ( false );
1899 
1900  // 実行結果を返す
1901  return result;
1902  }
1903 }
1904 
1905 #pragma managed( pop )
virtual HWND GetSizeBar() const noexcept
サイズバーコントロール取得関数
Definition: CWndPane.h:215
virtual int GetMinWidth() noexcept override
最小水平サイズ取得関数
virtual HWND & GetHandle() noexcept
ウィンドウハンドル取得関数
Definition: CWndBase.h:69
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
ドキュメントタブウィンドウ取得関数
Definition: CWndPartition.h:95
virtual bool ShowChildAll(bool bShow) noexcept override
全子ウィンドウ表示関数
static HWND CreateSizeBar(HWND hParent) noexcept
サイズバーコントロール作成関数
virtual bool IsShow() noexcept
表示フラグ取得関数
Definition: CWndPane.h:191
virtual CWndPane * GetOrderPane(int *pnOrder) noexcept override
オーダー番号ペインウィンドウ取得関数
コンテナウィンドウクラス
Definition: CWndContainer.h:31
bool m_bFocusElement
エレメントウィンドウフォーカス有効フラグ
virtual int GetMinHeight() noexcept
最小垂直サイズ取得関数
Definition: CWndPane.h:631
virtual LRESULT WmDrawItem() noexcept override
virtual LRESULT StnClicked() noexcept override
static int const MIN_HEIGHT
最小垂直サイズ
Definition: CWndPane.h:703
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
パーティションサイズ設定関数
Definition: CWndPane.h:263
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
子ウィンドウ表示領域減算関数
Definition: CWndBase.cpp:1425
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
HWND m_hWnd
ウィンドウハンドル
Definition: CWndBase.h:1539
virtual bool ResumeConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報復元関数
JSON構成情報クラス
Definition: CJsonConfig.h:31
virtual int GetMinWidth() noexcept
最小水平サイズ取得関数
Definition: CWndPane.h:620
CWndPartition(CWndElement *(*pfnCreateElement)(), wchar_t const *pszElementName) noexcept
コンストラクタ
virtual LRESULT WmSize() noexcept override
各種メッセージ処理関数
virtual bool CancelMoveSizeBar() noexcept
サイズバー移動中止関数
static int const MIN_WIDTH
最小水平サイズ
Definition: CWndPane.h:702
ウィンドウライブラリ名前空間
Definition: CommandIdDef.h:22
static int const SIZEBAR_THICK
サイズバー太さ
static bool s_bResizePartitionRealTime
リアルタイムパーティションサイズ変更フラグ
Definition: CWndPane.h:695
CWndList m_cElementList
エレメントウィンドウリスト
EPartitionPos
パーティション配置位置種別列挙体
Definition: CWndPane.h:58
static wchar_t const *const KEY_PARTITION_POS
パーティション配置位置キー文字列
Definition: CWndPartition.h:41
virtual int Find(Type const &rElement) const noexcept
検索関数
Definition: CArray.hpp:637
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
Definition: CWndBase.h:655
virtual bool GetMinPartitionSize(SIZE &rsSize) noexcept
最小パーティション表示領域サイズ取得関数
int m_nMaxSize
最大パーティションサイズ
virtual LRESULT WmMouseMove() noexcept
Definition: CWndBase.h:691
virtual LRESULT WmLButtonUp() noexcept
Definition: CWndBase.h:693
virtual int GetOrderIndex(CWndPane *pcPane=nullptr, int *pnOrder=nullptr) noexcept override
ペインウィンドウオーダー番号取得関数
JSON構成情報自動セクションブロッククラス
virtual bool ShowChildWindow(CWndPane *pcChild, bool bShow) noexcept
子ウィンドウ表示状態設定関数
Definition: CWndPane.cpp:682
virtual bool IsPartition() const noexcept
パーティションウィンドウ判別関数
Definition: CWndPane.h:228
virtual bool MoveSizeBar() noexcept
サイズバー移動関数
LPARAM m_lParam
メッセージ第2引数
Definition: CWndBase.h:1542
int m_nMinSize
最小パーティションサイズ
virtual int GetPartitionSize() const noexcept
パーティションサイズ取得関数
Definition: CWndPane.h:250
ドキュメントタブウィンドウクラス
POINT m_sPoint
カーソル座標
virtual bool GetPaintRect(RECT &rsRect) noexcept override
クライアント描画領域取得関数
virtual bool CreateSizeBarImageControl() noexcept
サイズバーイメージコントロール作成関数
パーティションウィンドウクラスヘッダファイル
virtual bool CanHideChildWindow(CWndPane *pcChild) noexcept
子ウィンドウ非表示可能状態取得関数
Definition: CWndPane.h:490
virtual bool CanDeleteChildWindow(CWndPane *pcChild) noexcept
子ウィンドウ削除可能状態取得関数
Definition: CWndPane.h:503
static wchar_t const *const KEY_PARTITION_SIZE
パーティションサイズキー文字列
Definition: CWndPartition.h:42
virtual CWndPane * GetPaneWindow(HWND hWnd) const noexcept
表示フラグ取得関数
Definition: CWndPane.h:178
virtual bool GetChildPaneInfo(SChildPaneInfo &rsChildInfo) noexcept override
子ペインウィンドウ情報取得関数
int m_nSize
保存パーティションサイズ
ペインウィンドウクラス
Definition: CWndPane.h:74
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
オーダー番号ペインウィンドウ取得関数
WPARAM m_wParam
メッセージ第1引数
Definition: CWndBase.h:1541
static COLORREF const COLOR_SIZEBAR_BORDER
サイズバーボーダー色
virtual bool DrawSizeBar(LPDRAWITEMSTRUCT lpDraw, EPartitionPos ePos) noexcept
サイズバーコントロール描画関数
virtual LRESULT WmSetCursor() noexcept
Definition: CWndBase.h:592
virtual bool DeleteChildAll() noexcept override
全子ウィンドウ削除関数
virtual bool SaveConfig(CJsonConfig &rcConfig) noexcept override
ウィンドウ構成情報保存関数
virtual bool GetPartitionClientRect(RECT &rsRect) noexcept
パーティション表示クライアント領域取得関数
JSON構成情報自動セクションブロッククラスヘッダファイル
子ペインウィンドウ情報構造体
Definition: CWndPane.h:43
virtual int GetCount() const noexcept
配列要素数取得関数
Definition: CArray.h:149
virtual bool ShowChildAll(bool bShow) noexcept override
全子ウィンドウ表示関数
virtual bool CanDeleteChildWindow(CWndPane *pcChild) noexcept override
子ウィンドウ削除可能状態取得関数
virtual EPartitionPos GetPartitionPos() const noexcept
パーティション配置位置取得関数
Definition: CWndPane.h:239