Jump to content
Sign in to follow this  
Wolvereness

Lost

Recommended Posts

Wolvereness

Okay, I have a script that I have a number of items - Each with a name.

The user must be able to click and change the order of the item(s) selected.

How can this be done? I know this sounds vague but this is what I need. The script is closed source.

I'm working with Tri-Dimensional Arrays. Any additional controls or variants that depend on the level should be added to the 3rd dimension. Also, for the number of different levels the variable $Number has been declared.

To clarify, someone needs to change the order (dimension 1) of this array

The array is as follows:

$Levels[level (starts on 1)][Other use (used later)][Property]

Properties are as follows:

0 = Name

1 = Previous checkbox control

2 = 1/0 saying to use this level or not. Read from property 1

Please do NOT post saying 'Sorry I can't help you' or any variant of that sort

Edited by Wolvereness

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
Share on other sites
Insolence

I don't understand what it is you want, you want to move array elements and such, right?

And graphically display the changes to the user?


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
Wolvereness

I need a GUI so that the user can easily change the order of the first dimension copying the contents of the other 2 dimensions with each change.


Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
Share on other sites
ezzetabi

Are you sure you need three dimensions? Probably you just need two.

That way:

$wLevels[level (starts on 1) - Other use (used later) - Property][0-1-2]

So in code

Dim $wLevels[100][3]

$wLevels[0][0] = $wNumbersofelements

$wLevels[1][0] = $wLevel1

$wLevels[1][1] = $wOtherUse1

$wLevels[1][2] = $wProp1

$wLevels[1][0] = $wLevel2

$wLevels[1][1] = $wOtherUse2

$wLevels[1][2] = $wProp2

ect...

So for changing order you have just to swap the content with a temp variant as buffer..

E.g. change the 6th with the 18th...

$wBuffer = $wLevel[6][0]

$wLevel[6][0] = $wLevel[18][0]

$wLevel[18][0] = $wBuffer

$wBuffer = $wLevel[6][1]

$wLevel[6][1] = $wLevel[18][1]

$wLevel[18][1] = $wBuffer

$wBuffer = $wLevel[6][2]

$wLevel[6][2] = $wLevel[18][2]

$wLevel[18][2] = $wBuffer

Edit: about your sig. I hate you too. :idiot:

Edited by ezzetabi

Share this post


Link to post
Share on other sites
JSThePatriot

Have you searched for the UDF along the lines of _ArraySort()? If not check it out. It might help.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites
ezzetabi

No problems, the concept is the same... Use a buffer and swap every variant.

Share this post


Link to post
Share on other sites
Wolvereness

No problems, the concept is the same... Use a buffer and swap every variant.

<{POST_SNAPBACK}>

I kinda figured that, but the problem lies in the user being able to activate this buffer for the given elements...

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
Share on other sites
ezzetabi

What about making a list control with the... list of the item with two buttons, move up and move down?

Share this post


Link to post
Share on other sites
Wolvereness

... I don't know how to do that without being obsene amount of code


Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
Share on other sites
ezzetabi

Probably the best is keeping a string of the values you want show to the user pipe separed. So when the user click up or down you start a func that take as parameter the value of the selected item in the list and seek for the same in the array, found the position swap with it the next item (or the prev) and return the new string. The array have to be global, or passed by ref.

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.