view horori/merger/src/utils.cpp @ 6:c17740b2286a draft master

update horoi manual.
author pyon <pyon@macmini>
date Thu, 22 Jul 2021 05:58:03 +0900
parents aaaa401818a1
children
line wrap: on
line source

// Filename   : utils.cpp
// Last Change: 2020-03-18  15:01:12.
//
#include <wx/wx.h>
#include "utils.h"

wxRect Geo2Rect(wxString geo)
{
    long w, h, x, y;
    wxString sw = geo.BeforeFirst('x');
    wxString sh = geo.AfterFirst('x').BeforeFirst('+');
    wxString sx = geo.AfterFirst('+').BeforeFirst('+');
    wxString sy = geo.AfterLast('+');

    sw.ToLong(&w, 10);
    sh.ToLong(&h, 10);
    sx.ToLong(&x, 10);
    sy.ToLong(&y, 10);

    return wxRect((int)x, (int)y, (int)w, (int)h);
}

wxRect ZeroRect()
{
	wxRect rect(wxPoint(0, 0), wxPoint(0, 0));
	return rect;
}