Jump to content

Help with multiple controls stored in array


Recommended Posts

heya

i've been looking for asnwer on this question for about 8-9 months and ... STILL nothing for now ... searched forum and i decided to start the topic.

so whats it all about? look:

;//includes
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

;//options

;//vars
Dim $button_ctrl[11]
;//gui
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 168, 449, 432, 195)
For $i = 1 to 10
    $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i*35, 75, 25)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;//main loop
Do
$msg = GUIGetMsg()

Until $msg = $GUI_EVENT_CLOSE

what is on my mind is: how to get that the msg is from button X?

;//includes
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

;//options

;//vars
Dim $button_ctrl[11]
;//gui
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 168, 449, 432, 195)
For $i = 1 to 10
    $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i*35, 75, 25)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;//main loop
Do
$msg = GUIGetMsg()
 For $i = 1 to 10
    If $msg = $button_ctrl[$i] then
 MsgBox(0, "", "u clicked on button #" & $i)
    EndIF
Next
Until $msg = $GUI_EVENT_CLOSE

this DOESNT wotks well ... i mean sometimes it gets the msg sometimes not. there is delay from when it counts to when it gets the new msg recieved so sometimes i click when it still counts and the new msg isnt recived by guigetmsg ... i like to use Do-Untill styles, but did it in select-case = still the same ... and there is no way to do it like that:

;//includes
 #include <GUIConstants.au3>
 #include <ButtonConstants.au3>
 #include <GUIConstantsEx.au3>
 #include <WindowsConstants.au3>
 
 ;//options
 
 ;//vars
 Dim $button_ctrl[11]
 ;//gui
 #Region ### START Koda GUI section ### Form=
 $Form1 = GUICreate("Form1", 168, 449, 432, 195)
 For $i = 1 to 10
    $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i*35, 75, 25)
 Next
 GUISetState(@SW_SHOW)
 #EndRegion ### END Koda GUI section ###
 
 ;//main loop
 Do
 $msg = GUIGetMsg()
    If $msg = $button_ctrl[1] then _func_for_button(1)
    If $msg = $button_ctrl[2] then _func_for_button(2)
    If $msg = $button_ctrl[3] then _func_for_button(3)
    ...
 Until $msg = $GUI_EVENT_CLOSE

because its 10 controls now, what about 912? there must be a way to get what i'm clicking the "easy" way

thank you in advance

Edited by cheatera

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

Link to comment
Share on other sites

  • Moderators

cheatera,

I am surprised to hear you say that the second example (where you use a loop to compare each ControlID in the array to the GUIGetMsg return value) does not work. I have used that technique successfully in many scripts. ;)

And as for it not getting messages for all the buttons pressed - AutoIt queues them up nicely for me and I get a nice series of MsgBoxes telling me which buttons were pressed. :)

Could you post a script in which you have a problem in using this form of button detection - there might be something else that is causing you to miss button presses.

Of course, if your button starts a longish function running, you will not interrupt that function unless you make special arrangements - see the Interrupting a running function tutorial in the Wiki to see how it can be done. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

yep thats it - it IS a long func, but still your reply with interrupting funcs gives me halve the answer ... i was thinking more like using some kind of registering the control on its creation, like

_GUICtrl_OnHoverRegister($button[$i], "_Hover_Func")

and get the hoover id, but still, when u create more controls BEFORE button creation there will be a difference. like ID=1 would be gui itself or the label u created BEFORE button creation, so if u hover over $button[1], the id would be 5-6 or depends on how many controls you created BEFORE buttons creation. isnt there any way to register the function to the button upon its creation? like

...

For $i = 1 to 10

$button[$i] = GUICtrlCreateButton(...)

_register_on_click_func($i)

Next

...

Func _reguister_on_click_func($_ctrl_id)

;do that'n'that

EndFunc

and when $button[n] is clicked it goes to that func with args "n"?

strangely i ran the code (i just writed it on the forum without runing it) and i was amazed when it ran smoothly ... but thats plain script, and controls are only 10. if there are 200-300 there will be alot of delay in counting. depends on the CPU too but there must NOT be any kind of operatin which depends on the speed of the PC in this situation.. like clicking on button214 and wait till it counts them all (on my pc like 1sec to count them) and then do the func. maybe in your scripts you used too few controls? idk, but there is delay for sure. and what about if the control ISNT still created? but u dommed some kind of max controls that may be created like

Dim $button[99]

and created only 2 of them, till it loops from 2 to 98, the $button[98] is 0 and msg is 0 on idle so it will ran the func for all other buttons with 0 args.

any other suggestions for the "self register thing upon creation" of the control?

Edited by cheatera

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

Link to comment
Share on other sites

  • Moderators

cheatera,

on my pc like 1sec to count them

You must be joking - is it steam powered? ;):)

Try running this script and see how long each search of the 1000 button ControlIDs takes - for me it is around 2 millseconds:

#include <GUIConstantsEx.au3>

;//vars
Dim $button_ctrl[1001]
;//gui
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 168, 449, 432, 195)
For $i = 1 To 1000
    $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i * 35, 75, 25)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;//main loop
Do
    $msg = GUIGetMsg()
    $ibegin = TimerInit()
    For $i = 1 To 1000
        If $msg = $button_ctrl[$i] Then
            MsgBox(0, "", "u clicked on button #" & $i)
        EndIf
    Next
    ConsoleWrite(TimerDiff($iBegin) & @CRLF)
Until $msg = $GUI_EVENT_CLOSE

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

x) steam powered x))))

ok its my bad that i dont post the exact script ... your answers are good but i didnt explained well whats exaclty hapening. well here it is:

;//includes
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <Misc.au3>
;#include <GUICtrlOnHover.au3>

;//options
Opt("MouseCoordMode", 2)
;Opt("CaretCoordMode", 2)

;//vars
Dim $hotspot_ctrl[99]
Dim $hotspot_loc[99]
Dim $hotspot_info[99][11]
Dim $hotspot_movers[99][9]
$hotspot_count = 0

;//gui
$frame_gui = GUICreate("Form1", 1025, 769, -1, -1, BitOR($WS_POPUP,$WS_GROUP))
$pic = GUICtrlCreatePic("pic.jpg", 0, 0, 1024, 768)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetCursor (-1, 3)

For $i = 1 to 8
    $hotspot_movers[1][$i] = GUICtrlCreateLabel("", -11, -11, 1, 1, $SS_WHITEFRAME)
Next

GUISetState(@SW_SHOW)
$current_hotspot = 1
;//main loop
Do
$msg = GUIGetMsg()
$ID = GUIGetCursorInfo($frame_gui)
$mpos = MouseGetPos()
$mouse_cur = MouseGetCursor()
ToolTip($id[4] & @CRLF & $mouse_cur)

    For $I = 1 to 98
        If $msg = $hotspot_ctrl[$i] then
            ;func for moving the hotspot itself with arg $i
            MsgBox(0, "", "")
        EndIf
    Next
    If $msg = $GUI_EVENT_PRIMARYDOWN And $mouse_cur = 2 then
        $hotspot_count += 1
        ;MsgBox(0, "", $id[4])
        _CreateHotSpot($mpos[0], $mpos[1], $hotspot_count)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][1] then ;gore vlqvo
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 1)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][2] then ;gore sreda
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 2)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][3] then ;gore dqsno
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 3)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][4] then ;sreda vlqvo
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 4)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][5] then ;sreda dqsno
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 5)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][6] then ;dolu vlqvo
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 6)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][7] then ;dolu sreda
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 7)
    EndIf
    If $msg = $hotspot_movers[$current_hotspot][8] then ;dolu dqsno
        $current_hotspot = 1
        _Resize($current_hotspot = 1, 8)
    EndIf
Until $msg = $GUI_EVENT_CLOSE


;//funcs

Func _MoveMovers($x, $y, $w, $h, $hotspot)
;gore-lqvo
GUICtrlSetPos($hotspot_movers[$hotspot][1], $x - 4.5, $y - 4.5, 5, 5)
;gore_sreda
GUICtrlSetPos($hotspot_movers[$hotspot][2], ($x + ($w / 2)) - 2.5, $y - 4.5, 5, 5)
;gore_dqsno
GUICtrlSetPos($hotspot_movers[$hotspot][3], $x + $w, $y - 4.5, 5, 5)
;sreda_lqvo
GUICtrlSetPos($hotspot_movers[$hotspot][4], $x - 5, $y + ($h / 2) - 2.5, 5, 5)
;sreda_dqsno
GUICtrlSetPos($hotspot_movers[$hotspot][5], $x + $w, $y + ($h / 2) - 3, 5, 5)
;dolu_lqvo
GUICtrlSetPos($hotspot_movers[$hotspot][6], $x - 5, $y + $h, 5, 5)
;dolu_sreda
GUICtrlSetPos($hotspot_movers[$hotspot][7], ($x + ($w / 2)) - 2.5, $y + $h, 5, 5)
;dolu_dqsno
GUICtrlSetPos($hotspot_movers[$hotspot][8], $x + $w, $y + $h, 5, 5)
EndFunc

Func _Resize($_curr_hs, $_mover) ;$mover = clicked mover (1-8)
Local $hotspot = $_curr_hs
Local $dim = StringSplit($hotspot_loc[$hotspot], ",")
Local $win_coords = WinGetPos($frame_gui)

If $_mover = 1 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12)
EndIf
If $_mover = 2 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11)
EndIf
If $_mover = 3 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10)
EndIf
If $_mover = 4 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13)
EndIf
If $_mover = 5 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13)
EndIf
If $_mover = 6 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10)
EndIf
If $_mover = 7 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11)
EndIf
If $_mover = 8 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12)
EndIf

If $_mover = 1 then
    _MouseTrap($win_coords[0], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1])
        _MoveMovers($mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1], $hotspot)
        $hotspot_loc[$hotspot] = $mpos[0] & "," & $mpos[1] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & ($dim[2] + $dim[4]) - $mpos[1]
        ToolTip("X = " & $mpos[0] & @CRLF & "Y = " & $mpos[1] & @CRLF & "Width = " & ($dim[1] + $dim[3]) - $mpos[0] & @CRLF & "Height = " & ($dim[2] + $dim[4]) - $mpos[1])
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 2 then
    _MouseTrap($win_coords[0] + $dim[1], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1])
        _MoveMovers($dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & $dim[3] & "," & ($dim[2] + $dim[4]) - $mpos[1]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 3 then
    _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1], $win_coords[2] + $win_coords[0], ($win_coords[1] + $dim[2] + $dim[4]) - 5)
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1])
        _MoveMovers($dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]) & "," & ($dim[2] + $dim[4]) - $mpos[1]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 4 then
    _MouseTrap($win_coords[0], $win_coords[1] + $dim[2], (($dim[1] + $dim[3]) - 5) + $win_coords[0], $dim[2] + $dim[4] + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4])
        _MoveMovers($mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4], $hotspot)
        $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & $dim[4]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 5 then
    _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2], $win_coords[2] + $win_coords[0], $win_coords[1] + $dim[4] + $dim[2])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4])
        _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $dim[4]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 6 then
    _MouseTrap($win_coords[0], $win_coords[1] + $dim[2] + 5, ($win_coords[0] + $dim[1] + $dim[3]) - 5, $win_coords[1] + $win_coords[3])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]))
        _MoveMovers($mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot)
        $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & $dim[3] + ($dim[1] - $mpos[0]) & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 7 then
    _MouseTrap($win_coords[0] + $dim[1], $win_coords[1] + $dim[2] + 5, $dim[1] + $dim[3] + $win_coords[0], $win_coords[3] + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]))
        _MoveMovers($dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $dim[3] & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 8 then
    _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2] + 5, $win_coords[0] + $win_coords[2], $win_coords[1] + $win_coords[3])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2])
        _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $mpos[1] - $dim[2]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf

_MouseTrap()
ToolTip("")
GUICtrlSetCursor($hotspot_ctrl[$hotspot], 9)
EndFunc

Func _CreateHotSpot($_x, $_y, $_curr_hs)

Local $hotspot = $_curr_hs
Local $startpoint_x = $_x
Local $startpoint_y = $_y
Local $endpoint_x = $startpoint_x + 5
Local $endpoint_y = $startpoint_y + 5

MouseMove($endpoint_x + 5, $endpoint_y + 5, 0)
$hotspot_ctrl[$hotspot] = GUICtrlCreateLabel("", $startpoint_x, $startpoint_y, $endpoint_x, $endpoint_y, $SS_ETCHEDHORZ)
;_GUICtrl_OnHoverRegister($hotspot_ctrl[$hotspot], "_Hover_Func")
GUICtrlSetTip(-1, "hotspot #" & $hotspot)
GUICtrlSetCursor (-1, 9)

Do
$msg2 = GUIGetMsg()
$mpos = MouseGetPos()
$ID = GUIGetCursorInfo()
;ToolTip($id[4])
    If $startpoint_x < $mpos[0] Then 
        $X = $startpoint_x
        $W = $mpos[0] - $startpoint_x
    Else
        $X = $mpos[0]
        $W = $startpoint_x - $mpos[0]
    EndIf

    If $startpoint_y < $mpos[1] Then 
        $Y = $startpoint_y
        $H = $mpos[1] - $startpoint_y
    Else
        $Y = $mpos[1]
        $H = $startpoint_y - $mpos[1]
    EndIf
    GUICtrlSetPos($hotspot_ctrl[$hotspot], $x, $y, $w, $h)
    $hotspot_loc[$hotspot] = $x & "," & $y & "," & $w & "," & $h
Until $msg2 = $GUI_EVENT_PRIMARYUP

;gore-lqvo
$hotspot_movers[$hotspot][1] = GUICtrlCreateLabel("", $x - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 12)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "NW (1)")
;gore_sreda
$hotspot_movers[$hotspot][2] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 11)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "N (2)")
;gore_dqsno
$hotspot_movers[$hotspot][3] = GUICtrlCreateLabel("", $x + $w, $y - 4.5, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 10)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "NE (3)")
;sreda_lqvo
$hotspot_movers[$hotspot][4] = GUICtrlCreateLabel("", $x - 4.5, $y + ($h / 2), 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 13)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "w (4)")
;sreda_dqsno
$hotspot_movers[$hotspot][5] = GUICtrlCreateLabel("", $x + $w, $y + ($h / 2), 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 13)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "E (5)")
;dolu_lqvo
$hotspot_movers[$hotspot][6] = GUICtrlCreateLabel("", $x - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 10)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "SW (6)")
;dolu_sreda
$hotspot_movers[$hotspot][7] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 11)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "S (7)")
;dolu_dqsno
$hotspot_movers[$hotspot][8] = GUICtrlCreateLabel("", $x + $w, $y + $h, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 12)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "SE (8)")
EndFunc

copy/paste, download pic.jpg put in same dir and watch poping msgboxes ... thats because the ctrl itself isnt created yet. do you understand me more better now?

delete the

For $I = 1 to 98

If $msg = $hotspot_ctrl[$i] then

;func for moving the hotspot itself with arg $i

MsgBox(0, "", "")

EndIf

Next

to see what my script actualy does.

post-12429-12859406806387_thumb.jpg

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

Link to comment
Share on other sites

  • Moderators

cheatera,

Can you explain what on earth you are trying to do - I cannot make head nor tail of that script. ;)

Once we see what you want to do, we can work out how to do it. ;)

M23

Edit: Ok, we can get rind of the cascading MsgBoxes by using this:

For $i = 1 To 98
    If $msg = $hotspot_ctrl[$i] And $hotspot_ctrl[$i] <> "" Then

That way we prevent firing on every pass through the loop. I still do not understand what you are trying to do though! :)

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

it creates hotspots on image, for lateer viewing/editing etc. so basicly darg to create hotspot. after that u can RESIZE it bot NOT move it (i didnt writed it for $current_hotspot).

so:

If $msg = $GUI_EVENT_PRIMARYDOWN And $mouse_cur = 2 then

$hotspot_count += 1

;MsgBox(0, "", $id[4])

_CreateHotSpot($mpos[0], $mpos[1], $hotspot_count)

EndIf

checks if mouse is clicked (and held) if yes => _CreateHotSpot with those args, $hotspot_counts ++ because to give the new created button a var which will handle him later.

after _CreateHotSpot which is simply resizing of the control it idles, and w8s for new click, if u click on any of the "movers" (the little boxes in corners and centers) it will start to resize of in that direction.

the problem is that i gieved "a constant" of $current_hotspot = 1 and u can only edit $hotspot_ctrl[1], and all the movers for $hotspot_ctrl[1]. i want to detect which is the clicked label so can pass the right argument to move him and etc., and move the "movers" bcoz they are with the same "constant" of 1. so i must get the "current clicked/hoovered" hotspot so to pass it to the funcs. more clear now?

edit: x) dude i jsut realised that i may see if there is a creation at all in $hotspot_ctrl, like If $hotspot_ctrl[$i] <> "" .. and i just wanted to post the explaining so u to know what my script does any way ... and u just edited YOU post saying the same x) ok i got it ... this is it > will check if the If $hotspot_ctrl[$i] = "", and if it is - continue count, if not to pass the $i to the func ;) ty if wernt you i wouldnt think of it and when i saw u suggestin the same i know that im in the right direction :)

/closed

Edited by cheatera

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

Link to comment
Share on other sites

  • Moderators

cheatera,

Once I got the MsgBoxes to stop (did you see the new code I posted above?) I worked it out myself - I am glad to see I got it right! ;)

It seems to work well - are you saying that it does not for you? ;)

The script could certianly do with some tidying - as it is raining and even the golf on TV has stopped, I will take a look and see if I can speed it up for you. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

yep i did read the edit above ;) ty

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

Link to comment
Share on other sites

How about using a "Scripting.Dictionary" object?

#include <GUIConstantsEx.au3>

;//vars
Dim $button_ctrl[1001]
$oButtons = ObjCreate('Scripting.Dictionary')
If Not IsObj($oButtons) Then
    MsgBox(16 + 262144, "Error!", "Creating Scripting.Dictionary object failed.")
    Exit
EndIf
$oButtons.CompareMode = 1

;//gui
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 168, 449, 432, 195)
For $i = 1 To 1000
    $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i * 35, 75, 25)
    $oButtons.Add($button_ctrl[$i], $i)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;//main loop
Do
    $msg = GUIGetMsg()
    $ibegin = TimerInit()
    If $oButtons.Exists($msg) Then
        MsgBox(0, "", "u clicked on button #" & $oButtons.item($msg))
    EndIf
    ConsoleWrite(TimerDiff($ibegin) & @CRLF)
Until $msg = $GUI_EVENT_CLOSE
Link to comment
Share on other sites

DONE! now i removed movers, decided there is no point to create 8 more ctrls while i can just moved them around the edited label, and actualy this-a-like i know wich hotspot im in, when i look at the movers that they are on it ... ;)

Download pic again if needed.

;//includes
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <Misc.au3>
;#include <GUICtrlOnHover.au3>

;//options
Opt("MouseCoordMode", 2)
;Opt("CaretCoordMode", 2)

;//vars
Dim $hotspot_ctrl[99]
Dim $hotspot_loc[99]
Dim $hotspot_info[99][11]
Dim $hotspot_movers[9]
$hotspot_count = 0

;//gui
$frame_gui = GUICreate("Form1", 1025, 769, -1, -1, BitOR($WS_POPUP,$WS_GROUP))
$pic = GUICtrlCreatePic("pic.jpg", 0, 0, 1024, 768)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetCursor (-1, 3)

For $i = 1 to 8
    $hotspot_movers[$i] = GUICtrlCreateLabel("", -11, -11, 1, 1, $SS_WHITEFRAME)
Next

GUISetState(@SW_SHOW)
$current_hotspot = 1
;//main loop
Do
$msg = GUIGetMsg()
;$ID = GUIGetCursorInfo($frame_gui)
$mpos = MouseGetPos()
$mouse_cur = MouseGetCursor()

    For $i = 1 to 98
        If $msg = $hotspot_ctrl[$i] And $hotspot_loc[$i] <> "" then
            $current_hotspot = $i
            $_dim_ = StringSplit($hotspot_loc[$i], ",")
            _MoveMovers($_dim_[1], $_dim_[2], $_dim_[3], $_dim_[4])
        EndIf
    Next
    If $msg = $GUI_EVENT_PRIMARYDOWN And $mouse_cur = 2 then
        _MoveMovers(-666)
        $hotspot_count += 1
        _CreateHotSpot($mpos[0], $mpos[1], $hotspot_count)
    EndIf
    If $msg = $hotspot_movers[1] then ;gore vlqvo
        ;$current_hotspot = 1
        _Resize($current_hotspot, 1)
    EndIf
    If $msg = $hotspot_movers[2] then ;gore sreda
        ;$current_hotspot = 1
        _Resize($current_hotspot, 2)
    EndIf
    If $msg = $hotspot_movers[3] then ;gore dqsno
        ;$current_hotspot = 1
        _Resize($current_hotspot, 3)
    EndIf
    If $msg = $hotspot_movers[4] then ;sreda vlqvo
        ;$current_hotspot = 1
        _Resize($current_hotspot, 4)
    EndIf
    If $msg = $hotspot_movers[5] then ;sreda dqsno
        ;$current_hotspot = 1
        _Resize($current_hotspot, 5)
    EndIf
    If $msg = $hotspot_movers[6] then ;dolu vlqvo
        ;$current_hotspot = 1
        _Resize($current_hotspot, 6)
    EndIf
    If $msg = $hotspot_movers[7] then ;dolu sreda
        ;$current_hotspot = 1
        _Resize($current_hotspot, 7)
    EndIf
    If $msg = $hotspot_movers[8] then ;dolu dqsno
        ;$current_hotspot = 1
        _Resize($current_hotspot, 8)
    EndIf
Until $msg = $GUI_EVENT_CLOSE


;//funcs

Func _MoveMovers($x = -666, $y = -1, $w = -1, $h = -1, $hotspot = -1)
If $x = -666 then
    For $i = 1 to 8
        GUICtrlSetPos($hotspot_movers[$i], -11, -11, 1, 1)
    Next
Else
    ;gore-lqvo
    GUICtrlSetPos($hotspot_movers[1], $x - 4.5, $y - 4.5, 5, 5)
    ;gore_sreda
    GUICtrlSetPos($hotspot_movers[2], ($x + ($w / 2)) - 2.5, $y - 4.5, 5, 5)
    ;gore_dqsno
    GUICtrlSetPos($hotspot_movers[3], $x + $w, $y - 4.5, 5, 5)
    ;sreda_lqvo
    GUICtrlSetPos($hotspot_movers[4], $x - 5, $y + ($h / 2) - 2.5, 5, 5)
    ;sreda_dqsno
    GUICtrlSetPos($hotspot_movers[5], $x + $w, $y + ($h / 2) - 3, 5, 5)
    ;dolu_lqvo
    GUICtrlSetPos($hotspot_movers[6], $x - 5, $y + $h, 5, 5)
    ;dolu_sreda
    GUICtrlSetPos($hotspot_movers[7], ($x + ($w / 2)) - 2.5, $y + $h, 5, 5)
    ;dolu_dqsno
    GUICtrlSetPos($hotspot_movers[8], $x + $w, $y + $h, 5, 5)
EndIf
EndFunc
    
Func _Resize($_curr_hs, $_mover) ;$mover = clicked mover (1-8)
Local $hotspot = $_curr_hs
Local $dim = StringSplit($hotspot_loc[$hotspot], ",")
Local $win_coords = WinGetPos($frame_gui)

If $_mover = 1 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12)
EndIf
If $_mover = 2 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11)
EndIf
If $_mover = 3 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10)
EndIf
If $_mover = 4 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13)
EndIf
If $_mover = 5 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13)
EndIf
If $_mover = 6 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10)
EndIf
If $_mover = 7 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11)
EndIf
If $_mover = 8 then
    GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12)
EndIf

If $_mover = 1 then
    _MouseTrap($win_coords[0], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1])
        _MoveMovers($mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1], $hotspot)
        $hotspot_loc[$hotspot] = $mpos[0] & "," & $mpos[1] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & ($dim[2] + $dim[4]) - $mpos[1]
        ToolTip("X = " & $mpos[0] & @CRLF & "Y = " & $mpos[1] & @CRLF & "Width = " & ($dim[1] + $dim[3]) - $mpos[0] & @CRLF & "Height = " & ($dim[2] + $dim[4]) - $mpos[1])
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 2 then
    _MouseTrap($win_coords[0] + $dim[1], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1])
        _MoveMovers($dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & $dim[3] & "," & ($dim[2] + $dim[4]) - $mpos[1]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 3 then
    _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1], $win_coords[2] + $win_coords[0], ($win_coords[1] + $dim[2] + $dim[4]) - 5)
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1])
        _MoveMovers($dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]) & "," & ($dim[2] + $dim[4]) - $mpos[1]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 4 then
    _MouseTrap($win_coords[0], $win_coords[1] + $dim[2], (($dim[1] + $dim[3]) - 5) + $win_coords[0], $dim[2] + $dim[4] + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4])
        _MoveMovers($mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4], $hotspot)
        $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & $dim[4]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 5 then
    _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2], $win_coords[2] + $win_coords[0], $win_coords[1] + $dim[4] + $dim[2])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4])
        _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $dim[4]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 6 then
    _MouseTrap($win_coords[0], $win_coords[1] + $dim[2] + 5, ($win_coords[0] + $dim[1] + $dim[3]) - 5, $win_coords[1] + $win_coords[3])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]))
        _MoveMovers($mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot)
        $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & $dim[3] + ($dim[1] - $mpos[0]) & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 7 then
    _MouseTrap($win_coords[0] + $dim[1], $win_coords[1] + $dim[2] + 5, $dim[1] + $dim[3] + $win_coords[0], $win_coords[3] + $win_coords[1])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]))
        _MoveMovers($dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $dim[3] & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf
If $_mover = 8 then
    _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2] + 5, $win_coords[0] + $win_coords[2], $win_coords[1] + $win_coords[3])
    Do
    $msg3 = GUIGetMsg()
    $mpos = MouseGetPos()
        GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2])
        _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2], $hotspot)
        $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $mpos[1] - $dim[2]
    Until $msg3 = $GUI_EVENT_PRIMARYUP
EndIf

_MouseTrap()
ToolTip("")
GUICtrlSetCursor($hotspot_ctrl[$hotspot], 9)
EndFunc

Func _CreateHotSpot($_x, $_y, $_curr_hs)

Local $hotspot = $_curr_hs
Local $startpoint_x = $_x
Local $startpoint_y = $_y
Local $endpoint_x = $startpoint_x + 5
Local $endpoint_y = $startpoint_y + 5

MouseMove($endpoint_x + 5, $endpoint_y + 5, 0)
$hotspot_ctrl[$hotspot] = GUICtrlCreateLabel("", $startpoint_x, $startpoint_y, $endpoint_x, $endpoint_y, $SS_ETCHEDHORZ)
$current_hotspot = $hotspot
GUICtrlSetTip(-1, "hotspot #" & $hotspot)
GUICtrlSetCursor (-1, 9)

Do
$msg2 = GUIGetMsg()
$mpos = MouseGetPos()
$ID = GUIGetCursorInfo()
;ToolTip($id[4])
    If $startpoint_x < $mpos[0] Then 
        $X = $startpoint_x
        $W = $mpos[0] - $startpoint_x
    Else
        $X = $mpos[0]
        $W = $startpoint_x - $mpos[0]
    EndIf

    If $startpoint_y < $mpos[1] Then 
        $Y = $startpoint_y
        $H = $mpos[1] - $startpoint_y
    Else
        $Y = $mpos[1]
        $H = $startpoint_y - $mpos[1]
    EndIf
    GUICtrlSetPos($hotspot_ctrl[$hotspot], $x, $y, $w, $h)
    $hotspot_loc[$hotspot] = $x & "," & $y & "," & $w & "," & $h
Until $msg2 = $GUI_EVENT_PRIMARYUP

;gore-lqvo
$hotspot_movers[1] = GUICtrlCreateLabel("", $x - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 12)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "NW (1)")
;gore_sreda
$hotspot_movers[2] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 11)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "N (2)")
;gore_dqsno
$hotspot_movers[3] = GUICtrlCreateLabel("", $x + $w, $y - 4.5, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 10)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "NE (3)")
;sreda_lqvo
$hotspot_movers[4] = GUICtrlCreateLabel("", $x - 4.5, $y + ($h / 2), 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 13)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "w (4)")
;sreda_dqsno
$hotspot_movers[5] = GUICtrlCreateLabel("", $x + $w, $y + ($h / 2), 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 13)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "E (5)")
;dolu_lqvo
$hotspot_movers[6] = GUICtrlCreateLabel("", $x - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 10)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "SW (6)")
;dolu_sreda
$hotspot_movers[7] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 11)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "S (7)")
;dolu_dqsno
$hotspot_movers[8] = GUICtrlCreateLabel("", $x + $w, $y + $h, 5, 5, $SS_WHITEFRAME)
GUICtrlSetCursor (-1, 12)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetTip(-1, "SE (8)")
EndFunc

@KaFu: dude ... that is EXACLTY what i was looking for :) ty! didnt knew about this object but will use it ... can it make labels? like those i need? "transperent"? download this code and run it on your machine to see what i mean ...

Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??[u]Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)[/u]

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...