Ver código fonte

update 9/20 22

XKSYU2021 1 mês atrás
pai
commit
1e79703955

+ 6 - 1
Ui for BDS/ID.h

@@ -44,4 +44,9 @@
 #define ID_LOG_CLEAR 50102
 
 #define ID_FILE_Config 5100
-#define ID_FILE_Backup 5200
+#define ID_FILE_Backup 5200
+
+#define ID_FILE_Bk_Level 5201
+#define ID_FILE_Bk_All 5202
+#define ID_FILE_Bk_Cover 5203
+#define ID_FILE_Bk_Open 5204

+ 1 - 1
Ui for BDS/MAIN.cpp

@@ -199,7 +199,7 @@ int WINAPI WinMain(
     HWND hFIbk = CreateWindow(
         L"BUTTON", L"备份存档",
         WS_VISIBLE | WS_CHILD,
-        210, 510, 110, 40,
+        200, 510, 110, 40,
         hWnd, (HMENU)ID_FILE_Backup,
         (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE), NULL
     );

+ 1 - 1
Ui for BDS/SharedValue.h

@@ -7,7 +7,7 @@
 #define C(x) (x "\n")
 
 extern HANDLE UIw_key, BDSr_key, UIr_log, BDSw_log;
-extern HWND hWnd, hLog, hTime, hWeather, hPlayer, hConfig;
+extern HWND hWnd, hLog, hTime, hWeather, hPlayer, hConfig, hBackup;
 
 #define TITLE _T("UI for BDS")
 

+ 79 - 1
Ui for BDS/childProc.cpp

@@ -498,6 +498,84 @@ LRESULT CALLBACK PlayerProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
         return DefWindowProc(hWnd1, msg, wParam, lParam);
     }
     return 0;
-    return 0;
 }
 
+LRESULT CALLBACK BkProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam) {
+    switch(msg)
+    {
+    case WM_CREATE:
+    {
+        HWND hLabel_1 = CreateWindow(
+            L"STATIC", L"备份选项",
+            WS_VISIBLE | WS_CHILD,
+            20, 20, 100, 30,
+            hWnd1, NULL,
+            (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
+        );
+        HWND hLevelBk = CreateWindow(
+            L"BUTTON", L"备份存档",
+            WS_VISIBLE | WS_CHILD,
+            30,70,  110, 40,
+            hWnd1, H_ ID_FILE_Bk_Level,
+            (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
+        );
+        HWND hAllBk = CreateWindow(
+            L"BUTTON", L"备份全部文件",
+            WS_VISIBLE | WS_CHILD,
+            150,70,  170, 40,
+            hWnd1, H_ ID_FILE_Bk_All,
+            (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
+        );
+        HWND hBkCover = CreateWindow(
+            L"BUTTON", L"覆盖相应先前备份",
+            WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
+            30, 125, 210, 40,
+            hWnd1, H_ ID_FILE_Bk_Cover,
+            (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
+        );
+        HWND hLabel_2 = CreateWindow(
+            L"STATIC", L"还原选项(应用会自动识别类型)",
+            WS_VISIBLE | WS_CHILD,
+            20, 200, 290, 30,
+            hWnd1, NULL,
+            (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
+        );
+        HWND hRec = CreateWindow(
+            L"BUTTON", L"选择文件",
+            WS_VISIBLE | WS_CHILD,
+            30, 245, 110, 40,
+            hWnd1, H_ ID_FILE_Bk_Open,
+            (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
+        );
+        break;
+    }
+
+    case WM_COMMAND:
+    {
+        WORD wmId = LOWORD(wParam);
+        switch (wmId)
+        {
+        case ID_FILE_Bk_Level:
+
+            break;
+        case ID_FILE_Bk_All:
+
+            break;
+        case ID_FILE_Bk_Open:
+
+            break;
+        }
+        break;
+    }
+
+    case WM_CLOSE:
+        DestroyWindow(hWnd1);
+        break;
+    case WM_DESTROY:
+        hBackup = NULL;
+        break;
+    default:
+        return DefWindowProc(hWnd1, msg, wParam, lParam);
+    }
+    return 0;
+}

+ 12 - 3
Ui for BDS/mainProc.cpp

@@ -3,14 +3,14 @@
 #include "Function.h"
 #include "SharedValue.h"
 
-InitHW(hTime);   InitHW(hWeather);   InitHW(hLog);   InitHW(hPlayer); InitHW(hConfig);
+InitHW(hTime);   InitHW(hWeather);   InitHW(hLog);   InitHW(hPlayer); InitHW(hConfig); InitHW(hBackup);
 
 LRESULT CALLBACK TimeProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam);
 LRESULT CALLBACK WeatherProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam);
 LRESULT CALLBACK LogProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam);
 LRESULT CALLBACK PlayerProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam);
 LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam);
-
+LRESULT CALLBACK BkProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam);
 
 
 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -143,9 +143,18 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                 hConfig = CreateChildWindow(hWnd,
                     _T("配置文件编辑"),
                     570, 1200,
-                    ConfProc, _T("fc_player"), HI_FI_config);
+                    ConfProc, _T("file_conf"), HI_FI_config);
             }
             break;
+        case ID_FILE_Backup:
+            if (!hBackup)
+            {
+                HINSTANCE HI_FI_backup = NULL;
+                hBackup = CreateChildWindow(hWnd,
+                    _T("备份与恢复"),
+                    460, 400,
+                    BkProc, _T("file_backup"), HI_FI_backup);
+            }
         }
         break;
     }