Jump to content

Image Button Dissapears


BBMG
 Share

Recommended Posts

Hi all,

I am a self-professed newbie and trying my hand learning this great software called AutoIt.

I'm trying very hard to learn and have searched diligently but I'm still stuck.. hoping the experts here can shed some luck..

I'm very sure its simple to solve but being a newbie I simply don't know where to look. Thanks in advance for the help guys :D

Basically I'm trying to create a CD-ROM interface with image buttons and I based my script on one of the example scripts that come with the installer.

Everything works fine but when my program window gets dragged around, minimised or when another external window from another application gets on top of it, my image buttons dissapears when focus is given back to my program. All thats left is the background image sadly.

I'm guessing some refresh method is missing to recreate the the gui each time my software gets focus or something is missing from the codes to make the image buttons stay even when another program overlaps and focus is given back to my program. I'm doing my best to describe and hope you guys get what this noob is talking about hehe.. Thanks again guys!

Best Regards,

Aliff

cdrom_gui.au3cdrom_gui.au3

Link to comment
Share on other sites

Hi all,

I am a self-professed newbie and trying my hand learning this great software called AutoIt.

I'm trying very hard to learn and have searched diligently but I'm still stuck.. hoping the experts here can shed some luck..

I'm very sure its simple to solve but being a newbie I simply don't know where to look. Thanks in advance for the help guys :D

Basically I'm trying to create a CD-ROM interface with image buttons and I based my script on one of the example scripts that come with the installer.

Everything works fine but when my program window gets dragged around, minimised or when another external window from another application gets on top of it, my image buttons dissapears when focus is given back to my program. All thats left is the background image sadly.

I'm guessing some refresh method is missing to recreate the the gui each time my software gets focus or something is missing from the codes to make the image buttons stay even when another program overlaps and focus is given back to my program. I'm doing my best to describe and hope you guys get what this noob is talking about hehe.. Thanks again guys!

Best Regards,

Aliff

cdrom_gui.au3cdrom_gui.au3

GuiCtrlCreatePic("images\bg.gif",0,0, 828,562,$WS_CLIPSIBLINGS)
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Doesn't he just want to create the background image last, then disable it?

GuiCtrlCreatePic("images\bg.gif",0,0, 828,562)
GuiCtrlSetState(-1, $GUI_DISABLE)

I don't think so. Maybe you mean he should create the background image first and disable? That would show the other pics ok but not the button which had the caption missing when I tried it, but the WS_CLIPSIBLINGS seemed to overcome both problems and redrew ok after minimising or being hidden.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi,

I tried the above but it asked me to declare it so it didn't work for me.

Thank you Martin.

Don't give up so easily! Just add

#include <windowsconstants.au3>

:D

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Doesn't he just want to create the background image last, then disable it?

GuiCtrlCreatePic("images\bg.gif",0,0, 828,562)
GuiCtrlSetState(-1, $GUI_DISABLE)

Hi Wraitdu,

I tried yours but now my image buttons totally dissapeared.

What I want to do it retain everything as it first displays.

The problem is, the image buttons dissapears when something else gets on top of it and focus is given back to my AutoIt program, leaving behind the bg image only.

I don't want that. I just want all the GUI elements to be retained no matter what.

Sorry if I sounded vague.

-The GUI I want is created normally and perfect when the compiled program first runs.

If another window opens in this case,

one of my image button on the GUI called a pdf reader which opens a pdf.

Window Focus now changes to pdf file which opens up.

I close pdf.

Window Focus now back on compiled program which was beneath the pdf window.

The GUI Image buttons all dissapear leaving backround only!

I just want to resolve this behaviour. I don't want the image buttons to ever dissapear.

Thank you.

Link to comment
Share on other sites

Ok, create the background pic control FIRST, then disable it. Everything then works normally for me.

@martin

I had written my first reply to say 'create the bg first', but then read the help file for GuiCtrlCreatePic() which says to create the bg LAST and disable. Ah well. I didn't have any trouble with the button caption though...

PS -

WS_CLIPSIBLINGS also works just fine for me.

@BBMG

In future, please post a working script with needed resources. It's a pain to replace all the images with something I have to try this thing out.

Edited by wraithdu
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...