Jump to content

_AniSliderMoveGui()


Recommended Posts

@ /dev/null

I was trying to understand ( and utilize ) this portion of your work

based on this

;===============================================================================

;

; Function Name: _AniSliderMoveGui()

;

; Description: Drag-n-Drop with mouse. This functions moves the whole GUI,

; no matter where the user clicked.

;

; Parameter(s): None

; Requirement(s): None

; Return Value(s): None

;

; Author(s): /dev/null aka KurtK

;

;===============================================================================

I see no requirements, thus i beleive it can be used with any GUI

Is this true and how do I link it to GUICreate("my GUI")

and secondly can buttons ( similar to your test example) be placed within this GUI

I tried different ways to no avail..........

thanks

8)

func _AniSliderMoveGui()
  local $i_ControlHandleFound = 0, $i_ControlIdFound = 0, $i_Counter
  
   for $i_Counter = 0 to Ubound($a_AniSliderCtrlHandles)-1
       if $a_AniSliderCtrlHandles[$i_Counter] = @GUI_CTRLHANDLE then $i_ControlHandleFound = 1
       if $a_AniSliderCtrlHandles[$i_Counter] = @GUI_CTRLID then $i_ControlIdFound = 1
   next

   if (@GUI_WINHANDLE = $h_AniSliderGuiHandle) OR ($i_ControlHandleFound = 1) then
     select
       case (@GUI_CTRLID = $GUI_EVENT_PRIMARYDOWN) OR ($i_ControlIdFound = 1)
           $i_AniSliderMousePosStart= MouseGetPos()
           $i_AniSliderMouseKlicked  = 1
          
          
       case @GUI_CTRLID = $GUI_EVENT_PRIMARYUP
           $i_AniSliderMouseKlicked = 0
           $i_AniSliderMousePosCurr= MouseGetPos()
           $delta_x = $i_AniSliderMousePosCurr[0] - $i_AniSliderMousePosStart[0]
           $delta_y = $i_AniSliderMousePosCurr[1] - $i_AniSliderMousePosStart[1]
           WinMove($h_AniSliderGuiHandle,"", $i_AniSliderGuiPos[0]+$delta_x, $i_AniSliderGuiPos[1]+$delta_y)
           $i_AniSliderGuiPos = WinGetPos($h_AniSliderGuiHandle)        
          
       case @GUI_CTRLID = $GUI_EVENT_MOUSEMOVE
           if $i_AniSliderMouseKlicked = 1 then
              $i_AniSliderMousePosCurr= MouseGetPos()
           $delta_x = $i_AniSliderMousePosCurr[0] - $i_AniSliderMousePosStart[0]
           $delta_y = $i_AniSliderMousePosCurr[1] - $i_AniSliderMousePosStart[1]
           WinMove($h_AniSliderGuiHandle,"", $i_AniSliderGuiPos[0]+$delta_x, $i_AniSliderGuiPos[1]+$delta_y)
        
           endif
     endselect
   endif        
endfunc

NEWHeader1.png

Link to comment
Share on other sites

I see no requirements, thus i beleive it can be used with any GUI

Is this true and how do I link it to  GUICreate("my GUI")

Actually you cannot use it with a GUI MessageLoop, as the whole thing only works in

GUI OnEvent mode. Reason: I have to update and move the GUI, while I'm in some other program parts (functions, etc.), so I cannot use a MessageLoop. I use this UDF to show the user that my program is still doing somthing, while I'm checking for network connectivity, retreiving HTML code in the background and do some authentication for the user with HTTP POST requests.

and secondly can buttons ( similar to your test example) be placed within this GUI I tried different ways to no avail.......... thanks

Yes, you can place buttons in the GUI. If you want to check if the button was pressed you will have to extend my code, as this was not needed in my project.

EDIT: You will have to add a button in _AniSliderCreateGui()

Can you tell a bit more what you want to do?

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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