Infinite loop when playing a sound - windev

I want a sound to be played in a loop until an on/off button is off.
I use this code:
WHILE BTN_Bouton73..Enfoncé=1
Son(S_chemin+"H3.wav",sonBoucle)
END
But it goes into an infinite loop!

try with
WHILE BTN_Bouton73..Enfoncé=1
Son(S_chemin+"H3.wav",sonBoucle)
Multitask(-1)
END
I think you could realese button to stop
It give control back to Windows : see documentation

Related

QDialog is on top of every Application

we need to execute dialog on top of every windows application.
we tried some code below for that but its not working for us.
setWindowFlags(Qt::WindowStaysOnTopHint);
setModal(true);
setWindowModality(Qt::WindowModal);
can you Please let us know how can we achieve this?
It should work with only:
setWindowFlags(Qt::WindowStaysOnTopHint);
Then remove:
setModal(true);
setWindowModality(Qt::WindowModal);
And try again.

How To Switch b/w windows/dialogs in Autoit

I have Two Windows I have to Switch b/w them
I tried the following code but not worked, here I tried to Simply Press Keyboard button ALT+TAB but does't work:
Send("! {TAB}")
or
Send("ALT} {TAB}")
The best way to do it is to use WinActivate to activate each window each time you want. It's way more safe than use Send("!{TAB}").
WinActivate
You have a space in the Send-command. And so you send: Alt+Space+TAB.
So it works:
Send("!{TAB}")

How to handle dynamic overlay using webdriver

While executing a selenium script, we are getting a overlay (like popup) which is asking to confirm yes or no.
In this case the main problem being the Overlay popup does not come at a constant place,instead it comes at differen places.
example :- consider we have 4 pages to navigate some time it comes in first page and some times it comes in second page, and sometimes
it comes in the same page while we are accessing different elements.sometimes we are not getting overlay.
please let me know how to solve this issue, Thanks in advance
You can handle that through driver options, at least in Internet Explorer. This is how I do in Selenium.NET binding
var options = new InternetExplorerOptions { EnableNativeEvents = false };
options.UnexpectedAlertBehavior = InternetExplorerUnexpectedAlertBehavior.Dismiss;
It will force close any unexpected pop up.
Not sure that this is correct solution, but this must solution of your task.
You can create simple function(method) that checks for existence of this popup with some timeout. And put in in all possible places.
Or you can check it by some timer in another thread(with pause of main thread)

Delete button with dialogOK in Grid

Im trying to implement delete button in GRID, same as with CRUD. I found dialogOK (http://agiletoolkit.org/blog/introduction-to-dialog-integration/), but guess i don't know how to use it right.
My code:
$gridC=$this->add('Grid');
$gridC->setModel('Campaign');
$gridC->addcolumn('Button', 'Delete')->js('click', $this->js()->univ()->dialogOK('Yey','Some custom javascript action here',$this->delete()));
//test only
$gridC->addcolumn('Button', 'Deletex')->js('click')->univ()->dialogOK('Are you sure?','This will take you to other page',$this->js()->univ()->page($this->api->getDestinationURL('admin')));
...
function delete(){
...
}
When i click on the button the delete() function starts right away, before i click ok. Also modal window is started :(
Any suggestions, i searched but couldn't find any good example..
NEXT DAY:
I checked the thing again, im almost shure i did it the right way, but i think i found a bug i dialogOK (http://agiletoolkit.org/blog/introduction-to-dialog-integration/)
I i re-create this example on any normal page:
$button = $this->add('Button');
$button->js('click')->univ()->dialogOK('Are you sure?','This will take you to other page',
$button->js()->univ()->page($this->api->getDestinationURL('index'))
);
The page redirects to index page, it doen't wait for OK button clicked. Insted it opens the dialogOK, but in the background redirects to index page..
I'm using atk 4.2.5 from master branch..
OK, that webpage has some bugs :( I would really appreciate if you could edit it and send in pull request in Github atk4-web.
Some tips to get you on road:
Try to use dialogConfirm() method not dialogOK(). Is it working then?
Try to add ->_enclose() after ->page(). That'll enclose JS expression in function.
If dialogConfirm() works and similar dialogOK() does not work, then I guess there is small bug in dialogOK() method. There should be close: if(fn)fn(), instead of close: fn, in atk4_univ.js file dialogOK method.
Can you try these tips and tell me what works for you? Sorry I didn't do that myself - I'm really out of time now :(

How to disable a Perl/Tk window close ('X') button on Windows

Is there a way to make a Perl/Tk window's close ('X') button disabled?
I know how to ignore clicking it using the technique described here, but I would much rather have it disabled.
I'm using Perl/Tk on Windows.
Thanks,
splintor
If you are in a Unix environment you are out of luck. The "close" button is managed by the Window Manager of the desktop which is a completely different process that you have no control on.
Even if by a hack you disable the "close" button the user can always bring it back
if the window manager permits this. The enlightenment window manager for example can
enable/disable all window buttons on demand.
The technique you give in the link is doing exactly this. It does not remove
the "close" button. It just gives a hint to the window manager (WM_DELETE_WINDOW).
It is up to the window manager if this hint will be honoured or not.
See also the icccm and NetWM pages.
What you want might be possible on Windows, but my experience with this OS
is limited so perhaps another poster will know this.
I have an app that I wrote, i was wondering about the same thing, and i don't disableit, but i have a call back to a subroutine, that simply does return;
$Mw->protocol('WM_DELETE_WINDOW',sub{return;});
According to the Perl Monks, it looks like the following works on Windows:
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $window = new MainWindow;
$window ->title("Close test");
$window ->geometry("400x250");
#prevents window from closing
$window->protocol('WM_DELETE_WINDOW' => sub {
print "Do stuff before exiting\n";
exit;
});
MainLoop;
In the above code, you are intercepting the signal sent when the user presses 'X' and can then write your own subroutine to execute when the button is pressed.
If you want to disable the close icon, set sub to empty (effectively telling it to "do nothing when pressed"): 'WM_DELETE_WINDOW' => sub {}
If you don't manage to really disable the close button (I mean to grey it out or even remove it from the window decoration), it might be the most intuitive thing to iconify your window instead of closing it. This is what I did.
$window->protocol('WM_DELETE_WINDOW', sub { $window->iconify(); } );

Resources