admin
2024-05-17 03654f19baa454b990c052c43e2393a1c53c2c81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<iostream>
#include <wx/wx.h>
 
 
#include "MainFrame.h"
 
#include "MyConfigUtil.h"
 
 
 
 
class App :public wxApp {
 
public:
    bool OnInit() {
    
        SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
        
        WindowPosSize rect =    MyConfigUtil::getMainWindowPos();
        cout << "»ñÈ¡µ½µÄ×ø±ê£º" << rect.x <<"  "<< rect.y << endl;
        wxString title = "¼Ó±´¿ØÖÆÖÐÐÄ";
        title.Append(to_string(DPI));
        if (rect.x==-1&&rect.y==-1) {
            wxPoint p = wxDefaultPosition;
            wxSize s = wxSize(FRAME_WIDTH, FRAME_HEIGHT);
            
 
            MainFrame* window = new MainFrame(title, p, s);
            window->Show();
        }
        else {
            wxPoint    p= wxPoint(rect.x, rect.y);
            cout << "ÉèÖõÄ×ø±ê£º" << p.x << "  " << p.y << endl;
            wxSize    s =  wxSize(rect.width, rect.height);
            MainFrame* window = new MainFrame(title, p, s);
            window->Show();
        }
        return true;
    }
 
};
wxIMPLEMENT_APP(App);