/* INCLUDES *********************************************************/
#include <windows.h>
+#include <commctrl.h>
+#include <tchar.h>
#include "globalvar.h"
-#include "drawing.h"
#include "history.h"
-#include "mouse.h"
/* FUNCTIONS ********************************************************/
SetCapture(hwnd);
break;
case WM_MOUSEMOVE:
- // TODO: print things in the status bar
+ if (resizing)
+ {
+ TCHAR sizeStr[100];
+ short xRel;
+ short yRel;
+ xRel = ((short)LOWORD(lParam)-xOrig)*1000/zoom;
+ yRel = ((short)HIWORD(lParam)-yOrig)*1000/zoom;
+ if (hwnd==hSizeboxLeftTop)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes-yRel);
+ if (hwnd==hSizeboxCenterTop)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes-yRel);
+ if (hwnd==hSizeboxRightTop)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes-yRel);
+ if (hwnd==hSizeboxLeftCenter)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes);
+ if (hwnd==hSizeboxRightCenter)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes);
+ if (hwnd==hSizeboxLeftBottom)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes+yRel);
+ if (hwnd==hSizeboxCenterBottom)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes+yRel);
+ if (hwnd==hSizeboxRightBottom)
+ _stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes+yRel);
+ SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)sizeStr);
+ }
break;
case WM_LBUTTONUP:
if (resizing)
cropReversible(imgXRes, imgYRes+yRel, 0, 0);
if (hwnd==hSizeboxRightBottom)
cropReversible(imgXRes+xRel, imgYRes+yRel, 0, 0);
+ SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)_T(""));
}
break;