Sign in to follow this  
Followers 0
Joec49

Help-buttons not working-wierd

8 posts in this topic

All button events defined....window comes up and buttons ignored...any ideas?

$child = GUICreate("Event Details", 500, 400);

GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit4')

GUICtrlCreateLabel("View Event",100,10,-1,-1)

GUISetBkColor(0x88AABB)

GUICtrlCreateButton("SELECT",20,375,50,20)

GUISetOnEvent(-1,'view_select')

GUICtrlCreateButton("VIEW",400,100,50,20)

GuiSetOnevent(-1,'view_view')

GUICtrlCreateButton("DELETE",400,150,50,20)

GUISetOnEvent(-1,'view_delete')

GUICtrlCreateButton("HELP",400,200,50,20)

GUISetOnEvent(-1,'view_help')

GUICtrlCreateButton("QUIT",400,250,50,20)

GUISetOnEvent(-1,'guiexit3')

GUISetState(@SW_SHOW)

...

Func guiexit3()

GuiDelete($child)

Return

endfunc

Share this post


Link to post
Share on other sites



I stripped it down further and still no luck

Func anyname()

$child=GUICreate("Details", 500, 400);

GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit3')

GUICtrlCreateButton("QUIT",200,100,100,100)

GUISetOnEvent(-1,'guiexit3')

GUISetState(@SW_SHOW)

endfunc

Here is the called function

Func guiexit3()

GuiDelete($child)

Return

endfunc

The button appears fine but when I click on it, nothing happens. I have done this with other windows

many times before and it works fine but not here...any ideas?

=====================================================================

All button events defined....window comes up and buttons ignored...any ideas?

$child = GUICreate("Event Details", 500, 400);

GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit4')

GUICtrlCreateLabel("View Event",100,10,-1,-1)

GUISetBkColor(0x88AABB)

GUICtrlCreateButton("SELECT",20,375,50,20)

GUISetOnEvent(-1,'view_select')

GUICtrlCreateButton("VIEW",400,100,50,20)

GuiSetOnevent(-1,'view_view')

GUICtrlCreateButton("DELETE",400,150,50,20)

GUISetOnEvent(-1,'view_delete')

GUICtrlCreateButton("HELP",400,200,50,20)

GUISetOnEvent(-1,'view_help')

GUICtrlCreateButton("QUIT",400,250,50,20)

GUISetOnEvent(-1,'guiexit3')

GUISetState(@SW_SHOW)

...

Func guiexit3()

GuiDelete($child)

Return

endfunc

Share this post


Link to post
Share on other sites

Did you specify the Opt("GUIOnEventMode", 1) ?

Yes - what I showed was a small section of the overall code. The other windows (with buttons) work fine but this does not.

I simply cannot figure out why....

Joe

Share this post


Link to post
Share on other sites

Yes - what I showed was a small section of the overall code. The other windows (with buttons) work fine but this does not.

I simply cannot figure out why....

Joe

Well then you will have to show more code for us to understand your issue.

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Well then you will have to show more code for us to understand your issue.

Here is more code and now QUIT works but the other buttons light when I move

the mouse over them but do nothing when I click except when I click on QUIT,

it calls guiexit3 and does the proper thing. But SELECT, VIEW, DELETE and HELP

are coded properly (I think) but ignored completely- only QUIT works.

Func guiexit3() ;TAKES DOWN CHILD AND THEN RETURNS

GuiDelete($child)

Return

endfunc

;The theview button

func theview_delete()

Msgbox(64,"theviewDELETE","HI")

EndFunc

func theview_help()

$s= "This window allows you to see all scheduled reminders and"

$s=$s & @cr & "sorts them in date/time order. You can view any selected"

$s=$s & @cr & "item and also delete any selected item."

Msgbox(64,"theview HELP",$s)

EndFunc

func theview_view()

MSGBOX(64,"theviewVIEW","THERE")

EndFunc

func theview_select()

MSGBOX(64,"VIEWSELECT","HI")

EndFunc

Func theview() ;button

$child=GUICreate("Reminder Event Details", 500, 400);

GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit3')

GUICtrlCreateLabel("REMINDER: View Event",100,10,-1,-1)

GUISetBkColor(0x88AABB)

GUICtrlCreateButton("SELECT",400,50,50,20)

GUISetOnEvent(-1,"theview_select")

GUICtrlCreateButton("VIEW",400,100,50,20)

GuiSetOnevent(-1,'theview_view')

GUICtrlCreateButton("DELETE",400,150,50,20)

GUISetOnEvent(-1,'theview_delete')

GUICtrlCreateButton("HELP",400,250,50,20)

GUISetOnEvent(-1,'theview_help')

GUICtrlCreateButton("QUIT",400,200,50,20)

GUICtrlSetOnEvent(-1,"guiexit3")

$listview =GUICtrlCreateListView("Seq#|Date|Time|Text", 10, 10, 350, 350)

For $x = 1 To 100

GUICtrlCreateListViewItem($x & "|mm/dd/yyyy|hh:mm|randomtext", $listview);

Next

;GUICtrlSetResizing($listview, $GUI_DOCKALL)

GUISetState

Share this post


Link to post
Share on other sites

for controls use

GUICtrlSetOnEvent

#include <WindowsConstants.au3>
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

Dim $child

theview()


Func guiexit3() ;TAKES DOWN CHILD AND THEN RETURNS
    GUIDelete($child)
    Return
EndFunc   ;==>guiexit3
;The theview button
Func theview_delete()
    MsgBox(64, "theviewDELETE", "HI")
EndFunc   ;==>theview_delete
Func theview_help()
    $s = "This window allows you to see all scheduled reminders and"
    $s = $s & @CR & "sorts them in date/time order. You can view any selected"
    $s = $s & @CR & "item and also delete any selected item."
    MsgBox(64, "theview HELP", $s)
EndFunc   ;==>theview_help
Func theview_view()
    MsgBox(64, "theviewVIEW", "THERE")
EndFunc   ;==>theview_view
Func theview_select()
    MsgBox(64, "VIEWSELECT", "HI")
EndFunc   ;==>theview_select
Func theview() ;button
    
    $child = GUICreate("Reminder Event Details", 500, 400);
    GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit3')
    GUICtrlCreateLabel("REMINDER: View Event", 100, 10, -1, -1)
    GUISetBkColor(0x88AABB)
    GUICtrlCreateButton("SELECT", 400, 50, 50, 20)
    GUICtrlSetOnEvent(-1, "theview_select")
    GUICtrlCreateButton("VIEW", 400, 100, 50, 20)
    GUICtrlSetOnEvent(-1, 'theview_view')
    GUICtrlCreateButton("DELETE", 400, 150, 50, 20)
    GUICtrlSetOnEvent(-1, 'theview_delete')
    GUICtrlCreateButton("HELP", 400, 250, 50, 20)
    GUICtrlSetOnEvent(-1, 'theview_help')
    GUICtrlCreateButton("QUIT", 400, 200, 50, 20)
    GUICtrlSetOnEvent(-1, "guiexit3")
    $listview = GUICtrlCreateListView("Seq#|Date|Time|Text", 10, 10, 350, 350)
    For $x = 1 To 100
        GUICtrlCreateListViewItem($x & "|mm/dd/yyyy|hh:mm|randomtext", $listview);
    Next
    ;GUICtrlSetResizing($listview, $GUI_DOCKALL)
    GUISetState()

    While WinExists($child)
        Sleep(10)
    WEnd

EndFunc   ;==>theview

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

for controls use

GUICtrlSetOnEvent

Thanks - that did it! Thanks for taking the time to look at it

#include <WindowsConstants.au3>
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

Dim $child

theview()


Func guiexit3() ;TAKES DOWN CHILD AND THEN RETURNS
    GUIDelete($child)
    Return
EndFunc   ;==>guiexit3
;The theview button
Func theview_delete()
    MsgBox(64, "theviewDELETE", "HI")
EndFunc   ;==>theview_delete
Func theview_help()
    $s = "This window allows you to see all scheduled reminders and"
    $s = $s & @CR & "sorts them in date/time order. You can view any selected"
    $s = $s & @CR & "item and also delete any selected item."
    MsgBox(64, "theview HELP", $s)
EndFunc   ;==>theview_help
Func theview_view()
    MsgBox(64, "theviewVIEW", "THERE")
EndFunc   ;==>theview_view
Func theview_select()
    MsgBox(64, "VIEWSELECT", "HI")
EndFunc   ;==>theview_select
Func theview() ;button
    
    $child = GUICreate("Reminder Event Details", 500, 400);
    GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit3')
    GUICtrlCreateLabel("REMINDER: View Event", 100, 10, -1, -1)
    GUISetBkColor(0x88AABB)
    GUICtrlCreateButton("SELECT", 400, 50, 50, 20)
    GUICtrlSetOnEvent(-1, "theview_select")
    GUICtrlCreateButton("VIEW", 400, 100, 50, 20)
    GUICtrlSetOnEvent(-1, 'theview_view')
    GUICtrlCreateButton("DELETE", 400, 150, 50, 20)
    GUICtrlSetOnEvent(-1, 'theview_delete')
    GUICtrlCreateButton("HELP", 400, 250, 50, 20)
    GUICtrlSetOnEvent(-1, 'theview_help')
    GUICtrlCreateButton("QUIT", 400, 200, 50, 20)
    GUICtrlSetOnEvent(-1, "guiexit3")
    $listview = GUICtrlCreateListView("Seq#|Date|Time|Text", 10, 10, 350, 350)
    For $x = 1 To 100
        GUICtrlCreateListViewItem($x & "|mm/dd/yyyy|hh:mm|randomtext", $listview);
    Next
    ;GUICtrlSetResizing($listview, $GUI_DOCKALL)
    GUISetState()

    While WinExists($child)
        Sleep(10)
    WEnd

EndFunc   ;==>theview

8)

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  
Followers 0