by leresidue · 8y ago · 0 comments
I'm using it to call a zoom function in my skeleton image program.
void toysanta() {
toy *nbzoom = nullptr;
nbzoom = isVerb(L"setzoomlevel");
if(nbzoom) {
if(nbzoom->hasClaus && nbzoom->sled == toy::integer) {
bool k = false;
POINT pt = {0,0};
toy *xt = getToy(L"x");
toy *yt = getToy(L"y");
if(xt && yt && xt->canNumber() && yt->canNumber()) {
pt.x = xt->getInteger();
pt.y = yt->getInteger();
k = true;
}
setzoomlevel(nbzoom->claus.integer, k, pt);
}
}
}
The toysanta() member function is from the VerbCommand class. From the zoom widget, there's void ZoomWidget::sendzoom_to_target(bool k, POINT pt) {
if(target) {
std::wstring cc = L"setzoomlevel ";
int zoom = realZ;//(zPos-32)/3;
cc += std::to_wstring(zoom);
if(k) {
cc += L" x " + std::to_wstring(pt.x);
cc += L" y " + std::to_wstring(pt.y);
}
target->receive(&cc);
}
}
The receive() member function calls the toysanta() function from the target.What I plan, is for it to just be perfect, to be honest. I hope it may help others create better software one day.
No comments yet.