Some code refactoring and cleanup; one small bug fix
[xboard.git] / winboard / wedittags.c
index 3039f4c..965e723 100644 (file)
 #include <dlgs.h>\r
 \r
 #include "common.h"\r
-#include "winboard.h"\r
 #include "frontend.h"\r
 #include "backend.h"\r
-#include "wedittags.h"\r
+#include "winboard.h"\r
 \r
 /* Module globals */\r
 static char *editTagsText;\r
-HWND editTagsDialog = NULL;\r
 BOOL editTagsUp = FALSE;\r
 BOOL canEditTags = FALSE;\r
-int editTagsX, editTagsY, editTagsW, editTagsH;\r
 \r
 /* Imports from winboard.c */\r
 extern HINSTANCE hInst;\r
@@ -86,18 +83,18 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       GetClientRect(hDlg, &rect);\r
       sizeX = rect.right;\r
       sizeY = rect.bottom;\r
-      if (editTagsX != CW_USEDEFAULT && editTagsY != CW_USEDEFAULT &&\r
-         editTagsW != CW_USEDEFAULT && editTagsH != CW_USEDEFAULT) {\r
+      if (wpTags.x != CW_USEDEFAULT && wpTags.y != CW_USEDEFAULT &&\r
+         wpTags.width != CW_USEDEFAULT && wpTags.height != CW_USEDEFAULT) {\r
        WINDOWPLACEMENT wp;\r
-       EnsureOnScreen(&editTagsX, &editTagsY, 0, 0);\r
+       EnsureOnScreen(&wpTags.x, &wpTags.y, 0, 0);\r
        wp.length = sizeof(WINDOWPLACEMENT);\r
        wp.flags = 0;\r
        wp.showCmd = SW_SHOW;\r
        wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0;\r
-       wp.rcNormalPosition.left = editTagsX;\r
-       wp.rcNormalPosition.right = editTagsX + editTagsW;\r
-       wp.rcNormalPosition.top = editTagsY;\r
-       wp.rcNormalPosition.bottom = editTagsY + editTagsH;\r
+       wp.rcNormalPosition.left = wpTags.x;\r
+       wp.rcNormalPosition.right = wpTags.x + wpTags.width;\r
+       wp.rcNormalPosition.top = wpTags.y;\r
+       wp.rcNormalPosition.bottom = wpTags.y + wpTags.height;\r
        SetWindowPlacement(hDlg, &wp);\r
 \r
        GetClientRect(hDlg, &rect);\r