Jump to content
Sign in to follow this  

AutoItObject this pointer

Recommended Posts


Converting a windowclass from C++ to SDL_UDF.

int windowclass::drag()
int i=0;
if(mbDown[mbLEFT]==1) {
if(dragging==0) {
if(mouseoverrect(x, y, w, h)) {
if(buttons>0) {
for(i=0; i<buttons; i++) {
if(mouseoverrect(x+button[i].x, y+button[i].y, button[i].w, button[i].h)) {
return i;
SDL_GetMouseState(&mousex, &mousey);
windisx = mousex - x;
windisy = mousey - y;
wdrag=this;// I can't do 'this' yet in AutoIt
if(wdrag==this && dragging && !nodrag) {
SDL_GetMouseState(&mousex, &mousey);
x = mousex-windisx;
y = mousey-windisy;
if(mbDown[mbLEFT]==0) {
return -1;

func windowodrag($oself)
 if _ispressed(1) then
  if $oself.dragging= 0 then
   if mouseoverrect($oself.x, $oself.y, $oself.w, $oself.h)= 1 then
    $oself.dragdisx= $mousex-$oself.x
    $oself.dragdisy= $mousey-$oself.y
    $oself.dragging= 1
    $oself.wdrag= $oself; How do I use keyword 'this in AutoIt?
  endif;endif dragging= 0
  if $oself.wdrag= $oself and $oself.dragging= 1 and $oself.nodrag= 0 then
   _SDL_GetMouseState($mousex, $mousey)
   $oself.x= $mousex-$oself.dragdisx
   $oself.y= $mousey-$oself.dragdisy
   $redraw= 1
  $oself.dragging= 0
  $oself.wdrag= 0
 endif;endif left mouse button

I use AutoItObject to store movable windows on an SDL_Surface.

Does anyone know a AutoItObject, C++ 'this' pointer to self equivalent?

Edited by Xandy

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.