xj qian
2024-06-27 cfe2fd47edee46fea43cc6bda85e74cd30beeaef
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
#pragma once
 
#include "xbase.hpp"
#include "xnative.hpp"
 
class xview : public xnative
{
public:
    xview(void * impl,HWND hWnd):xnative(impl),hWnd(hWnd){}
    xview(void * impl):xnative(impl),hWnd(0){}
public:
    virtual ~xview() {}
public:
    typedef int (xview::*FEvent)(TEvent* evt, LPARAM p);
private:
    HWND hWnd;
public:
    void SetHandle(HWND hWnd){this->hWnd=hWnd;}
    HWND GetHandle(){return hWnd;}
public:
    int alert(const wchar_t* txt)
    {
        MessageBoxW(GetHandle(),txt,L"Tip",1);
        return 1;
    } 
    int alert(const char* txt)
    {
        MessageBoxA(GetHandle(),txt,"Tip",1);
        return 1;
    }
};