Sign in to follow this  
Followers 0
Paulie

Buttons on $WS_POPUP

5 posts in this topic

For some reason, my buttons don't work right when i have the on a fullscreen "$WS_POPUP, $WS_EX_TOPMOST" GUI window

THey appear right, but you can't click on them, they don't work, however when i make a separate non-popup window, then the work, however, this ner window has the titlebar at the top, making it not very professional looking,

any sugesstions?

My code:

CODE

#include <GUIConstants.au3>

;---Hotkeys---

Hotkeyset("{ESC}", "Force_Quit")

Hotkeyset("{SPACE}", "Skip_intro")

;---Variables---

Global $button_[4], $label_[4], $Intro_label_[4], $left, $top_[4], $number, $i, $n,$intro_button_[1]

;---Intro Gui build---

WinMinimizeAll()

$intro = GuiCreate("", @DesktopWidth+5, @DesktopHeight, -1,-1, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor(0x00000)

GUISetState()

IntroWords(1, 100, 0, 250, 10, 250, 550, 200, "The Tragedy of...", 50, 500, "Signature", 0xff0000)

IntroWords(2, 225, 0, 175, 10, 175, 1000, 400, "Romeo and Juliet", 100, 500, "Signature", 0xFFFFFF)

IntroWords(3, 600, 1024, 425, -10, 425, 500, 200, "Created By: Paul Sandels", 20, 500, "Signature", 0xFFFFFF)

$Intro_button_[0] = GuiCtrlCreatebutton("Press ""Space"" to Begin", 500, 700, 200, 30)

GuiSetState()

;---Display/detect---

While 1

$message = GUIGetMsg()

If $message = $GUI_EVENT_CLOSE then exitloop

Wend

;---Fuctions---

Func IntroWords($round, $top, $left, $limit, $steps, $lessthan, $width, $height, $label, $size, $weight, $font, $color)

$Intro_label_[$round] = GUICtrlCreateLabel($label, $left, $top, $width, $height)

GUICtrlSetFont( -1, $size, $weight, 0, $font)

GuiCtrlSetcolor(-1, $color)

For $left = $left to $limit step $steps

Sleep(75)

Sleep(10)

GUICtrlSetPos($Intro_label_[$round], $left, $top, $width, $height)

Sleep(10)

Next

Sleep(500)

EndFunc

Func Force_Quit()

Exit 0

EndFunc

Func Skip_intro()

RunWait(@COMSPEC & " /c start Powerpnt.exe", "", @SW_HIDE)

Endfunc

ty

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <GUIConstants.au3>
;---Hotkeys---
Hotkeyset("{ESC}", "Force_Quit")
Hotkeyset("{SPACE}", "Skip_intro")
;---Variables---
Global $button_[4], $label_[4], $Intro_label_[4], $left, $top_[4], $number, $i, $n,$intro_button_[1]
;---Intro Gui build---
WinMinimizeAll()
$intro = GuiCreate("", @DesktopWidth+5, @DesktopHeight, -1,-1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x00000)
GUISetState()
IntroWords(1, 100, 0, 250, 10, 250, 550, 200, "The Tragedy of...", 50, 500, "Signature", 0xff0000)
IntroWords(2, 225, 0, 175, 10, 175, 1000, 400, "Romeo and Juliet", 100, 500, "Signature", 0xFFFFFF)
IntroWords(3, 600, 1024, 425, -10, 425, 500, 100, "Created By: Paul Sandels", 20, 500, "Signature", 0xFFFFFF)
$Intro_button_[0] = GuiCtrlCreatebutton("Press ""Space"" to Begin", 500, 700, 200, 30)
GuiSetState()
;---Display/detect---
While 1
    $message = GUIGetMsg()
    If $message = $GUI_EVENT_CLOSE then exitloop
Wend
    ;---Fuctions---
    Func IntroWords($round, $top, $left, $limit, $steps, $lessthan, $width, $height, $label, $size, $weight, $font, $color)
        $Intro_label_[$round] = GUICtrlCreateLabel($label, $left, $top, $width, $height)
        GUICtrlSetFont( -1, $size, $weight, 0, $font)
        GuiCtrlSetcolor(-1, $color)
        For $left = $left to $limit step $steps
            Sleep(75)
            Sleep(10)
            GUICtrlSetPos($Intro_label_[$round], $left, $top, $width, $height)
            Sleep(10)
            Next
            Sleep(500)
            EndFunc
            Func Force_Quit()
                Exit 
            EndFunc
            Func Skip_intro()
                RunWait(@COMSPEC & " /c start Powerpnt.exe", "", @SW_HIDE)
            Endfunc

people do this all the time...

The last label's height was too big, it was overlapping the button. U gotta watch out for that.

Edited by CHRIS95219

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Replace the first bit with this, also u do not have any instructions what to do if button is pressed?

I also removed the addition GuiSetState()

$intro = GuiCreate("", @DesktopWidth+5, @DesktopHeight, -1,-1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x00000)
$Intro_button_[0] = GuiCtrlCreatebutton('Press "Space" to Begin', 500, 700, 200, 30)
GUISetState()

IntroWords(1, 100, 0, 250, 10, 250, 550, 200, "The Tragedy of...", 50, 500, "Signature", 0xff0000)
IntroWords(2, 225, 0, 175, 10, 175, 1000, 400, "Romeo and Juliet", 100, 500, "Signature", 0xFFFFFF)
IntroWords(3, 600, 1024, 425, -10, 425, 500, 200, "Created By: Paul Sandels", 20, 500, "Signature", 0xFFFFFF)


;---Display/detect---
While 1
$message = GUIGetMsg()

If $message = $GUI_EVENT_CLOSE then exitloop

Wend
Edited by HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Share this post


Link to post
Share on other sites

people do this all the time...

The last label's height was too big, it was overlapping the button. U gotta watch out for that.

That fixed it!! :D

I can't belive i was so dumb to miss that,

glad you caught it though

TY

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