0
|
1 // Filename : utils.cpp
|
|
2 // Last Change: 2020-03-18 15:01:12.
|
|
3 //
|
|
4 #include <wx/wx.h>
|
|
5 #include "utils.h"
|
|
6
|
|
7 wxRect Geo2Rect(wxString geo)
|
|
8 {
|
|
9 long w, h, x, y;
|
|
10 wxString sw = geo.BeforeFirst('x');
|
|
11 wxString sh = geo.AfterFirst('x').BeforeFirst('+');
|
|
12 wxString sx = geo.AfterFirst('+').BeforeFirst('+');
|
|
13 wxString sy = geo.AfterLast('+');
|
|
14
|
|
15 sw.ToLong(&w, 10);
|
|
16 sh.ToLong(&h, 10);
|
|
17 sx.ToLong(&x, 10);
|
|
18 sy.ToLong(&y, 10);
|
|
19
|
|
20 return wxRect((int)x, (int)y, (int)w, (int)h);
|
|
21 }
|
|
22
|
|
23 wxRect ZeroRect()
|
|
24 {
|
|
25 wxRect rect(wxPoint(0, 0), wxPoint(0, 0));
|
|
26 return rect;
|
|
27 }
|
|
28
|