Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (fairtrader, AndrewAMD, 3run), 576 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
click and drag panel #190467
03/27/08 05:14
03/27/08 05:14
Joined: Mar 2008
Posts: 6
T
twinkling Offline OP
Newbie
twinkling  Offline OP
Newbie
T

Joined: Mar 2008
Posts: 6
Is it possible to have a panel that can be drag around (with the mouse pointer) just like a normal window in our system?

Re: click and drag panel [Re: twinkling] #190468
03/27/08 07:58
03/27/08 07:58
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
Yes.

There is an article about it somewhere in the aum


"Yesterday was once today's tomorrow."
Re: click and drag panel [Re: Inestical] #190469
03/27/08 09:02
03/27/08 09:02
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Untested small code snippet; example code
No guarantee! If it blows up your computer, its not my fault
Code:

// ==================================================================
// File: Code Snippet
// Type: C-Script
// Requirements: A6.31 and above
// Description: Panel that can be dragged using the mouse
// ==================================================================


// ==================================================================
// FUNCTION PROTOTYPE

function drag_panel(panel);


// ==================================================================
// PANELS

panel* drag_pan;

panel test_pan
{
bmap = bla_map;

on_click = drag_panel; //important!
}


// ==================================================================
// FUNCTION

function drag_panel(panel)
{
var diff[3];

drag_pan = panel;

diff.x = mouse_pos.x - drag_pan.pos_x;
diff.y = mouse_pos.y - drag_pan.pos_y;

while(mouse_left)
{
drag_pan.pos_x = mouse_pos.x - diff.x;
drag_pan.pos_y = mouse_pos.y - diff.y;

wait(1);
}
}


// ==================================================================
// END OF FILE
// ==================================================================



Re: click and drag panel [Re: Xarthor] #190470
03/27/08 11:01
03/27/08 11:01
Joined: Mar 2008
Posts: 6
T
twinkling Offline OP
Newbie
twinkling  Offline OP
Newbie
T

Joined: Mar 2008
Posts: 6
cool~! It works!! thanks! =D


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1