Jump to content

Mouse coord with gui


retaly
 Share

Recommended Posts

this is my last big problem.. i hope,

trying designing my gui, but at the momment doesnt work the close with X, and button doesnt change Start/pause

if i use

Opt("GuiOnEventMode", 1)

if not use, coord doesnt work and exit working but start/pause doesnt, omg :S

im not understand that programing language :graduated:(

wanna to learn, plz heelp once more

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <TabConstants.au3>

#include <GUIConstants.au3>

#include <EzSkin.au3>

Opt("GuiOnEventMode", 1)

$EzGUI = EzSkinGUICreate("Tabbed Notebook Dialog", 656, 456)

$EzIcon = EzSkinIcon($EzGUI)

$PageControl1 = GUICtrlCreateTab(32, 32, 588, 416, $TCS_BUTTONS)

$TabSheet1 = GUICtrlCreateTabItem("tab0")

$x1 = GUICtrlCreateEdit("", 96, 56, 57, 17, BitOR($ES_CENTER, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_NUMBER, $WS_BORDER), 0)

GUICtrlSetData(-1, "0")

$y1 = GUICtrlCreateEdit("", 192, 56, 57, 17, BitOR($ES_CENTER, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_NUMBER, $WS_BORDER), 0)

GUICtrlSetData(-1, "0")

$Label1 = GUICtrlCreateLabel("y", 176, 56, 17, 17, BitOR($SS_CENTER, $WS_BORDER))

GUICtrlSetBkColor(-1, 0xFFFBF0)

$Label2 = GUICtrlCreateLabel("x", 80, 56, 17, 17, BitOR($SS_CENTER, $WS_BORDER))

GUICtrlSetBkColor(-1, 0xFFFBF0)

$Button1 = GUICtrlCreateButton("Definiálás", 256, 56, 75, 17)

GUICtrlSetOnEvent(-1, "_Button1")

$start = EzSkinButton("Start", 144, 296, 97, 25)

GUICtrlSetOnEvent(-1, "_StartS")

$nx2 = GUICtrlCreateLabel("x", 80, 80, 17, 17, BitOR($SS_CENTER, $WS_BORDER))

GUICtrlSetBkColor(-1, 0xFFFBF0)

$x2 = GUICtrlCreateEdit("", 96, 80, 57, 17, BitOR($ES_CENTER, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_NUMBER, $WS_BORDER), 0)

GUICtrlSetData(-1, "0")

$ny2 = GUICtrlCreateLabel("y", 176, 80, 17, 17, BitOR($SS_CENTER, $WS_BORDER))

GUICtrlSetBkColor(-1, 0xFFFBF0)

$y2 = GUICtrlCreateEdit("", 192, 80, 57, 17, BitOR($ES_CENTER, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_NUMBER, $WS_BORDER), 0)

GUICtrlSetData(-1, "0")

$Button2 = GUICtrlCreateButton("Definiálás", 256, 80, 75, 17)

GUICtrlSetOnEvent(-1, "_Button2")

GUICtrlSetFont(-1, 8, 400, 0, "Arial")

$TabSheet2 = GUICtrlCreateTabItem("tab1")

$dik = EzSkinButton("dik", 168, 144, 75, 25)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW)

GUISetState(@SW_SHOW)

GUISetState()

HotKeySet("{ENTER}", "_End")

HotKeySet("{DEL}", "_stop")

HotKeySet("{HOME}", "_activate")

Global $fRun = False

$fRun1 = False

$fRun2 = False

While 1

EzSkinOver()

$msg = GUIGetMsg()

If $msg = $EzIcon[1] Then Exit

If $msg = $EzIcon[2] Then GuiSetstate(@SW_MINIMIZE, $EzGUI)

;If $msg = $start Then MsgBox(64,"EzSkin", "The Skin is operating properly... Thanks ")

If $msg = $dik Then MsgBox(64,"EzSkin", "The Skin is operating properly... Thanks ")

If $fRun1 Then

$aPos = MouseGetPos()

GUICtrlSetData($x1, $aPos[0])

GUICtrlSetData($y1, $aPos[1])

EndIf

If $fRun2 Then

$aPos = MouseGetPos()

GUICtrlSetData($x2, $aPos[0])

GUICtrlSetData($y2, $aPos[1])

EndIf

Sleep(10) ; You need this to prevent 100% CPU usage

WEnd

Func _StartS()

$fRun = Not $fRun

If $fRun Then

GUICtrlSetData($start, "Pause")

Else

GUICtrlSetData($start, "Start")

EndIf

EndFunc ;==>_StartS

Func _Quit()

Exit

EndFunc ;==>_Quit

Func _stop()

$fRun = False

GUICtrlSetData($start, "Start")

EndFunc ;==>_stop

Func _activate()

WinActivate("Test")

EndFunc ;==>_activate

Func _End()

$fRun1 = False

$fRun2 = False

EndFunc ;==>_End

Func _Button1()

$fRun1 = True

EndFunc

Func _Button2()

$fRun2 = True

EndFunc

Edited by retaly
Link to comment
Share on other sites

  • Moderators

retaly,

Do you actually read the replies you get? :graduated:

Opt("GuiOnEventMode", 1)
...
$msg = GUIGetMsg()
If $msg = $EzIcon[1] Then Exit
If $msg = $EzIcon[2] Then GUISetState(@SW_MINIMIZE, $EzGUI)

What did I say a few posts ago? ;)

"You cannot use both OnEvent and MessageLoop modes at the same time"

Your EzIcons will never be actioned as (taken directly from the Help file):

"If the GUIOnEventMode option is set to 1 then the return from GUIGetMsg is always 0"

Go and read the Help file under <GUI Reference - GUI Event Modes> and make sure you understand the difference between the 2 modes. :)

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

  • Moderators

retaly,

I already wrote you a script that has teh same functionality as that one which worked and I posted it above. :graduated:

I do not use EzSkin.au3 and so I have no idea how to use it in OnEvent mode. So, I suggest you either read the UDF function headers to find out how to do it yourself or post in the thread where you found it and ask the author.

And I am not going to do either of those things 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

  • Moderators

retaly,

Please do NOT send PMs asking for help - it is contrary to the Forum Rules: :graduated:

"Do not PM users asking for personal support. This is considered harassment. Instead post a topic in General Help & Support, that's what it's there for."

I have already explained earlier in this thread that I do not use the EzSkin and so I had no idea how to use it in OnEvent mode. However, as you seem unwilling or unable to find out how to do it for yourself, I have looked into the UDF to find the solution for you. You need to do something like this:

; Set OnEvent mode
Opt("GuiOnEventMode", 1)
...
; Get the EzIcon return values
$EzIcon = EzSkinIcon($EzGUI)
; Set events for them
GUICtrlSetOnEvent($EzIcon[1], "_Close")
GUICtrlSetOnEvent($EzIcon[2], "_Mini")
...
; Create functions to run when the events occur
Func _Close()
    Exit
EndFunc
 
Func _Mini()
    GUISetState(@SW_MINIMIZE, $EzGUI)
EndFunc

Please do not expect any more help on this - and do NOT PM me again. ;)

M23

Edit: Missed a "not".

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

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