Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Can gadgets move?

Can gadgets move?

Discuss OrbForms Designer and PocketC Architect

Postby Woofin on Tue Mar 20, 2007 6:20 pm

Can we move a gadget by changing the gadget's x and y values? I added the following method to my gadget:

void SpriteGadget.MoveTo(int NewX, int NewY) {
gadget.enabled = false;
gadget.visible = false;
gadget.x = NewX;
gadget.y = NewY;
gadget.visible = true;
gadget.enabled = true;
alert("Moved sprite to (" + gadget.x + "," + gadget.y + ")");
}

When I run my form and it executes this method, it shows an alert with the new (x,y) coordinates, but the gadget still appears in its original location; it does not actually move.

How can I move a gadget to a new (x,y)?
Woofin
 
Posts: 11
Joined: Thu Mar 15, 2007 2:35 pm
Location: USA

Postby nmc on Tue Mar 20, 2007 7:24 pm

try 'this.gadget.x' instead;
at least for .w and .h this works in my apps.
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Postby Woofin on Tue Mar 20, 2007 8:18 pm

Thanks, nmc - good idea. I tried it but it still didn't work, no difference. Would you be willing to post your code illustrating how yours works? I tried modifying .w and .h to see if that would work and they don't reflect the changes either :(
Woofin
 
Posts: 11
Joined: Thu Mar 15, 2007 2:35 pm
Location: USA

Postby nmc on Wed Mar 21, 2007 9:12 am

My gadget is resized by the Orbforms runtime when the user rotates the screen or shows/hides the DIA.

Relevant code snippets:

Code: Select all
handler mainForm.onresize() {
   mainGrid.Resize();
   ...
}

struct GridGadget {
   UIGadget   gadget;
   Draw      G, DC;
   ...
};


where 'G' is my onscreen draw context and 'DC' is for offscreen drawing (avoids flickering).

Code: Select all
void GridGadget.Resize() {
   DC.release();
   DC.create(this.gadget.w*2, this.gadget.h*2);
}

void GridGadget.ondraw() {
   ...
   G.nbegin();
   G.draw(DC, 0, 0);
   G.fg(5);
   G.line(clrFG, timeLineX-XOff, 0, timeLineX-XOff, this.gadget.h*2);
   G.end();
}


The attached draw context is automatically adjusted since I only do some extra work for my special draw functionality, so there seems to be no voodoo in changing the coordinates of a gadget.

And for the 'onpen' thread: this gadget uses the onpen events to show the coordinates of the pen in my grids context, moving the pen updates the coordinate-output; the mainForm ony uses onpenup() to cleanup the output, so 'pendown' and 'penmove' seems to be fired for the gadget while 'penup' must be fired in the form itself.
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Postby Woofin on Wed Mar 21, 2007 1:04 pm

Excellent, it works now. Thank you very much for all of the help, including the onpen events. Very helpful! :)
Woofin
 
Posts: 11
Joined: Thu Mar 15, 2007 2:35 pm
Location: USA


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron