Jump to content

me by simple


jpam
 Share

Recommended Posts

have question

3 picture controls

what i want is the top picture (last created)

gets below the 2 other picture controls !

whitout guictrldelete

and witout changing the creating sequence !

it's me by simple butt i don't no how ??? :)

#include <GUIConstants.au3>

GUICreate("",400,400,-1,-1)

$pic1 = GUICtrlCreatePic("",175,250,72,97,$BS_BITMAP)

GUICtrlSetImage($pic1,"c:\xback.BMP")

$pic2 = GUICtrlCreatepic("",100,250,72,97,$BS_BITMAP)

GUICtrlSetImage($pic2,"c:\xback.BMP")

$pic3 = GUICtrlCreatepic("",132.5,220,72,97,$BS_BITMAP)

GUICtrlSetImage($pic3,"c:\xback.BMP")

GUISetState()

While 1

Sleep(1000)

WEnd

xback.BMP

Edited by jpam
Link to comment
Share on other sites

Nothing wrong with your script syntax, so long as xback.bmp is really in C:\. If you want the picture in the same folder as the script, try this:

#include <GUIConstants.au3>

GUICreate("",400,400,-1,-1)

$pic1 = GUICtrlCreatePic("",175,250,72,97,$BS_BITMAP)
GUICtrlSetImage(-1,@scriptdir&"\xback.BMP")

$pic2 = GUICtrlCreatepic("",100,250,72,97,$BS_BITMAP)
GUICtrlSetImage(-1,@scriptdir&"\xback.BMP")

$pic3 = GUICtrlCreatepic("",132.5,220,72,97,$BS_BITMAP)
GUICtrlSetImage(-1,@scriptdir&"\xback.BMP")
GUISetState()

While 1
Sleep(1000)
WEnd

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

no larry guictrlsetpos is not what i want

the last pic control created is on top of the other controls

i want him behind the other 2 controls early created

i am seaching for a command to put him behind without deleting and recreating

the 2 other controls.

i have a gui that allready have these controls created

and i want to re-order them on the fly

:)

jpam

Link to comment
Share on other sites

ControlHide() or GUICtrlSetState()+$GUI_DISABLE

GUICtrlSetState() + $GUI_SHOW and $GUI_HIDE respectively should do the trick. I dont know that $GUI_DISABLE would be exactly what he is wanting.

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)

Link to comment
Share on other sites

It sounds to me that he wants to re-order the z-order (how objects are layered) of the controls. Unfortunately, I don't believe there is anyway to adjust the z-order of a control, as I believe it was brought up before.

The only way to define z-order is in the actual sequence that the controls are created.

In an unrelated note, I see you're trying to set the X position of $pic3 to 132.5. I'm pretty sure that won't work. It will either land on 132 or 133 as you can't really place anything between pixels.

Edited by Saunders
Link to comment
Share on other sites

It sounds to me that he wants to re-order the z-order (how objects are layered) of the controls. Unfortunately, I don't believe there is anyway to adjust the z-order of a control, as I believe it was brought up before.

The only way to define z-order is in the actual sequence that the controls are created.

In an unrelated note, I see you're trying to set the X position of $pic3 to 132.5. I'm pretty sure that won't work. It will either land on 132 or 133 as you can't really place anything between pixels.

I agree that is what he is wanting, but cannot be done. The simple work around is what I posted above.

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)

Link to comment
Share on other sites

@ Saunders

thats just what i want "z-order"

@ JSThePatriot

GUICtrlSetState() $GUI_HIDE & $GUI_SHOW do not work

thanks guys for looking in it :)

jpam

mybe the only solution is re-creating the controls in the right order :P

#include <GUIConstants.au3>

GUICreate("",400,400,-1,-1)

$pic1 = GUICtrlCreatePic("",175,250,72,97,$BS_BITMAP)

GUICtrlSetImage($pic1,"c:\xback.BMP")

GUICtrlSetState($pic1,$GUI_HIDE)

$pic2 = GUICtrlCreatepic("",100,250,72,97,$BS_BITMAP)

GUICtrlSetImage($pic2,"c:\xback.BMP")

GUICtrlSetState($pic2,$GUI_HIDE)

$pic3 = GUICtrlCreatepic("",135,220,72,97,$BS_BITMAP)

GUICtrlSetImage($pic3,"c:\xback.BMP")

GUISetState()

Sleep(1000)

GUICtrlSetState($pic2,$GUI_SHOW)

GUICtrlSetState($pic1,$GUI_SHOW)

While 1

Sleep(1000)

WEnd

Link to comment
Share on other sites

I think larry was right. Try this:

#include <GUIConstants.au3>

GUICreate("",400,400,-1,-1)
guisetstate()

$pic1 = GUICtrlCreatePic("",175,250,72,97,$BS_BITMAP)
GUICtrlSetImage(-1,@scriptdir&"\xback.BMP")

sleep(1000)

$pic2 = GUICtrlCreatepic("",100,250,72,97,$BS_BITMAP)
GUICtrlSetImage(-1,@scriptdir&"\xback.BMP")

sleep(1000)

$pic3 = GUICtrlCreatepic("",132.5,220,72,97,$BS_BITMAP)
GUICtrlSetImage(-1,@scriptdir&"\xback.BMP")
GUISetState()

sleep(1000)

GUICtrlSetPos($pic1,175,250,72,97)
GUICtrlSetPos($pic2,100,250,72,97)


While 1
   $msg = GUIGetMsg()
   if $msg = $GUI_EVENT_CLOSE then exit
WEnd

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

Here, I just made this. It has the benefit of not having to tell it the current position of the control you're moving to the top:

Func _GUICtrlSetZonTop($ctrlid)
    Local $ParentLong = DllCall("user32.dll","long","GetWindowLong","hwnd",GUICtrlGetHandle($ctrlid),"int",-8)
    Local $pos = ControlGetPos(hwnd($ParentLong[0]), "", GUICtrlGetHandle($ctrlid))
    GUICtrlSetPos($ctrlid,$pos[0],$pos[1],$pos[2],$pos[3])
EndFunc

Edit: Simplified the function

Edited by lod3n

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

lod3n @ larry !!!

you guys make me a very very happy man! :P

it works !

i try that before with guictrlsetpos but with the wrong pic control ($pic1)

man, i am so stupid ! :)

your custom func is even better ,it rocks !

Very very many thanks guys ! :D

jpam

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...