1 #include "FirstUiBuilder.h"
2 #include "SelectRegion.h"
5 #include "UIDirect3DPrimaryCanvas.h"
7 #include "UIImageFrame.h"
8 #include "UIImageStyle.h"
10 #include "UnicodeUtils.h"
14 SelectRegionDialogBox
*SelectRegionDialogBox::sThis
= 0;
16 extern UIColor gHighlightOutlineColor
;
17 extern UIColor gHighlightFillColor
;
20 extern void AddTooltipFromControlID( HWND TooltipWindow
, HWND ParentWindow
, UINT ControlID
, char *Tooltip
);
21 extern void ClearDefPushButtonLook( HWND hwndDlg
, UINT nControlID
);
22 extern void MoveSizeDlgControl( HWND hwnd
, UINT itemID
, UIPoint Move
, UIPoint Size
);
24 static const float cMaxZoomLevel
= 8.0f
;
26 //-----------------------------------------------------------------
28 SelectRegionDialogBox::SelectRegionDialogBox( void ) :
39 mSelectionRect
.SetUseBounds (true);
42 //-----------------------------------------------------------------
44 bool SelectRegionDialogBox::EditProperty( HWND hwndParent
, UIImageStyle
*theStyle
, UIString
&Value
)
50 mStyle
= UI_ASOBJECT(UIImageStyle
, theStyle
->DuplicateObject());
51 const UICanvas
* const theCanvas
= theStyle
->GetSourceCanvas();
56 theCanvas
->GetSize (mImageSize
);
58 const UIRect
bounds (mImageSize
);
59 mSelectionRect
.SetBounds (bounds
);
61 mImage
->SetCanvas (const_cast<UICanvas
*>(theCanvas
));
62 mImage
->SetSourceRect (&bounds
);
64 mImage
->SetSize( mImageSize
);
65 UIUtils::ParseRect( Value
, mRegion
);
66 mSelectionRect
.SetRect( mRegion
);
70 if( DialogBox( GetModuleHandle(0), MAKEINTRESOURCE(IDD_SELECTREGION
), hwndParent
, StaticDialogProc
) )
72 UIUtils::FormatRect( Value
, mRegion
);
82 //-----------------------------------------------------------------
84 bool SelectRegionDialogBox::EditProperty( HWND hwndParent
, UIImage
*theImage
, UIString
&Value
)
88 mImage
= UI_ASOBJECT(UIImage
, theImage
->DuplicateObject());
90 const UICanvas
*theCanvas
= mImage
->GetCanvas();
95 const UIRect
src( 0, 0, theCanvas
->GetWidth(), theCanvas
->GetHeight() );
96 mImage
->SetSourceRect( &src
);
97 mImageSize
= UISize( theCanvas
->GetWidth(), theCanvas
->GetHeight() );
98 mImage
->SetColor(UIColor::white
);
99 mImage
->SetBackgroundOpacity(0.0f
);
100 mImage
->SetMaximumSize( mImageSize
);
101 mImage
->SetSize( mImageSize
);
102 mSelectionRect
.SetBounds ( UIRect ( 0, 0, mImageSize
.x
, mImageSize
.y
) );
103 UIUtils::ParseRect( Value
, mRegion
);
104 mSelectionRect
.SetRect( mRegion
);
108 if( DialogBox( GetModuleHandle(0), MAKEINTRESOURCE(IDD_SELECTREGION
), hwndParent
, StaticDialogProc
) )
110 UIUtils::FormatRect( Value
, mRegion
);
120 //-----------------------------------------------------------------
122 void SelectRegionDialogBox::UpdateTextbox( void )
125 UIUtils::FormatRect( RectString
, mRegion
);
126 SetDlgItemText( mHwnd
, IDC_VALUE
, Unicode::wideToNarrow (RectString
).c_str() );
129 //-----------------------------------------------------------------
131 void SelectRegionDialogBox::UpdateSelectionRect( void )
133 mSelectionRect
.SetRect( mRegion
);
136 //-----------------------------------------------------------------
138 void SelectRegionDialogBox::ReadRectFromTextbox( void )
140 HWND hControl
= GetDlgItem( mHwnd
, IDC_VALUE
);
141 long TextLength
= SendMessage( hControl
, WM_GETTEXTLENGTH
, 0, 0 ) + 1;
142 char *Buffer
= new char[ TextLength
];
144 SendMessage( hControl
, WM_GETTEXT
, TextLength
, (LPARAM
)Buffer
);
146 UIUtils::ParseRect( Buffer
, mRegion
);
149 //-----------------------------------------------------------------
151 void SelectRegionDialogBox::EnableControls( void )
153 if( mZoomLevel
<= 1.0f
)
155 EnableWindow( GetDlgItem( mHwnd
, IDC_ZOOMIN
), TRUE
);
156 EnableWindow( GetDlgItem( mHwnd
, IDC_ZOOMOUT
), FALSE
);
158 else if( mZoomLevel
>= cMaxZoomLevel
)
160 EnableWindow( GetDlgItem( mHwnd
, IDC_ZOOMIN
), FALSE
);
161 EnableWindow( GetDlgItem( mHwnd
, IDC_ZOOMOUT
), TRUE
);
165 EnableWindow( GetDlgItem( mHwnd
, IDC_ZOOMIN
), TRUE
);
166 EnableWindow( GetDlgItem( mHwnd
, IDC_ZOOMOUT
), TRUE
);
170 //-----------------------------------------------------------------
172 void SelectRegionDialogBox::UpdateScrollbars( HWND hwnd
, const UIPoint
* center
)
174 UISize
ZoomedImageSize( UIScalar( float(mImageSize
.x
) * mZoomLevel
), UIScalar( float(mImageSize
.y
) * mZoomLevel
) );
177 GetWindowRect( hwnd
, &rc
);
185 if( rc
.right
< ZoomedImageSize
.x
|| rc
.bottom
< ZoomedImageSize
.y
)
186 GetClientRect( hwnd
, &rc
);
188 UISize
NewSize( rc
.right
, rc
.bottom
);
190 //-----------------------------------------------------------------
191 //-- center on the specified pixel
195 mScrollOffset
.x
= static_cast<long>(static_cast<float>(center
->x
) * mZoomLevel
) - rc
.right
/ 2;
196 mScrollOffset
.y
= static_cast<long>(static_cast<float>(center
->y
) * mZoomLevel
) - rc
.bottom
/ 2;
199 // Validate scroll positions
200 if( mScrollOffset
.x
+ NewSize
.x
> ZoomedImageSize
.x
)
201 mScrollOffset
.x
= ZoomedImageSize
.x
- NewSize
.x
;
203 if( mScrollOffset
.x
< 0 )
206 if( mScrollOffset
.y
+ NewSize
.y
> ZoomedImageSize
.y
)
207 mScrollOffset
.y
= ZoomedImageSize
.y
- NewSize
.y
;
209 if( mScrollOffset
.y
< 0 )
213 si
.cbSize
= sizeof( si
);
214 si
.fMask
= SIF_PAGE
| SIF_POS
| SIF_RANGE
;
215 si
.nPage
= NewSize
.x
;
217 si
.nMax
= ZoomedImageSize
.x
;
218 si
.nPos
= mScrollOffset
.x
;
220 SetScrollInfo( hwnd
, SB_HORZ
, &si
, TRUE
);
222 si
.cbSize
= sizeof( si
);
223 si
.fMask
= SIF_PAGE
| SIF_POS
| SIF_RANGE
;
224 si
.nPage
= NewSize
.y
;
226 si
.nMax
= ZoomedImageSize
.y
;
227 si
.nPos
= mScrollOffset
.y
;
229 SetScrollInfo( hwnd
, SB_VERT
, &si
, TRUE
);
232 //-----------------------------------------------------------------
234 void SelectRegionDialogBox::UpdateCanvasScrollPosition( HWND hwnd
, UINT uMsg
, WPARAM wParam
)
236 UISize
ZoomedImageSize( UIScalar( float(mImageSize
.x
) * mZoomLevel
), UIScalar( float(mImageSize
.y
) * mZoomLevel
) );
239 GetWindowRect( hwnd
, &rc
);
247 if( rc
.right
< ZoomedImageSize
.x
|| rc
.bottom
< ZoomedImageSize
.y
)
248 GetClientRect( hwnd
, &rc
);
250 UISize
NewSize( rc
.right
, rc
.bottom
);
252 if( uMsg
== WM_HSCROLL
)
254 switch( LOWORD( wParam
) )
261 mScrollOffset
.x
= ZoomedImageSize
.x
- NewSize
.x
;
265 mScrollOffset
.x
-= int( mZoomLevel
);
267 if( mScrollOffset
.x
< 0 )
272 mScrollOffset
.x
+= int( mZoomLevel
);
274 if( mScrollOffset
.x
> ZoomedImageSize
.x
- NewSize
.x
)
275 mScrollOffset
.x
= ZoomedImageSize
.x
- NewSize
.x
;
280 mScrollOffset
.x
-= int( 10.0f
* mZoomLevel
);
282 if( mScrollOffset
.x
< 0 )
288 mScrollOffset
.x
+= int( 10.0f
* mZoomLevel
);
290 if( mScrollOffset
.x
> ZoomedImageSize
.x
- NewSize
.x
)
291 mScrollOffset
.x
= ZoomedImageSize
.x
- NewSize
.x
;
297 si
.cbSize
= sizeof( si
);
298 si
.fMask
= SIF_TRACKPOS
;
300 GetScrollInfo( hwnd
, SB_HORZ
, &si
);
301 mScrollOffset
.x
= si
.nTrackPos
;
307 switch( LOWORD( wParam
) )
314 mScrollOffset
.y
= ZoomedImageSize
.y
- NewSize
.y
;
318 mScrollOffset
.y
-= int( mZoomLevel
);
320 if( mScrollOffset
.y
< 0 )
325 mScrollOffset
.y
+= int( mZoomLevel
);
327 if( mScrollOffset
.y
> ZoomedImageSize
.y
- NewSize
.y
)
328 mScrollOffset
.y
= ZoomedImageSize
.y
- NewSize
.y
;
333 mScrollOffset
.y
-= int( 10.0f
* mZoomLevel
);
335 if( mScrollOffset
.y
< 0 )
341 mScrollOffset
.y
+= int( 10.0f
* mZoomLevel
);
343 if( mScrollOffset
.y
> ZoomedImageSize
.y
- NewSize
.y
)
344 mScrollOffset
.y
= ZoomedImageSize
.y
- NewSize
.y
;
350 si
.cbSize
= sizeof( si
);
351 si
.fMask
= SIF_TRACKPOS
;
353 GetScrollInfo( hwnd
, SB_VERT
, &si
);
354 mScrollOffset
.y
= si
.nTrackPos
;
360 //-----------------------------------------------------------------
362 void SelectRegionDialogBox::SizeToContent( void )
368 GetWindowRect( mHwnd
, &rcDialog
);
369 GetWindowRect( GetDlgItem( mHwnd
, IDC_CANVAS
), &rcImage
);
371 // Note, I'm not using this rect as a rect, the right and bottom elements
372 // are actually the width and height.
373 rcDialog
.right
-= rcDialog
.left
; rcDialog
.left
= 0;
374 rcDialog
.bottom
-= rcDialog
.top
; rcDialog
.top
= 0;
376 rcImage
.right
-= rcImage
.left
; rcImage
.left
= 0;
377 rcImage
.bottom
-= rcImage
.top
; rcImage
.top
= 0;
379 UISize
ZoomedImageSize( UIScalar( float(mImageSize
.x
) * mZoomLevel
), UIScalar( float(mImageSize
.y
) * mZoomLevel
) );
381 while( (ZoomedImageSize
.x
< rcImage
.right
) && (ZoomedImageSize
.y
< rcImage
.bottom
) )
385 ZoomedImageSize
.x
= UIScalar( float(mImageSize
.x
) * mZoomLevel
);
386 ZoomedImageSize
.y
= UIScalar( float(mImageSize
.y
) * mZoomLevel
);
388 if( mZoomLevel
>= cMaxZoomLevel
)
390 mZoomLevel
= cMaxZoomLevel
;
395 rcDialog
.right
= rcDialog
.right
- rcImage
.right
+ ZoomedImageSize
.x
+ 1;
396 rcDialog
.bottom
= rcDialog
.bottom
- rcImage
.bottom
+ ZoomedImageSize
.y
+ 1;
398 SystemParametersInfo( SPI_GETWORKAREA
, 0, &rcDesktop
, 0 );
401 rcDialog
.left
= (rcDesktop
.right
- rcDesktop
.left
) / 2 + rcDesktop
.left
- rcDialog
.right
/ 2;
402 rcDialog
.top
= (rcDesktop
.bottom
- rcDesktop
.top
) / 2 + rcDesktop
.top
- rcDialog
.bottom
/ 2;
404 MoveWindow( mHwnd
, rcDialog
.left
, rcDialog
.top
, rcDialog
.right
, rcDialog
.bottom
, TRUE
);
407 //-----------------------------------------------------------------
409 void SelectRegionDialogBox::ShowZoomLevel( void )
413 if( mZoomLevel
!= 1.0f
)
414 sprintf( Buffer
, "(%d%% Zoom)", int(mZoomLevel
* 100.0f
) );
416 sprintf( Buffer
, "(Actual Pixels)" );
418 SetDlgItemText( mHwnd
, IDC_ZOOMLEVEL
, Buffer
);
421 //-----------------------------------------------------------------
423 LPARAM
SelectRegionDialogBox::InverseTranslateLParam( LPARAM lParam
)
425 long x
= LOWORD( lParam
);
426 long y
= HIWORD( lParam
);
428 x
+= mScrollOffset
.x
;
429 y
+= mScrollOffset
.y
;
431 x
= static_cast<long>( static_cast<float>(x
) / mZoomLevel
);
432 y
= static_cast<long>( static_cast<float>(y
) / mZoomLevel
);
434 return MAKELPARAM( x
, y
);
437 //-----------------------------------------------------------------
439 BOOL CALLBACK
SelectRegionDialogBox::DialogProc( HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
447 UpdateSelectionRect();
449 HWND theCanvasWindow
= GetDlgItem( hwndDlg
, IDC_CANVAS
);
451 if( theCanvasWindow
)
454 SetWindowLong( theCanvasWindow
, GWL_WNDPROC
, (LONG
)StaticCanvasProc
);
455 SendMessage( theCanvasWindow
, WM_APP
, 0, 0 );
458 AddTooltipFromControlID( gTooltip
, hwndDlg
, IDC_ZOOMIN
, "Zoom In" );
459 AddTooltipFromControlID( gTooltip
, hwndDlg
, IDC_ZOOMOUT
, "Zoom Out" );
461 SendDlgItemMessage( hwndDlg
, IDC_ZOOMIN
, BM_SETIMAGE
, IMAGE_ICON
,
462 (LPARAM
)LoadImage( GetModuleHandle(0), MAKEINTRESOURCE(IDI_ZOOMIN
), IMAGE_ICON
, 16, 16, 0 ) );
463 SendDlgItemMessage( hwndDlg
, IDC_ZOOMOUT
, BM_SETIMAGE
, IMAGE_ICON
,
464 (LPARAM
)LoadImage( GetModuleHandle(0), MAKEINTRESOURCE(IDI_ZOOMOUT
), IMAGE_ICON
, 16, 16, 0 ) );
466 SendDlgItemMessage( hwndDlg
, IDC_DRAWHIGHLIGHT
, BM_SETIMAGE
, IMAGE_ICON
,
467 (LPARAM
)LoadImage( GetModuleHandle(0), MAKEINTRESOURCE(IDI_DRAWHIGHLIGHT
), IMAGE_ICON
, 16, 16, 0 ) );
468 CheckDlgButton( hwndDlg
, IDC_DRAWHIGHLIGHT
, BST_CHECKED
);
473 GetClientRect( hwndDlg
, &rcClient
);
474 SendMessage( hwndDlg
, WM_SIZE
, 0, MAKELPARAM( rcClient
.right
, rcClient
.bottom
) );
483 // Equivalent to pressing cancel
484 EndDialog( hwndDlg
, 0 );
487 case WM_GETMINMAXINFO
:
489 LPMINMAXINFO pmmi
= (LPMINMAXINFO
)lParam
;
494 rc
.right
= mInitialSize
.x
;
495 rc
.bottom
= mInitialSize
.y
;
497 AdjustWindowRectEx( &rc
, GetWindowLong( hwndDlg
, GWL_STYLE
), TRUE
, GetWindowLong( hwndDlg
, GWL_EXSTYLE
) );
498 pmmi
->ptMinTrackSize
.x
= rc
.right
- rc
.left
;
499 pmmi
->ptMinTrackSize
.y
= rc
.bottom
- rc
.top
;
508 NewSize
.x
= LOWORD(lParam
);
509 NewSize
.y
= HIWORD(lParam
);
511 if( (NewSize
.x
== 0) || (NewSize
.y
== 0) )
514 if( mOldSize
.x
!= 0 )
516 UISize DeltaSize
= NewSize
- mOldSize
;
518 MoveSizeDlgControl( hwndDlg
, IDC_CANVAS
, UIPoint(0,0), UIPoint( DeltaSize
.x
, DeltaSize
.y
) );
519 MoveSizeDlgControl( hwndDlg
, IDOK
, UIPoint(DeltaSize
.x
,0), UIPoint( 0, 0 ) );
520 MoveSizeDlgControl( hwndDlg
, IDCANCEL
, UIPoint(DeltaSize
.x
,0), UIPoint( 0, 0 ) );
521 MoveSizeDlgControl( hwndDlg
, IDC_DRAWHIGHLIGHT
, UIPoint(DeltaSize
.x
,DeltaSize
.y
), UIPoint( 0, 0 ) );
522 MoveSizeDlgControl( hwndDlg
, IDC_ZOOMIN
, UIPoint(DeltaSize
.x
,DeltaSize
.y
), UIPoint( 0, 0 ) );
523 MoveSizeDlgControl( hwndDlg
, IDC_ZOOMOUT
, UIPoint(DeltaSize
.x
,DeltaSize
.y
), UIPoint( 0, 0 ) );
524 MoveSizeDlgControl( hwndDlg
, IDC_ZOOMLEVEL
, UIPoint(DeltaSize
.x
,DeltaSize
.y
), UIPoint( 0, 0 ) );
525 MoveSizeDlgControl( hwndDlg
, IDC_VALUELABEL
, UIPoint(0,DeltaSize
.y
), UIPoint( 0, 0 ) );
526 MoveSizeDlgControl( hwndDlg
, IDC_VALUE
, UIPoint(0,DeltaSize
.y
), UIPoint( DeltaSize
.x
, 0 ) );
529 mInitialSize
= NewSize
;
537 if( LOWORD( wParam
) == IDOK
)
539 ReadRectFromTextbox();
540 EndDialog( hwndDlg
, 1 );
542 else if( LOWORD( wParam
) == IDCANCEL
)
543 EndDialog( hwndDlg
, 0 );
544 else if( LOWORD( wParam
) == IDC_DRAWHIGHLIGHT
)
546 mDrawHighlight
= IsDlgButtonChecked( hwndDlg
, IDC_DRAWHIGHLIGHT
) != 0;
547 SetFocus( GetDlgItem( hwndDlg
, IDC_VALUE
) );
548 InvalidateRect( GetDlgItem( hwndDlg
, IDC_CANVAS
), 0, FALSE
);
550 else if( LOWORD( wParam
) == IDC_ZOOMIN
)
552 if( HIWORD(wParam
) == BN_CLICKED
)
554 SetFocus( GetDlgItem( hwndDlg
, IDC_VALUE
) );
555 ClearDefPushButtonLook( hwndDlg
, IDC_ZOOMIN
);
558 if( mZoomLevel
> cMaxZoomLevel
)
559 mZoomLevel
= cMaxZoomLevel
;
563 const UIRect
& rect
= mSelectionRect
.GetRect ();
564 const UIPoint
center ((rect
.left
+ rect
.right
) / 2, (rect
.top
+ rect
.bottom
) / 2);
566 UpdateScrollbars( GetDlgItem( hwndDlg
, IDC_CANVAS
), ¢er
);
567 InvalidateRect( GetDlgItem( hwndDlg
, IDC_CANVAS
), 0, FALSE
);
570 else if( LOWORD( wParam
) == IDC_ZOOMOUT
)
572 if( HIWORD(wParam
) == BN_CLICKED
)
574 SetFocus( GetDlgItem( hwndDlg
, IDC_VALUE
) );
575 ClearDefPushButtonLook( hwndDlg
, IDC_ZOOMOUT
);
578 if( mZoomLevel
< 1.0f
)
583 const UIRect
& rect
= mSelectionRect
.GetRect ();
584 const UIPoint
center ((rect
.left
+ rect
.right
) / 2, (rect
.top
+ rect
.bottom
) / 2);
586 UpdateScrollbars( GetDlgItem( hwndDlg
, IDC_CANVAS
), ¢er
);
587 InvalidateRect( GetDlgItem( hwndDlg
, IDC_CANVAS
), 0, FALSE
);
590 else if( LOWORD( wParam
) == IDC_VALUE
)
592 if( HIWORD( wParam
) == EN_CHANGE
)
594 ReadRectFromTextbox();
595 UpdateSelectionRect();
596 InvalidateRect( GetDlgItem( hwndDlg
, IDC_CANVAS
), 0, FALSE
);
607 //-----------------------------------------------------------------
609 BOOL CALLBACK
SelectRegionDialogBox::CanvasProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
614 return DLGC_WANTARROWS
;
618 BOOL rc
= DefWindowProc( hwnd
, uMsg
, wParam
, lParam
);
620 if( rc
== HTNOWHERE
)
626 case WM_MOUSEACTIVATE
:
632 GetClientRect( hwnd
, &rc
);
633 mDisplay
= new UIDirect3DPrimaryCanvas( UISize( rc
.right
, rc
.bottom
), hwnd
, false );
634 mDisplay
->Attach( 0 );
636 DWORD dwStyle
= GetWindowLong( hwnd
, GWL_STYLE
);
638 dwStyle
|= WS_HSCROLL
;
639 dwStyle
|= WS_VSCROLL
;
641 SetWindowLong( hwnd
, GWL_STYLE
, dwStyle
);
642 SendMessage( hwnd
, WM_SIZE
, 0, MAKELPARAM( rc
.right
, rc
.bottom
) );
648 UISize
NewSize( LOWORD(lParam
), HIWORD(lParam
) );
649 UISize
ZoomedImageSize( UIScalar( float(mImageSize
.x
) * mZoomLevel
), UIScalar( float(mImageSize
.y
) * mZoomLevel
) );
650 mDisplay
->SetSize( NewSize
);
652 UpdateScrollbars( hwnd
);
659 UpdateCanvasScrollPosition( hwnd
, uMsg
, wParam
);
660 UpdateScrollbars( hwnd
);
661 InvalidateRect( hwnd
, 0, FALSE
);
669 BeginPaint( hwnd
, &ps
);
670 EndPaint( hwnd
, &ps
);
672 if( mDisplay
->BeginRendering() )
675 DWORD dwFillColor
= GetSysColor( COLOR_3DFACE
);
676 dwFillColor
= 0xff666666;
678 mDisplay
->PushState();
680 FillColor
.r
= GetRValue( dwFillColor
);
681 FillColor
.g
= GetGValue( dwFillColor
);
682 FillColor
.b
= GetBValue( dwFillColor
);
685 mDisplay
->SetOpacity( 1.0f
);
686 mDisplay
->ClearTo( FillColor
, UIRect (0, 0, mDisplay
->GetWidth (), mDisplay
->GetHeight () ));
687 mDisplay
->Translate( -mScrollOffset
);
689 mDisplay
->Scale( mZoomLevel
, mZoomLevel
);
690 mImage
->Render( *mDisplay
);
696 mSelectionRect
.SetFillColor( gHighlightFillColor
);
697 mSelectionRect
.SetOutlineColor( gHighlightOutlineColor
);
698 mSelectionRect
.SetCanDrawHandles( true );
699 mSelectionRect
.Render( mDisplay
);
702 mDisplay
->EndRendering();
705 mDisplay
->PopState();
714 mSelectionRect
.ProcessMessage( hwnd
, uMsg
, wParam
, InverseTranslateLParam( lParam
) );
715 InvalidateRect( hwnd
, 0, FALSE
);
716 mRegion
= mSelectionRect
.GetRect();
724 mSelectionRect
.ProcessMessage( hwnd
, uMsg
, wParam
, InverseTranslateLParam( lParam
) );
725 InvalidateRect( hwnd
, 0, FALSE
);
726 mRegion
= mSelectionRect
.GetRect();
732 mSelectionRect
.ProcessMessage( hwnd
, uMsg
, wParam
, InverseTranslateLParam( lParam
) );
733 InvalidateRect( hwnd
, 0, FALSE
);
734 mRegion
= mSelectionRect
.GetRect();
744 return DefWindowProc( hwnd
, uMsg
, wParam
, lParam
);
747 return DefWindowProc( hwnd
, uMsg
, wParam
, lParam
);
751 //-----------------------------------------------------------------
753 BOOL CALLBACK
SelectRegionDialogBox::StaticCanvasProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
755 SelectRegionDialogBox
*thisCache
= static_cast<SelectRegionDialogBox
*>( GetProp( hwnd
, "this" ) );
760 SetProp( hwnd
, "this", sThis
);
763 return thisCache
->CanvasProc( hwnd
, uMsg
, wParam
, lParam
);
766 //-----------------------------------------------------------------
768 BOOL CALLBACK
SelectRegionDialogBox::StaticDialogProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
770 SelectRegionDialogBox
*thisCache
= static_cast<SelectRegionDialogBox
*>( GetProp( hwnd
, "this" ) );
775 SetProp( hwnd
, "this", sThis
);
778 return thisCache
->DialogProc( hwnd
, uMsg
, wParam
, lParam
);