29 #include "../../idlib/precompiled.h"
32 #include "../../sys/win32/rc/guied_resource.h"
35 #include "../common/MaskEdit.h"
49 memset ( &wndClass, 0,
sizeof(wndClass) );
50 wndClass.cbSize =
sizeof(WNDCLASSEX);
51 wndClass.lpszClassName =
"GUIEDITOR_TRANSFORMER_CLASS";
53 wndClass.hbrBackground = (HBRUSH)GetStockObject( LTGRAY_BRUSH );;
54 wndClass.hCursor = LoadCursor((HINSTANCE)
NULL, IDC_ARROW);
55 wndClass.lpszMenuName =
NULL;
57 RegisterClassEx ( &wndClass );
59 mWnd = CreateWindowEx ( WS_EX_TOOLWINDOW,
60 "GUIEDITOR_TRANSFORMER_CLASS",
62 WS_SYSMENU|WS_CAPTION|WS_POPUP|WS_OVERLAPPED|WS_BORDER|WS_CLIPSIBLINGS|WS_CHILD,
79 GetWindowRect ( parent, &rParent );
80 GetWindowRect (
mWnd, &rTrans );
81 SetWindowPos (
mWnd, NULL,
82 rParent.right - 10 - (rTrans.right-rTrans.left),
83 rParent.bottom - 10 - (rTrans.bottom-rTrans.top),
85 SWP_NOZORDER|SWP_NOSIZE );
118 cs = (LPCREATESTRUCT) lParam;
120 SetWindowLong ( hWnd, GWL_USERDATA, (
LONG)trans );
130 GetWindowRect ( trans->
mWnd, &rWindow );
131 GetClientRect ( trans->
mWnd, &rClient );
132 GetWindowRect ( trans->
mDlg, &rDlg );
134 SetWindowPos ( trans->
mWnd,
NULL, 0, 0,
135 (rWindow.right-rWindow.left)-(rClient.right-rClient.left) + (rDlg.right-rDlg.left),
136 (rWindow.bottom-rWindow.top)-(rClient.bottom-rClient.top) + (rDlg.bottom-rDlg.top),
139 ShowWindow ( trans->
mDlg, SW_SHOW );
140 UpdateWindow ( trans->
mDlg );
146 return DefWindowProc ( hWnd, msg, wParam, lParam );
166 SetWindowLong ( hWnd, GWL_USERDATA, lParam );
176 if ( LOWORD ( wParam ) == IDOK )
178 SendMessage ( hWnd, WM_NEXTDLGCTL, 0, 0 );
180 else if ( HIWORD ( wParam ) == EN_KILLFOCUS && trans && trans->
mWorkspace )
184 GetWindowText ( GetDlgItem ( hWnd, LOWORD(wParam) ), temp, 64 );
185 value = atoi ( temp );
195 rect.
x -= screenRect.
x;
196 rect.
y -= screenRect.
y;
199 switch ( LOWORD ( wParam ) )
202 if ( value - rect[0] )
209 if ( value - rect[1] )
216 if ( value - rect[2] )
223 if ( value - rect[3] )
246 ShowWindow (
mWnd, visible?SW_SHOW:SW_HIDE );
291 rect.
x -= screenRect.
x;
292 rect.
y -= screenRect.
y;
324 LPMSG lpMsg = (LPMSG) lParam;
326 if ( nCode >= 0 && PM_REMOVE == wParam )
329 if ( lpMsg->message != WM_SYSCHAR && (lpMsg->message >= WM_KEYFIRST && lpMsg->message <= WM_KEYLAST) )
331 if ( IsDialogMessage(
gTransDlg, lpMsg) )
337 lpMsg->message = WM_NULL;
344 return CallNextHookEx(
gTransHook, nCode, wParam, lParam);
#define IDD_GUIED_TRANSFORMER
GLsizei const GLfloat * value
void SetTransformerVisible(bool vis)
CONST PIXELFORMATDESCRIPTOR UINT
idWindow * GetBottomMost(void)
void SetWindowPlacement(const char *name, HWND hwnd)
bool GetWindowPlacement(const char *name, HWND hwnd)
HINSTANCE GetInstance(void)
rvGEOptions & GetOptions(void)
idRectangle & GetScreenRect(void)
#define IDC_GUIED_ITEMRECTW
#define IDC_GUIED_ITEMRECTH
rvGESelectionMgr & GetSelectionMgr(void)
#define IDC_GUIED_ITEMRECTX
idRectangle & GetRect(void)
int ToolWindowActivate(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
static rvGEWindowWrapper * GetWrapper(idWindow *window)
void AddModifierSize(const char *modName, float l, float t, float r, float b, bool snap)
idVec2 & WindowToWorkspace(idVec2 &point)
void NumberEdit_Attach(HWND hWnd)
void AddModifierMove(const char *modName, float x, float y, bool snap)
char * va(const char *fmt,...)
virtual void ActivateTool(bool active)=0
#define IDC_GUIED_ITEMRECTY