Hi, On copy event, i need to display confirm dialog (we use fancybox dialogs in all project) and depending on user choice add some text (reference) to the copied text or leave the text as it is. And the problem is that - when dialog appears copy function continues to go further and don't wait till confirmation. **Is there a way to pause the event and then continue?** I know i can stop event `e.preventDefault();`. Maybe there is some way to manualy invoke copy event and pass modified text as selection? $("body").bind ('beforecopy', function (e) { if (typeof window.getSelection == …

Member Avatar
Member Avatar
+0 forum 1

My applet creates a new sound every time an impact occurs, which is very frequently. How come, when the sounds become too numerous, the game ceases to run smoothly? Here is the code that gets called many, many times: class soundThread extends Thread { String sound; soundThread(String i_sound) { sound = i_sound; } public void run() { try{ URL path = new URL(getClass().getProtectionDomain().getCodeSource().getLocation(), sound+".wav"); AudioClip clip = Applet.newAudioClip(path); //checkpoint A clip.play(); //checkpoint B }catch(Exception e){System.err.println("err= soundThread_error");e.printStackTrace();} } } The longest pause occurs at `clip.play();`. Any clue why it would take so long to play the clip? And how can I …

Member Avatar
Member Avatar
+0 forum 3

How do I code if I am coding what will happen if I press a button. and then ask a question and want to wait until either of two others buttons are pressed like an yes or no question say i code something and to continue i need the answer like 0=no 1=yes and return that value to the first button code depending on which other button i pressed to answer the question private void dostuff_Click(object sender, EventArgs e) { //code code //need answer to question //and then get a return value depending on which of the //two below i …

Member Avatar
Member Avatar
+0 forum 12

HI everyone! Please help! HOw to make a loop wait until a button is click...??

Member Avatar
Member Avatar
+0 forum 27

Hello! Below is a function exhibiting a simple stopwatch mechanism. It stops when the user presses any key and goes back to the main menu. My question is, is there anyway I can pause the time and continue it as desired by the user? I would like to use "P" as Pause and "C" as continue. Thanks :) [CODE]void stopwatch() { int hh,mm,ss,ms,z; hh=00; mm=00; ss=00; ms=00; z=1; while(hh<=24 && z==1) //since there are 24 hours in a day { mm=0; while(mm<=59 && z==1) //since there are 60 minutes in an hour { ss=0; while(ss<=59 && z==1) //since there are …

Member Avatar
Member Avatar
+0 forum 5

I am writing a C# program that reads in a text file of a list of events followed by a date and time, delimited by a comma and prints it out to a textbox along with how much time is left till that date and time happens. It must read the data from a text file known as PersonalClock.dat (if there is data within it) or MasterClock.dat (if there is no data in PersonalClock.dat). However, I need it to update every 5 seconds. My code is below. Notice I have a function called pauseForMilliseconds (lines 31 and 50) that would …

Member Avatar
Member Avatar
+0 forum 3

I would like to know how to use [ICODE]system("pause")[/ICODE]from C++ in Python 2.7 to get similar effect. Could you help me?

Member Avatar
Member Avatar
+0 forum 3

Is there any way i can pause a file download in my vb program?? I have tried both the http method and the my.computer.net method with no luck. I have also tried pausing the background worker by this method:[URL="http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/407a38ec-b012-4628-9627-c0aa3cd87a42/"]http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/407a38ec-b012-4628-9627-c0aa3cd87a42/[/URL] But even if the bgworker is paused the download goes on..... Or is there any way i can download the file in parts and combine them. So if a user pauses the download the current part gets deleted and when he start it back the download starts from that part of the file?? Cheers!!

Member Avatar
Member Avatar
+0 forum 2

Hi, I have a piece of code which loops through checked checkboxes to do something with each of them. After each turn in the loop I want to pause before it continues to the next checkbox until the user enters a piece of text into the text box. I have tried something like this but haven't had any sucess, I'm still quite new to VB.Net so please bare with me! [CODE] Private keypressed as Boolean = False Private Sub txtCurrentCaptcha_keyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCurrentCaptcha.KeyDown If e.KeyCode = Keys.Enter Then keypressed = True End If End …

Member Avatar
Member Avatar
+0 forum 8

This is for the numerous people I see constantly asking how to "pause" the console after their code runs. The explanation for how the code works is within the snippet in comments. Basically, the "cin.clear();" function will clear the input stream, getting rid of any newline characters that would have made methods like using the "cin.get();" function to pause the console not work. Then, we have the "cin.ignore();" function. This will ignore the maximum amount of characters that can be entered into the stream (numeric_limits<streamsize>::max) be ignored, or wait for a newline character ( \n ). This way, the console …

Member Avatar
Member Avatar
-1 forum 10

Hey everyone, I am writing a Java program and I want to present the user with a settings window when they run a function in the main GUI so they can set the parameters which are used in the function. Ideally what I would like to do in the main function (part of the main GUI JFrame) is; [LIST] [*]Create an instance of the settings window (JFrame or maybe JDialog?) [*]Display the settings window [*]WAIT for the user to input some values and press the OK button in the settings window [*]Retrieve the values from the settings window [*]Run the …

Member Avatar
Member Avatar
+0 forum 3

Hello, Please disregard any small syntax errors I have made in this question, I’m trying to simplify a program that is many pages long. I have a program that has 2 parts, main.cpp and a form GUI.h. Both have functions that pass variables between themselves and I don't want to combine the two due to other aspects of their functionality. The form is loaded from running the main program using the Application::Run command. The idea of the form is that it is constantly open (viewable) and updates the values that it shows based on either: a) algorithm run in main.cpp; …

Member Avatar
Member Avatar
+0 forum 7

I am building a crawler+parser in Python. It has to be run for, like 20 hours. How can I modify the code such that the code execution pauses (before next urllib2.urlopen) when the internet is disconnected, and AUTOMATICALLY resumes with the same variable values, when the internet connection is back on? Thanks.

Member Avatar
Member Avatar
+0 forum 3

I have been working on a program in java which displays the different steps of sorting a list. My step() method updates the gui with the current iteration of the sort, and works fine when it is called from my button's action listener. My goal is to make an auto-step, which calls step() and then pauses the thread. My problem is that the gui won't update! I have tried all kinds of different wait functions, plus revalidating, repainting and updating the GUI. The part of the code in question is below. [code=java] /* stepFast(delayTime) * *automatically steps through the sort …

Member Avatar
Member Avatar
+0 forum 5

Here is what i want to do : I have a laptop, a LCD TV connected with a DVI cable. I want to set up a loop presentation to run all day. It runs very well, i setup up with dual display, and full screen, and powerpoint has a "play on another display" option. The problem is that when i take the focus from the powerpoint gets paused, is something normal, but i want to disable it. Andi want to use the laptop, and let it run in background. You can test it yourself with alt-tab... Same thing happen with …

Member Avatar
+0 forum 0

Alright... so I found numerous examples on the proper way to suspend and pause threads but none really relate to my problem. I have a thread which runs in the background of my game which does all the simulation of moving players, calculating spaces and ect... I have a pause button for the user if they need to take a break, but I can't find a way to pause the thread nicely without bugs. [CODE] run() { while(true) { function1(); function2(); function3(); function4(); function5(); } }[/CODE] To try and pause the thread I inserted a while loop which polls a …

Member Avatar
Member Avatar
+0 forum 12

Hi friends I am building a C# windows application and I am using axWindowsMediaPlayer to play a URL. I am using player.Ctlcontrols.pause() to pause the player on the click of a button,also I have made sure that the video is being played when I try to pause it but this doesnt seem to pause the video. I guess there's another way to pause a playing URL in axWindowsMediaPlayer. Please some up with some idea, any help is appreciated. I need it urgent,please Regards Sumit

Member Avatar
+0 forum 0

Dear Sir/Madam I have a program where I have used a small form as Input / Message Box in place of VB’s InputBox / MsgBox in a click event procedure i.e CmdSave_Click(). Though the code lines are executing in that procedure at a time, the global variable GblBox is not getting the value 1 for executing SaveRecord procedure, which is passing by the FrmMsgBox(a form)’s CmdOK button. So, can I hold/pause the code lines of Form1 from line no. 6 to 9 till passing the global variable’s value as like as InputBox. Or is there another way to solve. Please, …

Member Avatar
Member Avatar
+0 forum 6

Hey all. (the reason i dont post code is a)because i think its far too long because the whole program is not just about that and b) because i think you might be able to help me w/o code,as it is kind of wierd problem)~~ So i wrote this program which basically opens a simple 5-line file,each line containing words and numbers,and what i wanted to do is separate and store each word and each number using an array for each of them.so i had array1[] for the first word,array2[] for the second etc and had some counters so that …

Member Avatar
Member Avatar
-2 forum 2

Hello everyone! I know how to use a Timer class: [CODE=C#]static void Main(string[] args) { System.Timers.Timer MyTimer = new System.Timers.Timer(); MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(MyTimer_Elapsed); MyTimer.Interval = 2000; MyTimer.Enabled = true; //etc. } static void MyTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { //do something every 2 seconds }[/CODE] What I like to do is draw something every 2 secs during a draw method in a loop like: >while condition true > Draw object > Wait 2 secs >end loop after condition false I could use a very long empty for loop as a wait method, is there a better way? Have looked around …

Member Avatar
Member Avatar
+0 forum 4

Hi, I'm programming an application that records video samples of 5 seconds each. the recording takes place inside a loop. I use MFC and DirectShow The thing is, that the main thread must pause for 5 seconds while the sample is being recorded. in order to do that, I can use sleep or WaitForSingleObject but I still want to have the ability to click on the dialog's buttons (STOP for example...) Is there any way to accomplish that without multithreading? Hope this is understood. many thanks for your help!

Member Avatar
Member Avatar
+0 forum 4

The End.